Package org.yamcs.events
Class AbstractEventProducer
java.lang.Object
org.yamcs.events.AbstractEventProducer
- All Implemented Interfaces:
EventProducer
- Direct Known Subclasses:
MockupEventProducer
,QuietEventProducer
,Slf4jEventProducer
,StreamEventProducer
Default implementation of an EventProducer that provides shortcut methods for sending message of different severity
types.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
flushEventBuffer
(boolean startNewSequence) abstract long
newEvent()
Creates a default Event Builder with these fields pre-filled: source, seqNo, receptionTime, generationTimevoid
sendCritical
(String msg) send an critical event with the type automatically filled in as the caller class namevoid
sendDistress
(String msg) send an distress event with the type automatically filled in as the caller class namevoid
sendEvent
(Event.EventSeverity severity, String type, String msg) void
send an info event with the type automatically filled in as the caller class namevoid
sendSevere
(String msg) send an severe event with the type automatically filled in as the caller class namevoid
sendWarning
(String msg) send an warning event with the type automatically filled in as the caller class namevoid
send an watch event with the type automatically filled in as the caller class namevoid
setRepeatedEventReduction
(boolean repeatedEventReduction, long repeatedEventTimeoutMillisec) By default event repetitions are checked for possible reduction.void
setSeqNo
(int sn) void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.yamcs.events.EventProducer
close, sendCritical, sendDistress, sendError, sendEvent, sendInfo, sendSevere, sendWarning, sendWatch
-
Field Details
-
logAllMessages
protected boolean logAllMessages
-
-
Constructor Details
-
AbstractEventProducer
public AbstractEventProducer()
-
-
Method Details
-
setSource
- Specified by:
setSource
in interfaceEventProducer
-
setSeqNo
public void setSeqNo(int sn) - Specified by:
setSeqNo
in interfaceEventProducer
-
sendInfo
Description copied from interface:EventProducer
send an info event with the type automatically filled in as the caller class name- Specified by:
sendInfo
in interfaceEventProducer
- Parameters:
msg
- - event message
-
sendWatch
Description copied from interface:EventProducer
send an watch event with the type automatically filled in as the caller class name- Specified by:
sendWatch
in interfaceEventProducer
- Parameters:
msg
- - event message
-
sendWarning
Description copied from interface:EventProducer
send an warning event with the type automatically filled in as the caller class name- Specified by:
sendWarning
in interfaceEventProducer
- Parameters:
msg
- - event message
-
sendCritical
Description copied from interface:EventProducer
send an critical event with the type automatically filled in as the caller class name- Specified by:
sendCritical
in interfaceEventProducer
- Parameters:
msg
- - event message
-
sendDistress
Description copied from interface:EventProducer
send an distress event with the type automatically filled in as the caller class name- Specified by:
sendDistress
in interfaceEventProducer
- Parameters:
msg
- - event message
-
sendSevere
Description copied from interface:EventProducer
send an severe event with the type automatically filled in as the caller class name- Specified by:
sendSevere
in interfaceEventProducer
- Parameters:
msg
- - event message
-
sendEvent
- Specified by:
sendEvent
in interfaceEventProducer
-
setRepeatedEventReduction
public void setRepeatedEventReduction(boolean repeatedEventReduction, long repeatedEventTimeoutMillisec) By default event repetitions are checked for possible reduction. Disable if 'realtime' events are required.- Specified by:
setRepeatedEventReduction
in interfaceEventProducer
- Parameters:
repeatedEventReduction
- if true - enable the reduction of events.repeatedEventTimeoutMillisec
- - how long to keep quiet in case of equal events being sent
-
flushEventBuffer
protected void flushEventBuffer(boolean startNewSequence) -
newEvent
Description copied from interface:EventProducer
Creates a default Event Builder with these fields pre-filled: source, seqNo, receptionTime, generationTime- Specified by:
newEvent
in interfaceEventProducer
-
getMissionTime
public abstract long getMissionTime()
-