Class MaintenanceUtil

java.lang.Object
com.adobe.granite.maintenance.MaintenanceUtil

public abstract class MaintenanceUtil extends Object
Utility class for maintenance related stuff.
  • Constructor Details

    • MaintenanceUtil

      public MaintenanceUtil()
  • Method Details

    • isValidTimeInterval

      public static boolean isValidTimeInterval(String startTime, String endTime)
      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

      public static int[] parseTime(String value) throws IllegalArgumentException
      Check if the given time string is valid ([hour]:[minute])
      Returns:
      a two value array with hour and minute if its valid, null otherwise.
      Throws:
      IllegalArgumentException
    • getCronExpression

      public static String getCronExpression(int[] timeDef)
    • getCronExpression

      public static String getCronExpression(String time)
    • getNextExecutionTime

      public static Calendar getNextExecutionTime(String startTime, String endTime)
      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

      public static Calendar getNextWindowExecutionTime(Resource windowResource)
      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