Package org.geotools.gce.imagemosaic
Class ImageMosaicEventHandlers
- Object
- 
- ImageMosaicEventHandlers
 
- 
 public class ImageMosaicEventHandlers extends Object Base class to handle events- Author:
- carlo cancellieri - GeoSolutions SAS
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classImageMosaicEventHandlers.CompletionEventEvent launched when processing completesstatic classImageMosaicEventHandlers.ExceptionEventEvent launched when an exception occurs.static classImageMosaicEventHandlers.FileProcessingEventA special ProcessingEvent raised when a file has completed/failed ingestionstatic classImageMosaicEventHandlers.ProcessingEventstatic classImageMosaicEventHandlers.ProcessingEventListenerprotected static classImageMosaicEventHandlers.ProgressEventDispatchThreadEventLauncherPrivate Class which simply fires the events using a copy of the listeners list in order to avoid problems with listeners that remove themselves or are removed by someone elsestatic classImageMosaicEventHandlers.URIProcessingEventA special ProcessingEvent raised when a url has completed/failed ingestionstatic classImageMosaicEventHandlers.URLProcessingEventA special ProcessingEvent raised when a url has completed/failed ingestion
 - 
Field SummaryFields Modifier and Type Field Description protected List<ImageMosaicEventHandlers.ProcessingEventListener>notificationListenersList containing all the objects that want to be notified during processing.protected booleansendDelayedMessagesSet this to false for command line UIs where the delayed event sending may prevent some messages to be seen before the tool exits, to true for real GUI where you don't want the processing to be blocked too long, or when you have slow listeners in general.
 - 
Constructor SummaryConstructors Constructor Description ImageMosaicEventHandlers()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProcessingEventListener(ImageMosaicEventHandlers.ProcessingEventListener listener)Adding a listener to theImageMosaicEventHandlers.ProcessingEventListeners' list.protected voidfireCompleted()Sends the indexing completion eventprotected voidfireEvent(Level level, String inMessage, double percentage)Firing an event to listeners in order to inform them about what we are doing and about the percentage of work already carried out.protected voidfireException(Exception ex)Firing an exception event to listeners in order to inform them that processing broke and we can no longer proceed.protected voidfireFileEvent(Level level, File file, boolean ingested, String inMessage, double percentage)Firing an event to listeners in order to inform them about what we are doing and about the percentage of work already carried out.protected voidfireURIEvent(Level level, URI uri, boolean ingested, String inMessage, double percentage)Firing an event to listeners in order to inform them about what we are doing and about the percentage of work already carried out.protected voidfireUrlEvent(Level level, URL url, boolean ingested, String inMessage, double percentage)Firing an event to listeners in order to inform them about what we are doing and about the percentage of work already carried out.booleanisSendDelayedMessages()voidremoveAllProcessingEventListeners()Removing all the listeners.voidremoveProcessingEventListener(ImageMosaicEventHandlers.ProcessingEventListener listener)Removing aImageMosaicEventHandlers.ProcessingEventListenerfrom the listeners' list.voidsetSendDelayedMessages(boolean sendDelayedMessages)
 
- 
- 
- 
Field Detail- 
notificationListenersprotected List<ImageMosaicEventHandlers.ProcessingEventListener> notificationListeners List containing all the objects that want to be notified during processing.
 - 
sendDelayedMessagesprotected boolean sendDelayedMessages Set this to false for command line UIs where the delayed event sending may prevent some messages to be seen before the tool exits, to true for real GUI where you don't want the processing to be blocked too long, or when you have slow listeners in general.
 
- 
 - 
Method Detail- 
addProcessingEventListenerpublic final void addProcessingEventListener(ImageMosaicEventHandlers.ProcessingEventListener listener) Adding a listener to theImageMosaicEventHandlers.ProcessingEventListeners' list.- Parameters:
- listener- to add to the list of listeners.
 
 - 
fireEventprotected void fireEvent(Level level, String inMessage, double percentage) Firing an event to listeners in order to inform them about what we are doing and about the percentage of work already carried out.- Parameters:
- inMessage- The message to show.
- percentage- The percentage for the process.
 
 - 
fireFileEventprotected void fireFileEvent(Level level, File file, boolean ingested, String inMessage, double percentage) Firing an event to listeners in order to inform them about what we are doing and about the percentage of work already carried out.- Parameters:
- inMessage- The message to show.
- percentage- The percentage for the process.
 
 - 
fireUrlEventprotected void fireUrlEvent(Level level, URL url, boolean ingested, String inMessage, double percentage) Firing an event to listeners in order to inform them about what we are doing and about the percentage of work already carried out.- Parameters:
- inMessage- The message to show.
- percentage- The percentage for the process.
 
 - 
fireURIEventprotected void fireURIEvent(Level level, URI uri, boolean ingested, String inMessage, double percentage) Firing an event to listeners in order to inform them about what we are doing and about the percentage of work already carried out.- Parameters:
- inMessage- The message to show.
- percentage- The percentage for the process.
 
 - 
fireExceptionprotected void fireException(Exception ex) Firing an exception event to listeners in order to inform them that processing broke and we can no longer proceed. This is a convenience method, it will callfireException(String, double, Exception)with the exception message and -1 as percentage.- Parameters:
- ex- the actual exception occurred
 
 - 
fireCompletedprotected void fireCompleted() Sends the indexing completion event
 - 
isSendDelayedMessagespublic boolean isSendDelayedMessages() 
 - 
setSendDelayedMessagespublic void setSendDelayedMessages(boolean sendDelayedMessages) 
 - 
removeAllProcessingEventListenerspublic void removeAllProcessingEventListeners() Removing all the listeners.
 - 
removeProcessingEventListenerpublic void removeProcessingEventListener(ImageMosaicEventHandlers.ProcessingEventListener listener) Removing aImageMosaicEventHandlers.ProcessingEventListenerfrom the listeners' list.- Parameters:
- listener-- ImageMosaicEventHandlers.ProcessingEventListenerto remove from the list of listeners.
 
 
- 
 
-