|
Project JXTA | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.cm.SrdiCache
Description of the Class
Nested Class Summary | |
(package private) class |
SrdiCache.SrdiEntry
Description of the Class |
Constructor Summary | |
SrdiCache(long maxSize)
Constructor for the SrdiCache object |
|
SrdiCache(long maxSize,
long interval)
Construct a srdiObject and starts a GC thread which runs every "interval" milliseconds |
Method Summary | |
void |
add(String primaryKey,
String attribute,
String value,
Object path,
long expiration,
boolean sticky)
add a cache entry |
void |
clear()
Empties the cache completely. |
boolean |
containsKey(String primaryKey,
String secondaryKey)
Determines whether this object is caching a particular key |
void |
garbageCollect()
|
Enumeration |
getEntries(String primaryKey,
String secondaryKey)
return all entries of primary, and secondary keys |
long |
getMaxSize()
returns the maxSize of the SrdiCache object |
Enumeration |
getPrimaryKeys()
return all primary keys |
Enumeration |
getSecondaryKeys(String primaryKey)
return all primary keys |
long |
getSize()
Gets the size attribute of the SrdiCache object |
void |
purge(int fraction)
Purges some of the cache. |
Enumeration |
query(String primaryKey,
String attribute,
String value)
Query the cache |
void |
remove(Object path)
remove a file entry from cache |
void |
removeKey(String primaryKey,
String secondaryKey)
|
void |
run()
|
long |
setMaxSize(long maxSize)
Sets the maxSize of the SrdiCache object only in the condition where maxSize is > size of the cache in other words we can't shrink it past the size |
void |
stop()
stop the current running thread |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SrdiCache(long maxSize)
maxSize
- maximum number of entries in the cachepublic SrdiCache(long maxSize, long interval)
maxSize
- maximum number of entries in the cacheinterval
- the interval at which the gc will run in millisecondsMethod Detail |
public long getMaxSize()
public long setMaxSize(long maxSize)
maxSize
- new size
public long getSize()
public Enumeration getPrimaryKeys()
public Enumeration getSecondaryKeys(String primaryKey)
public Enumeration getEntries(String primaryKey, String secondaryKey)
public void add(String primaryKey, String attribute, String value, Object path, long expiration, boolean sticky)
attribute
- Attribute String to query onvalue
- value of the attribute stringpath
- in a specific path, if null specified search in all
pathsexpiration
- expiration associated with this entry
relative time in millisecondspublic boolean containsKey(String primaryKey, String secondaryKey)
primaryKey
- primary key to search forsecondaryKey
- secondardy key to search for.
public void remove(Object path)
path
- relative pathpublic Enumeration query(String primaryKey, String attribute, String value)
attribute
- Attribute String to query onvalue
- value of the attribute string
public void purge(int fraction)
fraction
- Description of the Parameterpublic void clear()
public void garbageCollect()
public void removeKey(String primaryKey, String secondaryKey)
public void stop()
public void run()
run
in interface Runnable
|
JXTA J2SE | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |