Class DefaultCoverageAccess

    • Field Detail

      • driver

        protected final Driver driver
        Driver used to create this CoverageAccess.
      • accessParameters

        protected final Map<String,​Parameter<?>> accessParameters
      • connectionParameters

        protected final Map<String,​Serializable> connectionParameters
      • names

        protected List<Name> names
    • Constructor Detail

      • DefaultCoverageAccess

        public DefaultCoverageAccess​(Driver driver,
                                     EnumSet<CoverageAccess.AccessType> allowedAccessTypes,
                                     Map<String,​Parameter<?>> accessParams,
                                     Map<String,​Serializable> connectionParameters)
    • Method Detail

      • access

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

        Specified by:
        access in interface CoverageAccess
        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
      • canCreate

        public boolean canCreate​(Name name,
                                 Map<String,​Serializable> params,
                                 Hints hints,
                                 ProgressListener listener)
                          throws IOException
        Description copied from interface: CoverageAccess
        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.

        Specified by:
        canCreate in interface CoverageAccess
        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
      • canDelete

        public boolean canDelete​(Name name,
                                 Map<String,​Serializable> params,
                                 Hints hints)
                          throws IOException
        Description copied from interface: CoverageAccess
        Test to see if this coverage access is suitable for deleting a CoverageSource referred by Name, with the specified set of parameters.
        Specified by:
        canDelete in interface CoverageAccess
        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
      • create

        public CoverageStore create​(Name name,
                                    Map<String,​Serializable> params,
                                    Hints hints,
                                    ProgressListener listener)
                             throws IOException
        Description copied from interface: CoverageAccess
        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.

        Specified by:
        create in interface CoverageAccess
        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:
        IOException
      • delete

        public boolean delete​(Name name,
                              Map<String,​Serializable> params,
                              Hints hints)
                       throws IOException
        Description copied from interface: CoverageAccess
        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.

        Specified by:
        delete in interface CoverageAccess
        Returns:
        true in case of success.
        Throws:
        IOException
      • getNames

        public List<Name> getNames​(ProgressListener listener)
        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 interface CoverageAccess
        Returns:
        Names of the available contents.
      • isCreateSupported

        public boolean isCreateSupported()
        Description copied from interface: CoverageAccess
        Tells me whether or not this CoverageAccess supports creation of a new coverage storage.

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

        Specified by:
        isCreateSupported in interface CoverageAccess
        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 this CoverageAccess supports removal of an existing coverage storage.
        Specified by:
        isDeleteSupported in interface CoverageAccess
        Returns:
        true when removal of an existing coverage storage is supported, false otherwise.
      • 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 interface CoverageAccess