Class MaintenanceUtil


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

      • MaintenanceUtil

        public MaintenanceUtil()
    • Method Detail

      • 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.
      • 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