Class PerishableCountDown
java.lang.Object
uk.ac.gda.services.common.endstation.PerishableCountDown
Builds counter to generate optional count down seconds of
Perishable time interval with set expiration time.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final classBuilds count down to the expiry of an established time interval (which may have already expired).static final classBuilds count down to the expiry of a set time period to start immediately -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic LocalDateTimegenerateFutureExpiration(int remainingTimeSeconds) static PerishableCountDown.BuildergetCountDownBuilderForExpirationOf(Perishable perishable) Provides Builder for head of a chained call construction of an expiring count downstatic PerishableCountDown.BuildergetCountDownBuilderForImminentExpiry(int remainingSeconds) Provides Builder for head of a chained call construction of an expiring count downSeconds remaining in count down, if any, prior to cut-off
-
Field Details
-
MAX_PERMITTED_REMAINING_SECONDS
public static final int MAX_PERMITTED_REMAINING_SECONDS- See Also:
-
-
Method Details
-
supplyRemainingSecondsIfAny
Seconds remaining in count down, if any, prior to cut-off- Returns:
- remaining seconds
-
getCountDownBuilderForExpirationOf
Provides Builder for head of a chained call construction of an expiring count down- Parameters:
perishable- source of expiration timing - e.g. stale Msg come in late over message bus- Returns:
- builder which creates count down expiring in synch with input
-
getCountDownBuilderForImminentExpiry
public static PerishableCountDown.Builder getCountDownBuilderForImminentExpiry(int remainingSeconds) Provides Builder for head of a chained call construction of an expiring count down- Parameters:
remainingSeconds- for an imminent source of expiration timing- Returns:
- builder which creates count down expiring in number of seconds given by input
-
generateFutureExpiration
-