|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.xnode.XNodeStoreChangeCache
public class XNodeStoreChangeCache
Backed by a Stack, acts as a list of XNodeStoreEvents
received by an XNodeStoreListener attached to the
XNodeStore. Note that upon creation of an
XNodeStoreChangeCache object, it will automatically attach a listener to
the XNodeStore (which is a singleton class in this implementation). It's
possible to create multiple caches (for whatever reason); each will add
its own listener. To remove a cache, it's first necessary to call its
removeListener() method to remove the listener, otherwise it will
remain, hanging.
The cache can be directly manipulated as a Stack.
There is some code to support separate indexing on a per-Collection basis, but given that indexes are currently for the entire database, it's not used.
| Field Summary | |
|---|---|
static int |
COL_ADD
The int code indicating a new Collection has been added. |
static int |
COL_DEL
The int code indicating a Collection has been deleted. |
static int |
COL_MOD
The int code indicating a Collection has been modified (by adding, modifying or deleting nodes). |
static int |
NODE_ADD
The int code indicating a new Node has been added. |
static int |
NODE_DEL
The int code indicating a Node has been deleted. |
static int |
NODE_MOD
The int code indicating a Node has been modified. |
static int |
REINDEX
The int code indicating that the number of changes that have occurred has passed the threshold for rebuilding the entire database index. |
| Constructor Summary | |
|---|---|
XNodeStoreChangeCache(XNodeStore xnodestore)
Default constructor with an XNodeStore. |
|
| Method Summary | |
|---|---|
protected void |
addDefaultListener()
Adds the listener that this XNodeStoreChangeCache uses to create the cache of event notifications to the XNodeStore. |
void |
clear()
Clear the cache contents. |
Stack |
getCache()
Return the cache contents as a Stack. |
static String[] |
parseEntry(String entry)
Provided a space-delimited cache entry, returns a three element array containing its fields in entry order: type, cid, nid. |
void |
removeListener()
Removes this XNodeStoreChangeCache's listener from the XNodeStore. |
String |
tostring()
Returns the cache as a string (nl-delimited list of type+cid). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int REINDEX
public static final int COL_ADD
public static final int COL_DEL
public static final int COL_MOD
public static final int NODE_ADD
public static final int NODE_DEL
public static final int NODE_MOD
| Constructor Detail |
|---|
public XNodeStoreChangeCache(XNodeStore xnodestore)
throws XNodeException
XNodeException - if unable to add the cache listener to the XNodeStore.| Method Detail |
|---|
protected void addDefaultListener()
public void removeListener()
public static String[] parseEntry(String entry)
public void clear()
public Stack getCache()
public String tostring()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||