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 longgetExpireTime()Gets the absolute time at which the current value is no longer valid.protected longgetTimeout()Gets the configured relative expire timeout for values cached by this instance.booleanisValid(V curValue)Returnstrueif the expire time is greater than the current time,falseotherwise.voidset(V value)Sets the current valueprotected voidupdateExpireTime()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:
setin classExpiringValue<V>
-
isValid
public boolean isValid(V curValue)
Returnstrueif the expire time is greater than the current time,falseotherwise.- Specified by:
isValidin classExpiringValue<V>
-
-