Package com.boomi.connector.util
Class ExpiringConnectorCache<K>
- java.lang.Object
-
- com.boomi.connector.util.ConnectorCache<K>
-
- com.boomi.connector.util.ExpiringConnectorCache<K>
-
public class ExpiringConnectorCache<K> extends ConnectorCache<K>
Subclass of ConnectorCache which "expires" after a certain (fixed) amount of time. After the timeToLive provided in the constuctor this ConnectorCache implementation will returnfalsefrom theisValid()method.
-
-
Constructor Summary
Constructors Constructor Description ExpiringConnectorCache(K key, long timeToLive)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetExpireTime()Returns the time (in milliseconds) after which this ConnectorCache is no longer valid.booleanisValid()Returnsfalseif the current time is past the expiration time for this ConnectorCache.-
Methods inherited from class com.boomi.connector.util.ConnectorCache
clearCache, getCache, getKey
-
-
-
-
Constructor Detail
-
ExpiringConnectorCache
public ExpiringConnectorCache(K key, long timeToLive)
- Parameters:
key- the key by which this ConnectorCache will be cached in the connector cachetimeToLive- the relative time from now (in milliseconds) after which this ConnectorCache should no longer be considered valid
-
-
Method Detail
-
getExpireTime
public long getExpireTime()
Returns the time (in milliseconds) after which this ConnectorCache is no longer valid.
-
isValid
public boolean isValid()
Returnsfalseif the current time is past the expiration time for this ConnectorCache. Returnstrueif this cache should be considered valid,falseotherwise. This method will be called byConnectorCache.getCache(K, X, com.boomi.connector.util.ConnectorCacheFactory<K, C, X>)whenever a ConnectorCache is retrieved. If this method returnsfalse, the retrieved ConnectorCache will be discarded and a new one created via the ConnectorCacheFactory provided.Default implementation always returns
true.- Overrides:
isValidin classConnectorCache<K>
-
-