Class JobLogMonitor
- java.lang.Object
-
- br.pucrio.tecgraf.soma.job.log.monitor.impl.JobLogMonitor
-
- All Implemented Interfaces:
ResourceMonitor
public class JobLogMonitor extends Object implements ResourceMonitor
-
-
Field Summary
Fields Modifier and Type Field Description static StringENCODING_PARAMETERstatic StringTIMESTAMP_PARAMETER
-
Constructor Summary
Constructors Constructor Description JobLogMonitor(Integer maxLengthSize, boolean enableWatcherPolling, Integer watcherThreadPoolSize, Integer watcherPollingIntervalMillis, Charset defaultCharset, boolean enableCharsetDetection)JobLogMonitor(ExecutorService pool, FileReader fileReader, boolean enableWatcherPolling, Integer watcherThreadPoolSize, Integer watcherPollingIntervalMillis, Map<String,LogFileMonitoredResource> monitoredResourcesByPath, Map<String,JobLogFileWatcher> watchersByParentPath, Map<String,Set<ResourceMonitorListener<ResourceMonitorEvent>>> listenersByPath)Constructor with arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(String filePath, ResourceMonitorListener<ResourceMonitorEvent> listener, Map<String,Object> args)protected JobLogFileWatchercreateJobLogFileWatcher()voidfinishMonitoring()List<ResourceMonitorEvent>getEvents(String filePath, Long startSeqnum, Long endSeqnum)booleanisAllListenersWereRemoved()voidremoveListener(String filePath, ResourceMonitorListener<ResourceMonitorEvent> listener)
-
-
-
Field Detail
-
TIMESTAMP_PARAMETER
public static final String TIMESTAMP_PARAMETER
- See Also:
- Constant Field Values
-
ENCODING_PARAMETER
public static final String ENCODING_PARAMETER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JobLogMonitor
public JobLogMonitor(Integer maxLengthSize, boolean enableWatcherPolling, Integer watcherThreadPoolSize, Integer watcherPollingIntervalMillis, Charset defaultCharset, boolean enableCharsetDetection)
-
JobLogMonitor
public JobLogMonitor(ExecutorService pool, FileReader fileReader, boolean enableWatcherPolling, Integer watcherThreadPoolSize, Integer watcherPollingIntervalMillis, Map<String,LogFileMonitoredResource> monitoredResourcesByPath, Map<String,JobLogFileWatcher> watchersByParentPath, Map<String,Set<ResourceMonitorListener<ResourceMonitorEvent>>> listenersByPath)
Constructor with arguments.- Parameters:
pool-monitoredResourcesByPath-watchersByParentPath-listenersByPath-
-
-
Method Detail
-
addListener
public void addListener(String filePath, ResourceMonitorListener<ResourceMonitorEvent> listener, Map<String,Object> args)
- Specified by:
addListenerin interfaceResourceMonitor
-
removeListener
public void removeListener(String filePath, ResourceMonitorListener<ResourceMonitorEvent> listener)
- Specified by:
removeListenerin interfaceResourceMonitor
-
getEvents
public List<ResourceMonitorEvent> getEvents(String filePath, Long startSeqnum, Long endSeqnum)
- Specified by:
getEventsin interfaceResourceMonitor
-
finishMonitoring
public void finishMonitoring()
-
isAllListenersWereRemoved
public boolean isAllListenersWereRemoved()
-
createJobLogFileWatcher
protected JobLogFileWatcher createJobLogFileWatcher() throws IOException
- Throws:
IOException
-
-