Class OakFileDataStore
- java.lang.Object
-
- org.apache.jackrabbit.core.data.AbstractDataStore
-
- org.apache.jackrabbit.core.data.FileDataStore
-
- org.apache.jackrabbit.oak.plugins.blob.datastore.OakFileDataStore
-
- All Implemented Interfaces:
DataStore,MultiDataStoreAware,SharedDataStore
public class OakFileDataStore extends FileDataStore implements SharedDataStore
Oak specific extension of JR2 FileDataStore which enables provisioning the signing key via OSGi config
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.jackrabbit.oak.plugins.blob.SharedDataStore
SharedDataStore.Type
-
-
Constructor Summary
Constructors Constructor Description OakFileDataStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMetadataRecord(java.io.File input, java.lang.String name)Adds the root record.voidaddMetadataRecord(java.io.InputStream input, java.lang.String name)Adds the root record.voiddeleteAllMetadataRecords(java.lang.String prefix)Deletes all records matching the given prefix.booleandeleteMetadataRecord(java.lang.String name)Deletes the root record represented by the given parameters.java.util.Iterator<DataIdentifier>getAllIdentifiers()Get all identifiers.java.util.List<DataRecord>getAllMetadataRecords(java.lang.String prefix)Gets the all root records.java.util.Iterator<DataRecord>getAllRecords()Retrieved an iterator over all DataRecords.DataRecordgetMetadataRecord(java.lang.String name)Retrieves the metadata record with the given nameDataRecordgetRecordForId(DataIdentifier id)Retrieves the record for the given identifierSharedDataStore.TypegetType()Gets the type.booleanmetadataRecordExists(java.lang.String name)Checks if the metadata record with the name existsvoidsetReferenceKey(byte[] referenceKey)voidsetReferenceKeyEncoded(java.lang.String encodedKey)Set Base64 encoded signing keyvoidsetReferenceKeyPlainText(java.lang.String textKey)Set the referenceKey from plain text.-
Methods inherited from class org.apache.jackrabbit.core.data.FileDataStore
addRecord, clearInUse, close, deleteAllOlderThan, deleteRecord, getMinRecordLength, getPath, getRecordIfStored, init, setMinRecordLength, setPath, updateModifiedDateOnAccess
-
Methods inherited from class org.apache.jackrabbit.core.data.AbstractDataStore
getRecord, getRecordFromReference
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jackrabbit.oak.plugins.blob.SharedDataStore
getRepositoryId, setRepositoryId
-
-
-
-
Field Detail
-
LOG
public static final Logger LOG
-
-
Method Detail
-
getAllIdentifiers
public java.util.Iterator<DataIdentifier> getAllIdentifiers()
Description copied from interface:DataStoreGet all identifiers.- Specified by:
getAllIdentifiersin interfaceDataStore- Overrides:
getAllIdentifiersin classFileDataStore- Returns:
- an iterator over all DataIdentifier objects
-
setReferenceKeyEncoded
public void setReferenceKeyEncoded(java.lang.String encodedKey)
Set Base64 encoded signing key
-
setReferenceKeyPlainText
public void setReferenceKeyPlainText(java.lang.String textKey)
Set the referenceKey from plain text. Key content would be UTF-8 encoding of the string.This is useful when setting key via generic bean property manipulation from string properties. User can specify the key in plain text and that would be passed on this object via
PropertiesUtil.populate(Object, java.util.Map, boolean)- Parameters:
textKey- base64 encoded key- See Also:
PropertiesUtil.populate(Object, java.util.Map, boolean)
-
setReferenceKey
public void setReferenceKey(byte[] referenceKey)
-
addMetadataRecord
public void addMetadataRecord(java.io.InputStream input, java.lang.String name) throws DataStoreExceptionDescription copied from interface:SharedDataStoreAdds the root record.- Specified by:
addMetadataRecordin interfaceSharedDataStore- Parameters:
input- the streamname- the name of the root record- Throws:
DataStoreException- the data store exception
-
addMetadataRecord
public void addMetadataRecord(java.io.File input, java.lang.String name) throws DataStoreExceptionDescription copied from interface:SharedDataStoreAdds the root record.- Specified by:
addMetadataRecordin interfaceSharedDataStore- Parameters:
input- the filename- the name of the root record- Throws:
DataStoreException- the data store exception
-
getMetadataRecord
public DataRecord getMetadataRecord(java.lang.String name)
Description copied from interface:SharedDataStoreRetrieves the metadata record with the given name- Specified by:
getMetadataRecordin interfaceSharedDataStore- Parameters:
name- the name of the record- Returns:
-
metadataRecordExists
public boolean metadataRecordExists(java.lang.String name)
Description copied from interface:SharedDataStoreChecks if the metadata record with the name exists- Specified by:
metadataRecordExistsin interfaceSharedDataStore- Returns:
-
getAllMetadataRecords
public java.util.List<DataRecord> getAllMetadataRecords(java.lang.String prefix)
Description copied from interface:SharedDataStoreGets the all root records.- Specified by:
getAllMetadataRecordsin interfaceSharedDataStore- Returns:
- the all root records
-
deleteMetadataRecord
public boolean deleteMetadataRecord(java.lang.String name)
Description copied from interface:SharedDataStoreDeletes the root record represented by the given parameters.- Specified by:
deleteMetadataRecordin interfaceSharedDataStore- Parameters:
name- the name of the root record- Returns:
- success/failure
-
deleteAllMetadataRecords
public void deleteAllMetadataRecords(java.lang.String prefix)
Description copied from interface:SharedDataStoreDeletes all records matching the given prefix.- Specified by:
deleteAllMetadataRecordsin interfaceSharedDataStore- Parameters:
prefix- metadata type identifier
-
getAllRecords
public java.util.Iterator<DataRecord> getAllRecords()
Description copied from interface:SharedDataStoreRetrieved an iterator over all DataRecords.- Specified by:
getAllRecordsin interfaceSharedDataStore- Returns:
- iterator over DataRecords
-
getRecordForId
public DataRecord getRecordForId(DataIdentifier id) throws DataStoreException
Description copied from interface:SharedDataStoreRetrieves the record for the given identifier- Specified by:
getRecordForIdin interfaceSharedDataStore- Parameters:
id- the if of the record- Returns:
- data record
- Throws:
DataStoreException
-
getType
public SharedDataStore.Type getType()
Description copied from interface:SharedDataStoreGets the type.- Specified by:
getTypein interfaceSharedDataStore- Returns:
- the type
-
-