org.activemath.omdocjdom.mbase
Class OJXMLRPCmbaseServer

java.lang.Object
  extended by org.activemath.omdocjdom.mbase.OJXMLRPCmbaseServer

public class OJXMLRPCmbaseServer
extends Object

This class acts as a generic wrapper of any given MBaseRef to serve it through XML-RPC on the given port number.

Use its peer OJXmlRpcMBaseRef to communicate with it and obtain an MBaseRef at the other side.

Version:

Nested Class Summary
 class OJXMLRPCmbaseServer.ReloadErrorHandler
          This class is made public only for the purposes of being served by XML-RPC server...
 
Field Summary
static String CVS_ID
          Missing description of the Field
protected static org.apache.commons.logging.Log log
          Missing description of the Field
static int NO_SUCH_ITEM_ERRCODE
          The XML-RPC error code sent when an ID requested did not exist.
 
Constructor Summary
OJXMLRPCmbaseServer(int portNumber, MBaseRef mbaseRef)
          Missing description of constructor for the OJXMLRPCmbaseServer object
OJXMLRPCmbaseServer(MBaseRef mbaseRef)
           
OJXMLRPCmbaseServer(Subconfiguration config)
          A constructor that reads its properties from the Manager properties and uses the Manager's MBaseRef.
 
Method Summary
 boolean assertItsUp()
          Relays to MBaseRef.assertItsUp().
protected  void attemptShutdown(String candidatePassword)
          Missing description of the Method
 MBaseRef close()
          Closes the attached server listening to the socket.
protected  void finalize()
          Missing description of the Method
 String getAttribute(String id, String attributeName)
          Missing description of the gets the attribute attribute of the OJXMLRPCmbaseServer object
 String getCanonicalID(String givenID)
          Calls MBaseRef.getCanonicalID(org.activemath.abstractcontent.MBaseID).
 String getChildren(String id, String xPathExpr)
           
 Vector getCollectionsProvided()
          Calls MBaseRef.getStructuredListOfConcepts(java.util.Collection).
 Hashtable getCommonName(String id)
          Missing description of the gets the commonName attribute of the OJXMLRPCmbaseServer object
 String getCompleteDCMetadata(String id)
          Missing description of the gets the completeDCMetadata attribute of the OJXMLRPCmbaseServer object
 Vector getDefinitions(String id, Vector collections)
          Missing description of the gets the definitions attribute of the OJXMLRPCmbaseServer object
 Vector getDependencies(String id)
          This method returns a vector (an XML-RPC array) of dependencies.
 String getFormalContent(String id)
          Missing description of the gets the formalContent attribute of the OJXMLRPCmbaseServer object
 Vector getForWhat(String id)
          Missing description of the gets the forWhat attribute of the OJXMLRPCmbaseServer object
 String getMetadata(String id)
          Missing description of the gets the metadata attribute of the OJXMLRPCmbaseServer object
 String getMethodNames()
          Returns the attached description of the methods (FIXME: currently missing).
 Hashtable getOMDocPath(String givenID)
          Returns the path of the OMDoc from which was loaded the element pointed at by this ID.
 Vector getProofs(String id, Vector collections)
          Missing description of the gets the proofs attribute of the OJXMLRPCmbaseServer object
 Vector getRelated(String id, Vector collections)
          This method returns a vector (an XML-RPC array) of dependencies.
 String getStructuredListOfConcepts(Vector collections)
          Missing description of the gets the structuredListOfConcepts attribute of the OJXMLRPCmbaseServer object
 String getTextualContent(String id)
          Missing description of the gets the textualContent attribute of the OJXMLRPCmbaseServer object
 String getTheory(String id)
          Missing description of the gets the theory attribute of the OJXMLRPCmbaseServer object
 String getTypeString(String id)
          Missing description of the gets the typeString attribute of the OJXMLRPCmbaseServer object
 Vector listItems(String idString)
           
 Vector listTheories(Vector collections)
           
 String reload()
           
 String reload(Vector collections)
           
 String reloadWithErrors()
           
 String reloadWithErrors(String collName)
           
 String reloadWithErrors(Vector collections)
          Reloads the content from the directory.
 Vector searchIDs(String idSubstring)
          Searches for an id by substring...
 Vector searchText(String textToSearch, Vector collections)
          Calls MBaseRef.searchText(java.lang.String, java.util.Collection).
 String shutdown(String key)
          Shuts down using the generated password (currently deactivated)
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CVS_ID

public static final String CVS_ID
Missing description of the Field

See Also:
Constant Field Values

NO_SUCH_ITEM_ERRCODE

public static final int NO_SUCH_ITEM_ERRCODE
The XML-RPC error code sent when an ID requested did not exist.

See Also:
Constant Field Values

log

