edu.ucsb.nceas.metacat.stringclient.impl
Interface MetacatString


public interface MetacatString

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.


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 String
 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.
 

Method Detail

login

public void login(java.lang.String username,
                  java.lang.String password)
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

logout

public void logout()
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

read

public 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.

Parameters:
docid - the identifier of the document to be read
Returns:
a String for accessing the document

query

public 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 String


insert

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

Parameters:
docid - the docid to insert the document
xmlDocument - a String for accessing the XML document to be inserted
schema - a String for accessing the DTD or XML Schema for the document
Returns:
the metacat response message

update

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

Parameters:
docid - the docid to update
xmlDocument - a String for accessing the XML text to be updated
schema - a String for accessing the DTD or XML Schema for the document
Returns:
the metacat response message

delete

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

Parameters:
docid - the docid to delete
Returns:
the metacat response message
Throws:
InsufficientKarmaException - when the user has insufficent rights for the operation
MetacatInaccessibleException - when the metacat server can not be reached or does not respond
MetacatException - when the metacat server generates another error

setMetacatUrl

public void setMetacatUrl(java.lang.String metacatUrl)
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


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