ninja.activeproxy.path.pxset
Class PathXSetService

java.lang.Object
  |
  +--ninja.rmi.NinjaRemoteObject
        |
        +--ninja.ispace.iSpaceService
              |
              +--ninja.activeproxy.path.pxset.PathXSetService

public class PathXSetService
extends ninja.ispace.iSpaceService
implements PathXSetServiceIF, ninja.sds.SDSinsecureServiceIF

Class similar to Ben's XSETService This makes the SETserver an RMI service It offers methods to query the database by specifying a sequence of attribute and tag names. This query is higher-level than that SETserver which takes in nly DOM documents. After a set of revisions, I think that it can be replaced with Ben's XSet Server now or SETserver, which accepts only documents.


Field Summary
(package private) static boolean debug
           
protected  ninja.sds.ServiceDescription descr
           
(package private)  com.ibm.xml.parsers.DOMParser parser
           
private static java.lang.String PATH_XSET_SERVICE_NAME
           
private  ninja.xset.SETserver server
           
 
Fields inherited from class ninja.rmi.NinjaRemoteObject
servref
 
Constructor Summary
PathXSetService()
          Constructor: Creates a SETserver object, initializes DTDSring;
 
Method Summary
private  void addConnectorFiles(java.lang.String path)
          Method used to add connectors to the XSet search engine index
 void addDocument(java.lang.String docxml)
          Method used to add a new operator to the XSet search engine index
protected  void destroy()
          Destroy: reqd by iSpaceService
 byte[] getDescription()
          This routine creates a service description for this service, and return its byte array.
protected  void init(ninja.ispace.iSpaceServiceConfig config)
          Initialization: checks the arguments and prints out informative message.
static PathXSetServiceIF loadSDSImplementer()
          Find an instance of path instantiator on the network
 java.util.Vector query(java.lang.String xmlQuery)
          Method that queries the XSet server and returns vector of XML documents
 void removeDocument(java.lang.String docxml)
          Method used to remove an operator the XSet search engine index
private  org.w3c.dom.Document XML2DOM(java.lang.String xmlString)
          Method to retrieve the DOM document from the XML String
 
Methods inherited from class ninja.rmi.NinjaRemoteObject
exportObject, getStub, unexportObject
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

debug

static boolean debug

server

private ninja.xset.SETserver server

parser

com.ibm.xml.parsers.DOMParser parser

PATH_XSET_SERVICE_NAME

private static final java.lang.String PATH_XSET_SERVICE_NAME

descr

protected ninja.sds.ServiceDescription descr
Constructor Detail

PathXSetService

public PathXSetService()
                throws java.rmi.RemoteException,
                       InvalidXMLException,
                       DirectoryInaccessibleException
Constructor: Creates a SETserver object, initializes DTDSring;
Throws:
java.rmi.RemoteException - as required by RMI
Method Detail

init

protected void init(ninja.ispace.iSpaceServiceConfig config)
Initialization: checks the arguments and prints out informative message.
Overrides:
init in class ninja.ispace.iSpaceService
Parameters:
iSPaceServiceConfig - config as reqd by iSpaceService

getDescription

public byte[] getDescription()
This routine creates a service description for this service, and return its byte array.
Specified by:
getDescription in interface ninja.sds.SDSinsecureServiceIF
Returns:
Service description

destroy

protected void destroy()
Destroy: reqd by iSpaceService
Overrides:
destroy in class ninja.ispace.iSpaceService
Parameters:
iSPaceServiceConfig - config as reqd by iSpaceService

addDocument

public void addDocument(java.lang.String docxml)
                 throws java.rmi.RemoteException,
                        InvalidXMLException,
                        DuplicateException
Method used to add a new operator to the XSet search engine index
Specified by:
addDocument in interface PathXSetServiceIF
Parameters:
docxml - xml description of the document to be added
Throws:
java.rmi.RemoteException - as a remote service should
InvalidXMLException -  
DuplicateException - Also this method converts the XML string to a DOM doc though the SETserver provides a method to register a string, just so this is similar to the removeOperator method

addConnectorFiles

private void addConnectorFiles(java.lang.String path)
                        throws java.rmi.RemoteException,
                               InvalidXMLException,
                               DirectoryInaccessibleException
Method used to add connectors to the XSet search engine index
Parameters:
path - path of connector xml files
Throws:
java.rmi.RemoteException - as a remote service should
InvalidXMLException - Note, most of the try,catch blocks will never have to handle an exception because their functionalities overlap.

removeDocument

public void removeDocument(java.lang.String docxml)
                    throws java.rmi.RemoteException,
                           InvalidXMLException,
                           NotFoundException
Method used to remove an operator the XSet search engine index
Specified by:
removeDocument in interface PathXSetServiceIF
Parameters:
docxml - xml description of the document to be removed
Throws:
java.rmi.RemoteException - as a remote service should
InvalidXMLException - Note, most of the try,catch blocks will never have to handle an exception because their functionalities overlap.

query

public java.util.Vector query(java.lang.String xmlQuery)
                       throws java.rmi.RemoteException,
                              InvalidXMLException
Method that queries the XSet server and returns vector of XML documents
Specified by:
query in interface PathXSetServiceIF
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
Throws:
java.rmi.RemoteException - required by RMI
ninja.xset.XSetException - parse error by SETserver

XML2DOM

private org.w3c.dom.Document XML2DOM(java.lang.String xmlString)
                              throws InvalidXMLException
Method to retrieve the DOM document from the XML String
Parameters:
String - xmlString input xml string
Returns:
Document corresponding DOM document from XSet
Throws:
ninja.xset.XSetException - on parse error from SETserver

loadSDSImplementer

public static PathXSetServiceIF loadSDSImplementer()
                                            throws ninja.sds.NoSDSfound,
                                                   java.rmi.RemoteException,
                                                   java.lang.Exception
Find an instance of path instantiator on the network
Throws:
ninja.sds.NoSDSfound - SDS exception
java.rmi.RemoteException - reqd by RMI
java.lang.Exception - just in case?? :)