net.cnri.dobj
Class DOClient
java.lang.Object
net.cnri.dobj.DOClient
- All Implemented Interfaces:
- DOConstants
public class DOClient
- extends java.lang.Object
- implements DOConstants
This class describes an object that provides communication
capabilities with the entire digital object system. All operations
performed on digital objects can be performed through an instance of
this class.
Field Summary |
boolean |
DEBUG
|
Fields inherited from interface net.cnri.dobj.DOConstants |
ABSTRACT_ATTRIBUTE, ADD_RELATIONSHIPS_OP_ID, ADD_TYPE_OP_ID, ANONYMOUS_ID, AUDIT_GET_OP_ID, AUDIT_QUERY_OP_ID, CLIENT_AUTH_TYPE_HSPUBKEY, CLIENT_AUTH_TYPE_HSSECKEY, CREATE_OBJ_OP_ID, CREATOR_ATTRIBUTE, DATE_CREATED_ATTRIBUTE, DATE_FORMAT_MDYHMS, DATE_MODIFIED_ATTRIBUTE, DEL_ATTRIBUTES_OP_ID, DELETE_DATA_OP_ID, DELETE_OBJ_OP_ID, DOES_OBJ_EXIST_OP_ID, ELEMENT_ATTS_MSGTYPE, EM_COMMAND_CREATE_DATASTREAM, EM_COMMAND_CREATE_DISSEMINATOR, EM_COMMAND_CREATE_DO, EM_COMMAND_DELETE_ATTACHMENTS, EM_COMMAND_DELETE_DATASTREAM, EM_COMMAND_DELETE_DISSEMINATOR, EM_COMMAND_DELETE_DO, EM_COMMAND_GET_DATASTREAM_BYTES, EM_COMMAND_GET_DATASTREAM_KEY_METADATA, EM_COMMAND_GET_DISSEMINATION, EM_COMMAND_GET_DISSEMINATOR_METADATA, EM_COMMAND_GET_EXECUTABLE, EM_COMMAND_GET_KEY_METADATA, EM_COMMAND_GET_READ_REQUEST, EM_COMMAND_GET_SERVLET, EM_COMMAND_GET_TYPE_SIGNATURE, EM_COMMAND_GET_VERSION, EM_COMMAND_LIST_ATTACHMENTS, EM_COMMAND_LIST_DATASTREAMS, EM_COMMAND_LIST_DISSEMINATORS, EM_COMMAND_LIST_DO, EM_COMMAND_LIST_DO_POLICIES, EM_COMMAND_SET_ATTACHMENTS, EM_COMMAND_SET_DATASTREAM_BYTES, EM_COMMAND_SET_DO_POLICIES, EM_COMMAND_SET_EXECUTABLE, EM_COMMAND_SET_READ_REQUEST, EM_COMMAND_VERIFY_DO, FILE_NAME_ATTRIBUTE, FOLDER_ATTRIBUTE, GET_ATTRIBUTES_OP_ID, GET_CREDENTIALS_OP_ID, GET_DATA_OP_ID, GET_REPO_TXNS_OP_ID, GET_SERIALIZED_FORM_OP_ID, GRANT_KEY_OP_ID, HAS_TYPE_OP_ID, INJECT_KNOWBOT_OP_ID, IS_PART_OF_ATTRIBUTE, LANGUAGE_ATTRIBUTE, LIST_DATA_OP_ID, LIST_OBJECTS_OP_ID, LIST_OPERATIONS_OP_ID, LIST_TYPES_OP_ID, MIME_TYPE_ATTRIBUTE, NOTES_ATTRIBUTE, OBJECT_ATTS_MSGTYPE, OBJECT_NAME_HDL_TYPE, OBJECT_SERVER_HDL_TYPE, OBJECT_SVRINFO_HDL_TYPE, OWNER_ATTRIBUTE, PARAM_ATTRIBUTES, PARAM_ELEMENT_ID, PUSH_REPO_TXN_OP_ID, REFERENCES_ATTRIBUTE, REMOVE_TYPE_OP_ID, REPO_RIGHTS_ELEMENT_ID, RIGHTS_ELEMENT_ID, SEARCH_OP_ID, SET_ATTRIBUTES_OP_ID, SIZE_ATTRIBUTE, STORE_CREDENTIAL_OP_ID, STORE_DATA_OP_ID, TITLE_ATTRIBUTE |
Constructor Summary |
DOClient(DOAuthentication id)
Create a DOClient instance set up to authenticate with the given information |
DOClient(java.lang.String clientID,
DOServerConnection serverConn)
Create a DOClient instance set up to authenticate by forwarding over the given
connection to a proxied client. |
Method Summary |
void |
closeAllConnections()
|
DOClientConnection |
getConnectionToRepository(java.lang.String repositoryID)
Return a connection to the given repository. |
java.lang.String |
getID()
Get the identifier used to authenticate this client |
static net.handle.hdllib.Resolver |
getResolver()
|
java.lang.String[] |
listOperations(java.lang.String repositoryID,
java.lang.String objectID)
List the operations that can be performed on the given object at the
specified repository. |
StreamPair |
performOperation(java.lang.String objectID,
java.lang.String operationID,
HeaderSet parameters)
Performs the specified operation on the object identified by
"objectID" with the given input. |
StreamPair |
performOperation(java.lang.String repositoryID,
java.lang.String objectID,
java.lang.String operationID,
HeaderSet parameters)
|
static java.lang.String |
resolveRepositoryID(java.lang.String objectID)
Resolves the given object identifier and returns the repository that
hosts the object. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEBUG
public boolean DEBUG
DOClient
public DOClient(java.lang.String clientID,
DOServerConnection serverConn)
- Create a DOClient instance set up to authenticate by forwarding over the given
connection to a proxied client.
DOClient
public DOClient(DOAuthentication id)
- Create a DOClient instance set up to authenticate with the given information
getID
public java.lang.String getID()
- Get the identifier used to authenticate this client
listOperations
public java.lang.String[] listOperations(java.lang.String repositoryID,
java.lang.String objectID)
throws DOException
- List the operations that can be performed on the given object at the
specified repository. If repositoryID is null, this will return the
operations available from the default repository for the object.
- Throws:
DOException
performOperation
public StreamPair performOperation(java.lang.String objectID,
java.lang.String operationID,
HeaderSet parameters)
throws DOException
- Performs the specified operation on the object identified by
"objectID" with the given input. This returns a pair of streams
to/from which the input/output of the operation can be written.
The given parameters are included in the operation request, but
should be considered part of the input.
This method will 1) Authenticate the repository of the object being
operated upon, 2) establish an encrypted connection to that repository,
3) provide our authentication to the repository, 4) forward everything
that is written to the input stream (in the returned pair) to the repository,
and 5) Verify the repository's signature of any bytes that are recieved and
forward them to the InputStream that is returned from this operation.
- Throws:
DOException
performOperation
public StreamPair performOperation(java.lang.String repositoryID,
java.lang.String objectID,
java.lang.String operationID,
HeaderSet parameters)
throws DOException
- Throws:
DOException
getConnectionToRepository
public DOClientConnection getConnectionToRepository(java.lang.String repositoryID)
throws DOException
- Return a connection to the given repository. This method will return an
open (cached) connection if one is available and if not it will construct
a new connection and return it.
- Throws:
DOException
resolveRepositoryID
public static final java.lang.String resolveRepositoryID(java.lang.String objectID)
throws DOException
- Resolves the given object identifier and returns the repository that
hosts the object.
- Throws:
DOException
closeAllConnections
public void closeAllConnections()
throws java.lang.Exception
- Throws:
java.lang.Exception
getResolver
public static net.handle.hdllib.Resolver getResolver()