Class 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 return false from the isValid() method.
    • Constructor Detail

      • ExpiringConnectorCache

        public ExpiringConnectorCache​(K key,
                                      long timeToLive)
        Parameters:
        key - the key by which this ConnectorCache will be cached in the connector cache
        timeToLive - 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()
        Returns false if the current time is past the expiration time for this ConnectorCache. Returns true if this cache should be considered valid, false otherwise. This method will be called by ConnectorCache.getCache(K, X, com.boomi.connector.util.ConnectorCacheFactory<K, C, X>) whenever a ConnectorCache is retrieved. If this method returns false, the retrieved ConnectorCache will be discarded and a new one created via the ConnectorCacheFactory provided.

        Default implementation always returns true.

        Overrides:
        isValid in class ConnectorCache<K>