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.
|
getOrCreateDigitalObject
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOrCreateDigitalObject
public NetworkedRepository(DOAuthentication auth, java.lang.String repoId) throws RepositoryException
RepositoryException
public NetworkedRepository(DOAuthentication auth, DOServiceInfo service) throws RepositoryException
RepositoryException
public 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.)RepositoryException
public 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.)RepositoryException
public 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.RepositoryException
public 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.RepositoryException
public void ensureIndexUpToDate() throws RepositoryException
RepositoryException
public void reindexAllObjects() throws DOException, java.io.IOException, RepositoryException
DOException
java.io.IOException
RepositoryException
public void reindexObject(java.lang.String objectId) throws java.io.IOException
java.io.IOException
public java.lang.String getHandle()
Repository
null
for local repositories.getHandle
in interface Repository
getHandle
in class AbstractRepository
null
if not available.public boolean verifyDigitalObject(java.lang.String handle) throws RepositoryException
Repository
verifyDigitalObject
in interface Repository
verifyDigitalObject
in class AbstractRepository
handle
- an identifier for a digital objectRepositoryException
public DigitalObject createDigitalObject(java.lang.String handle) throws CreationException, RepositoryException
Repository
null
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 Repository
handle
- 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 repositoryRepositoryException
public DigitalObject getDigitalObject(java.lang.String handle) throws RepositoryException
Repository
getDigitalObject
in interface Repository
handle
- the identifier for the digital objectRepositoryException
public void deleteDigitalObject(java.lang.String handle) throws RepositoryException
Repository
deleteDigitalObject
in interface Repository
deleteDigitalObject
in class AbstractRepository
handle
- the identifier for the digital objectRepositoryException
public CloseableIterator<java.lang.String> listHandles() throws RepositoryException
Repository
listHandles
in interface Repository
listHandles
in class AbstractRepository
RepositoryException
public CloseableIterator<DigitalObject> listObjects() throws RepositoryException
Repository
listObjects
in interface Repository
listObjects
in class AbstractRepository
RepositoryException
public QueryResults<DigitalObject> search(java.lang.String query, QueryParams queryParams) throws RepositoryException
RepositoryException
public 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 Repository
search
in class AbstractRepository
RepositoryException
public QueryResults<DigitalObject> search(Query query, QueryParams queryParams) throws RepositoryException
Repository
search
in interface Repository
search
in class AbstractRepository
query
- 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 Repository
searchHandles
in class AbstractRepository
RepositoryException
public QueryResults<java.lang.String> searchHandles(Query query, QueryParams queryParams) throws RepositoryException
Repository
searchHandles
in interface Repository
searchHandles
in class AbstractRepository
query
- the query to performqueryParams
- parameters for the query, or null
for default parametersQueryResults
.RepositoryException
public QueryResults<DigitalObject> search(Query query) throws RepositoryException
Repository
search
in interface Repository
search
in class AbstractRepository
query
- the query to performQueryResults
.RepositoryException
public QueryResults<java.lang.String> searchHandles(Query query) throws RepositoryException
Repository
searchHandles
in interface Repository
searchHandles
in class AbstractRepository
query
- the query to performQueryResults
.RepositoryException
public 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 Repository
searchMapping
in class AbstractRepository
RepositoryException
public void close()
Repository
close
in interface Repository
public 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.RepositoryException
public 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