public class DefaultCoverageAccess extends Object implements CoverageAccess
CoverageAccess
.CoverageAccess.AccessType
Modifier and Type | Field and Description |
---|---|
protected Map<String,Parameter<?>> |
accessParameters |
protected EnumSet<CoverageAccess.AccessType> |
allowedAccessTypes |
protected Map<String,Serializable> |
connectionParameters |
protected Driver |
driver
Driver used to create this CoverageAccess.
|
protected List<Name> |
names |
Constructor and Description |
---|
DefaultCoverageAccess(Driver driver,
EnumSet<CoverageAccess.AccessType> allowedAccessTypes,
Map<String,Parameter<?>> accessParams,
Map<String,Serializable> connectionParameters) |
Modifier and Type | Method and Description |
---|---|
CoverageSource |
access(Name name,
Map<String,Serializable> params,
CoverageAccess.AccessType accessType,
Hints hints,
ProgressListener listener)
Retrieve a
CoverageSource to access a Named Coverage. |
boolean |
canCreate(Name name,
Map<String,Serializable> params,
Hints hints,
ProgressListener listener)
Test to see if this coverage access is suitable for creating a
CoverageStore referred
by Name, with the specified set of parameters. |
boolean |
canDelete(Name name,
Map<String,Serializable> params,
Hints hints)
Test to see if this coverage access is suitable for deleting a
CoverageSource
referred by Name, with the specified set of parameters. |
CoverageStore |
create(Name name,
Map<String,Serializable> params,
Hints hints,
ProgressListener listener)
Create a
CoverageStore with the specified name. |
boolean |
delete(Name name,
Map<String,Serializable> params,
Hints hints)
Asks this
CoverageAccess to entirely remove a certain Coverage from the available
CoverageSource s. |
void |
dispose()
This will free any cached info object or header information.
|
Map<String,Parameter<?>> |
getAccessParameterInfo(CoverageAccess.AccessType accessType)
Describes the required (and optional) parameters that can be used to open a
CoverageSource . |
Map<String,Serializable> |
getConnectParameters()
Retrieves the parameters used to connect to this live instance of
CoverageAccess . |
int |
getCoveragesNumber(ProgressListener listener)
The number of Coverages made available.
|
Driver |
getDriver()
Returns the
Driver which has been used to connect to this CoverageAccess. |
ServiceInfo |
getInfo(ProgressListener listener)
Description of the CoverageAccess we are connected to here.
|
List<Name> |
getNames(ProgressListener listener)
Names of the available Coverages.
|
MetadataNode |
getStorageMetadata(String metadataDomain) |
Set<String> |
getStorageMetadataDomains() |
Set<CoverageAccess.AccessType> |
getSupportedAccessTypes()
|
boolean |
isCreateSupported()
Tells me whether or not this
CoverageAccess supports creation of a new coverage
storage. |
boolean |
isDeleteSupported()
Tells me whether or not this
CoverageAccess supports removal of an existing coverage
storage. |
protected final Driver driver
protected final EnumSet<CoverageAccess.AccessType> allowedAccessTypes
protected final Map<String,Serializable> connectionParameters
public DefaultCoverageAccess(Driver driver, EnumSet<CoverageAccess.AccessType> allowedAccessTypes, Map<String,Parameter<?>> accessParams, Map<String,Serializable> connectionParameters)
public CoverageSource access(Name name, Map<String,Serializable> params, CoverageAccess.AccessType accessType, Hints hints, ProgressListener listener) throws IOException
CoverageAccess
CoverageSource
to access a Named Coverage.
access
in interface CoverageAccess
params
- Additional parameters as needed to indicate what part of the data set to accessaccessType
- Requested level of accesslistener
- used to report progress while obtianing accessIOException
public boolean canCreate(Name name, Map<String,Serializable> params, Hints hints, ProgressListener listener) throws IOException
CoverageAccess
CoverageStore
referred
by Name, with the specified set of parameters.
This method will only return true if getSupportedAccessTypes() == READ_WRITE.
canCreate
in interface CoverageAccess
params
- Indicate the content to be createdIOException
public boolean canDelete(Name name, Map<String,Serializable> params, Hints hints) throws IOException
CoverageAccess
CoverageSource
referred by Name, with the specified set of parameters.canDelete
in interface CoverageAccess
IOException
public CoverageStore create(Name name, Map<String,Serializable> params, Hints hints, ProgressListener listener) throws IOException
CoverageAccess
CoverageStore
with the specified name.
You can check isCreateSupported() prior to calling this method. Implementing subclasses
may throw an UnsupportedOperationException
in case the related Driver won't allow
CoverageStore
creation.
create
in interface CoverageAccess
params
- Indicate the content to be createdIOException
public boolean delete(Name name, Map<String,Serializable> params, Hints hints) throws IOException
CoverageAccess
CoverageAccess
to entirely remove a certain Coverage from the available
CoverageSource
s.
Many file based formats won't allow to perform such operation, but db based source should be quite happy with it.
delete
in interface CoverageAccess
true
in case of success.IOException
public Map<String,Parameter<?>> getAccessParameterInfo(CoverageAccess.AccessType accessType)
CoverageAccess
CoverageSource
.
getAccessParameterInfo
in interface CoverageAccess
Map
describing the Map
for #connect(Map)
.public Map<String,Serializable> getConnectParameters()
CoverageAccess
CoverageAccess
.getConnectParameters
in interface CoverageAccess
CoverageAccess
.public int getCoveragesNumber(ProgressListener listener)
CoverageAccess
getCoveragesNumber
in interface CoverageAccess
public ServiceInfo getInfo(ProgressListener listener)
CoverageAccess
getInfo
in interface CoverageAccess
public List<Name> getNames(ProgressListener listener)
CoverageAccess
Each Coverage named here represents a unique data product that may be accessed via the CoverageSource
getNames
in interface CoverageAccess
public MetadataNode getStorageMetadata(String metadataDomain)
getStorageMetadata
in interface CoverageAccess
public Set<String> getStorageMetadataDomains()
getStorageMetadataDomains
in interface CoverageAccess
public Set<CoverageAccess.AccessType> getSupportedAccessTypes()
CoverageAccess
getSupportedAccessTypes
in interface CoverageAccess
Set
of supported CoverageAccess.AccessType
s for this CoverageAccess
instance.public boolean isCreateSupported()
CoverageAccess
CoverageAccess
supports creation of a new coverage
storage.
This method will only return true if getSupportedAccessTypes() == READ_WRITE.
isCreateSupported
in interface CoverageAccess
true
when removal of of a new coverage storage is supported, false
otherwise.public boolean isDeleteSupported()
CoverageAccess
CoverageAccess
supports removal of an existing coverage
storage.isDeleteSupported
in interface CoverageAccess
true
when removal of an existing coverage storage is supported,
false
otherwise.public Driver getDriver()
CoverageAccess
Driver
which has been used to connect to this CoverageAccess.getDriver
in interface CoverageAccess
Driver
used to connectpublic void dispose()
CoverageAccess
Often a CoverageAccess
will keep a file channel open, this will clean that sort of
thing up.
Once a CoverageAccess
has been disposed it can be seen as being in unspecified
state, hence calling a method on it may have unpredictable results.
dispose
in interface CoverageAccess
Copyright © 1996–2019 Geotools. All rights reserved.