Package com.illumon.iris.binarystore
Interface ExpirationManager<T>
- All Known Implementing Classes:
ExpirationManager.ArbitraryExpiration
,ExpirationManager.BaseExpiration
,ExpirationManager.DailyExpiration
,ExpirationManager.DailyHourlyExpiration
,ExpirationManager.HourlyExpiration
,ExpirationManager.StaticExpiration
public interface ExpirationManager<T>
Manage a value that changes after a certain period of time.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ExpirationManager.ArbitraryExpiration
Returns a string representing the current time period.static class
ExpirationManager.BaseExpiration<T>
static class
ExpirationManager.DailyExpiration
Returns the current date.static class
ExpirationManager.DailyHourlyExpiration
Provides DailyExpiration and adds access to the current date.static class
ExpirationManager.HourlyExpiration
Expires on the hour, returning a datetime format of "yyyy-MM-dd.HHmmss.SSSZ", which will round to "yyyy-MM-dd.HH0000.000-????" after rolling on the hour.static class
ExpirationManager.StaticExpiration<T>
Static value - does not expire. -
Method Summary
Modifier and Type Method Description T
get()
Get the value of this ExpirationManager for the current time.T
get(long now)
Get the value of this ExpirationManager for the given time.default T
initialize()
The value for the current time, assuming it is the first access.default T
initialize(long now)
The value for the given time, assuming it is the first access.
-
Method Details
-
get
T get()Get the value of this ExpirationManager for the current time. Current time should be obtained from the appropriate time source, not necessarily System.currentTimeMillis.e.g ClockFactory.get().currentTimeMillis()
- Returns:
- the value corresponding to timesource.currentTimeMillis()
-
get
Get the value of this ExpirationManager for the given time. It is assumed that times passed in will be monotonically increasing.- Parameters:
now
- the result of System.currentTimeInMillis.- Returns:
- the value corresponding to the given time
-
initialize
The value for the given time, assuming it is the first access. Certain implementations generate different values for the initialized time vs. after an expiration.- Parameters:
now
- the result of System.currentTimeInMillis.- Returns:
- the value corresponding to the given initialization time
-
initialize
The value for the current time, assuming it is the first access. Certain implementations generate different values for the initialized time vs. after an expiration.- Returns:
- the value corresponding to the given initialization time
-