Class BufferedFilePublisherBase
java.lang.Object
org.eso.ias.plugin.publisher.PublisherBase
org.eso.ias.plugin.publisher.BufferedPublisherBase
org.eso.ias.plugin.publisher.impl.BufferedFilePublisherBase
- All Implemented Interfaces:
MonitorPointSender
- Direct Known Subclasses:
FilePublisher
,JsonFilePublisher
Base class for the publishers that write strings (with different format)
on a file.
- 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
ConstructorDescriptionBufferedFilePublisherBase
(String pluginId, String monitoredSystemId, ScheduledExecutorService executorSvc, BufferedWriter outWriter) Constructor -
Method Summary
Methods inherited from class org.eso.ias.plugin.publisher.BufferedPublisherBase
publish, sendMonitoredPointsToIas, setUp
Methods inherited from class org.eso.ias.plugin.publisher.PublisherBase
getStats, isClosed, isStopped, mergeProperties, offer, 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
-
BufferedFilePublisherBase
public BufferedFilePublisherBase(String pluginId, String monitoredSystemId, ScheduledExecutorService executorSvc, BufferedWriter outWriter) Constructor- Parameters:
pluginId
- The identifier of the pluginmonitoredSystemId
- The identifier of the system monitored by the pluginexecutorSvc
- The executor serviceoutWriter
- The output writer
-
-
Method Details
-
buildString
Builds the string to be written in the file.It can be a simple string, XML, JSON and so on.
- Parameters:
data
- The data to be sent to core of the IAS- Returns:
- The string to write in the file
- Throws:
PublisherException
- In case of error building the string
-
publish
Send the passed data to the core of the IAS.- Specified by:
publish
in classBufferedPublisherBase
- 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
-
start
Performs the initialization.- Specified by:
start
in classPublisherBase
- Throws:
PublisherException
- never
-
shutdown
Performs the cleanup.- Specified by:
shutdown
in classPublisherBase
- Throws:
PublisherException
- in case of error releasing the writer
-