Class CheckpointTimeUtils
java.lang.Object
org.wso2.carbon.governance.api.util.CheckpointTimeUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longcalculateTimeDifference(String timeStampOne, String timeStampTwo) This method used to calculate time difference of two timestamps.static longcalculateTimeDifferenceToPresent(String timeStamp) This method used to calculate time difference between timestamp to present.static StringformatTimeDuration(long duration) This method is used to format a timestamp to 'dd:hh:mm:ss'.static StringThis method is used to current timestatic longgetMillySecondsByDuration(String duration) This method is used to get duration in milly seconds by passing the duration as a String.static booleanisDurationBetweenTimestamps(long duration, String minTime, String maxTime) This method used to check whether a duration is between a specific boundary.
-
Constructor Details
-
CheckpointTimeUtils
public CheckpointTimeUtils()
-
-
Method Details
-
isDurationBetweenTimestamps
This method used to check whether a duration is between a specific boundary.- Parameters:
duration- lifecycle current state duration timestamp.minTime- boundary lower value.maxTime- boundary upper value.- Returns:
- true when duration is between the boundary.
-
getMillySecondsByDuration
This method is used to get duration in milly seconds by passing the duration as a String.- Parameters:
duration- duration as a String.- Returns:
- duration in milly seconds.
-
calculateTimeDifference
This method used to calculate time difference of two timestamps.- Parameters:
timeStampOne- latest timestamp.timeStampTwo- earlier timestamp.- Returns:
- timeDurationTimestamp timestamp difference from current time to current lifecycle last state changed time.
-
calculateTimeDifferenceToPresent
This method used to calculate time difference between timestamp to present.- Parameters:
timeStamp- earlier timestamp.- Returns:
- timeDurationTimestamp timestamp difference from current time to current lifecycle last state changed time.
-
getCurrentTime
This method is used to current time- Returns:
- String current time in yyyy-MM-dd HH:mm:ss.SSS format.
-
formatTimeDuration
This method is used to format a timestamp to 'dd:hh:mm:ss'.- Parameters:
duration- timestamp duration.- Returns:
- formatted time duration to 'dd:hh:mm:ss'.
-