Class ALfnTileStoreWrapper
- All Implemented Interfaces:
ILfnResourceMetadataResolver
,Closeable
,AutoCloseable
- Direct Known Subclasses:
TLfnCachingTileStore
,TLfnDigestTileStore
- Since:
- 2015.0
-
Nested Class Summary
Nested classes/interfaces inherited from class com.luciad.fusion.tilestore.ALfnTileStore
ALfnTileStore.CommitPolicy, ALfnTileStore.ReadResult, ALfnTileStore.Result, ALfnTileStore.WriteResult
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this Tile Store instance.boolean
deleteResource
(String aID) Deletes both the data and metadata of a resource.deleteUserData
(String aKey, ILfnCallback<ALfnTileStore.WriteResult> aCallback) Deletes binary user data from this Tile Store with a given key.Gets an asset from the Tile Store.Gets the capabilities offered by the Tile Store.getCoverage
(String aID) Gets a coverage from the Tile Store.Gets the IDs of all this Tile Store's coverage metadatas.Returns the metadata of this Tile Store.Gets a raster asset metadata.Gets a raster coverage metadata.<T extends ALfnResourceMetadata>
TGets the metadata of a resource.Gets a theme from the Tile Store.getThemeMetadata
(String aID) Gets the metadata of a theme.getURI()
Gets URI identifier of this Tile Store.getUserData
(String aKey, WritableByteChannel aSink, ILfnCallback<ALfnTileStore.ReadResult> aCallback) Gets binary user data from this Tile Store with a given key.Gets a vector asset metadata.Gets a vector coverage metadata.void
putMetadata
(TLfnTileStoreMetadata aTileStoreMetadata) Updates the metadata of this Tile Store.putRasterAssetMetadata
(TLfnRasterAssetMetadata aMetadata) Adds or updates an asset.Adds or updates a coverage.<T extends ALfnResourceMetadata>
TputResourceMetadata
(T aMetadata) Adds or updates the metadata of a resource.putThemeMetadata
(TLfnThemeMetadata aMetadata) Adds or updates a theme metadata.putUserData
(String aKey, ReadableByteChannel aSource, ILfnCallback<ALfnTileStore.WriteResult> aCallback) Puts binary user data in this Tile Store with a given key.putVectorAssetMetadata
(TLfnVectorAssetMetadata aMetadata) Adds or updates an asset.Adds or updates a coverage.<R extends ALfnResourceMetadata>
List<R> query
(ELfnResourceType aResourceType) Gets all the resource metadatas in this Tile Store of a given type.Future
<?> query
(ILfnQueryHandler aHandler, TLfnQuery aQuery) Queries the Tile Store for resources' metadata.toString()
Returns the URI as a string representation of this Tile Store.
-
Field Details
-
fDelegate
-
-
Constructor Details
-
ALfnTileStoreWrapper
-
-
Method Details
-
getURI
Description copied from class:ALfnTileStore
Gets URI identifier of this Tile Store.- Specified by:
getURI
in classALfnTileStore
- Returns:
- the URI
-
getCapabilities
Description copied from class:ALfnTileStore
Gets the capabilities offered by the Tile Store.The capabilities provide the Tile Store metadata and the supported operations. The operations are defined as constants on this class.
- Specified by:
getCapabilities
in classALfnTileStore
- Returns:
- the Tile Store capabilities
- Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure
-
getMetadata
Description copied from class:ALfnTileStore
Returns the metadata of this Tile Store.
Short for
getCapabilities().getMetadata()
- Overrides:
getMetadata
in classALfnTileStore
- Returns:
- the Tile Store metadata
- Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure
-
putMetadata
public void putMetadata(TLfnTileStoreMetadata aTileStoreMetadata) throws IOException, TLfnServiceException Description copied from class:ALfnTileStore
Updates the metadata of this Tile Store.
- Specified by:
putMetadata
in classALfnTileStore
- Parameters:
aTileStoreMetadata
- The new metadata for this Tile Store- Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure
-
getCoverage
Description copied from class:ALfnTileStore
Gets a coverage from the Tile Store. Coverage IDs can be found using either:ALfnTileStore.getCoverageIds()
ALfnTileStore.query(ILfnQueryHandler, TLfnQuery)
and get the ID from the metadata
- Overrides:
getCoverage
in classALfnTileStore
- Parameters:
aID
- the ID of the desired coverage- Returns:
- the coverage or
null
if it does not exist - Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure- See Also:
-
getAsset
Description copied from class:ALfnTileStore
Gets an asset from the Tile Store. Asset IDs can be found using either:query(ELfnResourceType.ASSET)
and get the ID from the metadataALfnTileStore.query(ILfnQueryHandler, TLfnQuery)
and get the ID from the metadata
- Overrides:
getAsset
in classALfnTileStore
- Parameters:
aID
- the ID of the desired asset- Returns:
- the asset or
null
if it does not exist - Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure
-
getTheme
Description copied from class:ALfnTileStore
Gets a theme from the Tile Store. Theme IDs can be found using either:query(ELfnResourceType.THEME)
and get the ID from the metadataALfnTileStore.query(ILfnQueryHandler, TLfnQuery)
and get the ID from the metadata
- Overrides:
getTheme
in classALfnTileStore
- Parameters:
aID
- the ID of the desired theme- Returns:
- the theme, or
null
if it does not exist - Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure
-
getResourceMetadata
public <T extends ALfnResourceMetadata> T getResourceMetadata(String aID) throws IOException, TLfnServiceException Description copied from class:ALfnTileStore
Gets the metadata of a resource.This implementation throws
UnsupportedOperationException
. Subclasses should override it to do something useful.- Specified by:
getResourceMetadata
in interfaceILfnResourceMetadataResolver
- Overrides:
getResourceMetadata
in classALfnTileStore
- Parameters:
aID
- the ID of the desired resource- Returns:
- the resource corresponding to the given ID, or
null
if it does not exist - Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure
-
putResourceMetadata
public <T extends ALfnResourceMetadata> T putResourceMetadata(T aMetadata) throws IOException, TLfnServiceException Description copied from class:ALfnTileStore
Adds or updates the metadata of a resource. The put sequence is verified:-
addition of a new resource will fail if a resource with the same ID already exists;
put of an existing resource will fail if the version of the updated metadata does
not match the metadata on the LuciadFusion service.
TLfnServiceException
exception will be thrown.This implementation throws
UnsupportedOperationException
. Subclasses should override it to do something useful.- Overrides:
putResourceMetadata
in classALfnTileStore
- Parameters:
aMetadata
- the metadata describing the resource to be put- Returns:
- the resource metadata with the new put sequence
- Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure or conflict
-
getThemeMetadata
Description copied from class:ALfnTileStore
Gets the metadata of a theme. This implementation delegates toALfnTileStore.getResourceMetadata(String)
, which is suitable for most subclasses.- Overrides:
getThemeMetadata
in classALfnTileStore
- Parameters:
aID
- the ID of the desired theme- Returns:
- the theme corresponding to the given ID, or
null
if it does not exist - Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure
-
putThemeMetadata
public TLfnThemeMetadata putThemeMetadata(TLfnThemeMetadata aMetadata) throws IOException, TLfnServiceException Description copied from class:ALfnTileStore
Adds or updates a theme metadata. The put sequence is verified:-
addition of a new theme will fail if a theme with the same ID already exists;
put of an existing theme will fail if the version of the updated metadata does
not match the metadata on the LuciadFusion service.
TLfnServiceException
exception will be thrown.This implementation delegates to
ALfnTileStore.putResourceMetadata(com.luciad.fusion.tilestore.metadata.ALfnResourceMetadata)
, which is suitable for most subclasses.- Overrides:
putThemeMetadata
in classALfnTileStore
- Parameters:
aMetadata
- the metadata describing the theme to be put- Returns:
- the metadata with the new put sequence
- Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure or conflict
-
getRasterCoverageMetadata
public TLfnRasterCoverageMetadata getRasterCoverageMetadata(String aID) throws IOException, TLfnServiceException Description copied from class:ALfnTileStore
Gets a raster coverage metadata. This implementation delegates toALfnTileStore.getResourceMetadata(String)
, which is suitable for most subclasses.- Overrides:
getRasterCoverageMetadata
in classALfnTileStore
- Parameters:
aID
- the ID of the desired raster coverage- Returns:
- the raster coverage corresponding to the given ID, or
null
if it does not exist - Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure
-
putRasterCoverageMetadata
public TLfnRasterCoverageMetadata putRasterCoverageMetadata(TLfnRasterCoverageMetadata aMetadata) throws IOException, TLfnServiceException Description copied from class:ALfnTileStore
Adds or updates a coverage. The put sequence is verified:-
addition of a new coverage will fail if a coverage with the same ID already exists
put of an existing coverage will fail if the version of the updated metadata does
not match the metadata on the LuciadFusion service.
TLfnServiceException
This implementation delegates to
ALfnTileStore.putResourceMetadata(com.luciad.fusion.tilestore.metadata.ALfnResourceMetadata)
, which is suitable for most subclasses.- Overrides:
putRasterCoverageMetadata
in classALfnTileStore
- Parameters:
aMetadata
- the metadata describing the coverage to be put- Returns:
- the metadata with the new put sequence
- Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure
-
getVectorCoverageMetadata
public TLfnVectorCoverageMetadata getVectorCoverageMetadata(String aID) throws IOException, TLfnServiceException Description copied from class:ALfnTileStore
Gets a vector coverage metadata. This implementation delegates toALfnTileStore.getResourceMetadata(String)
, which is suitable for most subclasses.- Overrides:
getVectorCoverageMetadata
in classALfnTileStore
- Parameters:
aID
- the ID of the vector coverage- Returns:
- the vector coverage corresponding to the given ID, or
null
if it does not exist - Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure
-
putVectorCoverageMetadata
public TLfnVectorCoverageMetadata putVectorCoverageMetadata(TLfnVectorCoverageMetadata aMetadata) throws IOException, TLfnServiceException Description copied from class:ALfnTileStore
Adds or updates a coverage. The put sequence is verified:-
addition of a new coverage will fail if a coverage with the same ID already exists
put of an existing coverage will fail if the version of the updated metadata does
not match the metadata on the LuciadFusion service.
TLfnServiceException
This implementation delegates to
ALfnTileStore.putResourceMetadata(com.luciad.fusion.tilestore.metadata.ALfnResourceMetadata)
, which is suitable for most subclasses.- Overrides:
putVectorCoverageMetadata
in classALfnTileStore
- Parameters:
aMetadata
- the metadata describing the coverage to be put- Returns:
- the metadata with the new put sequence
- Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure
-
getRasterAssetMetadata
public TLfnRasterAssetMetadata getRasterAssetMetadata(String aID) throws IOException, TLfnServiceException Description copied from class:ALfnTileStore
Gets a raster asset metadata. This implementation delegates toALfnTileStore.getResourceMetadata(String)
, which is suitable for most subclasses.- Overrides:
getRasterAssetMetadata
in classALfnTileStore
- Parameters:
aID
- the ID of the desired raster asset- Returns:
- the raster asset corresponding to the given ID, or
null
if it does not exist - Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure
-
putRasterAssetMetadata
public TLfnRasterAssetMetadata putRasterAssetMetadata(TLfnRasterAssetMetadata aMetadata) throws IOException, TLfnServiceException Description copied from class:ALfnTileStore
Adds or updates an asset. The put sequence is verified:-
addition of a new asset will fail if an asset with the same ID already exists
put of an existing asset will fail if the version of the updated metadata does
not match the metadata on the LuciadFusion service.
TLfnServiceException
.This implementation delegates to
ALfnTileStore.putResourceMetadata(com.luciad.fusion.tilestore.metadata.ALfnResourceMetadata)
, which is suitable for most subclasses.- Overrides:
putRasterAssetMetadata
in classALfnTileStore
- Parameters:
aMetadata
- the metadata describing the asset to be put- Returns:
- the metadata with the new put sequence
- Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure
-
getVectorAssetMetadata
public TLfnVectorAssetMetadata getVectorAssetMetadata(String aID) throws IOException, TLfnServiceException Description copied from class:ALfnTileStore
Gets a vector asset metadata. This implementation delegates toALfnTileStore.getResourceMetadata(String)
, which is suitable for most subclasses.- Overrides:
getVectorAssetMetadata
in classALfnTileStore
- Parameters:
aID
- the ID of the desired vector asset- Returns:
- the vector asset corresponding to the given ID, or
null
if it does not exist - Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure
-
putVectorAssetMetadata
public TLfnVectorAssetMetadata putVectorAssetMetadata(TLfnVectorAssetMetadata aMetadata) throws IOException, TLfnServiceException Description copied from class:ALfnTileStore
Adds or updates an asset. The put sequence is verified:-
addition of a new asset will fail if an asset with the same ID already exists
put of an existing asset will fail if the version of the updated metadata does
not match the metadata on the LuciadFusion service.
TLfnServiceException
.This implementation delegates to
ALfnTileStore.putResourceMetadata(com.luciad.fusion.tilestore.metadata.ALfnResourceMetadata)
, which is suitable for most subclasses.- Overrides:
putVectorAssetMetadata
in classALfnTileStore
- Parameters:
aMetadata
- the metadata describing the asset to be put- Returns:
- the metadata with the new put sequence
- Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure
-
deleteResource
Description copied from class:ALfnTileStore
Deletes both the data and metadata of a resource. As soon as this method returns, the resource can be considered deleted for all practical purposes. Note however that space reclamation may or may not be immediate, since it is taken care of by a background process.- Overrides:
deleteResource
in classALfnTileStore
- Parameters:
aID
- the ID of a resource to be deleted- Returns:
true
if the resource has been deleted,false
if the resource does not exist- Throws:
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure
-
query
Description copied from class:ALfnTileStore
Queries the Tile Store for resources' metadata. The query returns the metadata of resources that match a given filter and type. Even though the API is asynchronous, implementations may be synchronous or asynchronous. The default implementations are in fact synchronous, but that is an implementation detail which may change at any time.- Overrides:
query
in classALfnTileStore
- Parameters:
aHandler
- the handler for the resultsaQuery
- the query to be performed- Returns:
- the future of the request, which could be asynchronous
-
getCoverageIds
Description copied from class:ALfnTileStore
Gets the IDs of all this Tile Store's coverage metadatas. This is a blocking call. It is a convenience method for the asynchronousALfnTileStore.query(ILfnQueryHandler, TLfnQuery)
. Any checked exceptions on the asynchronous handler will be wrapped in aRuntimeException
.- Overrides:
getCoverageIds
in classALfnTileStore
- Returns:
- the IDs of all this Tile Store's coverages, possibly empty but never
null
-
query
Description copied from class:ALfnTileStore
Gets all the resource metadatas in this Tile Store of a given type. This is a blocking call. It is a convenience method for the asynchronousALfnTileStore.query(ILfnQueryHandler, TLfnQuery)
. Any checked exceptions on the asynchronous handler will be wrapped in aRuntimeException
.- Overrides:
query
in classALfnTileStore
- Type Parameters:
R
- the expected resource type, which must not benull
- Parameters:
aResourceType
-- Returns:
- all this Tile Store's resource metadatas matching the specified type, possibly empty but never
null
-
putUserData
public Future<ALfnTileStore.WriteResult> putUserData(String aKey, ReadableByteChannel aSource, ILfnCallback<ALfnTileStore.WriteResult> aCallback) Description copied from class:ALfnTileStore
Puts binary user data in this Tile Store with a given key. User data is opaque binary data, and is used internally to store checkpoints and replication settings.The user data is read from the given channel. If user data with the given key already exists, it is overwritten and this call returns
true
.The user data key is an arbitrary string, but you are encouraged to use a java-like hierarchical naming scheme, for example
"com.luciad.fusion.yourUniqueKey"
.This operation is asynchronous. Callers can use the returned
Future
to wait for the result, or use ahandler
to be notified of the result.This operation is optional. Use
TLfnTileStoreOperation.isUserDataSupported(com.luciad.fusion.tilestore.TLfnTileStoreCapabilities)
to check if this operation is supported.- Overrides:
putUserData
in classALfnTileStore
- Parameters:
aKey
- A key associated with the user data.aSource
- The input channel the user data is read from.aCallback
- A callback that will be invoked when the operation is finished. May benull
.- Returns:
- A future, with result code
ALfnTileStore.WriteResult.PUT
if data with the given key already existed,ALfnTileStore.WriteResult.CREATED
if it is new.
-
getUserData
public Future<ALfnTileStore.ReadResult> getUserData(String aKey, WritableByteChannel aSink, ILfnCallback<ALfnTileStore.ReadResult> aCallback) Description copied from class:ALfnTileStore
Gets binary user data from this Tile Store with a given key.The user data is written to the given channel, if it exists.
The user data key is an arbitrary string, but you are encouraged to use a java-like hierarchical naming scheme, for example
"com.luciad.fusion.youruniquekey"
.This operation is asynchronous. Callers can use the returned
Future
to wait for the result, or use ahandler
to be notified of the result.This operation is optional. Use
TLfnTileStoreOperation.isUserDataSupported(com.luciad.fusion.tilestore.TLfnTileStoreCapabilities)
to check if this operation is supported.- Overrides:
getUserData
in classALfnTileStore
- Parameters:
aKey
- A key associated with the user data.aSink
- The output channel the data is written to, if it exists.aCallback
- A callback that will be invoked when the operation is finished. May benull
.- Returns:
- A future, with result value
ALfnTileStore.ReadResult.FOUND
if data with the given key exists,ALfnTileStore.Result.Code.NOT_FOUND
otherwise.
-
deleteUserData
public Future<ALfnTileStore.WriteResult> deleteUserData(String aKey, ILfnCallback<ALfnTileStore.WriteResult> aCallback) Description copied from class:ALfnTileStore
Deletes binary user data from this Tile Store with a given key.The user data key is an arbitrary string, but you should use a java-like hierarchical naming scheme.
This operation is asynchronous. Callers can use the returned
Future
to wait for the result, or use ahandler
to be notified of the result.This operation is optional. User
TLfnTileStoreOperation.isUserDataSupported(com.luciad.fusion.tilestore.TLfnTileStoreCapabilities)
to check if this operation is supported.- Overrides:
deleteUserData
in classALfnTileStore
- Parameters:
aKey
- A key associated with the user data.aCallback
- A callback that will be invoked when the operation is finished. May benull
.- Returns:
- A future, with result value
ALfnTileStore.WriteResult.DELETED
if data existed,ALfnTileStore.WriteResult.NOT_FOUND
otherwise.
-
toString
Description copied from class:ALfnTileStore
Returns the URI as a string representation of this Tile Store.- Overrides:
toString
in classALfnTileStore
- Returns:
- the URI as a string representation of this Tile Store
-
close
Description copied from class:ALfnTileStore
Closes this Tile Store instance. This method does nothing, but subclasses may override it to do something useful.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classALfnTileStore
- Throws:
IOException
- in case of an I/O failure
-