All Packages Class Hierarchy This Package Previous Next Index
Class ninja.xset.SETserver
java.lang.Object
|
+----ninja.xset.SETserver
- public class SETserver
- extends Object
- implements Serializable
Class that provides the main interface to the Search Engine on Treaps
It provides the public methods register and deregister for the
external applications.
-
globalHashSID
-
-
HASHSTORE
-
-
parser
-
-
refresh
-
-
rootTagList
-
-
runCleaner
-
-
storeDir
-
-
timeout
-
-
TREAPSTORE
-
-
SETserver(long, String)
- SETserver(long) **
Constructor method
Initializes variables and prepares the search indices for data
-
SETserver(String)
- SETserver() **
Constructor method
Initializes variables and prepares the search indices for data
This constructor is for SET instances with no timeouts
-
clearAll()
- clearAll() **
Method that resets the SETserver objects and deletes all
XML files in the data directory
-
containsSEID(String)
- boolean containsSEID(String) **
Method that tests if a given ServiceEntry ID is already registered
in SETserver.
-
enumerateTag(String[])
- Enumeration enumerateTag (Vector) **
Method to return an enumeration of values for a given tag.
-
printSET(String)
- printSET(String) **
Debugging method used to print out the registration treap
It uses the Treap.print()
-
querySET(Document)
- Vector querySET(Document) **
Method called by the XSet service or independent application to
query for a certain document, given an XML template
-
querySET(Document, Vector)
- Method to query the XSet server, and return only those fields requested
This returned data structure is rather complicated.
-
SETderegister(Document)
- SETderegister (Document) **
Method called by the SDS server or independent application to
remove a document from the SET search engine indices.
-
SETderegister(ServiceEntry)
- SETderegister (ServiceEntry) **
Method called by the XSet service to
remove a document from the SET search engine indices.
-
SETregister(Document, long)
- SETregister(Document, long) **
Method called by the SDS server or independent application to
add a new document to the XSet search engine.
-
SETregister(String, long)
- SETregister(String, long) **
Method called by application to add new document to XSet.
-
SETrenew(Document)
- SETrenew (Document) **
Method called by he SDS server to update an existing
XML document.
-
SETreplace(Document, Document)
- SETreplace(Document, Document) **
Method called by the SDS server or independent application to
replace an existing document with a new document.
-
testCheckAttributes()
- testCheckAttributes() **
TESTER Method for checkAttributes
-
testIntersect()
- testIntersect () **
TESTER Method for totalIntersect
HASHSTORE
public static final short HASHSTORE
TREAPSTORE
public static final short TREAPSTORE
rootTagList
protected Hashtable rootTagList
refresh
protected boolean refresh
timeout
protected long timeout
globalHashSID
protected Hashtable globalHashSID
storeDir
protected String storeDir
runCleaner
protected transient Thread runCleaner
parser
protected transient DOMParser parser
SETserver
public SETserver(long refreshRate,
String sDir)
- SETserver(long) **
Constructor method
Initializes variables and prepares the search indices for data
- Parameters:
- refreshRate - The number of milliseconds taken for an entry to become outdated encoded as a long
- sDir - The storage directory for all XML files
SETserver
public SETserver(String sDir)
- SETserver() **
Constructor method
Initializes variables and prepares the search indices for data
This constructor is for SET instances with no timeouts
- Parameters:
- sDir - The storage directory for all XML files
containsSEID
public boolean containsSEID(String serviceID)
- boolean containsSEID(String) **
Method that tests if a given ServiceEntry ID is already registered
in SETserver.
- Returns:
- whether the hashtable contains the given ServiceEntry ID
querySET
public Vector querySET(Document query)
- Vector querySET(Document) **
Method called by the XSet service or independent application to
query for a certain document, given an XML template
- Parameters:
- query - The XML document used as the template for the search
- Returns:
- The serviceEntry vector containing (if any) the matches
that correspond to the query
querySET
public Vector querySET(Document xmlQuery,
Vector tagVector) throws XSetException
- Method to query the XSet server, and return only those fields requested
This returned data structure is rather complicated. It's a vector of
hashtables, one hashtable for each matching XML document found. For
each of these matches, the hashtable hashes each of the requested
tag names to a vector. The vector contains all the string values
which occur in that tagname in the currently matched XML document.
So it's a Vector of Hashtables of Vectors.
- Parameters:
- xmlQuery, - the xml query in the form of a DOM tree object
- tagVector, - a vector containing String names of requested tags
- Returns:
- Vector of hashtables that map each requested tagname to its value
- Throws: XSetException
- for normal XSet errors
enumerateTag
public Enumeration enumerateTag(String pathArray[]) throws XSetException
- Enumeration enumerateTag (Vector) **
Method to return an enumeration of values for a given tag.
The method traverses the internal index for tags, and upon finding
the desired tag (indicated through a series of string arguments, it
calls the keys() method on the treap, and returns the enumeration.
- Parameters:
- pathArray - is an array of strings that denote the path from
the root of the document to the desired tag
- Returns:
- an enumeration of the existing values for the specified given
tag in the dataset tree
- Throws: XSetException
- for normal XSet errors
SETrenew
public void SETrenew(Document d) throws XSetException
- SETrenew (Document) **
Method called by he SDS server to update an existing
XML document. It hashes the document to get the ID and
retrieves the serviceEntry, then updates the heartbeat field.
- Parameters:
- renewDoc - XML document to be renewed
- Throws: XSetException
- for generalized errors
SETreplace
public void SETreplace(Document olddoc,
Document newdoc) throws XSetException
- SETreplace(Document, Document) **
Method called by the SDS server or independent application to
replace an existing document with a new document. It deletes
e old document first, the registers the new document.
- Parameters:
- olddoc - The XML document to be replaced in the SET
- newdoc - The XML document to replace olddoc
- Throws: XSetException
- for generalized errors
SETregister
public void SETregister(String xmltext,
long counter) throws XSetException
- SETregister(String, long) **
Method called by application to add new document to XSet.
This version is to provide a wrapper for parsing the XML string
- Parameters:
- xmltext - The XML document in string format
- counter - The counter value assigned externally via a counter obj
- Throws: XSetException
- for generalized errors
SETregister
public void SETregister(Document d,
long counter) throws XSetException
- SETregister(Document, long) **
Method called by the SDS server or independent application to
add a new document to the XSet search engine. Mainly a wrapper for
generating the serviceID
- Parameters:
- d - The XML document to be added to the search engine
- counter - The counter value assigned externally via a counter obj
- Throws: XSetException
- for generalized errors
SETderegister
public void SETderegister(Document d) throws XSetException
- SETderegister (Document) **
Method called by the SDS server or independent application to
remove a document from the SET search engine indices.
- Parameters:
- d - The XML document to be removed from the search engine
- Throws: XSetException
- for generalized errors
SETderegister
public void SETderegister(ServiceEntry se) throws XSetException
- SETderegister (ServiceEntry) **
Method called by the XSet service to
remove a document from the SET search engine indices.
- Parameters:
- se - The XML ServiceEntry to be removed from the search engine
- Throws: XSetException
- for generalized errors
clearAll
public void clearAll()
- clearAll() **
Method that resets the SETserver objects and deletes all
XML files in the data directory
testCheckAttributes
public void testCheckAttributes()
- testCheckAttributes() **
TESTER Method for checkAttributes
testIntersect
public void testIntersect()
- testIntersect () **
TESTER Method for totalIntersect
printSET
public void printSET(String roottagname)
- printSET(String) **
Debugging method used to print out the registration treap
It uses the Treap.print()
All Packages Class Hierarchy This Package Previous Next Index