Package org.geotools.gce.imagemosaic
Class ImageMosaicDirectoryWalker
Object
ImageMosaicDirectoryWalker
- All Implemented Interfaces:
Runnable
This class is in responsible for creating the index for a mosaic of images that we want to tie together as a single
coverage.
- Author:
- Simone Giannecchini, GeoSolutions, Carlo Cancellieri - GeoSolutions SAS
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ImageMosaicConfigHandlerprotected intindex of the element being processedprotected final ImageMosaicEventHandlersprotected intNumber of elements to process.protected booleanProper way to stop a thread is not by calling Thread.stop() but by using a shared variable that can be checked in order to notify a terminating condition.protected DefaultTransaction -
Constructor Summary
ConstructorsConstructorDescriptionImageMosaicDirectoryWalker(ImageMosaicConfigHandler catalogHandler, ImageMosaicEventHandlers eventHandler) ImageMosaicDirectoryWalker(ImageMosaicConfigHandler configHandler, ImageMosaicEventHandlers eventHandler, IOFileFilter filter) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanvoidvoidintintbooleangetStop()voidvoidrun()run the directory walkervoidsetElementIndex(int elementIndex) voidsetNumElements(int numElements) voidWarn this walker that we skip the provided pathvoidCreate a transaction for being used in this walkervoidstop()
-
Field Details
-
transaction
-
stop
protected volatile boolean stopProper way to stop a thread is not by calling Thread.stop() but by using a shared variable that can be checked in order to notify a terminating condition. -
configHandler
-
eventHandler
-
elementIndex
protected int elementIndexindex of the element being processed -
numElements
protected int numElementsNumber of elements to process.
-
-
Constructor Details
-
ImageMosaicDirectoryWalker
public ImageMosaicDirectoryWalker(ImageMosaicConfigHandler configHandler, ImageMosaicEventHandlers eventHandler, IOFileFilter filter) Default constructor.Sets a filter that can reduce the file the mosaic walker will take into consideration (in a more flexible way than the wildcards)
-
ImageMosaicDirectoryWalker
public ImageMosaicDirectoryWalker(ImageMosaicConfigHandler catalogHandler, ImageMosaicEventHandlers eventHandler)
-
-
Method Details
-
run
public void run()run the directory walker -
getConfigHandler
-
getEventHandler
-
getTransaction
-
getStop
public boolean getStop() -
stop
public void stop() -
startTransaction
public void startTransaction()Create a transaction for being used in this walker -
rollbackTransaction
- Throws:
IOException
-
commitTransaction
- Throws:
IOException
-
closeTransaction
public void closeTransaction() -
checkStop
protected boolean checkStop() -
getElementIndex
public int getElementIndex()- Returns:
- the elementIndex
-
getNumElements
public int getNumElements()- Returns:
- the numElements
-
setElementIndex
public void setElementIndex(int elementIndex) - Parameters:
elementIndex- the elementIndex to set
-
setNumElements
public void setNumElements(int numElements) - Parameters:
numElements- the numElements to set
-
skip
Warn this walker that we skip the provided path- Parameters:
path- the path to the file to skip
-