public class FileEventHandler extends java.lang.Object implements EventHandlerIF
| Constructor and Description |
|---|
FileEventHandler() |
| Modifier and Type | Method and Description |
|---|---|
int |
getEventCount()
Get the number of events in the queue that are ready to be processed.
|
int |
getEventCountToRetry()
Get the number of failed events in the queue that are ready to be retried.
|
MoMaLauncherTriggerEvent |
getNextEvent()
Get the next event in the queue.
|
MoMaLauncherTriggerEvent |
getNextEventToRetry()
Get the next event to retry
The implementation should only return events with a retry count < MoMaLauncher.maxRetryCount and an
event time older than now() - MoMaLauncher.RetryIntervalSeconds.
|
int |
getPermanentErrorCount()
Get the number of failed events in the queue that have reached the maximum retry count.
|
boolean |
init(java.util.Properties p)
Does the initialization.
|
void |
removeTriggerFile(MoMaLauncherTriggerEvent event) |
void |
setContext(XSDContextIF ctx)
Set the context for the event handler.
|
void |
setEventState(MoMaLauncherTriggerEvent event,
MoMaLauncherTriggerEvent.EventState state)
Set the state of an event
|
void |
setLogger(java.util.logging.Logger logger)
Pass the logger to the event handler to enable logging to the same file as the MoMaLauncher
|
void |
setMaxRetryCount(int maxRetryCount)
Set the maximum number of attempts to retry a failed event
|
void |
setMinEventAgeSeconds(int minEventAgeSeconds)
Set the number of seconds to wait before an event is processed.
|
void |
setNotConnectedSleepTime(int notConnectedSleepTime)
Set the number of seconds to wait before connection to the trigger source is retried after a disconnect.
|
void |
setRetryIntervalSeconds(int retryIntervalSeconds)
Set the number of seconds to wait before a failed event is retried.
|
public MoMaLauncherTriggerEvent getNextEvent()
EventHandlerIFgetNextEvent in interface EventHandlerIFpublic int getEventCount()
EventHandlerIFgetEventCount in interface EventHandlerIFpublic void removeTriggerFile(MoMaLauncherTriggerEvent event)
public void setEventState(MoMaLauncherTriggerEvent event, MoMaLauncherTriggerEvent.EventState state)
EventHandlerIFsetEventState in interface EventHandlerIFevent - The event to modifystate - The new statepublic boolean init(java.util.Properties p)
EventHandlerIFinit in interface EventHandlerIFp - The properties. All Properties defined for the MoMaLauncher are passed to the
EventHandlerpublic void setLogger(java.util.logging.Logger logger)
EventHandlerIFsetLogger in interface EventHandlerIFlogger - The logger defined for the MoMaLauncherpublic void setContext(XSDContextIF ctx)
EventHandlerIFsetContext in interface EventHandlerIFctx - The context used by the MoMaLauncherpublic int getEventCountToRetry()
EventHandlerIFgetEventCountToRetry in interface EventHandlerIFpublic MoMaLauncherTriggerEvent getNextEventToRetry()
EventHandlerIFgetNextEventToRetry in interface EventHandlerIFpublic void setMinEventAgeSeconds(int minEventAgeSeconds)
EventHandlerIFsetMinEventAgeSeconds in interface EventHandlerIFpublic void setMaxRetryCount(int maxRetryCount)
EventHandlerIFsetMaxRetryCount in interface EventHandlerIFpublic void setRetryIntervalSeconds(int retryIntervalSeconds)
EventHandlerIFsetRetryIntervalSeconds in interface EventHandlerIFretryIntervalSeconds - The number of seconds to waitpublic int getPermanentErrorCount()
EventHandlerIFgetPermanentErrorCount in interface EventHandlerIFpublic void setNotConnectedSleepTime(int notConnectedSleepTime)
EventHandlerIFsetNotConnectedSleepTime in interface EventHandlerIF