Package org.apache.jackrabbit.core.data
Interface Backend
- 
- All Known Implementing Classes:
- AbstractBackend,- FSBackend,- S3Backend,- VFSBackend
 
 public interface BackendThe interface defines the backend which can be plugged intoCachingDataStore.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Close backend and release resources like database connection if any.Set<DataIdentifier>deleteAllOlderThan(long timestamp)Delete all records which are older than timestamp.voiddeleteRecord(DataIdentifier identifier)Delete record identified by identifier.booleanexists(DataIdentifier identifier)This method check the existence of record in backend.booleanexists(DataIdentifier identifier, boolean touch)This method check the existence of record in backend.Iterator<DataIdentifier>getAllIdentifiers()Returns identifiers of all records that exists in backend.longgetLastModified(DataIdentifier identifier)Return lastModified of record identified by identifier.longgetLength(DataIdentifier identifier)Return length of record identified by identifier.voidinit(CachingDataStore store, String homeDir, String config)This method initialize backend with the configuration.InputStreamread(DataIdentifier identifier)Return inputstream of record identified by identifier.voidtouch(DataIdentifier identifier, long minModifiedDate)Update the lastModified of record if it's lastModified < minModifiedDate.voidtouchAsync(DataIdentifier identifier, long minModifiedDate, AsyncTouchCallback callback)Update the lastModified of record if it's lastModified < minModifiedDate asynchronously.voidwrite(DataIdentifier identifier, File file)Stores file to backend with identifier used as key.voidwriteAsync(DataIdentifier identifier, File file, AsyncUploadCallback callback)Write file to backend in asynchronous mode.
 
- 
- 
- 
Method Detail- 
initvoid init(CachingDataStore store, String homeDir, String config) throws DataStoreException This method initialize backend with the configuration.- Parameters:
- store-- CachingDataStore
- homeDir- path of repository home dir.
- config- path of config property file.
- Throws:
- DataStoreException
 
 - 
readInputStream read(DataIdentifier identifier) throws DataStoreException Return inputstream of record identified by identifier.- Parameters:
- identifier- identifier of record.
- Returns:
- inputstream of the record.
- Throws:
- DataStoreException- if record not found or any error.
 
 - 
getLengthlong getLength(DataIdentifier identifier) throws DataStoreException Return length of record identified by identifier.- Parameters:
- identifier- identifier of record.
- Returns:
- length of the record.
- Throws:
- DataStoreException- if record not found or any error.
 
 - 
getLastModifiedlong getLastModified(DataIdentifier identifier) throws DataStoreException Return lastModified of record identified by identifier.- Parameters:
- identifier- identifier of record.
- Returns:
- lastModified of the record.
- Throws:
- DataStoreException- if record not found or any error.
 
 - 
writevoid write(DataIdentifier identifier, File file) throws DataStoreException Stores file to backend with identifier used as key. If key pre-exists, it updates the timestamp of the key.- Parameters:
- identifier- key of the file
- file- file that would be stored in backend.
- Throws:
- DataStoreException- for any error.
 
 - 
writeAsyncvoid writeAsync(DataIdentifier identifier, File file, AsyncUploadCallback callback) throws DataStoreException Write file to backend in asynchronous mode.- Parameters:
- identifier-
- file-
- callback- Callback interface to called after upload succeed or failed.
- Throws:
- DataStoreException
 
 - 
getAllIdentifiersIterator<DataIdentifier> getAllIdentifiers() throws DataStoreException Returns identifiers of all records that exists in backend.- Returns:
- iterator consisting of all identifiers
- Throws:
- DataStoreException
 
 - 
existsboolean exists(DataIdentifier identifier, boolean touch) throws DataStoreException This method check the existence of record in backend. Return true if records exists else false. This method also touch record identified by identifier if touch is true.- Parameters:
- identifier-
- Throws:
- DataStoreException
 
 - 
existsboolean exists(DataIdentifier identifier) throws DataStoreException This method check the existence of record in backend.- Parameters:
- identifier- identifier to be checked.
- Returns:
- true if records exists else false.
- Throws:
- DataStoreException
 
 - 
touchvoid touch(DataIdentifier identifier, long minModifiedDate) throws DataStoreException Update the lastModified of record if it's lastModified < minModifiedDate.- Parameters:
- identifier-
- minModifiedDate-
- Throws:
- DataStoreException
 
 - 
touchAsyncvoid touchAsync(DataIdentifier identifier, long minModifiedDate, AsyncTouchCallback callback) throws DataStoreException Update the lastModified of record if it's lastModified < minModifiedDate asynchronously. Result of update is passed using appropriateAsyncTouchCallbackmethods. If identifier's lastModified > minModifiedAsyncTouchCallback.onAbort(AsyncTouchResult)is called. Any exception is communicated throughAsyncTouchCallback.onFailure(AsyncTouchResult). On successful update of lastModified,AsyncTouchCallback.onSuccess(AsyncTouchResult)is invoked.- Parameters:
- identifier-
- minModifiedDate-
- callback-
- Throws:
- DataStoreException
 
 - 
closevoid close() throws DataStoreExceptionClose backend and release resources like database connection if any.- Throws:
- DataStoreException
 
 - 
deleteAllOlderThanSet<DataIdentifier> deleteAllOlderThan(long timestamp) throws DataStoreException Delete all records which are older than timestamp.- Parameters:
- timestamp-
- Returns:
- Setof identifiers which are deleted.
- Throws:
- DataStoreException
 
 - 
deleteRecordvoid deleteRecord(DataIdentifier identifier) throws DataStoreException Delete record identified by identifier. No-op if identifier not found.- Parameters:
- identifier-
- Throws:
- DataStoreException
 
 
- 
 
-