Class InvDatasetFeatureCollection

  • All Implemented Interfaces:
    Closeable, AutoCloseable
    Direct Known Subclasses:
    InvDatasetFcFmrc, InvDatasetFcGrib, InvDatasetFcPoint

    @ThreadSafe
    public abstract class InvDatasetFeatureCollection
    extends Object
    implements Closeable
    Abstract superclass for Feature Collection Datasets. This is a InvCatalogRef subclass. So the reference is placed in the parent, but the catalog itself isnt constructed until the following call from DataRootHandler.makeDynamicCatalog(): match.dataRoot.featCollection.makeCatalog(match.remaining, path, baseURI);

    The DatasetFeatureCollection object is held in the DataRootManager's FeatureCollectionCache; it may get closed and recreated.

    Since:
    Mar 3, 2010
    • Field Detail

      • useNetcdfJavaBuilders

        protected static final boolean useNetcdfJavaBuilders
        See Also:
        Constant Field Values
      • contextName

        protected static String contextName
      • parent

        protected thredds.server.catalog.FeatureCollectionRef parent
      • orgService

        protected thredds.client.catalog.Service orgService
      • virtualService

        protected thredds.client.catalog.Service virtualService
      • latestService

        protected thredds.client.catalog.Service latestService
      • downloadService

        protected thredds.client.catalog.Service downloadService
      • name

        protected final String name
      • configPath

        protected final String configPath
      • fcType

        protected final thredds.featurecollection.FeatureCollectionType fcType
      • config

        protected final thredds.featurecollection.FeatureCollectionConfig config
      • topDirectory

        protected String topDirectory
      • datasetCollection

        protected thredds.inventory.MFileCollectionManager datasetCollection
      • first

        protected boolean first
      • lock

        protected final Object lock
    • Constructor Detail

      • InvDatasetFeatureCollection

        protected InvDatasetFeatureCollection​(thredds.server.catalog.FeatureCollectionRef parent,
                                              thredds.featurecollection.FeatureCollectionConfig config)
    • Method Detail

      • setContextName

        public static void setContextName​(String c)
      • setAllowedServices

        public static void setAllowedServices​(AllowedServices _allowedServices)
      • buildCatalogServiceHref

        protected static String buildCatalogServiceHref​(String path)
      • factory

        public static InvDatasetFeatureCollection factory​(thredds.server.catalog.FeatureCollectionRef parent,
                                                          thredds.featurecollection.FeatureCollectionConfig config)
      • makeDefaultServices

        protected void makeDefaultServices()
      • makeCollection

        protected void makeCollection()
      • processEvent

        public void processEvent​(thredds.inventory.CollectionUpdateEvent event)
      • showStatus

        public void showStatus​(Formatter f)
      • showStatusShort

        public String showStatusShort​(String type)
      • getPath

        protected String getPath()
      • getCatalogHref

        protected String getCatalogHref​(String what)
      • firstInit

        protected void firstInit()
      • update

        protected void update​(thredds.inventory.CollectionUpdateType force)
                       throws IOException
        Collection was changed, update internal objects. called by CollectionUpdater, trigger via handleCollectionEvent, so in a quartz scheduler thread
        Parameters:
        force - update type
        Throws:
        IOException
      • getName

        public String getName()
      • getConfigPath

        public String getConfigPath()
      • getLatestFileName

        public String getLatestFileName()
      • getTopDirectoryLocation

        public String getTopDirectoryLocation()
      • getConfig

        public thredds.featurecollection.FeatureCollectionConfig getConfig()
      • getDatasetCollectionManager

        public thredds.inventory.MCollection getDatasetCollectionManager()
      • getLogger

        public org.slf4j.Logger getLogger()
      • makeFullName

        protected String makeFullName​(thredds.client.catalog.DatasetNode ds)
      • makeCatalog

        public abstract thredds.client.catalog.builder.CatalogBuilder makeCatalog​(String match,
                                                                                  String orgPath,
                                                                                  URI catURI)
                                                                           throws IOException
        Get one of the catalogs contained in this collection, called by DataRootHandler.makeDynamicCatalog()
        Parameters:
        match - match.remaining
        orgPath - the path for the request.
        catURI - the base URI for the catalog to be made, used to resolve relative URLs.
        Returns:
        containing catalog
        Throws:
        IOException
      • makeCatalogTop

        protected thredds.client.catalog.builder.CatalogBuilder makeCatalogTop​(URI catURI,
                                                                               InvDatasetFeatureCollection.State localState)
                                                                        throws IOException,
                                                                               URISyntaxException
        Make the containing catalog of this feature collection "http://server:port/thredds/catalog/path/catalog.xml"
        Parameters:
        catURI - base URI of the request
        localState - current state to use
        Returns:
        the top FMRC catalog
        Throws:
        IOException - on I/O error
        URISyntaxException - if path is misformed
      • makeMetadataLink

        protected String makeMetadataLink​(String datasetName,
                                          String metadata)
      • makeUriResolved

        protected thredds.client.catalog.ThreddsMetadata.UriResolved makeUriResolved​(URI baseURI,
                                                                                     String href)
      • getPointDataset

        public ucar.nc2.ft.FeatureDatasetPoint getPointDataset​(String matchPath)
                                                        throws IOException
        Get the associated Point Dataset, if any. called by DatasetHandler.openPointDataset()
        Parameters:
        matchPath - match.remaining
        Returns:
        Grid Dataset, or null if n/a
        Throws:
        IOException - on error
      • getGridDataset

        public ucar.nc2.dt.grid.GridDataset getGridDataset​(String matchPath)
                                                    throws IOException
        Get the associated Grid Dataset, if any. called by DatasetHandler.openGridDataset()
        Parameters:
        matchPath - match.remaining
        Returns:
        Grid Dataset, or null if n/a
        Throws:
        IOException - on error
      • getGridCoverage

        public ucar.nc2.ft2.coverage.CoverageCollection getGridCoverage​(String matchPath)
                                                                 throws IOException
        Throws:
        IOException
      • getSimpleGeometryDataset

        public ucar.nc2.ft2.simpgeometry.SimpleGeometryFeatureDataset getSimpleGeometryDataset​(String matchPath)
                                                                                        throws IOException
        Throws:
        IOException
      • getNetcdfDataset

        public ucar.nc2.dataset.NetcdfDataset getNetcdfDataset​(String matchPath)
                                                        throws IOException
        Get the dataset named by the path. called by DatasetHandler.getNetcdfFile()
        Parameters:
        matchPath - remaining path from match
        Returns:
        requested dataset
        Throws:
        IOException - if read error
      • getFile

        public File getFile​(String remaining)