Class FSBackend
java.lang.Object
org.apache.jackrabbit.oak.spi.blob.AbstractSharedBackend
org.apache.jackrabbit.oak.plugins.blob.datastore.FSBackend
- All Implemented Interfaces:
 SharedBackend
- 
Field Summary
Fields - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddMetadataRecord(File input, String name) Adds a metadata record with the specified namevoidaddMetadataRecord(InputStream input, String name) Adds a metadata record with the specified namevoidclose()Close backend and release resources like database connection if any.voiddeleteAllMetadataRecords(String prefix) Deletes all the metadata records with the specified prefix.booleandeleteMetadataRecord(String name) Deletes the metadata record with the specified namevoiddeleteRecord(DataIdentifier identifier) Delete record identified by identifier.booleanexists(DataIdentifier identifier) This method check the existence of record in backend.Returns identifiers of all records that exists in backend.getAllMetadataRecords(String prefix) Gets all the metadata with a specified prefix.Returns a list of all DataRecordsgetMetadataRecord(String name) Gets the metadata of the specified name.byte[]Returns the reference key of this backend.getRecord(DataIdentifier identifier) Gets the record with the specified identifiervoidinit()InitializebooleanmetadataRecordExists(String name) Checks if the metadata record with the specified name exists.read(DataIdentifier identifier) Return inputstream of record identified by identifier.voidsetProperties(Properties properties) Properties used to configure the backend.voidwrite(DataIdentifier identifier, File file) Stores file to backend with identifier used as key.Methods inherited from class org.apache.jackrabbit.oak.spi.blob.AbstractSharedBackend
getReferenceFromIdentifier 
- 
Field Details
- 
FS_BACKEND_PATH
- See Also:
 
 
 - 
 - 
Constructor Details
- 
FSBackend
public FSBackend() 
 - 
 - 
Method Details
- 
init
Description copied from interface:SharedBackendInitialize- Throws:
 DataStoreException
 - 
read
Description copied from interface:SharedBackendReturn 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.
 - 
write
Description copied from interface:SharedBackendStores file to backend with identifier used as key. If key pre-exists, it updates the timestamp of the key.- Parameters:
 identifier- key of the filefile- file that would be stored in backend.- Throws:
 DataStoreException- for any error.
 - 
getRecord
Description copied from interface:SharedBackendGets the record with the specified identifier- Parameters:
 identifier- the record identifier- Returns:
 - the metadata DataRecord
 - Throws:
 DataStoreException
 - 
getAllIdentifiers
Description copied from interface:SharedBackendReturns identifiers of all records that exists in backend.- Returns:
 - iterator consisting of all identifiers
 - Throws:
 DataStoreException
 - 
exists
Description copied from interface:SharedBackendThis method check the existence of record in backend.- Parameters:
 identifier- identifier to be checked.- Returns:
 - true if records exists else false.
 - Throws:
 DataStoreException
 - 
deleteRecord
Description copied from interface:SharedBackendDelete record identified by identifier. No-op if identifier not found.- Throws:
 DataStoreException
 - 
addMetadataRecord
Description copied from interface:SharedBackendAdds a metadata record with the specified name- Parameters:
 input- the record input streamname- the name- Throws:
 DataStoreException
 - 
addMetadataRecord
Description copied from interface:SharedBackendAdds a metadata record with the specified name- Parameters:
 input- the record filename- the name- Throws:
 DataStoreException
 - 
getMetadataRecord
Description copied from interface:SharedBackendGets the metadata of the specified name.- Parameters:
 name- the name of the record- Returns:
 - the metadata DataRecord
 
 - 
getAllMetadataRecords
Description copied from interface:SharedBackendGets all the metadata with a specified prefix.- Parameters:
 prefix- the prefix of the records to retrieve- Returns:
 - list of all the metadata DataRecords
 
 - 
deleteMetadataRecord
Description copied from interface:SharedBackendDeletes the metadata record with the specified name- Parameters:
 name- the name of the record- Returns:
 - boolean to indicate success of deletion
 
 - 
deleteAllMetadataRecords
Description copied from interface:SharedBackendDeletes all the metadata records with the specified prefix.- Parameters:
 prefix- the prefix of the record
 - 
metadataRecordExists
Description copied from interface:SharedBackendChecks if the metadata record with the specified name exists.- Parameters:
 name- the name of the record- Returns:
 - whether record exists
 
 - 
getAllRecords
Description copied from interface:SharedBackendReturns a list of all DataRecords- Returns:
 - iterator over DataRecords
 
 - 
close
Description copied from interface:SharedBackendClose backend and release resources like database connection if any.- Throws:
 DataStoreException
 - 
getOrCreateReferenceKey
Description copied from class:AbstractSharedBackendReturns the reference key of this backend. If one does not already exist, it is automatically created in an implementation-specific way. The default implementation simply creates a temporary random key that's valid only until the data store gets restarted. Subclasses can override and/or decorate this method to support a more persistent reference key.This method is called only once during the lifetime of a backend instance and the return value is cached in memory, so it's no problem if the implementation is slow.
- Overrides:
 getOrCreateReferenceKeyin classAbstractSharedBackend- Returns:
 - reference key
 - Throws:
 DataStoreException- if the key is not available
 - 
setProperties
Properties used to configure the backend. These are mandatorily to be provided explicitly before calling {init()is invoked.- Parameters:
 properties- to configure Backend
 
 -