protected static org.apache.commons.logging.Log log
Missing description of the Field

Constructor Detail

OJXMLRPCmbaseServer

public OJXMLRPCmbaseServer(Subconfiguration config)
                    throws MBaseException
A constructor that reads its properties from the Manager properties and uses the Manager's MBaseRef.

Parameters:
config - Missing description of Parameter
Throws:
MBaseException - Missing description of Exception

OJXMLRPCmbaseServer

public OJXMLRPCmbaseServer(int portNumber,
                           MBaseRef mbaseRef)
                    throws MBaseException
Missing description of constructor for the OJXMLRPCmbaseServer object

Parameters:
portNumber - Missing description of Parameter
mbaseRef - Missing description of Parameter
Throws:
MBaseException - Missing description of Exception

OJXMLRPCmbaseServer

public OJXMLRPCmbaseServer(MBaseRef mbaseRef)
                    throws MBaseException
Throws:
MBaseException
Method Detail

getDependencies

public Vector getDependencies(String id)
                       throws Exception
This method returns a vector (an XML-RPC array) of dependencies. Dependency objects are simple records with the following keys: This has a slight redundancy: for getDependencies(java.lang.String), the "of" value is the id requested and for getRelated(java.lang.String, java.util.Vector), the "on" value is the id requested.

Parameters:
id - Missing description of Parameter
Returns:
Missing description of return The dependencies value
Throws:
MBaseException - Missing description of Exception
Exception

getRelated

public Vector getRelated(String id,
                         Vector collections)
                  throws Exception
This method returns a vector (an XML-RPC array) of dependencies. Dependency objects are simple records with the following keys: This has a slight redundancy: for getDependencies(java.lang.String), the "of" value is the id requested and for getRelated(java.lang.String, java.util.Vector), the "on" value is the id requested.

Parameters:
id - Missing description of Parameter
collections - Missing description of Parameter
Returns:
Missing description of return The related value
Throws:
MBaseException - Missing description of Exception
Exception

getForWhat

public Vector getForWhat(String id)
                  throws Exception
Missing description of the gets the forWhat attribute of the OJXMLRPCmbaseServer object

Parameters:
id - Missing description of Parameter
Returns:
Missing description of return The forWhat value
Throws:
MBaseException - Missing description of Exception
Exception

getDefinitions

public Vector getDefinitions(String id,
                             Vector collections)
                      throws Exception
Missing description of the gets the definitions attribute of the OJXMLRPCmbaseServer object

Parameters:
id - Missing description of Parameter
collections - Missing description of Parameter
Returns:
Missing description of return The definitions value
Throws:
MBaseException - Missing description of Exception
Exception

getProofs

public Vector getProofs(String id,
                        Vector collections)
                 throws Exception
Missing description of the gets the proofs attribute of the OJXMLRPCmbaseServer object

Parameters:
id - Missing description of Parameter
collections - Missing description of Parameter
Returns:
Missing description of return The proofs value
Throws:
MBaseException - Missing description of Exception
Exception

getTypeString

public String getTypeString(String id)
                     throws Exception
Missing description of the gets the typeString attribute of the OJXMLRPCmbaseServer object

Parameters:
id - Missing description of Parameter
Returns:
Missing description of return The typeString value
Throws:
MBaseException - Missing description of Exception
Exception

getTheory

public String getTheory(String id)
                 throws Exception
Missing description of the gets the theory attribute of the OJXMLRPCmbaseServer object

Parameters:
id - Missing description of Parameter
Returns:
Missing description of return The theory value
Throws:
MBaseException - Missing description of Exception
Exception

getCommonName

public Hashtable getCommonName(String id)
                        throws Exception
Missing description of the gets the commonName attribute of the OJXMLRPCmbaseServer object

Parameters:
id - Missing description of Parameter
Returns:
Missing description of return The commonName value
Throws:
MBaseException - Missing description of Exception
Exception

getMetadata

public String getMetadata(String id)
                   throws Exception
Missing description of the gets the metadata attribute of the OJXMLRPCmbaseServer object

Parameters:
id - Missing description of Parameter
Returns:
Missing description of return The metadata value
Throws:
MBaseException - Missing description of Exception
Exception

getCompleteDCMetadata

public String getCompleteDCMetadata(String id)
                             throws Exception
Missing description of the gets the completeDCMetadata attribute of the OJXMLRPCmbaseServer object

Parameters:
id - Missing description of Parameter
Returns:
Missing description of return The completeDCMetadata value
Throws:
MBaseException - Missing description of Exception
Exception

getTextualContent

public String getTextualContent(String id)
                         throws Exception
Missing description of the gets the textualContent attribute of the OJXMLRPCmbaseServer object

