Interface CoverageAccess

  • All Known Subinterfaces:
    FileCoverageAccess
    All Known Implementing Classes:
    DefaultCoverageAccess, DefaultFileCoverageAccess, NetCDFAccess

    public interface CoverageAccess
    Represents a Physical storage of coverage data (that we have a connection to).

    Please note that this service may be remote (or otherwise slow). You are doing IO here and should treat this class with respect - please do not access these methods from a display thread.

    Author:
    Simone Giannecchini, GeoSolutions, Jody Garnett
    • Method Detail

      • getDriver

        Driver getDriver()
        Returns the Driver which has been used to connect to this CoverageAccess.
        Returns:
        Driver used to connect
      • getInfo

        ServiceInfo getInfo​(ProgressListener listener)
        Description of the CoverageAccess we are connected to here.

        Returns:
        Description of the CoverageAccess we are connected to here.
      • getNames

        List<Name> getNames​(ProgressListener listener)
        Names of the available Coverages.

        Each Coverage named here represents a unique data product that may be accessed via the CoverageSource

        Returns:
        Names of the available contents.
      • getCoveragesNumber

        int getCoveragesNumber​(ProgressListener listener)
        The number of Coverages made available.
        Returns:
        getNames( listener ).size()
      • getAccessParameterInfo

        Map<String,​Parameter<?>> getAccessParameterInfo​(CoverageAccess.AccessType accessType)
        Describes the required (and optional) parameters that can be used to open a CoverageSource.

        Returns:
        Param a Map describing the Map for #connect(Map).
      • access

        CoverageSource access​(Name name,
                              Map<String,​Serializable> params,
                              CoverageAccess.AccessType accessType,
                              Hints hints,
                              ProgressListener listener)
                       throws IOException
        Retrieve a CoverageSource to access a Named Coverage.

        Parameters:
        name - Indicate the coverage to access
        params - Additional parameters as needed to indicate what part of the data set to access
        accessType - Requested level of access
        hints - Implementation specific hints; please review the javadocs for your Driver for details
        listener - used to report progress while obtianing access
        Throws:
        IOException
      • isCreateSupported

        boolean isCreateSupported()
        Tells me whether or not this CoverageAccess supports creation of a new coverage storage.

        This method will only return true if getSupportedAccessTypes() == READ_WRITE.

        Returns:
        true when removal of of a new coverage storage is supported, false otherwise.
      • canCreate

        boolean canCreate​(Name name,
                          Map<String,​Serializable> params,
                          Hints hints,
                          ProgressListener listener)
                   throws IOException
        Test to see if this coverage access is suitable for creating a CoverageStore referred by Name, with the specified set of parameters.

        This method will only return true if getSupportedAccessTypes() == READ_WRITE.

        Parameters:
        name - The name of the data set to create
        params - Indicate the content to be created
        hints - Implementations specific Hints, please check the javadocs for your driver for details
        Returns:
        true if a coverage can be created
        Throws:
        IOException
      • create

        CoverageStore create​(Name name,
                             Map<String,​Serializable> params,
                             Hints hints,
                             ProgressListener listener)
                      throws IOException
        Create a 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.

        Parameters:
        name - The name of the data set to create
        params - Indicate the content to be created
        hints - Implementations specific Hints, please check the javadocs for your driver for details
        Throws:
        IllegalStateException - if getSupportedAccessTypes() == READ_ONLY
        IOException
      • isDeleteSupported

        boolean isDeleteSupported()
        Tells me whether or not this CoverageAccess supports removal of an existing coverage storage.
        Returns:
        true when removal of an existing coverage storage is supported, false otherwise.
      • canDelete

        boolean canDelete​(Name name,
                          Map<String,​Serializable> params,
                          Hints hints)
                   throws IOException
        Test to see if this coverage access is suitable for deleting a CoverageSource referred by Name, with the specified set of parameters.
        Parameters:
        name - Name of data set to remove from
        params - Used to indicate what what of the data set to remove; if null indicate the entire data set should be removed
        hints - Implementation specific Hints; please consult the javadocs for the Driver you are working with.
        Throws:
        IOException
      • delete

        boolean delete​(Name name,
                       Map<String,​Serializable> params,
                       Hints hints)
                throws IOException
        Asks this CoverageAccess to entirely remove a certain Coverage from the available CoverageSources.

        Many file based formats won't allow to perform such operation, but db based source should be quite happy with it.

        Returns:
        true in case of success.
        Throws:
        IOException
      • getConnectParameters

        Map<String,​Serializable> getConnectParameters()
        Retrieves the parameters used to connect to this live instance of CoverageAccess.
        Returns:
        the parameters used to connect to this live instance of CoverageAccess.
      • dispose

        void dispose()
        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.

      • getStorageMetadata

        MetadataNode getStorageMetadata​(String metadataDomain)
      • getStorageMetadataDomains

        Set<String> getStorageMetadataDomains()