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.


Variable Index

 o globalHashSID
 o HASHSTORE
 o parser
 o refresh
 o rootTagList
 o runCleaner
 o timeout
 o TREAPSTORE

Constructor Index

 o SETserver()
Constructor method Initializes variables and prepares the search indices for data This constructor is for SET instances with no timeouts
 o SETserver(long)
Constructor method Initializes variables and prepares the search indices for data

Method Index

 o enumerateTag(String[])
Method to return an enumeration of values for a given tag.
 o printSET(String)
Debugging method used to print out the registration treap It uses the Treap.print()
 o querySET(Document)
Method called by the XSet service or independent application to query for a certain document, given an XML template
 o querySET(Document, Vector)
Method to query the XSet server, and return only those fields requested

This returned data structure is rather complicated.

 o SETderegister(Document)
Method called by the SDS server or independent application to remove a document from the SET search engine indices.
 o SETregister(Document)
Method called by the SDS server or independent application to add a new document to the XSet search engine.
 o SETregister(ServiceEntry, Document)
Method called by the SDS server or independent application to add a new document to the XSet search engine.
 o SETregister(String)
Method called by application to add new document to XSet.
 o SETrenew(Document)
Method called by the SDS server to update an existing XML document.
 o SETreplace(Document, Document)
Method called by the SDS server or independent application to replace an existing document with a new document.
 o testCheckAttributes()
TESTER Method for checkAttributes
 o testIntersect()
TESTER Method for totalIntersect

Variables

 o HASHSTORE
 public static final short HASHSTORE
 o TREAPSTORE
 public static final short TREAPSTORE
 o rootTagList
 protected Hashtable rootTagList
 o refresh
 protected boolean refresh
 o timeout
 protected long timeout
 o runCleaner
 protected Thread runCleaner
 o globalHashSID
 protected Hashtable globalHashSID
 o parser
 protected DOMParser parser

Constructors

 o 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
 o SETserver
 public SETserver()
Constructor method Initializes variables and prepares the search indices for data This constructor is for SET instances with no timeouts

Methods

 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o testCheckAttributes
 public void testCheckAttributes()
TESTER Method for checkAttributes

 o testIntersect
 public void testIntersect()
TESTER Method for totalIntersect

 o 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