Package com.luciad.fusion.tilestore
Class ALfnBinaryMetadataStore
java.lang.Object
com.luciad.fusion.tilestore.ALfnBinaryMetadataStore
- All Implemented Interfaces:
Closeable
,AutoCloseable
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
containsId
(String aId) Returnstrue
if this store contains a metadata for the given id,false
otherwise.abstract boolean
deleteMetadata
(String aId) Deletes the metadata for the given id.abstract void
getIds
(ILcdFunction aFunction) Applies the given function to the id's for which metadatas are stored in this store.abstract boolean
getMetadata
(String aId, WritableByteChannel aChannel) Retrieves the binary representation of the metadata for the given id.abstract int
Returns the number of metadatas contained in this store.abstract void
putMetadata
(String aId, ReadableByteChannel aChannel) Stores the binary representation of the metadata with the given id in this store.
-
Constructor Details
-
ALfnBinaryMetadataStore
public ALfnBinaryMetadataStore()
-
-
Method Details
-
getIds
Applies the given function to the id's for which metadatas are stored in this store. The id's are passed asString
instances to theapplyOn
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 returnsfalse
.- 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
Returnstrue
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
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 retrievalTLfnServiceException
- 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 givenWritableByteChannel
. The channel will never be closed by this method.- Parameters:
aId
- the id for which to retrieve the metadataaChannel
- 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 retrievalTLfnServiceException
- 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 aReadableByteChannel
. The channel will never be closed by this method.- Parameters:
aId
- the id for which to store the metadataaChannel
- the channel from which the metadata bytes should be read- Throws:
IOException
- if an I/O problem occurs during retrievalTLfnServiceException
- if a service problem occurs during retrieval
-
deleteMetadata
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 deletionTLfnServiceException
- if a service problem occurs during deletion
-