Class JsonFilePublisher
java.lang.Object
org.eso.ias.plugin.publisher.PublisherBase
org.eso.ias.plugin.publisher.BufferedPublisherBase
org.eso.ias.plugin.publisher.impl.BufferedFilePublisherBase
org.eso.ias.plugin.publisher.impl.JsonFilePublisher
- All Implemented Interfaces:
MonitorPointSender
A publisher that dumps JSON messages in the passed writer.
This implementation allows to investigate the sending of monitor points to the core of the IAS by looking at the JSON file where they are all dumped.
The data written in the file are the JSON representation of each message
i.e. a sequence of BufferedMonitoredSystemData
.
As such the file is not JSON specification compliant.
- 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
ConstructorDescriptionJsonFilePublisher
(String pluginId, String monitoredSystemId, ScheduledExecutorService executorSvc, BufferedWriter outWriter) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Build and return a JSON string representing the dataMethods inherited from class org.eso.ias.plugin.publisher.impl.BufferedFilePublisherBase
publish, shutdown, start
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
-
JsonFilePublisher
public JsonFilePublisher(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 to write JSON strings into
-
-
Method Details
-
buildString
Build and return a JSON string representing the data- Specified by:
buildString
in classBufferedFilePublisherBase
- Parameters:
data
- The data to be sent to core of the IAS- Returns:
- the JSON string representing the data
- Throws:
PublisherException
- In case of error building the string- See Also:
-