public interface MetacatRest
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DELETE
HTTP Verb DELETE
|
static java.lang.String |
FUNCTION_KEYWORD
Function keyword
|
static java.lang.String |
FUNCTION_NAME_GETALLDOCS
Function name for getalldocids function
|
static java.lang.String |
FUNCTION_NAME_GETNEXTOBJ
Function name for getnextobject function
|
static java.lang.String |
FUNCTION_NAME_GETNEXTREV
Function name for getnextrevision function
|
static java.lang.String |
FUNCTION_NAME_INSERT
Function name for insert function
|
static java.lang.String |
FUNCTION_NAME_ISREGISTERED
Function name for isregistered function
|
static java.lang.String |
FUNCTION_NAME_LOGIN
Function name for login function
|
static java.lang.String |
FUNCTION_NAME_LOGOUT
Function name for logout function
|
static java.lang.String |
FUNCTION_NAME_UPDATE
Function name for update function
|
static java.lang.String |
GET
HTTP Verb GET
|
static java.lang.String |
POST
HTTP Verb POST
|
static java.lang.String |
PUT
HTTP Verb PUT
|
static java.lang.String |
RESOURCE_IDENTIFIER
API IDENTIFIER Resource which controls object unique identifier operations
|
static java.lang.String |
RESOURCE_OBJECTS
API OBJECTS Resource which handles with document operations
|
static java.lang.String |
RESOURCE_SESSION
API SESSION Resource which handles with user session operations
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addLSID(java.lang.String identifierId)
Adds identifierId (Metacat Server does not support it!)
|
java.io.Reader |
authenticatedGetObject(java.lang.String docid,
java.lang.String outputFile)
Read XML document from server session, accessed by docid, and returned as a Reader.
|
java.io.Reader |
authenticatedQuery(java.io.Reader xmlQuery) |
java.lang.String |
create(java.lang.String docid,
java.io.Reader xmlDocument)
Create an XML document into the repository, making it available for
searching using the query() methods.
|
java.lang.String |
deleteObject(java.lang.String docid)
Delete an XML document in the repository.
|
java.util.Vector<java.lang.String> |
getAllDocids(java.lang.String scope)
return a list of all docids that match a given scope.
|
java.lang.String |
getNextObject(java.lang.String scope)
Return the highest document id for a given scope.
|
int |
getNextRevision(java.lang.String identifierId)
The method will return the latest revision in metacat server
for a given document id.
|
java.io.Reader |
getObject(java.lang.String docid,
java.lang.String outputFile)
Read a public XML document , accessed by docid, and returned as a Reader.
|
java.lang.String |
getSessionId()
Get the session identifier for this session.
|
boolean |
isRegistered(java.lang.String identifierId)
return true of the given docid is registered, false if not
|
java.lang.String |
login(java.lang.String username,
java.lang.String password)
Method used to log in to a metacat server through REST API
|
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.
|
void |
setContextRootUrl(java.lang.String contextRootUrl)
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)
Update an XML document into the repository, making it available for
searching using the query() methods.
|
static final java.lang.String GET
static final java.lang.String POST
static final java.lang.String PUT
static final java.lang.String DELETE
static final java.lang.String RESOURCE_OBJECTS
static final java.lang.String RESOURCE_SESSION
static final java.lang.String RESOURCE_IDENTIFIER
static final java.lang.String FUNCTION_KEYWORD
static final java.lang.String FUNCTION_NAME_LOGIN
static final java.lang.String FUNCTION_NAME_LOGOUT
static final java.lang.String FUNCTION_NAME_ISREGISTERED
static final java.lang.String FUNCTION_NAME_GETALLDOCS
static final java.lang.String FUNCTION_NAME_GETNEXTREV
static final java.lang.String FUNCTION_NAME_GETNEXTOBJ
static final java.lang.String FUNCTION_NAME_INSERT
static final java.lang.String FUNCTION_NAME_UPDATE
java.lang.String login(java.lang.String username, java.lang.String password) throws MetacatAuthException, MetacatInaccessibleException
username
- the username of the user, like an LDAP DNpassword
- the password for that user for authenticationMetacatAuthException
- when the username/password could
not be authenticatedMetacatInaccessibleException
java.lang.String logout() throws MetacatInaccessibleException, MetacatException
MetacatInaccessibleException
- when the metacat server can not be
reached or does not respondMetacatException
java.io.Reader getObject(java.lang.String docid, java.lang.String outputFile) throws InsufficientKarmaException, MetacatInaccessibleException, DocumentNotFoundException, MetacatException
docid
- the identifier of the document to be readoutputFile
- name of the file to be written to local (optional)InsufficientKarmaException
- when the user has insufficent rights
for the operationMetacatInaccessibleException
- when the metacat server can not be
reached or does not respondMetacatException
- when the metacat server generates another errorDocumentNotFoundException
java.io.Reader authenticatedGetObject(java.lang.String docid, java.lang.String outputFile) throws InsufficientKarmaException, MetacatInaccessibleException, DocumentNotFoundException, MetacatException
docid
- the identifier of the document to be readoutputFile
- name of the file to be written to local (optional)InsufficientKarmaException
- when the user has insufficent rights
for the operationMetacatInaccessibleException
- when the metacat server can not be
reached or does not respondMetacatException
- when the metacat server generates another errorDocumentNotFoundException
java.io.Reader query(java.io.Reader xmlQuery) throws MetacatInaccessibleException, java.io.IOException
xmlQuery
- a Reader for accessing the XML version of the queryMetacatInaccessibleException
java.io.IOException
java.io.Reader authenticatedQuery(java.io.Reader xmlQuery) throws MetacatInaccessibleException, java.io.IOException
MetacatInaccessibleException
java.io.IOException
java.lang.String create(java.lang.String docid, java.io.Reader xmlDocument) throws InsufficientKarmaException, MetacatException, java.io.IOException, MetacatInaccessibleException
docid
- the docid to insert the documentxmlDocument
- a Reader for accessing the XML document to be insertedInsufficientKarmaException
- when the user has insufficent rights
for the operationMetacatInaccessibleException
- when the metacat server can not be
reached or does not respondMetacatException
- when the metacat server generates another errorjava.io.IOException
- when there is an error reading the xml documentjava.lang.String update(java.lang.String docid, java.io.Reader xmlDocument) throws InsufficientKarmaException, MetacatException, java.io.IOException, MetacatInaccessibleException
docid
- the docid to insert the documentxmlDocument
- a Reader for accessing the XML document to be insertedInsufficientKarmaException
- when the user has insufficent rights
for the operationMetacatInaccessibleException
- when the metacat server can not be
reached or does not respondMetacatException
- when the metacat server generates another errorjava.io.IOException
- when there is an error reading the xml documentjava.lang.String deleteObject(java.lang.String docid) throws InsufficientKarmaException, MetacatException, MetacatInaccessibleException
docid
- the docid to deleteInsufficientKarmaException
- when the user has insufficent rights
for the operationMetacatInaccessibleException
- when the metacat server can not be
reached or does not respondMetacatException
- when the metacat server generates another errorvoid setContextRootUrl(java.lang.String contextRootUrl)
metacatUrl
- the URL for the metacat serverjava.lang.String getSessionId()
void setSessionId(java.lang.String sessionId)
String
- the sessionId from a previously established sessionjava.lang.String getNextObject(java.lang.String scope) throws MetacatException
scope
- String the scope to use for looking up the latest idMetacatException
- when an error occursint getNextRevision(java.lang.String identifierId) throws MetacatException
identifierId
- String the given docid you want to use. the docid it self
can have or haven't revision numberMetacatException
java.util.Vector<java.lang.String> getAllDocids(java.lang.String scope) throws MetacatException
scope
- String the scope to use to limit the docid queryMetacatException
- when an error occursboolean isRegistered(java.lang.String identifierId) throws MetacatException
scope
- String the scope to use to limit the docid queryMetacatException
- when an error occursjava.lang.String addLSID(java.lang.String identifierId) throws MetacatException
identifierId
- String the given docid you want to use.MetacatException
- when an error occursCopyright © 2020 Regents of the University of California. All Rights Reserved.