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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this Tile Store instance.booleandeleteResource(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.voidputMetadata(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:ALfnTileStoreGets URI identifier of this Tile Store.- Specified by:
getURIin classALfnTileStore- Returns:
- the URI
-
getCapabilities
Description copied from class:ALfnTileStoreGets 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:
getCapabilitiesin 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:ALfnTileStoreReturns the metadata of this Tile Store.
Short for
getCapabilities().getMetadata()- Overrides:
getMetadatain 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:ALfnTileStoreUpdates the metadata of this Tile Store.
- Specified by:
putMetadatain 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:ALfnTileStoreGets 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:
getCoveragein classALfnTileStore- Parameters:
aID- the ID of the desired coverage- Returns:
- the coverage or
nullif 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:ALfnTileStoreGets 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:
getAssetin classALfnTileStore- Parameters:
aID- the ID of the desired asset- Returns:
- the asset or
nullif 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:ALfnTileStoreGets 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:
getThemein classALfnTileStore- Parameters:
aID- the ID of the desired theme- Returns:
- the theme, or
nullif 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:ALfnTileStoreGets the metadata of a resource.This implementation throws
UnsupportedOperationException. Subclasses should override it to do something useful.- Specified by:
getResourceMetadatain interfaceILfnResourceMetadataResolver- Overrides:
getResourceMetadatain classALfnTileStore- Parameters:
aID- the ID of the desired resource- Returns:
- the resource corresponding to the given ID, or
nullif 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:ALfnTileStoreAdds 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.
TLfnServiceExceptionexception will be thrown.This implementation throws
UnsupportedOperationException. Subclasses should override it to do something useful.- Overrides:
putResourceMetadatain 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:ALfnTileStoreGets the metadata of a theme. This implementation delegates toALfnTileStore.getResourceMetadata(String), which is suitable for most subclasses.- Overrides:
getThemeMetadatain classALfnTileStore- Parameters:
aID- the ID of the desired theme- Returns:
- the theme corresponding to the given ID, or
nullif 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:ALfnTileStoreAdds 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.
TLfnServiceExceptionexception will be thrown.This implementation delegates to
ALfnTileStore.putResourceMetadata(com.luciad.fusion.tilestore.metadata.ALfnResourceMetadata), which is suitable for most subclasses.- Overrides:
putThemeMetadatain 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:ALfnTileStoreGets a raster coverage metadata. This implementation delegates toALfnTileStore.getResourceMetadata(String), which is suitable for most subclasses.- Overrides:
getRasterCoverageMetadatain classALfnTileStore- Parameters:
aID- the ID of the desired raster coverage- Returns:
- the raster coverage corresponding to the given ID, or
nullif 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:ALfnTileStoreAdds 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.
TLfnServiceExceptionThis implementation delegates to
ALfnTileStore.putResourceMetadata(com.luciad.fusion.tilestore.metadata.ALfnResourceMetadata), which is suitable for most subclasses.- Overrides:
putRasterCoverageMetadatain 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:ALfnTileStoreGets a vector coverage metadata. This implementation delegates toALfnTileStore.getResourceMetadata(String), which is suitable for most subclasses.- Overrides:
getVectorCoverageMetadatain classALfnTileStore- Parameters:
aID- the ID of the vector coverage- Returns:
- the vector coverage corresponding to the given ID, or
nullif 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:ALfnTileStoreAdds 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.
TLfnServiceExceptionThis implementation delegates to
ALfnTileStore.putResourceMetadata(com.luciad.fusion.tilestore.metadata.ALfnResourceMetadata), which is suitable for most subclasses.- Overrides:
putVectorCoverageMetadatain 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:ALfnTileStoreGets a raster asset metadata. This implementation delegates toALfnTileStore.getResourceMetadata(String), which is suitable for most subclasses.- Overrides:
getRasterAssetMetadatain classALfnTileStore- Parameters:
aID- the ID of the desired raster asset- Returns:
- the raster asset corresponding to the given ID, or
nullif 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:ALfnTileStoreAdds 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:
putRasterAssetMetadatain 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:ALfnTileStoreGets a vector asset metadata. This implementation delegates toALfnTileStore.getResourceMetadata(String), which is suitable for most subclasses.- Overrides:
getVectorAssetMetadatain classALfnTileStore- Parameters:
aID- the ID of the desired vector asset- Returns:
- the vector asset corresponding to the given ID, or
nullif 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:ALfnTileStoreAdds 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:
putVectorAssetMetadatain 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:ALfnTileStoreDeletes 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:
deleteResourcein classALfnTileStore- Parameters:
aID- the ID of a resource to be deleted- Returns:
trueif the resource has been deleted,falseif 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:ALfnTileStoreQueries 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:
queryin 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:ALfnTileStoreGets 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:
getCoverageIdsin classALfnTileStore- Returns:
- the IDs of all this Tile Store's coverages, possibly empty but never
null
-
query
Description copied from class:ALfnTileStoreGets 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:
queryin 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:ALfnTileStorePuts 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
Futureto wait for the result, or use ahandlerto 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:
putUserDatain 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.PUTif data with the given key already existed,ALfnTileStore.WriteResult.CREATEDif it is new.
-
getUserData
public Future<ALfnTileStore.ReadResult> getUserData(String aKey, WritableByteChannel aSink, ILfnCallback<ALfnTileStore.ReadResult> aCallback) Description copied from class:ALfnTileStoreGets 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
Futureto wait for the result, or use ahandlerto 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:
getUserDatain 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.FOUNDif data with the given key exists,ALfnTileStore.Result.Code.NOT_FOUNDotherwise.
-
deleteUserData
public Future<ALfnTileStore.WriteResult> deleteUserData(String aKey, ILfnCallback<ALfnTileStore.WriteResult> aCallback) Description copied from class:ALfnTileStoreDeletes 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
Futureto wait for the result, or use ahandlerto 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:
deleteUserDatain 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.DELETEDif data existed,ALfnTileStore.WriteResult.NOT_FOUNDotherwise.
-
toString
Description copied from class:ALfnTileStoreReturns the URI as a string representation of this Tile Store.- Overrides:
toStringin classALfnTileStore- Returns:
- the URI as a string representation of this Tile Store
-
close
Description copied from class:ALfnTileStoreCloses this Tile Store instance. This method does nothing, but subclasses may override it to do something useful.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classALfnTileStore- Throws:
IOException- in case of an I/O failure
-