Class DefaultCoverageAccess
- All Implemented Interfaces:
CoverageAccess
- Direct Known Subclasses:
DefaultFileCoverageAccess
CoverageAccess
.- Author:
- Simone Giannecchini, GeoSolutions SAS
-
Nested Class Summary
Nested classes/interfaces inherited from interface CoverageAccess
CoverageAccess.AccessType
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final EnumSet<CoverageAccess.AccessType>
protected final Map<String,
Serializable> protected final Driver
Driver used to create this CoverageAccess. -
Constructor Summary
ConstructorsConstructorDescriptionDefaultCoverageAccess
(Driver driver, EnumSet<CoverageAccess.AccessType> allowedAccessTypes, Map<String, Parameter<?>> accessParams, Map<String, Serializable> connectionParameters) -
Method Summary
Modifier and TypeMethodDescriptionaccess
(Name name, Map<String, Serializable> params, CoverageAccess.AccessType accessType, Hints hints, ProgressListener listener) Retrieve aCoverageSource
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 aCoverageStore
referred by Name, with the specified set of parameters.boolean
Test to see if this coverage access is suitable for deleting aCoverageSource
referred by Name, with the specified set of parameters.create
(Name name, Map<String, Serializable> params, Hints hints, ProgressListener listener) Create aCoverageStore
with the specified name.boolean
Asks thisCoverageAccess
to entirely remove a certain Coverage from the availableCoverageSource
s.void
dispose()
This will free any cached info object or header information.getAccessParameterInfo
(CoverageAccess.AccessType accessType) Describes the required (and optional) parameters that can be used to open aCoverageSource
.Retrieves the parameters used to connect to this live instance ofCoverageAccess
.int
getCoveragesNumber
(ProgressListener listener) The number of Coverages made available.Returns theDriver
which has been used to connect to this CoverageAccess.getInfo
(ProgressListener listener) Description of the CoverageAccess we are connected to here.getNames
(ProgressListener listener) Names of the available Coverages.getStorageMetadata
(String metadataDomain) boolean
Tells me whether or not thisCoverageAccess
supports creation of a new coverage storage.boolean
Tells me whether or not thisCoverageAccess
supports removal of an existing coverage storage.
-
Field Details
-
driver
Driver used to create this CoverageAccess. -
allowedAccessTypes
-
accessParameters
-
connectionParameters
-
names
-
-
Constructor Details
-
DefaultCoverageAccess
public DefaultCoverageAccess(Driver driver, EnumSet<CoverageAccess.AccessType> allowedAccessTypes, Map<String, Parameter<?>> accessParams, Map<String, Serializable> connectionParameters)
-
-
Method Details
-
access
public CoverageSource access(Name name, Map<String, Serializable> params, CoverageAccess.AccessType accessType, Hints hints, ProgressListener listener) throws IOExceptionDescription copied from interface:CoverageAccess
Retrieve aCoverageSource
to access a Named Coverage.- Specified by:
access
in interfaceCoverageAccess
- Parameters:
name
- Indicate the coverage to accessparams
- Additional parameters as needed to indicate what part of the data set to accessaccessType
- Requested level of accesshints
- Implementation specific hints; please review the javadocs for your Driver for detailslistener
- used to report progress while obtianing access- Throws:
IOException
-
canCreate
public boolean canCreate(Name name, Map<String, Serializable> params, Hints hints, ProgressListener listener) throws IOExceptionDescription copied from interface:CoverageAccess
Test to see if this coverage access is suitable for creating aCoverageStore
referred by Name, with the specified set of parameters.This method will only return true if getSupportedAccessTypes() == READ_WRITE.
- Specified by:
canCreate
in interfaceCoverageAccess
- Parameters:
name
- The name of the data set to createparams
- Indicate the content to be createdhints
- Implementations specific Hints, please check the javadocs for your driver for details- Returns:
- true if a coverage can be created
- Throws:
IOException
-
canDelete
public boolean canDelete(Name name, Map<String, Serializable> params, Hints hints) throws IOExceptionDescription copied from interface:CoverageAccess
Test to see if this coverage access is suitable for deleting aCoverageSource
referred by Name, with the specified set of parameters.- Specified by:
canDelete
in interfaceCoverageAccess
- Parameters:
name
- Name of data set to remove fromparams
- Used to indicate what what of the data set to remove; ifnull
indicate the entire data set should be removedhints
- Implementation specific Hints; please consult the javadocs for the Driver you are working with.- Throws:
IOException
-
create
public CoverageStore create(Name name, Map<String, Serializable> params, Hints hints, ProgressListener listener) throws IOExceptionDescription copied from interface:CoverageAccess
Create aCoverageStore
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 allowCoverageStore
creation.- Specified by:
create
in interfaceCoverageAccess
- Parameters:
name
- The name of the data set to createparams
- Indicate the content to be createdhints
- Implementations specific Hints, please check the javadocs for your driver for details- Throws:
IOException
-
delete
Description copied from interface:CoverageAccess
Asks thisCoverageAccess
to entirely remove a certain Coverage from the availableCoverageSource
s.Many file based formats won't allow to perform such operation, but db based source should be quite happy with it.
- Specified by:
delete
in interfaceCoverageAccess
- Returns:
true
in case of success.- Throws:
IOException
-
getAccessParameterInfo
Description copied from interface:CoverageAccess
Describes the required (and optional) parameters that can be used to open aCoverageSource
.- Specified by:
getAccessParameterInfo
in interfaceCoverageAccess
- Returns:
- Param a
Map
describing theMap
for#connect(Map)
.
-
getConnectParameters
Description copied from interface:CoverageAccess
Retrieves the parameters used to connect to this live instance ofCoverageAccess
.- Specified by:
getConnectParameters
in interfaceCoverageAccess
- Returns:
- the parameters used to connect to this live instance of
CoverageAccess
.
-
getCoveragesNumber
Description copied from interface:CoverageAccess
The number of Coverages made available.- Specified by:
getCoveragesNumber
in interfaceCoverageAccess
- Returns:
- getNames( listener ).size()
-
getInfo
Description copied from interface:CoverageAccess
Description of the CoverageAccess we are connected to here.- Specified by:
getInfo
in interfaceCoverageAccess
- Returns:
- Description of the CoverageAccess we are connected to here.
-
getNames
Description copied from interface:CoverageAccess
Names of the available Coverages.Each Coverage named here represents a unique data product that may be accessed via the CoverageSource
- Specified by:
getNames
in interfaceCoverageAccess
- Returns:
- Names of the available contents.
-
getStorageMetadata
- Specified by:
getStorageMetadata
in interfaceCoverageAccess
-
getStorageMetadataDomains
- Specified by:
getStorageMetadataDomains
in interfaceCoverageAccess
-
getSupportedAccessTypes
Description copied from interface:CoverageAccess
- Specified by:
getSupportedAccessTypes
in interfaceCoverageAccess
- Returns:
- the
Set
of supportedCoverageAccess.AccessType
s for thisCoverageAccess
instance.
-
isCreateSupported
public boolean isCreateSupported()Description copied from interface:CoverageAccess
Tells me whether or not thisCoverageAccess
supports creation of a new coverage storage.This method will only return true if getSupportedAccessTypes() == READ_WRITE.
- Specified by:
isCreateSupported
in interfaceCoverageAccess
- Returns:
true
when removal of of a new coverage storage is supported,false
otherwise.
-
isDeleteSupported
public boolean isDeleteSupported()Description copied from interface:CoverageAccess
Tells me whether or not thisCoverageAccess
supports removal of an existing coverage storage.- Specified by:
isDeleteSupported
in interfaceCoverageAccess
- Returns:
true
when removal of an existing coverage storage is supported,false
otherwise.
-
getDriver
Description copied from interface:CoverageAccess
Returns theDriver
which has been used to connect to this CoverageAccess.- Specified by:
getDriver
in interfaceCoverageAccess
- Returns:
Driver
used to connect
-
dispose
public void dispose()Description copied from interface:CoverageAccess
This will free any cached info object or header information.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.- Specified by:
dispose
in interfaceCoverageAccess
-