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)
-
XSetService()
- Constructor, just creates an SETserver object
-
AddDocument(String)
- AddDocument (String) **
Method used to add a single document to the XSet search engine index
-
AddFile(String)
- AddFile(String) **
Method to add a single file to the XSet dataset
-
AddFiles(String)
- AddFiles (String) **
Method used to add files to the XSet search engine index
-
Checkpoint()
- boolean Checkpoint () **
The method to do synchronous checkpointing.
It generates a new sequenceID for the checkpoint log entry
-
ClearAll()
- ClearAll() **
Method to clear the XSet index, in reality it just creates
a new instance of the SETserver object
-
destroy()
-
-
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.
-
ForceSync()
- boolean ForceSync () **
The method to force log buffers to be written out to disk.
-
getStoreDir()
- String getDatafilePath() **
Method to grab the full path of the datafiles, which is
the same as the storeDir + the data directory
-
init(String[])
- init(iSpaceServiceConfig) **
Initialization: checks the arguments and prints out
informative message.
-
main(String[])
-
-
Query(String)
- Vector Query(String) **
Method that queries the XSet server and returns vector of XML documents
-
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.
-
QuerySE(String)
- Vector QuerySE (String) **
Method to query the XSet server
-
RemoveDocument(Document)
- RemoveDocument(Document) **
The method that removes a document from the index structure
-
RemoveDocument(String)
- RemoveDocument(String) **
The method that takes in a XML string, and tries to remove it from the
index if it exists
-
Shutdown(boolean)
- int Shutdown(boolean backup) **
The method for shutting down a XSetService
XSetService
public XSetService() throws RemoteException
- Constructor, just creates an SETserver object
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.
destroy
protected void destroy()
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index