Package com.boomi.connector.util
Class SimpleExpiringValue<V>
- java.lang.Object
-
- com.boomi.connector.util.ExpiringValue<V>
-
- com.boomi.connector.util.SimpleExpiringValue<V>
-
- Direct Known Subclasses:
InactiveExpiringValue
public class SimpleExpiringValue<V> extends ExpiringValue<V>
ExpiringValue implementation which will expire the current value after a fixed amount of time.
-
-
Constructor Summary
Constructors Constructor Description SimpleExpiringValue(long valueTimeout)
SimpleExpiringValue(V value, long valueTimeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected long
getExpireTime()
Gets the absolute time at which the current value is no longer valid.protected long
getTimeout()
Gets the configured relative expire timeout for values cached by this instance.boolean
isValid(V curValue)
Returnstrue
if the expire time is greater than the current time,false
otherwise.void
set(V value)
Sets the current valueprotected void
updateExpireTime()
Updates the expire time to the current time plus the configured timeout-
Methods inherited from class com.boomi.connector.util.ExpiringValue
get
-
-
-
-
Constructor Detail
-
SimpleExpiringValue
public SimpleExpiringValue(long valueTimeout)
-
SimpleExpiringValue
public SimpleExpiringValue(V value, long valueTimeout)
-
-
Method Detail
-
getTimeout
protected long getTimeout()
Gets the configured relative expire timeout for values cached by this instance.
-
getExpireTime
protected long getExpireTime()
Gets the absolute time at which the current value is no longer valid.
-
updateExpireTime
protected void updateExpireTime()
Updates the expire time to the current time plus the configured timeout
-
set
public void set(V value)
Sets the current valueUpdates the expiration time via
updateExpireTime()
if the new value is non-null
.- Overrides:
set
in classExpiringValue<V>
-
isValid
public boolean isValid(V curValue)
Returnstrue
if the expire time is greater than the current time,false
otherwise.- Specified by:
isValid
in classExpiringValue<V>
-
-