All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ninja.xset.XSetService

java.lang.Object
   |
   +----java.rmi.server.RemoteObject
           |
           +----java.rmi.server.RemoteServer
                   |
                   +----java.rmi.server.UnicastRemoteObject
                           |
                           +----ninja.xset.XSetService

public class XSetService
extends UnicastRemoteObject
implements XSetServiceIF
Class that makes the SETserver an ISpace service It offers methods to addfiles to the XSet search engine, clear the XSet contents, and to query XSet As an ISpace service, the correct entry in ispace.cfg is ninja.xset.XSetService The service is originally empty, and files can be added directory by directory by calling XSetAddFiles(path)


Constructor Index

 o XSetService()
Constructor, just creates an SETserver object

Method Index

 o AddDocument(String)
AddDocument (String) ** Method used to add a single document to the XSet search engine index
 o AddFile(String)
AddFile(String) ** Method to add a single file to the XSet dataset
 o AddFiles(String)
AddFiles (String) ** Method used to add files to the XSet search engine index
 o Checkpoint()
boolean Checkpoint () ** The method to do synchronous checkpointing.
It generates a new sequenceID for the checkpoint log entry
 o ClearAll()
ClearAll() ** Method to clear the XSet index, in reality it just creates a new instance of the SETserver object
 o destroy()
 o EnumerateTag(String[])
EnumerateTag (String []) *** Method that takes in a path to a subpath down to a tag in the form of an array, and returns an enumeration of the existing values in the treap for that tag.
 o ForceSync()
boolean ForceSync () ** The method to force log buffers to be written out to disk.
 o getStoreDir()
String getDatafilePath() ** Method to grab the full path of the datafiles, which is the same as the storeDir + the data directory
 o init(String[])
init(iSpaceServiceConfig) ** Initialization: checks the arguments and prints out informative message.
 o main(String[])
 o Query(String)
Vector Query(String) ** Method that queries the XSet server and returns vector of XML documents
 o Query(String, Vector)
Vector Query (String, Vector) ** Method to query the XSet server, and return only those fields requested

This returned data structure is rather complicated.

 o QuerySE(String)
Vector QuerySE (String) ** Method to query the XSet server
 o RemoveDocument(Document)
RemoveDocument(Document) ** The method that removes a document from the index structure
 o RemoveDocument(String)
RemoveDocument(String) ** The method that takes in a XML string, and tries to remove it from the index if it exists
 o Shutdown(boolean)
int Shutdown(boolean backup) ** The method for shutting down a XSetService

Constructors

 o XSetService
 public XSetService() throws RemoteException
Constructor, just creates an SETserver object

Methods

 o init
 protected void init(String args[])
init(iSpaceServiceConfig) ** Initialization: checks the arguments and prints out informative message.
Now needs to check local filesystem for backup, and restore previous database contents from checkpoint.

 o destroy
 protected void destroy()
 o getStoreDir
 public String getStoreDir()
String getDatafilePath() ** Method to grab the full path of the datafiles, which is the same as the storeDir + the data directory

Returns:
The full path to the XML data files
 o AddDocument
 public void AddDocument(String xmlstring) throws RemoteException
AddDocument (String) ** Method used to add a single document to the XSet search engine index

Parameters:
xmlstring - the document to be added
Throws: RemoteException
as a remote service should
 o AddFiles
 public void AddFiles(String path) throws RemoteException
AddFiles (String) ** Method used to add files to the XSet search engine index

Parameters:
path - String that encodes the full path of the directory that contains the files to be indexed
Throws: RemoteException
as demanded by RMI
 o AddFile
 public void AddFile(String filename) throws RemoteException
AddFile(String) ** Method to add a single file to the XSet dataset

Parameters:
filename - String encoding of the filename including full path
Throws: RemoteException
if file not found or error in IO.
 o ClearAll
 public void ClearAll() throws RemoteException
ClearAll() ** Method to clear the XSet index, in reality it just creates a new instance of the SETserver object

 o QuerySE
 public Vector QuerySE(String xmlQuery) throws RemoteException
Vector QuerySE (String) ** Method to query the XSet server

Parameters:
xmlQuery - is the query in the form of a text string encoded xml document. The query must be well-formed, but not contain a reference to any DTDs
Returns:
Vector of ServiceEntry objects, each wrapped around XML Document
 o Query
 public Vector Query(String xmlQuery) throws RemoteException
Vector Query(String) ** Method that queries the XSet server and returns vector of XML documents

Parameters:
xmlQuery - is the query in string encoded xml format, which must be well-formed, and should not contain a reference to any DTDs
Returns:
Vector of XML documents in string form
 o Query
 public Vector Query(String xmlQuery,
                     Vector tagVector) throws RemoteException
Vector Query (String, Vector) ** 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 string encoded XML
tagVector, - a vector containing String names of requested tags
Returns:
Vector of hashtables that map each requested tag name to its value
 o EnumerateTag
 public Vector EnumerateTag(String pathArray[]) throws RemoteException
EnumerateTag (String []) *** Method that takes in a path to a subpath down to a tag in the form of an array, and returns an enumeration of the existing values in the treap for that tag. Just a simple wrapper around SETserver.enumerateTag()

Parameters:
pathArray - - the string array of tag names in the path to the tag
Returns:
Vector of unique existing values that exist in the dataset
 o RemoveDocument
 public void RemoveDocument(Document d) throws RemoteException
RemoveDocument(Document) ** The method that removes a document from the index structure

Parameters:
d - The org.w3c.dom document that is to be removed
 o RemoveDocument
 public void RemoveDocument(String xml) throws RemoteException
RemoveDocument(String) ** The method that takes in a XML string, and tries to remove it from the index if it exists

Parameters:
xml - The XML string representing the XML document to be removed
 o Checkpoint
 public boolean Checkpoint() throws RemoteException
boolean Checkpoint () ** The method to do synchronous checkpointing.
It generates a new sequenceID for the checkpoint log entry

Returns:
whether the checkpointing failed (-1) or succeeded (0)
Throws: RemoteException
which encapsulates any server side exceptions
 o ForceSync
 public void ForceSync() throws RemoteException
boolean ForceSync () ** The method to force log buffers to be written out to disk.

Throws: RemoteException
which encapsulates any server side exceptions
 o Shutdown
 public int Shutdown(boolean backup) throws RemoteException
int Shutdown(boolean backup) ** The method for shutting down a XSetService

Parameters:
backup - - whether to checkpoint before shutdown
Returns:
success or failure of the checkpointing before shutdown
 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index