public class NetworkedRepository extends AbstractRepository implements Repository
| Constructor and Description |
|---|
NetworkedRepository(DOAuthentication auth,
DOServiceInfo service) |
NetworkedRepository(DOAuthentication auth,
java.lang.String repoId) |
NetworkedRepository(java.lang.String repoHandle,
java.lang.String userHandle,
byte[] userPassword)
Constructs a NetworkedRepository looking up connection parameters in the handle system and secret key authentication.
|
NetworkedRepository(java.lang.String repoHandle,
java.lang.String host,
int port,
byte[] pubKeyBytes,
java.lang.String userHandle,
byte[] userPassword)
Constructs a NetworkedRepository using a specified host and port and secret key authentication.
|
NetworkedRepository(java.lang.String repoHandle,
java.lang.String host,
int port,
byte[] pubKeyBytes,
java.lang.String userHandle,
java.lang.String privateKeyFile,
java.lang.String passphrase)
Constructs a NetworkedRepository using a specified host and port and public key authentication.
|
NetworkedRepository(java.lang.String repoHandle,
java.lang.String userHandle,
java.lang.String privateKeyFile,
java.lang.String passphrase)
Constructs a NetworkedRepository looking up connection parameters in the handle system and public key authentication.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the repository and release all resources.
|
DigitalObject |
createDigitalObject(java.lang.String handle)
Creates a new digital object with the given identifier in this repository.
|
void |
deleteDigitalObject(java.lang.String handle)
Deletes a digital object from the repository.
|
void |
ensureIndexUpToDate()
Sends the repository a 1037/indexUpToDate operation.
|
DigitalObject |
getDigitalObject(java.lang.String handle)
Returns the digital object with the given identifier from this repository.
|
java.lang.String |
getHandle()
Returns the handle of the repository.
|
CloseableIterator<java.lang.String> |
listHandles()
Provides a CloseableIterator view of the identifiers for digital objects accessible through this repository.
|
CloseableIterator<DigitalObject> |
listObjects()
Provides a CloseableIterator view of the digital objects accessible through this repository.
|
StreamPair |
performOperation(java.lang.String objectId,
java.lang.String operationId,
HeaderSet parameters)
Perform an arbitrary operation.
|
StreamPair |
performOperation(java.lang.String objectId,
java.lang.String operationId,
java.util.Map<java.lang.String,java.lang.String> parameters)
Perform an arbitrary operation.
|
static java.lang.String |
queryToString(Query q) |
void |
reindexAllObjects() |
void |
reindexObject(java.lang.String objectId)
Reindex the object with the specified handle.
|
QueryResults<DigitalObject> |
search(Query query)
Provides a CloseableIterator view of the digital objects accessible through this repository under search bounds defined in the Query object with default parameters.
|
QueryResults<DigitalObject> |
search(Query query,
QueryParams queryParams)
Provides a CloseableIterator view of the digital objects accessible through this repository under search bounds defined in the Query object and the parameters defined in the QueryParams object.
|
QueryResults<DigitalObject> |
search(java.lang.String query)
Deprecated.
|
QueryResults<DigitalObject> |
search(java.lang.String query,
QueryParams queryParams) |
QueryResults<java.lang.String> |
searchHandles(Query query)
Provides a CloseableIterator view of the digital objects handles accessible through this repository under search bounds defined in the Query object with default parameters.
|
QueryResults<java.lang.String> |
searchHandles(Query query,
QueryParams queryParams)
Provides a CloseableIterator view of the digital objects handles accessible through this repository under search bounds defined in the Query object and the parameters defined in the QueryParams object.
|
QueryResults<java.lang.String> |
searchHandles(java.lang.String query)
Deprecated.
|
QueryResults<java.lang.String> |
searchHandles(java.lang.String query,
QueryParams queryParams) |
CloseableIterator<java.util.Map<java.lang.String,java.lang.String>> |
searchMapping(java.lang.String query)
Deprecated.
|
boolean |
verifyDigitalObject(java.lang.String handle)
Verifies whether a digital object with the given identifier can be accessed via this repository.
|
getOrCreateDigitalObjectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetOrCreateDigitalObjectpublic NetworkedRepository(DOAuthentication auth, java.lang.String repoId) throws RepositoryException
RepositoryExceptionpublic NetworkedRepository(DOAuthentication auth, DOServiceInfo service) throws RepositoryException
RepositoryExceptionpublic NetworkedRepository(java.lang.String repoHandle,
java.lang.String host,
int port,
byte[] pubKeyBytes,
java.lang.String userHandle,
byte[] userPassword)
throws RepositoryException
repoHandle - handle of the repository.host - port - pubKeyBytes - public key of the server (for the client to authenticate the server). This is the "publickey" file from the server directory.userHandle - handle of the user for client authentication. May coincide with the repository handle if authenticating as the server itself. (The server will look up this handle first in the password.dct file, then in the Handle System.)userPassword - password (secret key) for client authentication. (Note: this is the password either from the HS_SECKEY value in the user handle, or stored in the server's password.dct file.)RepositoryExceptionpublic NetworkedRepository(java.lang.String repoHandle,
java.lang.String userHandle,
byte[] userPassword)
throws RepositoryException
repoHandle - handle of the repository.userHandle - handle of the user for client authentication. May coincide with the repository handle if authenticating as the server itself. (The server will look up this handle first in the password.dct file, then in the Handle System.)userPassword - password (secret key) for client authentication. (Note: this is the password either from the HS_SECKEY value in the user handle, or stored in the server's password.dct file.)RepositoryExceptionpublic NetworkedRepository(java.lang.String repoHandle,
java.lang.String host,
int port,
byte[] pubKeyBytes,
java.lang.String userHandle,
java.lang.String privateKeyFile,
java.lang.String passphrase)
throws RepositoryException
repoHandle - handle of the repository.host - port - pubKeyBytes - public key of the server (for the client to authenticate the server). This is the "publickey" file from the server directory.userHandle - handle of the user for client authentication. May coincide with the repository handle if authenticating as the server itself.privateKeyFile - path to a file containing the user's (possibly encrypted) private key. If authenticating as the server itself, this is the "privatekey" file from the server directory.passphrase - passphrase to be used the decrypt an encrypted private key file. Can be null if the private key file is not encrypted.RepositoryExceptionpublic NetworkedRepository(java.lang.String repoHandle,
java.lang.String userHandle,
java.lang.String privateKeyFile,
java.lang.String passphrase)
throws RepositoryException
repoHandle - handle of the repository.userHandle - handle of the user for client authentication. May coincide with the repository handle if authenticating as the server itself.privateKeyFile - path to a file containing the user's (possibly encrypted) private key. If authenticating as the server itself, this is the "privatekey" file from the server directory.passphrase - passphrase to be used the decrypt an encrypted private key file. Can be null if the private key file is not encrypted.RepositoryExceptionpublic void ensureIndexUpToDate()
throws RepositoryException
RepositoryExceptionpublic void reindexAllObjects()
throws DOException,
java.io.IOException,
RepositoryException
DOExceptionjava.io.IOExceptionRepositoryExceptionpublic void reindexObject(java.lang.String objectId)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getHandle()
Repositorynull for local repositories.getHandle in interface RepositorygetHandle in class AbstractRepositorynull if not available.public boolean verifyDigitalObject(java.lang.String handle)
throws RepositoryException
RepositoryverifyDigitalObject in interface RepositoryverifyDigitalObject in class AbstractRepositoryhandle - an identifier for a digital objectRepositoryExceptionpublic DigitalObject createDigitalObject(java.lang.String handle) throws CreationException, RepositoryException
Repositorynull requests that the repository assign a new unique identifier;
this method will throw UnsupportedOperationException if the given repository does not support that functionality.createDigitalObject in interface Repositoryhandle - the identifier for the new digital object, or null to request that the repository assign a new unique identifier.CreationException - if an object with the given identifier already exists within the repositoryRepositoryExceptionpublic DigitalObject getDigitalObject(java.lang.String handle) throws RepositoryException
RepositorygetDigitalObject in interface Repositoryhandle - the identifier for the digital objectRepositoryExceptionpublic void deleteDigitalObject(java.lang.String handle)
throws RepositoryException
RepositorydeleteDigitalObject in interface RepositorydeleteDigitalObject in class AbstractRepositoryhandle - the identifier for the digital objectRepositoryExceptionpublic CloseableIterator<java.lang.String> listHandles() throws RepositoryException
RepositorylistHandles in interface RepositorylistHandles in class AbstractRepositoryRepositoryExceptionpublic CloseableIterator<DigitalObject> listObjects() throws RepositoryException
RepositorylistObjects in interface RepositorylistObjects in class AbstractRepositoryRepositoryExceptionpublic QueryResults<DigitalObject> search(java.lang.String query, QueryParams queryParams) throws RepositoryException
RepositoryExceptionpublic QueryResults<java.lang.String> searchHandles(java.lang.String query, QueryParams queryParams) throws RepositoryException
RepositoryException@Deprecated public QueryResults<DigitalObject> search(java.lang.String query) throws RepositoryException
search in interface Repositorysearch in class AbstractRepositoryRepositoryExceptionpublic QueryResults<DigitalObject> search(Query query, QueryParams queryParams) throws RepositoryException
Repositorysearch in interface Repositorysearch in class AbstractRepositoryquery - the query to performqueryParams - parameters for the query, or null for default parametersQueryResults.RepositoryException@Deprecated public QueryResults<java.lang.String> searchHandles(java.lang.String query) throws RepositoryException
searchHandles in interface RepositorysearchHandles in class AbstractRepositoryRepositoryExceptionpublic QueryResults<java.lang.String> searchHandles(Query query, QueryParams queryParams) throws RepositoryException
RepositorysearchHandles in interface RepositorysearchHandles in class AbstractRepositoryquery - the query to performqueryParams - parameters for the query, or null for default parametersQueryResults.RepositoryExceptionpublic QueryResults<DigitalObject> search(Query query) throws RepositoryException
Repositorysearch in interface Repositorysearch in class AbstractRepositoryquery - the query to performQueryResults.RepositoryExceptionpublic QueryResults<java.lang.String> searchHandles(Query query) throws RepositoryException
RepositorysearchHandles in interface RepositorysearchHandles in class AbstractRepositoryquery - the query to performQueryResults.RepositoryExceptionpublic static java.lang.String queryToString(Query q) throws RepositoryException
RepositoryException@Deprecated public CloseableIterator<java.util.Map<java.lang.String,java.lang.String>> searchMapping(java.lang.String query) throws RepositoryException
searchMapping in interface RepositorysearchMapping in class AbstractRepositoryRepositoryExceptionpublic void close()
Repositoryclose in interface Repositorypublic StreamPair performOperation(java.lang.String objectId, java.lang.String operationId, java.util.Map<java.lang.String,java.lang.String> parameters) throws RepositoryException
objectId - the id of the target object.operationId - the operation to perform.parameters - parameters of the operation.RepositoryExceptionpublic StreamPair performOperation(java.lang.String objectId, java.lang.String operationId, HeaderSet parameters) throws RepositoryException
objectId - the id of the target object.operationId - the operation to perform.parameters - parameters of the operation.RepositoryException