Interface SharedBackend

All Known Implementing Classes:
AbstractSharedBackend, FSBackend

public interface SharedBackend
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a metadata record with the specified name
    void
    Adds a metadata record with the specified name
    void
    Close backend and release resources like database connection if any.
    void
    Deletes all the metadata records with the specified prefix.
    boolean
    Deletes the metadata record with the specified name
    void
    deleteRecord(org.apache.jackrabbit.oak.spi.blob.data.DataIdentifier identifier)
    Delete record identified by identifier.
    boolean
    exists(org.apache.jackrabbit.oak.spi.blob.data.DataIdentifier identifier)
    This method check the existence of record in backend.
    Iterator<org.apache.jackrabbit.oak.spi.blob.data.DataIdentifier>
    Returns identifiers of all records that exists in backend.
    List<org.apache.jackrabbit.oak.spi.blob.data.DataRecord>
    Gets all the metadata with a specified prefix.
    Iterator<org.apache.jackrabbit.oak.spi.blob.data.DataRecord>
    Returns a list of all DataRecords
    org.apache.jackrabbit.oak.spi.blob.data.DataRecord
    Gets the metadata of the specified name.
    org.apache.jackrabbit.oak.spi.blob.data.DataRecord
    getRecord(org.apache.jackrabbit.oak.spi.blob.data.DataIdentifier id)
    Gets the record with the specified identifier
    void
    Initialize
    boolean
    Checks if the metadata record with the specified name exists.
    read(org.apache.jackrabbit.oak.spi.blob.data.DataIdentifier identifier)
    Return inputstream of record identified by identifier.
    void
    write(org.apache.jackrabbit.oak.spi.blob.data.DataIdentifier identifier, File file)
    Stores file to backend with identifier used as key.
  • Method Details

    • read

      InputStream read(org.apache.jackrabbit.oak.spi.blob.data.DataIdentifier identifier) throws org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
      Return inputstream of record identified by identifier.
      Parameters:
      identifier - identifier of record.
      Returns:
      inputstream of the record.
      Throws:
      org.apache.jackrabbit.oak.spi.blob.data.DataStoreException - if record not found or any error.
    • write

      void write(org.apache.jackrabbit.oak.spi.blob.data.DataIdentifier identifier, File file) throws org.apache.jackrabbit.oak.spi.blob.data.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:
      org.apache.jackrabbit.oak.spi.blob.data.DataStoreException - for any error.
    • getRecord

      org.apache.jackrabbit.oak.spi.blob.data.DataRecord getRecord(org.apache.jackrabbit.oak.spi.blob.data.DataIdentifier id) throws org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
      Gets the record with the specified identifier
      Parameters:
      id - the record identifier
      Returns:
      the metadata DataRecord
      Throws:
      org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
    • getAllIdentifiers

      Iterator<org.apache.jackrabbit.oak.spi.blob.data.DataIdentifier> getAllIdentifiers() throws org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
      Returns identifiers of all records that exists in backend.
      Returns:
      iterator consisting of all identifiers
      Throws:
      org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
    • getAllRecords

      Iterator<org.apache.jackrabbit.oak.spi.blob.data.DataRecord> getAllRecords() throws org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
      Returns a list of all DataRecords
      Returns:
      iterator over DataRecords
      Throws:
      org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
    • exists

      boolean exists(org.apache.jackrabbit.oak.spi.blob.data.DataIdentifier identifier) throws org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
      This method check the existence of record in backend.
      Parameters:
      identifier - identifier to be checked.
      Returns:
      true if records exists else false.
      Throws:
      org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
    • close

      void close() throws org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
      Close backend and release resources like database connection if any.
      Throws:
      org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
    • deleteRecord

      void deleteRecord(org.apache.jackrabbit.oak.spi.blob.data.DataIdentifier identifier) throws org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
      Delete record identified by identifier. No-op if identifier not found.
      Parameters:
      identifier -
      Throws:
      org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
    • addMetadataRecord

      void addMetadataRecord(InputStream input, String name) throws org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
      Adds a metadata record with the specified name
      Parameters:
      input - the record input stream
      name - the name
      Throws:
      org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
    • addMetadataRecord

      void addMetadataRecord(File input, String name) throws org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
      Adds a metadata record with the specified name
      Parameters:
      input - the record file
      name - the name
      Throws:
      org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
    • getMetadataRecord

      org.apache.jackrabbit.oak.spi.blob.data.DataRecord getMetadataRecord(String name)
      Gets the metadata of the specified name.
      Parameters:
      name - the name of the record
      Returns:
      the metadata DataRecord
    • getAllMetadataRecords

      List<org.apache.jackrabbit.oak.spi.blob.data.DataRecord> getAllMetadataRecords(String prefix)
      Gets all the metadata with a specified prefix.
      Parameters:
      prefix - the prefix of the records to retrieve
      Returns:
      list of all the metadata DataRecords
    • deleteMetadataRecord

      boolean deleteMetadataRecord(String name)
      Deletes the metadata record with the specified name
      Parameters:
      name - the name of the record
      Returns:
      boolean to indicate success of deletion
    • deleteAllMetadataRecords

      void deleteAllMetadataRecords(String prefix)
      Deletes all the metadata records with the specified prefix.
      Parameters:
      prefix - the prefix of the record
    • metadataRecordExists

      boolean metadataRecordExists(String name)
      Checks if the metadata record with the specified name exists.
      Parameters:
      name - the name of the record
      Returns:
      whether record exists
    • init

      void init() throws org.apache.jackrabbit.oak.spi.blob.data.DataStoreException
      Initialize
      Throws:
      org.apache.jackrabbit.oak.spi.blob.data.DataStoreException