public class CachedList extends AssetList
Constructor and Description |
---|
CachedList(java.lang.String name,
int capacity) |
CachedList(java.lang.String name,
int capacity,
int option,
int timeout,
int threshold) |
Modifier and Type | Method and Description |
---|---|
int |
add(java.lang.String key,
long[] meta,
java.lang.Object obj)
overrides the default behavior and adds a null as the pattern
|
int |
add(java.lang.String key,
long[] meta,
java.lang.Object obj,
int id)
overrides the default behavior and adds a null as the pattern
|
int |
add(java.lang.String key,
long[] meta,
org.apache.oro.text.regex.Pattern pattern,
java.lang.Object obj)
It checks object and the existence of the key first.
|
int |
add(java.lang.String key,
long[] meta,
org.apache.oro.text.regex.Pattern pattern,
java.lang.Object obj,
int id)
It checks object and the existence of the key first.
|
Browser |
browser(java.lang.String topic,
long currentTime)
returns a Browser for all asset IDs associated with the topic or
null if the topic does not exist or has expired by the time.
|
void |
clear() |
boolean |
containsTopic(java.lang.String topic)
It only checks the existence of the topic no matter whether it has
expired or not.
|
java.lang.String[] |
disfragment(long currentTime)
It removes all expired topics, resets all sequence numbers and updates
topic counts for each associated asset.
|
int |
expire(java.lang.String topic,
long currentTime)
It expires the topic and returns 0 if the ttl is larger than zero.
|
protected void |
finalize() |
long |
getCount(java.lang.String topic)
returns the access count of the topic.
|
org.apache.oro.text.regex.Pattern |
getPattern(int id)
It returns the pattern for the id-th asset
|
org.apache.oro.text.regex.Pattern |
getPattern(java.lang.String key)
It returns the pattern for the asset with the key
|
long |
getTimestamp(java.lang.String topic)
returns the timestamp of the topic.
|
int |
getTopicCount()
returns the total number of cached topics.
|
int |
getTopicCount(int id)
returns the number of cached topics associated to an given asset.
|
int |
getTTL(java.lang.String topic)
returns the ttl of the topic.
|
int |
insert(java.lang.String key,
long[] meta,
java.lang.Object obj,
int id)
overrides the default behavior and inserts a null as the pattern
|
int |
insert(java.lang.String key,
long[] meta,
org.apache.oro.text.regex.Pattern pattern,
java.lang.Object obj,
int id)
It checks the object and the existence of the key first.
|
Browser |
insertTopic(java.lang.String topic,
long timestamp,
int ttl,
int[] meta)
It checks the existence of the topic first.
|
boolean |
isExpired(java.lang.String topic,
long currentTime)
It returns true if the topic has expired, or false otherwise.
|
java.lang.Object |
remove(int id)
It removes both the object of the id and its metadata.
|
java.lang.Object |
remove(java.lang.String key)
It removes both the object of the key and its metadata.
|
java.lang.String[] |
sortedTopics()
returns an array of all existing topics in the NATURAL order.
|
java.util.Set<java.lang.String> |
topicSet()
returns a Set for all cached topics no matter whether they have
expired or not.
|
int |
touch(java.lang.String topic,
long timestamp)
It updates mtime of the topic if it has not expired yet.
|
int |
touch(java.lang.String topic,
long timestamp,
long currentTime)
It updates mtime of the topic with a given reference time for expiration.
|
int |
updateTopic(java.lang.String topic,
long timestamp,
int ttl,
int[] meta)
As long as the topic exists, it updates the timestamp, ttl and metadata
no matter whether the topic has expired or not.
|
browser, containsKey, existsID, get, get, getCapacity, getID, getKey, getMetaData, getMetaData, getName, isFull, queryIDs, replaceKey, rotate, set, set, size, swap
public CachedList(java.lang.String name, int capacity, int option, int timeout, int threshold)
public CachedList(java.lang.String name, int capacity)
public Browser insertTopic(java.lang.String topic, long timestamp, int ttl, int[] meta)
public int updateTopic(java.lang.String topic, long timestamp, int ttl, int[] meta)
public int expire(java.lang.String topic, long currentTime)
public int touch(java.lang.String topic, long timestamp)
public int touch(java.lang.String topic, long timestamp, long currentTime)
public boolean isExpired(java.lang.String topic, long currentTime)
public boolean containsTopic(java.lang.String topic)
public int getTopicCount()
public int getTopicCount(int id)
public int getTTL(java.lang.String topic)
public long getTimestamp(java.lang.String topic)
public long getCount(java.lang.String topic)
public java.lang.String[] disfragment(long currentTime)
public java.lang.String[] sortedTopics()
public java.util.Set<java.lang.String> topicSet()
public int add(java.lang.String key, long[] meta, org.apache.oro.text.regex.Pattern pattern, java.lang.Object obj)
public int add(java.lang.String key, long[] meta, java.lang.Object obj)
public int add(java.lang.String key, long[] meta, org.apache.oro.text.regex.Pattern pattern, java.lang.Object obj, int id)
public int add(java.lang.String key, long[] meta, java.lang.Object obj, int id)
public int insert(java.lang.String key, long[] meta, org.apache.oro.text.regex.Pattern pattern, java.lang.Object obj, int id)
public int insert(java.lang.String key, long[] meta, java.lang.Object obj, int id)
public java.lang.Object remove(java.lang.String key)
public java.lang.Object remove(int id)
public org.apache.oro.text.regex.Pattern getPattern(int id)
public org.apache.oro.text.regex.Pattern getPattern(java.lang.String key)
public Browser browser(java.lang.String topic, long currentTime)