public class MemoryRepository extends AbstractDirectRepository
Constructor and Description |
---|
MemoryRepository() |
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.
|
DigitalObject |
getDigitalObject(java.lang.String handle)
Returns the digital object with the given identifier from this repository.
|
java.io.File |
getFile(java.lang.String handle,
java.lang.String elementName)
Returns a file for the data of the data element.
|
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.
|
CloseableIterator<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.
|
CloseableIterator<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.
|
boolean |
verifyDigitalObject(java.lang.String handle)
Verifies whether a digital object with the given identifier can be accessed via this repository.
|
createDataElement, deleteAttribute, deleteAttributes, deleteDataElement, getAttribute, getAttributes, getSize, listAttributes, listDataElementNames, read, setAttribute, setAttributes, verifyDataElement, write
getHandle, search, search, searchHandles, searchHandles, searchMapping
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHandle, search, search, searchHandles, searchHandles, searchMapping
public boolean verifyDigitalObject(java.lang.String handle)
Repository
verifyDigitalObject
in interface Repository
verifyDigitalObject
in class AbstractRepository
handle
- an identifier for a digital objectpublic DigitalObject createDigitalObject(java.lang.String handle) throws CreationException
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 repositorypublic DigitalObject getDigitalObject(java.lang.String handle)
Repository
handle
- the identifier for the digital objectpublic 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 void deleteDigitalObject(java.lang.String handle) throws NoSuchDigitalObjectException
Repository
deleteDigitalObject
in interface Repository
deleteDigitalObject
in class AbstractRepository
handle
- the identifier for the digital objectNoSuchDigitalObjectException
public CloseableIterator<java.lang.String> listHandles()
Repository
listHandles
in interface Repository
listHandles
in class AbstractRepository
public CloseableIterator<DigitalObject> listObjects()
Repository
listObjects
in interface Repository
listObjects
in class AbstractRepository
public CloseableIterator<DigitalObject> search(Query query) throws RepositoryException
Repository
search
in interface Repository
search
in class AbstractRepository
query
- the query to performQueryResults
.RepositoryException
public CloseableIterator<java.lang.String> searchHandles(Query query) throws RepositoryException
Repository
searchHandles
in interface Repository
searchHandles
in class AbstractRepository
query
- the query to performQueryResults
.RepositoryException
public void close()
Repository
public java.io.File getFile(java.lang.String handle, java.lang.String elementName) throws RepositoryException
DirectRepository
getFile
in interface DirectRepository
getFile
in class AbstractDirectRepository
RepositoryException