net.dontdrinkandroot.cache.impl

## Class AbstractCache<K,V>

- java.lang.Object
- - net.dontdrinkandroot.cache.impl.AbstractCache<K,V>

All Implemented Interfaces:
  Cache<K,V>

Direct Known Subclasses:
  AbstractMapBackedCache

    public abstract class AbstractCache<K,V>
    extends Object
    implements Cache<K,V>

Author:
  Philip W. Sorst <philip@sorst.net>

### Field Summary

### Fields inherited from interface net.dontdrinkandroot.cache.Cache

`UNLIMITED_IDLE_TIME`

### Constructor Summary

Constructors
Constructor and Description
`AbstractCache(String name, long defaultTimeToLive)`
`AbstractCache(String name, long defaultTimeToLive, long defaultMaxIdleTime)`

### Method Summary

Methods
`org.slf4j.Logger` `getCleanUpLogger()`
`long` `getDefaultMaxIdleTime()` Get the default max idle time for cache entries.
`long` `getDefaultTtl()` Retrieve the default time to live for cache entries.
`org.slf4j.Logger` `getLogger()`
`String` `getName()` Get the name of this cache.
`void` `setDefaultMaxIdleTime(long defaultMaxIdleTime)`
`void` `setDefaultTtl(long defaultTTL)` Sets the default time to live for cache entries.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.dontdrinkandroot.cache.Cache

`cleanUp, delete, get, getMetaData, getStatistics, getWithErrors, put, putWithErrors`

### Constructor Detail

#### AbstractCache

    public AbstractCache(String name,
                 long defaultTimeToLive)

#### AbstractCache

    public AbstractCache(String name,
                 long defaultTimeToLive,
                 long defaultMaxIdleTime)

### Method Detail

#### getName

    public final String getName()

Description copied from interface: `Cache`
Get the name of this cache.

Specified by:
  `getName` in interface `Cache<K,V>`
Returns:
  The name of this cache.

#### getDefaultTtl

    public final long getDefaultTtl()

Description copied from interface: `Cache`
Retrieve the default time to live for cache entries.

Specified by:
  `getDefaultTtl` in interface `Cache<K,V>`
Returns:
  The default time to live for a cache entry in milliseconds.

#### getDefaultMaxIdleTime

    public final long getDefaultMaxIdleTime()

Description copied from interface: `Cache`
Get the default max idle time for cache entries.

Specified by:
  `getDefaultMaxIdleTime` in interface `Cache<K,V>`
Returns:
  The default max idle time for cache entries in milliseconds.

#### getLogger

    public final org.slf4j.Logger getLogger()

#### getCleanUpLogger

    public final org.slf4j.Logger getCleanUpLogger()

#### setDefaultTtl

    public final void setDefaultTtl(long defaultTTL)

Description copied from interface: `Cache`
Sets the default time to live for cache entries.

Specified by:
  `setDefaultTtl` in interface `Cache<K,V>`
Parameters:
  `defaultTTL` - The default time to live for a cache entry in milliseconds.

#### setDefaultMaxIdleTime

    public final void setDefaultMaxIdleTime(long defaultMaxIdleTime)