Interface MonitorPointSender
- All Known Implementing Classes:
BufferedFilePublisherBase
,BufferedListenerPublisher
,BufferedPublisherBase
,FilePublisher
,JsonFilePublisher
,KafkaPublisher
,ListenerPublisher
,PublisherBase
MonitorPointSender
defines the interface
to send monitor point values and alarms to the IAS core.
When a value is received from the monitored system and,
if it is the case, filtered for noise, it is finally ready to be
sent to the IAS core by invoking offer(ValueToSend)
Implementers of this class, provides statistics collected during
the last observation period, getStats()
.
Life cycle:
setUp()
must be called to allocate the resources needed for sending massages to the core of the IAStearDown()
must be called to release the resources: no more messages can be sent after calling this method
Offering an item to a MonitorPointSender
does not ensure
that it is really sent to the final destination but the producer of
monitor pont values is supposed to continue providing monitor point
values at the proper time intervals.
The sender is, in fact, totally decoupled from the core of the IAS
and its functioning is not affected by the availability of the core
or the transport mechanism.
This allows to shutdown the transport framework or the core of
the IAS without affecting the functioning of the plugin that results,
de facto, totally decoupled from the IAS.
- Author:
- acaproni
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
The statistics provided by the sender in the last time interval. -
Method Summary
Modifier and TypeMethodDescriptiongetStats()
The statistics collected by the publisher after the previous invocation of this method.boolean
isClosed()
boolean
void
offer
(ValueToSend monitorPoint) Offer a monitor point to the publisher for sending to the corevoid
setUp()
Initialization method to allocate the resources needed to send messages to the core of the IAS.void
Publishing of messages begins after calling this method.void
Stop sending messages to the core of the IAS.void
tearDown()
Free all the resources when sending messages to the core of the IAS is not required anymore.
-
Method Details
-
offer
Offer a monitor point to the publisher for sending to the core- Parameters:
monitorPoint
- The notnull
monitor point to be sent to the IAS
-
getStats
MonitorPointSender.SenderStats getStats()The statistics collected by the publisher after the previous invocation of this method.Calling this method resets all the counters.
- Returns:
- The statistics collected by the publisher
-
setUp
Initialization method to allocate the resources needed to send messages to the core of the IAS.Even if the publisher is ready to send messages, no message will be published before calling
startSending()
.- Throws:
PublisherException
- In case of error acquiring the resources
-
tearDown
Free all the resources when sending messages to the core of the IAS is not required anymore.- Throws:
PublisherException
- In case of error releasing the resources
-
startSending
void startSending()Publishing of messages begins after calling this method.- See Also:
-
stopSending
void stopSending()Stop sending messages to the core of the IAS.Updates to be published when the sender is stopped are lost forever.
- See Also:
-
isStopped
boolean isStopped()- Returns:
true
if sending values to the core of the IAS has been stopped
-
isClosed
boolean isClosed()- Returns:
true
if the sender has been closed
-