Parameters:
id - Missing description of Parameter
Returns:
Missing description of return The textualContent value
Throws:
MBaseException - Missing description of Exception
Exception

getFormalContent

public String getFormalContent(String id)
                        throws Exception
Missing description of the gets the formalContent attribute of the OJXMLRPCmbaseServer object

Parameters:
id - Missing description of Parameter
Returns:
Missing description of return The formalContent value
Throws:
MBaseException - Missing description of Exception
Exception

getAttribute

public String getAttribute(String id,
                           String attributeName)
                    throws Exception
Missing description of the gets the attribute attribute of the OJXMLRPCmbaseServer object

Parameters:
id - Missing description of Parameter
attributeName - Missing description of Parameter
Returns:
Missing description of return The attribute value
Throws:
MBaseException - Missing description of Exception
Exception

getChildren

public String getChildren(String id,
                          String xPathExpr)
                   throws Exception
Throws:
Exception

getMethodNames

public String getMethodNames()
Returns the attached description of the methods (FIXME: currently missing).


listItems

public Vector listItems(String idString)
                 throws Exception
Throws:
Exception

listTheories

public Vector listTheories(Vector collections)
                    throws Exception
Throws:
Exception

getStructuredListOfConcepts

public String getStructuredListOfConcepts(Vector collections)
                                   throws Exception
Missing description of the gets the structuredListOfConcepts attribute of the OJXMLRPCmbaseServer object

Parameters:
collections - Missing description of Parameter
Returns:
Missing description of return The structuredListOfConcepts value
Throws:
MBaseException - Missing description of Exception
Exception

getCollectionsProvided

public Vector getCollectionsProvided()
                              throws Exception
Calls MBaseRef.getStructuredListOfConcepts(java.util.Collection).

Returns:
A Vector of strings
Throws:
MBaseException - if anything happens.
Exception

getCanonicalID

public String getCanonicalID(String givenID)
                      throws Exception
Calls MBaseRef.getCanonicalID(org.activemath.abstractcontent.MBaseID).

Parameters:
givenID - A string with, at least, the ID name
Returns:
The ID of the first item that matches this ID name
Throws:
MBaseItemNotFoundException - If there is no such ID.
Exception - If anything happens

getOMDocPath

public Hashtable getOMDocPath(String givenID)
                       throws Exception
Returns the path of the OMDoc from which was loaded the element pointed at by this ID. This may expose absolute-filenames which may be considered insecure.

Parameters:
givenID - The ID to be found
Returns:
A table with keys
  • path, the path relative to the basePath.
  • lineNumber the line-number in the file
  • columnNumber the column-number in the file
Throws:
MBaseItemNotFoundException - if the ID is not found
Exception - If anything happens,

searchText

public Vector searchText(String textToSearch,
                         Vector collections)
                  throws Exception
Calls MBaseRef.searchText(java.lang.String, java.util.Collection).

Parameters:
textToSearch -
collections - The collections to search through
Returns:
A Vector of IDs containing the given text
Throws:
Exception - If anything happens.

assertItsUp

public boolean assertItsUp()
                    throws Exception
Relays to MBaseRef.assertItsUp().

Returns:
Missing description of the Returned Value
Throws:
MBaseException - Missing description of Exception
Exception

shutdown

public String shutdown(String key)
                throws Exception
Shuts down using the generated password (currently deactivated)

Parameters:
key - The password
Returns:
"Shutting down in a second"
Throws:
Exception - if anything

reload

public String reload()
              throws Exception
Throws:
Exception

reload

public String reload(Vector collections)
              throws Exception
Throws:
Exception

reloadWithErrors

public String reloadWithErrors()
                        throws Exception
Throws:
Exception

reloadWithErrors

public String reloadWithErrors(String collName)
                        throws Exception
Throws:
Exception

reloadWithErrors

public String reloadWithErrors(Vector collections)
                        throws Exception
Reloads the content from the directory. Works only with AuthorExtendedMBaseRef.

Returns:
a name-prefix from which to invoke the method nextError which is a record of keys systemId (the file-name, relative to the basePath), message, exceptionClass, lineNumber, and columnNumber Or a string saying finished
Throws:
Exception

searchIDs

public Vector searchIDs(String idSubstring)
Searches for an id by substring...

Parameters:
idSubstring - The substring to search (may be empty to get a compelte list)
Returns:
The list of IDs that match

close

public MBaseRef close()
Closes the attached server listening to the socket. (is not publically offered through XML-RPC as its return type is not XML-RPC friendly)

Returns:
Anything... an incompatible return-type.

attemptShutdown

protected void attemptShutdown(String candidatePassword)
Missing description of the Method

Parameters:
candidatePassword - Missing description of Parameter

finalize

protected void finalize()
Missing description of the Method

Overrides:
finalize in class Object