Interface Cache

  • All Known Implementing Classes:
    EhCacheImpl

    public interface Cache
    This Interface is implemented by cacheable Fortress objects and is used to wrap the caching implementation to provide isolation.
    Author:
    Apache Directory Project
    • Method Detail

      • get

        Object get​(Object key)
            throws org.apache.directory.fortress.core.util.cache.CacheException
        Given a key name, return the corresponding value.
        Parameters:
        key - is the name used to store the entry.
        Returns:
        entry stored in the cache.
        Throws:
        org.apache.directory.fortress.core.util.cache.CacheException - will wraps the implementation's exception.
      • put

        void put​(Object key,
                 Object value)
          throws org.apache.directory.fortress.core.util.cache.CacheException
        Add a new entry to the cache.
        Parameters:
        key - name to be used for the entry.
        value - object that is stored.
        Throws:
        org.apache.directory.fortress.core.util.cache.CacheException - will wraps the implementation's exception.
      • clear

        boolean clear​(Object key)
               throws org.apache.directory.fortress.core.util.cache.CacheException
        Clear a cache entry for a given name.
        Parameters:
        key - name that entry is stored as.
        Returns:
        boolean value will be false if entry not found and true if entry was found and removed.
        Throws:
        org.apache.directory.fortress.core.util.cache.CacheException - will wraps the implementation's exception.
      • flush

        void flush()
            throws org.apache.directory.fortress.core.util.cache.CacheException
        Remove all entries from the cache.
        Throws:
        org.apache.directory.fortress.core.util.cache.CacheException - will wraps the implementation's exception.
      • getSearchAttribute

        <T> net.sf.ehcache.search.Attribute<T> getSearchAttribute​(String attributeName)
                                                           throws org.apache.directory.fortress.core.util.cache.CacheException
        Retrieve the Cache attribute
        Type Parameters:
        T - the type of search attribute
        Parameters:
        attributeName - the name of search attribute
        Returns:
        the search attribute
        Throws:
        org.apache.directory.fortress.core.util.cache.CacheException - will wraps the implementation's exception.
      • createQuery

        net.sf.ehcache.search.Query createQuery()
        Create a search query for the cache.
        Returns:
        a new Query builder