|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Backend
The interface defines the backend which can be plugged into
CachingDataStore.
| Method Summary | |
|---|---|
void |
close()
Close backend and release resources like database connection if any. |
Set<DataIdentifier> |
deleteAllOlderThan(long timestamp)
Delete all records which are older than timestamp. |
void |
deleteRecord(DataIdentifier identifier)
Delete record identified by identifier. |
boolean |
exists(DataIdentifier identifier)
This method check the existence of record in backend. |
boolean |
exists(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. |
long |
getLastModified(DataIdentifier identifier)
Return lastModified of record identified by identifier. |
long |
getLength(DataIdentifier identifier)
Return length of record identified by identifier. |
void |
init(CachingDataStore store,
String homeDir,
String config)
This method initialize backend with the configuration. |
InputStream |
read(DataIdentifier identifier)
Return inputstream of record identified by identifier. |
void |
write(DataIdentifier identifier,
File file)
Stores file to backend with identifier used as key. |
void |
writeAsync(DataIdentifier identifier,
File file,
AsyncUploadCallback callback)
Write file to backend in asynchronous mode. |
| Method Detail |
|---|
void init(CachingDataStore store,
String homeDir,
String config)
throws DataStoreException
store - CachingDataStorehomeDir - path of repository home dir.config - path of config property file.
DataStoreException
InputStream read(DataIdentifier identifier)
throws DataStoreException
identifier - identifier of record.
DataStoreException - if record not found or any error.
long getLength(DataIdentifier identifier)
throws DataStoreException
identifier - identifier of record.
DataStoreException - if record not found or any error.
long getLastModified(DataIdentifier identifier)
throws DataStoreException
identifier - identifier of record.
DataStoreException - if record not found or any error.
void write(DataIdentifier identifier,
File file)
throws DataStoreException
identifier - key of the filefile - file that would be stored in backend.
DataStoreException - for any error.
void writeAsync(DataIdentifier identifier,
File file,
AsyncUploadCallback callback)
throws DataStoreException
AsyncUploadCallback#call(DataIdentifier, File, com.day.crx.cloud.s3.ds.AsyncUploadCallback.RESULT)
after upload succeed or failed.
identifier - file - callback - Callback interface to called after upload succeed or failed.
DataStoreException
Iterator<DataIdentifier> getAllIdentifiers()
throws DataStoreException
DataStoreException
boolean exists(DataIdentifier identifier,
boolean touch)
throws DataStoreException
identifier -
DataStoreException
boolean exists(DataIdentifier identifier)
throws DataStoreException
identifier - identifier to be checked.
DataStoreException
void close()
throws DataStoreException
DataStoreException
Set<DataIdentifier> deleteAllOlderThan(long timestamp)
throws DataStoreException
timestamp -
Set of identifiers which are deleted.
DataStoreException
void deleteRecord(DataIdentifier identifier)
throws DataStoreException
identifier -
DataStoreException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||