Package org.geotools.imageio.netcdf
Class AncillaryFileManager
Object
AncillaryFileManager
- All Implemented Interfaces:
FileSetManager
A class used to store any auxiliary indexing information such as the low level indexer definition as well as the
datastore properties configuration specifying where to build that index.
Since 14.x is it also possible to store the catalog into a PostGis based DB
- Author:
- Daniele Romagnoli, GeoSolutions SAS
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAncillaryFileManager
(File netcdfFile, String indexFilePath) AncillaryFileManager
(File netcdfFile, String indexFilePath, String datastoreFilePath) -
Method Summary
Modifier and TypeMethodDescriptionboolean
acceptsVariable
(String varName) addCoverage
(String varName) void
Add a file to the file set managervoid
addSlice
(Slice2DIndex variableIndex) static void
Clear the parsed configs (datastore and indexer) cachestatic String
convertToHex
(byte[] data) void
dispose()
Dispose the ManagergetCoverageName
(String varName) Return aName
representation of the coverage nameGet the list of Names for the underlying coverage listCreate theDataStoreConfiguration
using the external datastoreIndexFile if provided, or the H2 based default.getParameter
(String parameterKey) boolean
getParameterAsBoolean
(String parameterKey) getSlice2DIndex
(int imageIndex) Return aSlice2DIndex
related to the provided imageIndexgetTypeName
(String coverageName) Returns the schema definition name for a given coverage (the schema definition name is not normally used in the database, which uses the coverage name instead)protected void
Retrieve basic indexer properties by scanning the indexer XML instance.void
boolean
list()
Return the list of all the files currently added to the managervoid
purge()
Remove all the files from the manager (An implementation may also physically remove all the files)void
removeFile
(String filePath) Remove a file from the manager (An implementation may also physically remove the file)void
setSchema
(Indexer.Coverages.Coverage coverage, String schemaName, String schemaDef) Add the default schema to this coveragevoid
Write indexer to disk
-
Field Details
-
INDEXER_CACHE
-
DATASTORE_CONFIG_CACHE
-
-
Constructor Details
-
AncillaryFileManager
public AncillaryFileManager(File netcdfFile, String indexFilePath) throws IOException, JAXBException, NoSuchAlgorithmException - Throws:
IOException
JAXBException
NoSuchAlgorithmException
-
AncillaryFileManager
public AncillaryFileManager(File netcdfFile, String indexFilePath, String datastoreFilePath) throws IOException, JAXBException, NoSuchAlgorithmException - Throws:
IOException
JAXBException
NoSuchAlgorithmException
-
-
Method Details
-
writeToDisk
Write indexer to diskTODO: Need to check for thread safety
- Throws:
IOException
JAXBException
-
getCoverageName
Return aName
representation of the coverage name -
dispose
public void dispose()Dispose the Manager -
getSlice2DIndex
Return aSlice2DIndex
related to the provided imageIndex- Throws:
IOException
-
getSlicesIndexFile
-
getIndexerFile
-
getDestinationDir
-
getDatastoreIndexFile
-
addSlice
-
addCoverage
-
initSliceManager
- Throws:
IOException
-
resetSliceManager
- Throws:
IOException
-
getCoveragesNames
Get the list of Names for the underlying coverage list -
initIndexer
protected void initIndexer() throws JAXBExceptionRetrieve basic indexer properties by scanning the indexer XML instance.- Throws:
JAXBException
-
getTypeName
Returns the schema definition name for a given coverage (the schema definition name is not normally used in the database, which uses the coverage name instead) -
setSchema
Add the default schema to this coverage -
acceptsVariable
-
isImposedSchema
public boolean isImposedSchema() -
addFile
Description copied from interface:FileSetManager
Add a file to the file set manager- Specified by:
addFile
in interfaceFileSetManager
-
list
Description copied from interface:FileSetManager
Return the list of all the files currently added to the manager- Specified by:
list
in interfaceFileSetManager
-
removeFile
Description copied from interface:FileSetManager
Remove a file from the manager (An implementation may also physically remove the file)- Specified by:
removeFile
in interfaceFileSetManager
-
purge
public void purge()Description copied from interface:FileSetManager
Remove all the files from the manager (An implementation may also physically remove all the files)- Specified by:
purge
in interfaceFileSetManager
-
convertToHex
-
getDatastoreConfiguration
Create theDataStoreConfiguration
using the external datastoreIndexFile if provided, or the H2 based default.- Throws:
IOException
-
getParameter
-
getParameterAsBoolean
-
clearCache
public static void clearCache()Clear the parsed configs (datastore and indexer) cache
-