Package com.adobe.granite.maintenance
Class MaintenanceUtil
java.lang.Object
com.adobe.granite.maintenance.MaintenanceUtil
Utility class for maintenance related stuff.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetCronExpression(int[] timeDef) static StringgetCronExpression(String time) static CalendargetNextExecutionTime(MaintenanceTaskInfo.TaskSchedule schedule, String startTime) Return the next execution time for this maintenance task If the time definitions are invalid, null is returned.static CalendargetNextExecutionTime(String startTime, String endTime) Return the next execution time for this window.static CalendargetNextWindowExecutionTime(Resource windowResource) Return the next execution time for this window.static booleanisValidTimeInterval(String startTime, String endTime) Check if the start and the end time are valid time definitions ([hour]:[minute]).static int[]Check if the given time string is valid ([hour]:[minute])
-
Constructor Details
-
MaintenanceUtil
public MaintenanceUtil()
-
-
Method Details
-
isValidTimeInterval
Check if the start and the end time are valid time definitions ([hour]:[minute]). This method does not check whether startTime is lower than endTime. -
parseTime
Check if the given time string is valid ([hour]:[minute])- Returns:
- a two value array with hour and minute if its valid,
nullotherwise. - Throws:
IllegalArgumentException
-
getCronExpression
-
getCronExpression
-
getNextExecutionTime
Return the next execution time for this window. If the current time is currently within the window, null will be returned. If the time definitions are invalid, null is returned as well.- Parameters:
startTime-endTime-- Returns:
- The next execution time, if the window is currently open
-
getNextExecutionTime
public static Calendar getNextExecutionTime(MaintenanceTaskInfo.TaskSchedule schedule, String startTime) Return the next execution time for this maintenance task If the time definitions are invalid, null is returned.- Returns:
- The next execution time, if the window is valid
-
getNextWindowExecutionTime
Return the next execution time for this window. If the current time is currently within the window, null will be returned. If the time definitions are invalid, null is returned as well.- Parameters:
windowResource- The window resource.- Returns:
- The next execution time, if the window is currently open
- Since:
- 1.1
-