All Packages Class Hierarchy This Package Previous Next Index
Class xset.SETserver
java.lang.Object
|
+----xset.SETserver
- public class SETserver
- extends Object
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
-
-
timeout
-
-
TREAPSTORE
-
-
SETserver()
- Constructor method
Initializes variables and prepares the search indices for data
This constructor is for SET instances with no timeouts
-
SETserver(long)
- Constructor method
Initializes variables and prepares the search indices for data
-
enumerateTag(String[])
- Method to return an enumeration of values for a given tag.
-
printSET(String)
- Debugging method used to print out the registration treap
It uses the Treap.print()
-
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)
- Method called by the SDS server or independent application to
remove a document from the SET search engine indices.
-
SETregister(Document)
- Method called by the SDS server or independent application to
add a new document to the XSet search engine.
-
SETregister(ServiceEntry, Document)
- Method called by the SDS server or independent application to
add a new document to the XSet search engine.
-
SETregister(String)
- Method called by application to add new document to XSet.
-
SETrenew(Document)
- Method called by the SDS server to update an existing
XML document.
-
SETreplace(Document, Document)
-
Method called by the SDS server or independent application to
replace an existing document with a new document.
-
testCheckAttributes()
- TESTER Method for checkAttributes
-
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
runCleaner
protected Thread runCleaner
globalHashSID
protected Hashtable globalHashSID
parser
protected DOMParser parser
SETserver
public SETserver(long refreshRate)
- 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
SETserver
public SETserver()
- Constructor method
Initializes variables and prepares the search indices for data
This constructor is for SET instances with no timeouts
querySET
public Vector querySET(Document query)
- 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 tag name to its value
- Throws: XSetException
- for normal XSet errors
enumerateTag
public Enumeration enumerateTag(String pathArray[]) throws XSetException
- 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 elements() 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
- Method called by the 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
- Method called by the SDS server or independent application to
replace an existing document with a new document. It deletes
the 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) throws XSetException
- 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
- Throws: XSetException
- for generalized errors
SETregister
public void SETregister(Document d) throws XSetException
- 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
- Throws: XSetException
- for generalized errors
SETregister
protected void SETregister(ServiceEntry se,
Document d)
- Method called by the SDS server or independent application to
add a new document to the XSet search engine.
- Parameters:
- xmltext - The original XML string, (used for efficient storage)
- d - The XML document to be added to the search engine
- serviceID - A previously generated ID for the document
SETderegister
public void SETderegister(Document d) throws XSetException
- 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
- Returns:
- true or false, whether the deregistration was successful
- Throws: XSetException
- for generalized errors
testCheckAttributes
public void testCheckAttributes()
- TESTER Method for checkAttributes
testIntersect
public void testIntersect()
- TESTER Method for totalIntersect
printSET
public void printSET(String roottagname)
- Debugging method used to print out the registration treap
It uses the Treap.print()
All Packages Class Hierarchy This Package Previous Next Index