Package org.eso.ias.plugin.publisher
Class BufferedPublisherBase
java.lang.Object
org.eso.ias.plugin.publisher.PublisherBase
org.eso.ias.plugin.publisher.BufferedPublisherBase
- All Implemented Interfaces:
MonitorPointSender
- Direct Known Subclasses:
BufferedFilePublisherBase
,BufferedListenerPublisher
Extends
PublisherBase
for publishing data to the IAS core with buffering.
Buffering in this context is at transmission level: all the collected monitor point values are sent with only one message instead of being sent one by one.
- Author:
- acaproni
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eso.ias.plugin.publisher.MonitorPointSender
MonitorPointSender.SenderStats
-
Field Summary
Fields inherited from class org.eso.ias.plugin.publisher.PublisherBase
defaultBufferSize, defaultThrottlingTime, iso8601dateFormat, MAX_BUFFER_SIZE_PROPNAME, maxBufferSize, monitoredSystemId, monitorPoints, monitorPointsSent, numOfErrorsSending, pluginId, publishedMessages, THROTTLING_PROPNAME, throttlingTime
-
Constructor Summary
ConstructorDescriptionBufferedPublisherBase
(String pluginId, String monitoredSystemId, ScheduledExecutorService executorSvc) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract long
Send the passed data to the core of the IAS.protected final long
publish
(MonitorPointData mpData) Provide a implementation ofPublisherBase.publish(MonitorPointData)
.protected void
Send the monitor points to the core of the IAS.void
setUp()
Initialize the publisherMethods inherited from class org.eso.ias.plugin.publisher.PublisherBase
getStats, isClosed, isStopped, mergeProperties, offer, shutdown, start, startSending, stopSending, tearDown
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eso.ias.plugin.publisher.MonitorPointSender
getStats, isClosed, isStopped, offer, startSending, stopSending, tearDown
-
Constructor Details
-
BufferedPublisherBase
public BufferedPublisherBase(String pluginId, String monitoredSystemId, ScheduledExecutorService executorSvc) Constructor- Parameters:
pluginId
- The identifier of the pluginmonitoredSystemId
- The identifier of the system monitored by the pluginexecutorSvc
- The executor service
-
-
Method Details
-
publish
Provide a implementation ofPublisherBase.publish(MonitorPointData)
.This method is never called because the
BufferedPublisherBase
publishes all the monitor point values in a single message instead of publishing one message for each monitor point value.- Specified by:
publish
in classPublisherBase
- Parameters:
mpData
- The monitor point data to send to the core of the IAS- Returns:
- 0L: no data sent
- Throws:
PublisherException
- In case of error publishing
-
publish
Send the passed data to the core of the IAS.This method is supposed to effectively sent the data to the core of the IAS
- Parameters:
data
- The data to send to the core of the IAS- Returns:
- The number of bytes sent to the core of the IAS
- Throws:
PublisherException
- In case of error publishing
-
sendMonitoredPointsToIas
protected void sendMonitoredPointsToIas()Send the monitor points to the core of the IAS.The method is synchronized as it can be called by 2 different threads: when the throttling time interval elapses and if the max size of the buffer has been reached
- Overrides:
sendMonitoredPointsToIas
in classPublisherBase
-
setUp
Description copied from class:PublisherBase
Initialize the publisher- Specified by:
setUp
in interfaceMonitorPointSender
- Overrides:
setUp
in classPublisherBase
- Throws:
PublisherException
- in case of error initializing- See Also:
-