use of com.emc.vipr.model.catalog.ExecutionWindowRestRep in project coprhd-controller by CoprHD.
the class ExecutionWindows method move.
public static void move(@Required String id, @Required Long start, @Required Integer timezoneOffsetInMinutes) {
ExecutionWindowRestRep executionWindow = ExecutionWindowUtils.getExecutionWindow(uri(id));
if (executionWindow == null) {
renderJSON(new CalResponse(false, MessagesUtils.get("executionWindow.notfound", id)));
}
ExecutionWindowForm executionWindowForm = new ExecutionWindowForm();
executionWindowForm.timezoneOffsetInMinutes = timezoneOffsetInMinutes == null ? 0 : timezoneOffsetInMinutes;
executionWindowForm.readFrom(executionWindow);
executionWindowForm.updateTimes(start, null);
boolean isOverlapping = isOverlapping(executionWindowForm);
if (isOverlapping) {
renderJSON(new CalResponse(false, MessagesUtils.get("executionWindow.overlapping", executionWindow.getName())));
}
executionWindowForm.save();
renderJSON(new CalResponse(true, MessagesUtils.get("executionWindow.saved.success", executionWindow.getName())));
}
Aggregations