edu.ucsb.nceas.metacat.stringclient.impl
Class MetacatStringImpl

java.lang.Object
  extended byGridServiceImpl
      extended byedu.ucsb.nceas.metacat.stringclient.impl.MetacatStringImpl

public class MetacatStringImpl
extends GridServiceImpl

This interface provides methods for initializing and logging in to a Metacat server, and then querying, reading, transforming, inserting, updating and deleting documents from that server.

See Also:
Serialized Form

Constructor Summary
MetacatStringImpl()
           
 
Method Summary
 java.lang.String delete(java.lang.String docid)
          Delete an XML document in the repository.
 java.lang.String insert(java.lang.String docid, java.lang.String xmlDocument, java.lang.String schema)
          Insert an XML document into the repository.
 void login(java.lang.String username, java.lang.String password)
          Method used to log in to a metacat server.
 void logout()
          Method used to log out a metacat server.
 java.lang.String query(java.lang.String xmlQuery)
          Query the metacat document store with the given metacat-compatible query document, and return the result set as a Reader.
 java.lang.String read(java.lang.String docid)
          Read an XML document from the metacat server session, accessed by docid, and returned as a String.
 void setMetacatUrl(java.lang.String metacatUrl)
          When the MetacatFactory creates an instance it needs to set the MetacatUrl to which connections should be made.
 java.lang.String update(java.lang.String docid, java.lang.String xmlDocument, java.lang.String schema)
          Update an XML document in the repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetacatStringImpl

public MetacatStringImpl()
Method Detail

login

public void login(java.lang.String username,
                  java.lang.String password)
           throws java.rmi.RemoteException
Method used to log in to a metacat server. Implementations will need to cache a cookie value to make the session persistent. Each time a call is made to one of the other methods (e.g., read), the cookie will need to be passed back to the metacat server along with the request.

Parameters:
username - the username of the user, like an LDAP DN
password - the password for that user for authentication
Throws:
java.rmi.RemoteException

logout

public void logout()
            throws java.rmi.RemoteException
Method used to log out a metacat server. When Metacat server will end the session when this call is invoken.

Throws:
MetacatInaccessibleException - when the metacat server can not be reached or does not respond
java.rmi.RemoteException

read

public java.lang.String read(java.lang.String docid)
                      throws java.rmi.RemoteException
Read an XML document from the metacat server session, accessed by docid, and returned as a String.

Parameters:
docid - the identifier of the document to be read
Returns:
a String for accessing the document
Throws:
java.rmi.RemoteException

query

public java.lang.String query(java.lang.String xmlQuery)
                       throws java.rmi.RemoteException
Query the metacat document store with the given metacat-compatible query document, and return the result set as a Reader.

Parameters:
xmlQuery - a string for accessing the XML version of the query
Returns:
a string for accessing the result set
Throws:
java.rmi.RemoteException

insert

public java.lang.String insert(java.lang.String docid,
                               java.lang.String xmlDocument,
                               java.lang.String schema)
                        throws java.rmi.RemoteException
Insert an XML document into the repository.

Parameters:
docid - the docid to insert the document
xmlDocument - a Reader for accessing the XML document to be inserted
schema - a Reader for accessing the DTD or XML Schema for the document
Returns:
the metacat response message
Throws:
java.rmi.RemoteException

update

public java.lang.String update(java.lang.String docid,
                               java.lang.String xmlDocument,
                               java.lang.String schema)
                        throws java.rmi.RemoteException
Update an XML document in the repository.

Parameters:
docid - the docid to update
xmlDocument - a Reader for accessing the XML text to be updated
schema - a Reader for accessing the DTD or XML Schema for the document
Returns:
the metacat response message
Throws:
java.rmi.RemoteException

delete

public java.lang.String delete(java.lang.String docid)
                        throws java.rmi.RemoteException
Delete an XML document in the repository.

Parameters:
docid - the docid to delete
Returns:
the metacat response message
Throws:
java.rmi.RemoteException

setMetacatUrl

public void setMetacatUrl(java.lang.String metacatUrl)
                   throws java.rmi.RemoteException
When the MetacatFactory creates an instance it needs to set the MetacatUrl to which connections should be made.

Parameters:
metacatUrl - the URL for the metacat server
Throws:
java.rmi.RemoteException


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.