public abstract class ALfnTileStoreWrapper extends ALfnTileStore
ALfnTileStore.CommitPolicy, ALfnTileStore.ReadResult, ALfnTileStore.Result, ALfnTileStore.WriteResult
Modifier and Type | Field and Description |
---|---|
protected ALfnTileStore |
fDelegate |
Modifier | Constructor and Description |
---|---|
protected |
ALfnTileStoreWrapper(ALfnTileStore aDelegate) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this Tile Store instance.
|
boolean |
deleteResource(String aID)
Deletes both the data and metadata of a resource.
|
Future<ALfnTileStore.WriteResult> |
deleteUserData(String aKey,
ILfnCallback<ALfnTileStore.WriteResult> aCallback)
Deletes binary user data from this Tile Store with a given key.
|
ALfnAsset |
getAsset(String aID)
Gets an asset from the Tile Store.
|
TLfnTileStoreCapabilities |
getCapabilities()
Gets the capabilities offered by the Tile Store.
|
ALfnCoverage |
getCoverage(String aID)
Gets a coverage from the Tile Store.
|
List<String> |
getCoverageIds()
Gets the IDs of all this Tile Store's coverage metadatas.
|
TLfnTileStoreMetadata |
getMetadata()
Returns the metadata of this Tile Store.
|
TLfnRasterAssetMetadata |
getRasterAssetMetadata(String aID)
Gets a raster asset metadata.
|
TLfnRasterCoverageMetadata |
getRasterCoverageMetadata(String aID)
Gets a raster coverage metadata.
|
<T extends ALfnResourceMetadata> |
getResourceMetadata(String aID)
Gets the metadata of a resource.
|
ALfnTheme |
getTheme(String aID)
Gets a theme from the Tile Store.
|
TLfnThemeMetadata |
getThemeMetadata(String aID)
Gets the metadata of a theme.
|
URI |
getURI()
Gets URI identifier of this Tile Store.
|
Future<ALfnTileStore.ReadResult> |
getUserData(String aKey,
WritableByteChannel aSink,
ILfnCallback<ALfnTileStore.ReadResult> aCallback)
Gets binary user data from this Tile Store with a given key.
|
TLfnVectorAssetMetadata |
getVectorAssetMetadata(String aID)
Gets a vector asset metadata.
|
TLfnVectorCoverageMetadata |
getVectorCoverageMetadata(String aID)
Gets a vector coverage metadata.
|
void |
putMetadata(TLfnTileStoreMetadata aTileStoreMetadata)
Updates the metadata of this Tile Store.
|
TLfnRasterAssetMetadata |
putRasterAssetMetadata(TLfnRasterAssetMetadata aMetadata)
Adds or updates an asset.
|
TLfnRasterCoverageMetadata |
putRasterCoverageMetadata(TLfnRasterCoverageMetadata aMetadata)
Adds or updates a coverage.
|
<T extends ALfnResourceMetadata> |
putResourceMetadata(T aMetadata)
Adds or updates the metadata of a resource.
|
TLfnThemeMetadata |
putThemeMetadata(TLfnThemeMetadata aMetadata)
Adds or updates a theme metadata.
|
Future<ALfnTileStore.WriteResult> |
putUserData(String aKey,
ReadableByteChannel aSource,
ILfnCallback<ALfnTileStore.WriteResult> aCallback)
Puts binary user data in this Tile Store with a given key.
|
TLfnVectorAssetMetadata |
putVectorAssetMetadata(TLfnVectorAssetMetadata aMetadata)
Adds or updates an asset.
|
TLfnVectorCoverageMetadata |
putVectorCoverageMetadata(TLfnVectorCoverageMetadata aMetadata)
Adds or updates a coverage.
|
<R extends ALfnResourceMetadata> |
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.
|
String |
toString()
Returns the URI as a string representation of this Tile Store.
|
protected final ALfnTileStore fDelegate
protected ALfnTileStoreWrapper(ALfnTileStore aDelegate)
public URI getURI()
ALfnTileStore
getURI
in class ALfnTileStore
public TLfnTileStoreCapabilities getCapabilities() throws IOException, TLfnServiceException
ALfnTileStore
The capabilities provide the Tile Store metadata and the supported operations. The operations are defined as constants on this class.
getCapabilities
in class ALfnTileStore
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failurepublic TLfnTileStoreMetadata getMetadata() throws IOException, TLfnServiceException
ALfnTileStore
Returns the metadata of this Tile Store.
Short for
getCapabilities().getMetadata()
getMetadata
in class ALfnTileStore
IOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failurepublic void putMetadata(TLfnTileStoreMetadata aTileStoreMetadata) throws IOException, TLfnServiceException
ALfnTileStore
Updates the metadata of this Tile Store.
putMetadata
in class ALfnTileStore
aTileStoreMetadata
- The new metadata for this Tile StoreIOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failurepublic ALfnCoverage getCoverage(String aID) throws IOException, TLfnServiceException
ALfnTileStore
ALfnTileStore.getCoverageIds()
ALfnTileStore.query(ILfnQueryHandler, TLfnQuery)
and get the ID from the metadatagetCoverage
in class ALfnTileStore
aID
- the ID of the desired coveragenull
if it does not existIOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failureALfnCoverage
public ALfnAsset getAsset(String aID) throws IOException, TLfnServiceException
ALfnTileStore
query(ELfnResourceType.ASSET)
and get the ID from the metadataALfnTileStore.query(ILfnQueryHandler, TLfnQuery)
and get the ID from the metadatagetAsset
in class ALfnTileStore
aID
- the ID of the desired assetnull
if it does not existIOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failurepublic ALfnTheme getTheme(String aID) throws IOException, TLfnServiceException
ALfnTileStore
query(ELfnResourceType.THEME)
and get the ID from the metadataALfnTileStore.query(ILfnQueryHandler, TLfnQuery)
and get the ID from the metadatagetTheme
in class ALfnTileStore
aID
- the ID of the desired themenull
if it does not existIOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failurepublic <T extends ALfnResourceMetadata> T getResourceMetadata(String aID) throws IOException, TLfnServiceException
ALfnTileStore
This implementation throws UnsupportedOperationException
.
Subclasses should override it to do something useful.
getResourceMetadata
in interface ILfnResourceMetadataResolver
getResourceMetadata
in class ALfnTileStore
aID
- the ID of the desired resourcenull
if it does not existIOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failurepublic <T extends ALfnResourceMetadata> T putResourceMetadata(T aMetadata) throws IOException, TLfnServiceException
ALfnTileStore
TLfnServiceException
exception will be thrown.
This implementation throws UnsupportedOperationException
.
Subclasses should override it to do something useful.
putResourceMetadata
in class ALfnTileStore
aMetadata
- the metadata describing the resource to be putIOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure or conflictpublic TLfnThemeMetadata getThemeMetadata(String aID) throws IOException, TLfnServiceException
ALfnTileStore
ALfnTileStore.getResourceMetadata(String)
, which is suitable for most subclasses.getThemeMetadata
in class ALfnTileStore
aID
- the ID of the desired themenull
if it does not existIOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failurepublic TLfnThemeMetadata putThemeMetadata(TLfnThemeMetadata aMetadata) throws IOException, TLfnServiceException
ALfnTileStore
TLfnServiceException
exception will be thrown.
This implementation delegates to ALfnTileStore.putResourceMetadata(com.luciad.fusion.tilestore.metadata.ALfnResourceMetadata)
, which is suitable for most subclasses.
putThemeMetadata
in class ALfnTileStore
aMetadata
- the metadata describing the theme to be putIOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failure or conflictpublic TLfnRasterCoverageMetadata getRasterCoverageMetadata(String aID) throws IOException, TLfnServiceException
ALfnTileStore
ALfnTileStore.getResourceMetadata(String)
, which is suitable for most subclasses.getRasterCoverageMetadata
in class ALfnTileStore
aID
- the ID of the desired raster coveragenull
if it does not existIOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failurepublic TLfnRasterCoverageMetadata putRasterCoverageMetadata(TLfnRasterCoverageMetadata aMetadata) throws IOException, TLfnServiceException
ALfnTileStore
TLfnServiceException
This implementation delegates to ALfnTileStore.putResourceMetadata(com.luciad.fusion.tilestore.metadata.ALfnResourceMetadata)
, which is suitable for most subclasses.
putRasterCoverageMetadata
in class ALfnTileStore
aMetadata
- the metadata describing the coverage to be putIOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failurepublic TLfnVectorCoverageMetadata getVectorCoverageMetadata(String aID) throws IOException, TLfnServiceException
ALfnTileStore
ALfnTileStore.getResourceMetadata(String)
, which is suitable for most subclasses.getVectorCoverageMetadata
in class ALfnTileStore
aID
- the ID of the vector coveragenull
if it does not existIOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failurepublic TLfnVectorCoverageMetadata putVectorCoverageMetadata(TLfnVectorCoverageMetadata aMetadata) throws IOException, TLfnServiceException
ALfnTileStore
TLfnServiceException
This implementation delegates to ALfnTileStore.putResourceMetadata(com.luciad.fusion.tilestore.metadata.ALfnResourceMetadata)
, which is suitable for most subclasses.
putVectorCoverageMetadata
in class ALfnTileStore
aMetadata
- the metadata describing the coverage to be putIOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failurepublic TLfnRasterAssetMetadata getRasterAssetMetadata(String aID) throws IOException, TLfnServiceException
ALfnTileStore
ALfnTileStore.getResourceMetadata(String)
, which is suitable for most subclasses.getRasterAssetMetadata
in class ALfnTileStore
aID
- the ID of the desired raster assetnull
if it does not existIOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failurepublic TLfnRasterAssetMetadata putRasterAssetMetadata(TLfnRasterAssetMetadata aMetadata) throws IOException, TLfnServiceException
ALfnTileStore
TLfnServiceException
.
This implementation delegates to ALfnTileStore.putResourceMetadata(com.luciad.fusion.tilestore.metadata.ALfnResourceMetadata)
, which is suitable for most subclasses.
putRasterAssetMetadata
in class ALfnTileStore
aMetadata
- the metadata describing the asset to be putIOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failurepublic TLfnVectorAssetMetadata getVectorAssetMetadata(String aID) throws IOException, TLfnServiceException
ALfnTileStore
ALfnTileStore.getResourceMetadata(String)
, which is suitable for most subclasses.getVectorAssetMetadata
in class ALfnTileStore
aID
- the ID of the desired vector assetnull
if it does not existIOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failurepublic TLfnVectorAssetMetadata putVectorAssetMetadata(TLfnVectorAssetMetadata aMetadata) throws IOException, TLfnServiceException
ALfnTileStore
TLfnServiceException
.
This implementation delegates to ALfnTileStore.putResourceMetadata(com.luciad.fusion.tilestore.metadata.ALfnResourceMetadata)
, which is suitable for most subclasses.
putVectorAssetMetadata
in class ALfnTileStore
aMetadata
- the metadata describing the asset to be putIOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failurepublic boolean deleteResource(String aID) throws IOException, TLfnServiceException
ALfnTileStore
deleteResource
in class ALfnTileStore
aID
- the ID of a resource to be deletedtrue
if the resource has been deleted, false
if the resource does not existIOException
- in case of an I/O failureTLfnServiceException
- in case of a service processing failurepublic Future<?> query(ILfnQueryHandler aHandler, TLfnQuery aQuery)
ALfnTileStore
query
in class ALfnTileStore
aHandler
- the handler for the resultsaQuery
- the query to be performedpublic List<String> getCoverageIds()
ALfnTileStore
ALfnTileStore.query(ILfnQueryHandler, TLfnQuery)
.
Any checked exceptions on the asynchronous handler will be wrapped in a RuntimeException
.getCoverageIds
in class ALfnTileStore
null
public <R extends ALfnResourceMetadata> List<R> query(ELfnResourceType aResourceType)
ALfnTileStore
ALfnTileStore.query(ILfnQueryHandler, TLfnQuery)
.
Any checked exceptions on the asynchronous handler will be wrapped in a RuntimeException
.query
in class ALfnTileStore
R
- the expected resource type, which must not be null
null
public Future<ALfnTileStore.WriteResult> putUserData(String aKey, ReadableByteChannel aSource, ILfnCallback<ALfnTileStore.WriteResult> aCallback)
ALfnTileStore
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 a handler
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.
putUserData
in class ALfnTileStore
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 be null
.ALfnTileStore.WriteResult.PUT
if data
with the given key already existed,
ALfnTileStore.WriteResult.CREATED
if it is new.public Future<ALfnTileStore.ReadResult> getUserData(String aKey, WritableByteChannel aSink, ILfnCallback<ALfnTileStore.ReadResult> aCallback)
ALfnTileStore
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 a handler
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.
getUserData
in class ALfnTileStore
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 be null
.ALfnTileStore.ReadResult.FOUND
if
data with the given key exists, ALfnTileStore.Result.Code.NOT_FOUND
otherwise.public Future<ALfnTileStore.WriteResult> deleteUserData(String aKey, ILfnCallback<ALfnTileStore.WriteResult> aCallback)
ALfnTileStore
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 a handler
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.
deleteUserData
in class ALfnTileStore
aKey
- A key associated with the user data.aCallback
- A callback that will be invoked when the operation is finished. May be null
.ALfnTileStore.WriteResult.DELETED
if
data existed, ALfnTileStore.WriteResult.NOT_FOUND
otherwise.public String toString()
ALfnTileStore
toString
in class ALfnTileStore
public void close() throws IOException
ALfnTileStore
close
in interface Closeable
close
in interface AutoCloseable
close
in class ALfnTileStore
IOException
- in case of an I/O failure