Class ALfnBinaryMetadataStore

java.lang.Object
com.luciad.fusion.tilestore.ALfnBinaryMetadataStore
All Implemented Interfaces:
Closeable, AutoCloseable

public abstract class ALfnBinaryMetadataStore extends Object implements Closeable
Entry point for storing and retrieving metadata by id.

This class works at binary data level: the conversion between metadata object (com.luciad.fusion.tilestore.metadata.ALfnResourceMetadata instance) and binary data is done outside the store; implementations of this class are only responsible for storing and retrieving the binary data representation of the metadata.

Since:
2012.0
  • Constructor Details

    • ALfnBinaryMetadataStore

      public ALfnBinaryMetadataStore()
  • Method Details

    • getIds

      public abstract void getIds(ILcdFunction aFunction) throws IOException, TLfnServiceException
      Applies the given function to the id's for which metadatas are stored in this store.

      The id's are passed as String instances to the applyOn method of the given function. The return value of the function is used as a stop criterion: the id iteration is interrupted if the function returns false.

      Parameters:
      aFunction - the function to apply the id's on.
      Throws:
      IOException - if an I/O problem occurs during the iteration.
      TLfnServiceException - if a service problem occurs during the iteration.
    • containsId

      public abstract boolean containsId(String aId) throws IOException, TLfnServiceException
      Returns true if this store contains a metadata for the given id, false otherwise.
      Parameters:
      aId - the id to test
      Returns:
      true if this store contains a metadata for the given id, false otherwise.
      Throws:
      IOException - if an I/O problem occurs during the test.
      TLfnServiceException - if a service problem occurs during the test.
    • getMetadataCount

      public abstract int getMetadataCount() throws IOException, TLfnServiceException
      Returns the number of metadatas contained in this store.
      Returns:
      the number of metadatas contained in this store
      Throws:
      IOException - if an I/O problem occurs during retrieval
      TLfnServiceException - if a service problem occurs during retrieval
    • getMetadata

      public abstract boolean getMetadata(String aId, WritableByteChannel aChannel) throws IOException, TLfnServiceException
      Retrieves the binary representation of the metadata for the given id. The data shall be written into the given WritableByteChannel. The channel will never be closed by this method.
      Parameters:
      aId - the id for which to retrieve the metadata
      aChannel - the channel in which the metadata bytes shall be written
      Returns:
      true if the metadata existed, false otherwise
      Throws:
      IOException - if an I/O problem occurs during retrieval
      TLfnServiceException - if a service problem occurs during retrieval
    • putMetadata

      public abstract void putMetadata(String aId, ReadableByteChannel aChannel) throws IOException, TLfnServiceException
      Stores the binary representation of the metadata with the given id in this store.

      The data is provided as a ReadableByteChannel. The channel will never be closed by this method.

      Parameters:
      aId - the id for which to store the metadata
      aChannel - the channel from which the metadata bytes should be read
      Throws:
      IOException - if an I/O problem occurs during retrieval
      TLfnServiceException - if a service problem occurs during retrieval
    • deleteMetadata

      public abstract boolean deleteMetadata(String aId) throws IOException, TLfnServiceException
      Deletes the metadata for the given id.
      Parameters:
      aId - the id for which to delete the metadata
      Returns:
      true if the metadata existed and was successfully deleted, false otherwise
      Throws:
      IOException - if an I/O problem occurs during deletion
      TLfnServiceException - if a service problem occurs during deletion