public class SyncingRepository extends DirectRepositoryWrapper
| Modifier and Type | Class and Description |
|---|---|
static class |
SyncingRepository.ModifiedSinceLastSyncQuery |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
INTERNAL_DELETE_LOCAL_AFTER_SYNC |
static java.lang.String |
INTERNAL_SYNC |
static java.lang.String |
LOCAL_CONFIG_HANDLE |
| Constructor and Description |
|---|
SyncingRepository(Repository remote,
DirectRepository local,
SyncingConfig syncingConfig) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the repository and release all resources.
|
void |
createDataElement(java.lang.String handle,
java.lang.String name)
Creates a new data element with the given name in this digital object.
|
DigitalObject |
createDigitalObject(java.lang.String handle)
Creates a new digital object with the given identifier in this repository.
|
void |
deleteAttribute(java.lang.String handle,
java.lang.String elementName,
java.lang.String name)
Deletes a particular attribute.
|
void |
deleteAttributes(java.lang.String handle,
java.lang.String elementName,
java.util.List<java.lang.String> names)
Deletes multiple attributes.
|
void |
deleteDataElement(java.lang.String handle,
java.lang.String name)
Deletes any data element of the given name.
|
SyncingConfig |
getConfig() |
long |
getGreatestModifiedFromRemote() |
long |
getLastSyncTime() |
long |
getPriorLastSyncTime() |
void |
lock(java.lang.String handle) |
void |
setAttribute(java.lang.String handle,
java.lang.String elementName,
java.lang.String name,
java.lang.String value)
Sets a particular attribute.
|
void |
setAttributes(java.lang.String handle,
java.lang.String elementName,
java.util.Map<java.lang.String,java.lang.String> attributes)
Sets the value of multiple attributes.
|
void |
startSyncing() |
void |
stopSyncing() |
void |
syncNow() |
void |
unlock(java.lang.String handle) |
long |
write(java.lang.String handle,
java.lang.String elementName,
java.io.InputStream data,
boolean append)
Writes new data into the data element.
|
getAttribute, getAttributes, getFile, getSize, listAttributes, listDataElementNames, read, verifyDataElementdeleteDigitalObject, getDigitalObject, getHandle, getOrCreateDigitalObject, listHandles, listObjects, search, search, search, searchHandles, searchHandles, searchHandles, searchMapping, verifyDigitalObjectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeleteDigitalObject, getDigitalObject, getHandle, getOrCreateDigitalObject, listHandles, listObjects, search, search, search, searchHandles, searchHandles, searchHandles, searchMapping, verifyDigitalObjectpublic static final java.lang.String LOCAL_CONFIG_HANDLE
public static final java.lang.String INTERNAL_SYNC
public static final java.lang.String INTERNAL_DELETE_LOCAL_AFTER_SYNC
public SyncingRepository(Repository remote, DirectRepository local, SyncingConfig syncingConfig) throws RepositoryException
RepositoryExceptionpublic void lock(java.lang.String handle)
public SyncingConfig getConfig()
public long getGreatestModifiedFromRemote()
public long getLastSyncTime()
public long getPriorLastSyncTime()
public void unlock(java.lang.String handle)
public void startSyncing()
public void stopSyncing()
public void syncNow()
throws RepositoryException,
java.io.IOException
RepositoryExceptionjava.io.IOExceptionpublic void close()
Repositoryclose in interface Repositoryclose in class RepositoryWrapperpublic 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 RepositorycreateDigitalObject in class RepositoryWrapperhandle - 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 void setAttributes(java.lang.String handle,
java.lang.String elementName,
java.util.Map<java.lang.String,java.lang.String> attributes)
throws RepositoryException
DirectRepositorysetAttributes in interface DirectRepositorysetAttributes in class DirectRepositoryWrapperattributes - the attributes to set, mapped to their new valuesRepositoryExceptionpublic void setAttribute(java.lang.String handle,
java.lang.String elementName,
java.lang.String name,
java.lang.String value)
throws RepositoryException
DirectRepositorysetAttribute in interface DirectRepositorysetAttribute in class DirectRepositoryWrappername - the attribute namevalue - the attribute value; if null, the attribute will be deleted.RepositoryExceptionpublic void deleteAttributes(java.lang.String handle,
java.lang.String elementName,
java.util.List<java.lang.String> names)
throws RepositoryException
DirectRepositorydeleteAttributes in interface DirectRepositorydeleteAttributes in class DirectRepositoryWrappernames - the names of the attributes to deleteRepositoryExceptionpublic void deleteAttribute(java.lang.String handle,
java.lang.String elementName,
java.lang.String name)
throws RepositoryException
DirectRepositorydeleteAttribute in interface DirectRepositorydeleteAttribute in class DirectRepositoryWrappername - the name of the attribute to deleteRepositoryExceptionpublic void createDataElement(java.lang.String handle,
java.lang.String name)
throws CreationException,
RepositoryException
DirectRepositorycreateDataElement in interface DirectRepositorycreateDataElement in class DirectRepositoryWrappername - the identifier for the new data elementCreationException - if a data element with the given name already existsRepositoryExceptionpublic void deleteDataElement(java.lang.String handle,
java.lang.String name)
throws RepositoryException
DirectRepositorydeleteDataElement in interface DirectRepositorydeleteDataElement in class DirectRepositoryWrappername - the identifier for the data elementRepositoryExceptionpublic long write(java.lang.String handle,
java.lang.String elementName,
java.io.InputStream data,
boolean append)
throws java.io.IOException,
RepositoryException
DirectRepositorywrite in interface DirectRepositorywrite in class DirectRepositoryWrapperdata - an InputStream streaming the new dataappend - whether to append the new data to the existing datajava.io.IOExceptionRepositoryException