View Javadoc

1   package com.atlassian.user.impl.cache;
2   
3   import java.util.List;
4   
5   /**
6    * @deprecated since 1.25, use {@link com.atlassian.cache.Cache} instead
7    */
8   public interface Cache
9   {
10      /**
11       * The name of the cache uniquely identifies this cache.
12       *
13       * @return the name of the cache.
14       */
15      String getName();
16  
17      /**
18       * Retrieve an object from this cache.
19       * @param key uniquely identifying the object to be retrieved.
20       *
21       * @return the object from the cache, or null if the object is not found.
22       */
23      Object get(Object key);
24  
25      /**
26       * Retrieve a list of all of the keys for objects currently stored in this cache.
27       *
28       * @return a list of keys for each of the objects in this cache.
29       *
30       * @deprecated this is not supported by all cache implementations and therefore will be removed from this interface
31       * in the near future.
32       */
33      List/*<Object>*/ getKeys();
34  
35      /**
36       * Put an object into the cache. If the specified key already exists within the cache, it will be replaced by
37       * the new object.
38       *
39       * @param key uniquely identifying the object to be added into the cache.
40       * @param value to be cached.
41       */
42      void put(Object key, Object value);
43  
44      /**
45       * Remove the object identified by the key from the cache. If no object can be found associated with this key
46       * then no action is taken.
47       *
48       * @param key uniquely identifying the object to be removed.
49       */
50      void remove(Object key);
51  
52      /**
53       * Remove all of the objects from this cache.
54       */
55      void removeAll();
56  
57      /**
58       * @deprecated The idea of status is not supported by all cache implementations and therefore is likely to be
59       * moved into another interface. Do not use this.
60       */
61      int getStatus();
62  }