public class RestRepository extends AbstractRepository
Constructor and Description |
---|
RestRepository(java.lang.String baseUri,
java.lang.String username,
java.lang.String password) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the repository and release all resources.
|
static void |
consumeEntity(org.apache.http.HttpEntity entity) |
static void |
consumeQuietly(org.apache.http.HttpEntity entity) |
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.
|
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.
|
DigitalObject |
getOrCreateDigitalObject(java.lang.String handle)
Returns the digital object with the given identifier from this repository, which is created if it does not exist.
|
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.
|
static java.lang.String |
queryToString(Query q) |
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,
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) |
boolean |
verifyDigitalObject(java.lang.String handle)
Verifies whether a digital object with the given identifier can be accessed via this repository.
|
search, searchHandles, searchMapping
public RestRepository(java.lang.String baseUri, java.lang.String username, java.lang.String password)
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.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
handle
- the identifier for the digital objectRepositoryException
public DigitalObject getOrCreateDigitalObject(java.lang.String handle) throws RepositoryException
Repository
getOrCreateDigitalObject
in interface Repository
getOrCreateDigitalObject
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 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<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 static java.lang.String queryToString(Query q) throws RepositoryException
RepositoryException
public void close()
Repository
public static void consumeEntity(org.apache.http.HttpEntity entity) throws java.io.IOException
java.io.IOException
public static void consumeQuietly(org.apache.http.HttpEntity entity)