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 Summary
Nested Classes Modifier and Type Class Description static class
ImageMosaicEventHandlers.CompletionEvent
Event launched when processing completesstatic class
ImageMosaicEventHandlers.ExceptionEvent
Event launched when an exception occurs.static class
ImageMosaicEventHandlers.FileProcessingEvent
A special ProcessingEvent raised when a file has completed/failed ingestionstatic class
ImageMosaicEventHandlers.ProcessingEvent
static class
ImageMosaicEventHandlers.ProcessingEventListener
protected static class
ImageMosaicEventHandlers.ProgressEventDispatchThreadEventLauncher
Private 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 class
ImageMosaicEventHandlers.URIProcessingEvent
A special ProcessingEvent raised when a url has completed/failed ingestionstatic class
ImageMosaicEventHandlers.URLProcessingEvent
A special ProcessingEvent raised when a url has completed/failed ingestion
-
Field Summary
Fields Modifier and Type Field Description protected List<ImageMosaicEventHandlers.ProcessingEventListener>
notificationListeners
List containing all the objects that want to be notified during processing.protected 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.
-
Constructor Summary
Constructors Constructor Description ImageMosaicEventHandlers()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProcessingEventListener(ImageMosaicEventHandlers.ProcessingEventListener listener)
Adding a listener to theImageMosaicEventHandlers.ProcessingEventListener
s' list.protected void
fireCompleted()
Sends the indexing completion eventprotected 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.protected void
fireException(Exception ex)
Firing an exception event to listeners in order to inform them that processing broke and we can no longer proceed.protected 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.protected 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.protected 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.boolean
isSendDelayedMessages()
void
removeAllProcessingEventListeners()
Removing all the listeners.void
removeProcessingEventListener(ImageMosaicEventHandlers.ProcessingEventListener listener)
Removing aImageMosaicEventHandlers.ProcessingEventListener
from the listeners' list.void
setSendDelayedMessages(boolean sendDelayedMessages)
-
-
-
Field Detail
-
notificationListeners
protected List<ImageMosaicEventHandlers.ProcessingEventListener> notificationListeners
List containing all the objects that want to be notified during processing.
-
sendDelayedMessages
protected 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
-
addProcessingEventListener
public final void addProcessingEventListener(ImageMosaicEventHandlers.ProcessingEventListener listener)
Adding a listener to theImageMosaicEventHandlers.ProcessingEventListener
s' list.- Parameters:
listener
- to add to the list of listeners.
-
fireEvent
protected 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.
-
fireFileEvent
protected 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.
-
fireUrlEvent
protected 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.
-
fireURIEvent
protected 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.
-
fireException
protected 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
-
fireCompleted
protected void fireCompleted()
Sends the indexing completion event
-
isSendDelayedMessages
public boolean isSendDelayedMessages()
-
setSendDelayedMessages
public void setSendDelayedMessages(boolean sendDelayedMessages)
-
removeAllProcessingEventListeners
public void removeAllProcessingEventListeners()
Removing all the listeners.
-
removeProcessingEventListener
public void removeProcessingEventListener(ImageMosaicEventHandlers.ProcessingEventListener listener)
Removing aImageMosaicEventHandlers.ProcessingEventListener
from the listeners' list.- Parameters:
listener
-ImageMosaicEventHandlers.ProcessingEventListener
to remove from the list of listeners.
-
-