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
ConstructorsConstructorDescriptionBufferedPublisherBase(String pluginId, String monitoredSystemId, ScheduledExecutorService executorSvc) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract longSend the passed data to the core of the IAS.protected final longpublish(MonitorPointData mpData) Provide a implementation ofPublisherBase.publish(MonitorPointData).protected voidSend the monitor points to the core of the IAS.voidsetUp()Initialize the publisherMethods inherited from class org.eso.ias.plugin.publisher.PublisherBase
getStats, isClosed, isStopped, mergeProperties, offer, shutdown, start, startSending, stopSending, tearDownMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
BufferedPublisherBasepublishes all the monitor point values in a single message instead of publishing one message for each monitor point value.- Specified by:
publishin 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:
sendMonitoredPointsToIasin classPublisherBase
-
setUp
Description copied from class:PublisherBaseInitialize the publisher- Specified by:
setUpin interfaceMonitorPointSender- Overrides:
setUpin classPublisherBase- Throws:
PublisherException- in case of error initializing- See Also:
-