Class TransactionCache<V extends BasicTransaction>

  • All Implemented Interfaces:
    TransactionStore<V>, edu.uiuc.ncsa.security.core.Store<V>, Map<edu.uiuc.ncsa.security.core.Identifier,​V>

    public class TransactionCache<V extends BasicTransaction>
    extends edu.uiuc.ncsa.security.core.cache.CachedMapFacade<V>
    implements TransactionStore<V>
    A cache. Set the backing store if you have one, otherwise this works perfectly well as an in-memory store.

    Usage

    To front a transaction store, write the store separately then instantiate an instance of this, passing the frontend store as an argument. You may then use the store and all it's facilities (such as retention policies) as you see fit.

    Created by Jeff Gaynor
    on Apr 27, 2010 at 4:27:10 PM

    • Constructor Detail

      • TransactionCache

        public TransactionCache()
    • Method Detail

      • getMostRecent

        public List<V> getMostRecent​(int n,
                                     List<String> attributes)
        Specified by:
        getMostRecent in interface edu.uiuc.ncsa.security.core.Store<V extends BasicTransaction>
      • getXMLConverter

        public edu.uiuc.ncsa.security.core.XMLConverter<V> getXMLConverter()
        Specified by:
        getXMLConverter in interface edu.uiuc.ncsa.security.core.Store<V extends BasicTransaction>
      • getEnvironment

        public edu.uiuc.ncsa.security.core.util.AbstractEnvironment getEnvironment()
      • setEnvironment

        public void setEnvironment​(edu.uiuc.ncsa.security.core.util.AbstractEnvironment environment)
      • isDestroyed

        public boolean isDestroyed()
      • setDestroyed

        protected void setDestroyed​(boolean destroyed)
      • destroy

        public boolean destroy()
      • init

        public boolean init()
      • put

        public void put​(V t)
      • checkDestroyed

        protected void checkDestroyed()
      • size

        public int size​(boolean includeVersions)
        Specified by:
        size in interface edu.uiuc.ncsa.security.core.Store<V extends BasicTransaction>
      • getAll

        public List<V> getAll()
        Specified by:
        getAll in interface edu.uiuc.ncsa.security.core.Store<V extends BasicTransaction>
      • getByKey

        protected V getByKey​(Object key,
                             int action)
        This is done as a switch statement to keep references to the cache up to date.
        Parameters:
        key -
        action -
        Returns:
      • size

        public int size()
        Specified by:
        size in interface Map<edu.uiuc.ncsa.security.core.Identifier,​V extends BasicTransaction>
        Overrides:
        size in class edu.uiuc.ncsa.security.core.cache.CachedMapFacade<V extends BasicTransaction>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface Map<edu.uiuc.ncsa.security.core.Identifier,​V extends BasicTransaction>
        Overrides:
        isEmpty in class edu.uiuc.ncsa.security.core.cache.CachedMapFacade<V extends BasicTransaction>
      • containsKey

        public boolean containsKey​(Object key)
        Specified by:
        containsKey in interface Map<edu.uiuc.ncsa.security.core.Identifier,​V extends BasicTransaction>
        Overrides:
        containsKey in class edu.uiuc.ncsa.security.core.cache.CachedMapFacade<V extends BasicTransaction>
      • containsValue

        public boolean containsValue​(Object value)
        Specified by:
        containsValue in interface Map<edu.uiuc.ncsa.security.core.Identifier,​V extends BasicTransaction>
        Overrides:
        containsValue in class edu.uiuc.ncsa.security.core.cache.CachedMapFacade<V extends BasicTransaction>
      • get

        public V get​(Object key)
        Specified by:
        get in interface Map<edu.uiuc.ncsa.security.core.Identifier,​V extends BasicTransaction>
        Overrides:
        get in class edu.uiuc.ncsa.security.core.cache.CachedMapFacade<V extends BasicTransaction>
      • create

        public V create()
        Specified by:
        create in interface edu.uiuc.ncsa.security.core.Store<V extends BasicTransaction>
      • put

        public V put​(edu.uiuc.ncsa.security.core.Identifier key,
                     V value)
        Specified by:
        put in interface Map<edu.uiuc.ncsa.security.core.Identifier,​V extends BasicTransaction>
        Overrides:
        put in class edu.uiuc.ncsa.security.core.cache.CachedMapFacade<V extends BasicTransaction>
      • remove

        public V remove​(Object key)
        Specified by:
        remove in interface Map<edu.uiuc.ncsa.security.core.Identifier,​V extends BasicTransaction>
        Overrides:
        remove in class edu.uiuc.ncsa.security.core.cache.CachedMapFacade<V extends BasicTransaction>
      • putAll

        public void putAll​(Map m)
        Specified by:
        putAll in interface Map<edu.uiuc.ncsa.security.core.Identifier,​V extends BasicTransaction>
        Overrides:
        putAll in class edu.uiuc.ncsa.security.core.cache.CachedMapFacade<V extends BasicTransaction>
      • clear

        public void clear()
        Specified by:
        clear in interface Map<edu.uiuc.ncsa.security.core.Identifier,​V extends BasicTransaction>
        Overrides:
        clear in class edu.uiuc.ncsa.security.core.cache.CachedMapFacade<V extends BasicTransaction>
      • keySet

        public Set<edu.uiuc.ncsa.security.core.Identifier> keySet()
        Specified by:
        keySet in interface Map<edu.uiuc.ncsa.security.core.Identifier,​V extends BasicTransaction>
        Overrides:
        keySet in class edu.uiuc.ncsa.security.core.cache.CachedMapFacade<V extends BasicTransaction>
      • entrySet

        public Set<Map.Entry<edu.uiuc.ncsa.security.core.Identifier,​V>> entrySet()
        Specified by:
        entrySet in interface Map<edu.uiuc.ncsa.security.core.Identifier,​V extends BasicTransaction>
        Overrides:
        entrySet in class edu.uiuc.ncsa.security.core.cache.CachedMapFacade<V extends BasicTransaction>
      • save

        public void save​(V t)
        Specified by:
        save in interface edu.uiuc.ncsa.security.core.Store<V extends BasicTransaction>
      • register

        public void register​(V transaction)
        Specified by:
        register in interface edu.uiuc.ncsa.security.core.Store<V extends BasicTransaction>
      • search

        public List<V> search​(String key,
                              String condition,
                              boolean isRegEx)
        Specified by:
        search in interface edu.uiuc.ncsa.security.core.Store<V extends BasicTransaction>
      • remove

        public boolean remove​(List<edu.uiuc.ncsa.security.core.Identifiable> objects)
        Specified by:
        remove in interface edu.uiuc.ncsa.security.core.Store<V extends BasicTransaction>