copper-server-mongo/src/main/java/com/pogeyan/cmis/data/mongo/PassiveExpiringMap.java
/**
		 * Determine the expiration time for the given key-value entry.
		 *
		 * @param key   the key for the entry (ignored).
		 * @param value the value for the entry (ignored).
		 * @return if {@link #timeToLiveMillis} &ge; 0, an expiration time of
		 *         {@link #timeToLiveMillis} + {@link System#currentTimeMillis()} is
		 *         returned. Otherwise, -1 is returned indicating the entry never
		 *         expires.
		 */
Determine the expiration time for the given key-value entry.
@param key   the key for the entry (ignored).
@param value the value for the entry (ignored).
@return if  #timeToLiveMillis ≥ 0, an expiration time of
#timeToLiveMillis +  System#currentTimeMillis() is
returned. Otherwise, -1 is returned indicating the entry never
expires.
Determine the expiration time for the given key - value entry . @param key the key for the entry ( ignored ) . @param value the value for the entry ( ignored ) . @return if #timeToLiveMillis ≥ 0 an expiration time of #timeToLiveMillis + System#currentTimeMillis () is returned . Otherwise - 1 is returned indicating the entry never expires .
@Override
		public long expirationTime(final K key, final V value) {
			if (timeToLiveMillis >= 0L) {
				final long now = System.currentTimeMillis();
				if (now > Long.MAX_VALUE - timeToLiveMillis) {
					return -1;
				}
				return now + timeToLiveMillis;
			}
			return -1L;
		}
@ Override public long expirationTime ( final K key , final V value ) { if ( timeToLiveMillis >= 0L ) { final long now = System . currentTimeMillis ( ) ; if ( now > Long . MAX_VALUE - timeToLiveMillis ) { return - 1 ; } return now + timeToLiveMillis ; } return - 1L ; }
Determine the expiration time for the given key-value entry.
Determine the expiration time for the given key - value entry .
// avoid numerical overflow // expiration would be greater than Long.MAX_VALUE // never expire // timeToLiveMillis in the future // never expire