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, searchMappingpublic RestRepository(java.lang.String baseUri,
java.lang.String username,
java.lang.String password)
public 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.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 repositoryRepositoryExceptionpublic DigitalObject getDigitalObject(java.lang.String handle) throws RepositoryException
Repositoryhandle - the identifier for the digital objectRepositoryExceptionpublic DigitalObject getOrCreateDigitalObject(java.lang.String handle) throws RepositoryException
RepositorygetOrCreateDigitalObject in interface RepositorygetOrCreateDigitalObject in class AbstractRepositoryhandle - the identifier for the digital objectRepositoryExceptionpublic CloseableIterator<java.lang.String> listHandles() throws RepositoryException
RepositorylistHandles in interface RepositorylistHandles in class AbstractRepositoryRepositoryExceptionpublic void deleteDigitalObject(java.lang.String handle)
throws RepositoryException
RepositorydeleteDigitalObject in interface RepositorydeleteDigitalObject in class AbstractRepositoryhandle - the identifier for the digital objectRepositoryExceptionpublic 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 static java.lang.String queryToString(Query q) throws RepositoryException
RepositoryExceptionpublic void close()
Repositorypublic static void consumeEntity(org.apache.http.HttpEntity entity)
throws java.io.IOException
java.io.IOExceptionpublic static void consumeQuietly(org.apache.http.HttpEntity entity)