// TODO: Should introduce an enum into task object
public static final String PENDING_STATE = "pending";
public static final String ERROR_STATE = "error";
public static TaskResourceRep refresh(RestClient client, TaskResourceRep task) {
RestLinkRep link = task.getRestLink();
if (link == null) {
throw new ViPRException("Task has no link");
}
return client.get(TaskResourceRep.class, link.getLinkRef().toString());
}