|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.ucsb.nceas.metacat.client.MetacatClient
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.
Constructor Summary | |
protected |
MetacatClient()
Constructor to create a new instance. |
Method Summary | |
java.lang.String |
delete(java.lang.String docid)
Delete an XML document in the repository. |
int |
getNewestDocRevision(java.lang.String docId)
The method will return the lasted revision in metacat server for a given document id. |
java.lang.String |
getSessionId()
Get the session identifier for this session. |
java.lang.String |
insert(java.lang.String docid,
java.io.Reader xmlDocument,
java.io.Reader schema)
Insert an XML document into the repository. |
java.lang.String |
login(java.lang.String username,
java.lang.String password)
Method used to log in to a metacat server. |
java.lang.String |
logout()
Method used to log out a metacat server. |
java.io.Reader |
query(java.io.Reader xmlQuery)
Query the metacat document store with the given metacat-compatible query document, and return the result set as a Reader. |
java.io.Reader |
read(java.lang.String docid)
Read an XML document from the metacat server session, accessed by docid, and returned as a Reader. |
java.io.Reader |
readInlineData(java.lang.String inlinedataid)
Read inline data from the metacat server session, accessed by inlinedataid and returned as a Reader. |
java.lang.String |
setAccess(java.lang.String _docid,
java.lang.String _principal,
java.lang.String _permission,
java.lang.String _permType,
java.lang.String _permOrder)
set the access on an XML document in the repository. |
void |
setMetacatUrl(java.lang.String metacatUrl)
When the MetacatFactory creates an instance it needs to set the MetacatUrl to which connections should be made. |
void |
setSessionId(java.lang.String sessionId)
Set the session identifier for this session. |
java.lang.String |
update(java.lang.String docid,
java.io.Reader xmlDocument,
java.io.Reader schema)
Update an XML document in the repository. |
java.lang.String |
upload(java.lang.String docid,
java.io.File file)
Upload a data document into the repository. |
java.lang.String |
upload(java.lang.String docid,
java.lang.String filename,
java.io.InputStream fileData,
int size)
Upload a data document into the repository. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected MetacatClient()
Method Detail |
public java.lang.String login(java.lang.String username, java.lang.String password) throws MetacatAuthException, MetacatInaccessibleException
login
in interface Metacat
username
- the username of the user, like an LDAP DNpassword
- the password for that user for authentication
MetacatAuthException
- when the username/password could
not be authenticated
MetacatInaccessibleException
public java.lang.String logout() throws MetacatInaccessibleException, MetacatException
logout
in interface Metacat
MetacatInaccessibleException
- when the metacat server can not be
reached or does not respond
MetacatException
public java.io.Reader read(java.lang.String docid) throws InsufficientKarmaException, MetacatInaccessibleException, MetacatException
read
in interface Metacat
docid
- the identifier of the document to be read
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 errorpublic java.io.Reader readInlineData(java.lang.String inlinedataid) throws InsufficientKarmaException, MetacatInaccessibleException, MetacatException
readInlineData
in interface Metacat
inlinedataid
- the identifier of the data to be read
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 errorpublic java.io.Reader query(java.io.Reader xmlQuery) throws MetacatInaccessibleException, java.io.IOException
query
in interface Metacat
xmlQuery
- a Reader for accessing the XML version of the query
MetacatInaccessibleException
java.io.IOException
public java.lang.String insert(java.lang.String docid, java.io.Reader xmlDocument, java.io.Reader schema) throws InsufficientKarmaException, MetacatException, java.io.IOException, MetacatInaccessibleException
insert
in interface Metacat
docid
- the docid to insert the documentxmlDocument
- a Reader for accessing the XML document to be insertedschema
- a Reader for accessing the DTD or XML Schema for
the document
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
java.io.IOException
- when there is an error reading the xml documentpublic java.lang.String update(java.lang.String docid, java.io.Reader xmlDocument, java.io.Reader schema) throws InsufficientKarmaException, MetacatException, java.io.IOException, MetacatInaccessibleException
update
in interface Metacat
docid
- the docid to updatexmlDocument
- a Reader for accessing the XML text to be updatedschema
- a Reader for accessing the DTD or XML Schema for
the document
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
java.io.IOException
- when there is an error reading the xml documentpublic java.lang.String upload(java.lang.String docid, java.io.File file) throws InsufficientKarmaException, MetacatException, java.io.IOException, MetacatInaccessibleException
upload
in interface Metacat
docid
- the docid to insert the document
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
java.io.IOException
- when there is an error reading the xml documentpublic java.lang.String upload(java.lang.String docid, java.lang.String filename, java.io.InputStream fileData, int size) throws InsufficientKarmaException, MetacatException, java.io.IOException, MetacatInaccessibleException
upload
in interface Metacat
docid
- the docid to insert the documentfilename
- the name of the documentfileData
- InputStream of the document that has to be insertedsize
- size of the data being sent. If more data is
found in the InputStream, an error would be reported.
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
java.io.IOException
- when there is an error reading the xml documentpublic java.lang.String delete(java.lang.String docid) throws InsufficientKarmaException, MetacatException, MetacatInaccessibleException
delete
in interface Metacat
docid
- the docid to delete
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 errorpublic java.lang.String setAccess(java.lang.String _docid, java.lang.String _principal, java.lang.String _permission, java.lang.String _permType, java.lang.String _permOrder) throws InsufficientKarmaException, MetacatException, MetacatInaccessibleException
setAccess
in interface Metacat
_docid
- the docid of the document for which the access should be applied._principal
- the document's principal_permission
- the access permission to be applied to the docid
{e.g. read,write,all}_permType
- the permission type to be applied to the document
{e.g. allow or deny}_permOrder
- the order that the document's permissions should be
processed {e.g. denyFirst or allowFirst}
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 errorpublic void setMetacatUrl(java.lang.String metacatUrl)
setMetacatUrl
in interface Metacat
metacatUrl
- the URL for the metacat serverpublic java.lang.String getSessionId()
getSessionId
in interface Metacat
public void setSessionId(java.lang.String sessionId)
setSessionId
in interface Metacat
public int getNewestDocRevision(java.lang.String docId) throws MetacatException
getNewestDocRevision
in interface Metacat
docId
- String the given docid you want to use. the docid it self
can have or haven't revision number
MetacatException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |