|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ldaptive.cache.LRUCache<Q>
Q - type of search requestpublic class LRUCache<Q extends SearchRequest>
Least-Recently-Used cache implementation. Leverages a LinkedHashMap.
| Constructor Summary | |
|---|---|
LRUCache(int size,
long timeToLive,
long interval)
Creates a new LRU cache. |
|
| Method Summary | |
|---|---|
void |
clear()
Removes all data from this cache. |
void |
close()
Frees any resources associated with this cache. |
SearchResult |
get(Q request)
Returns the ldap result for the supplied request. |
void |
put(Q request,
SearchResult result)
Stores the ldap result for the supplied request. |
int |
size()
Returns the number of items in this cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LRUCache(int size,
long timeToLive,
long interval)
size - number of results to cachetimeToLive - in seconds that results should stay in the cacheinterval - in seconds to enforce timeToLive| Method Detail |
|---|
public void clear()
public SearchResult get(Q request)
get in interface Cache<Q extends SearchRequest>request - to find ldap result with
public void put(Q request,
SearchResult result)
put in interface Cache<Q extends SearchRequest>request - used to find ldap resultresult - found with requestpublic int size()
public void close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||