public class ChannelCorrelator extends Correlator<Channel,ChannelTimeRecord,ChannelAgent>
newSourceAgent()
to
generate a ChannelAgent as a source agent.
The Correlator is the class that is used to setup monitoring of correlated
events. It is the sole entry point to the outside world. When correlations
are found, the Correlator broadcasts the correlation.
Note that all time is in seconds unless otherwise stated._binTimespan, correlationTester, localCenter
Constructor and Description |
---|
ChannelCorrelator(double aBinTimespan)
Creates new ChannelCorrelator
|
ChannelCorrelator(double aBinTimespan,
CorrelationFilter<ChannelTimeRecord> aFilter)
Creates new ChannelCorrelator.
|
Modifier and Type | Method and Description |
---|---|
void |
addChannel(Channel channel)
Add a channel to monitor.
|
void |
addChannel(Channel channel,
RecordFilter<ChannelTimeRecord> recordFilter)
Add a channel to monitor.
|
void |
addChannel(Channel channel,
java.lang.String channelId)
Add a channel to monitor.
|
void |
addChannel(Channel channel,
java.lang.String channelId,
RecordFilter<ChannelTimeRecord> recordFilter)
Add a channel to monitor.
|
void |
addChannel(java.lang.String channelId)
Add a channel to monitor.
|
void |
addChannel(java.lang.String channelId,
RecordFilter<ChannelTimeRecord> recordFilter)
Add a channel to monitor.
|
java.util.Collection<java.lang.String> |
inactiveChannelsByName()
Get the names of channels that are not being monitored due to connection
or monitor failure or simply not monitoried.
|
protected ChannelAgent |
newSourceAgent(Channel channel,
java.lang.String sourceName,
RecordFilter<ChannelTimeRecord> recordFilter)
Overrides the parent method to create and return a ChannelAgent as a source agent for this correlator.
|
int |
numActiveChannels()
Get the number of actively monitored channels.
|
int |
numInactiveChannels()
Get the number of channels that are inactive due to connection or monitor
failure or simply not monitored.
|
void |
removeAllChannels()
Remove all registered channels.
|
void |
removeChannel(Channel channel)
Stop managing the specified channel.
|
void |
removeChannel(java.lang.String channelId)
Stop managing the specified channel
|
addListener, addSource, addSource, binTimespan, dispose, fetchCorrelationWithTimeout, getNamesOfSources, getSourceAgents, hasSource, isRunning, monitorWithTimeout, numSources, pulseMonitorWithTimeout, registerEvents, removeAllSources, removeListener, removeSource, setBinTimespan, setCorrelationFilter, startMonitoring, stopMonitoring
public ChannelCorrelator(double aBinTimespan)
aBinTimespan
- timespan for the binspublic ChannelCorrelator(double aBinTimespan, CorrelationFilter<ChannelTimeRecord> aFilter)
aBinTimespan
- The time resolution for accepting two events as correlated.aFilter
- A filter to apply to the correlation.protected ChannelAgent newSourceAgent(Channel channel, java.lang.String sourceName, RecordFilter<ChannelTimeRecord> recordFilter)
newSourceAgent
in class Correlator<Channel,ChannelTimeRecord,ChannelAgent>
channel
- The new channel to monitor and correlate.sourceName
- The name to be associated with the source.recordFilter
- The filter to apply to the source's records.public int numActiveChannels()
public int numInactiveChannels()
public java.util.Collection<java.lang.String> inactiveChannelsByName()
public void addChannel(java.lang.String channelId)
channelId
- The PV name to monitor.public final void addChannel(java.lang.String channelId, RecordFilter<ChannelTimeRecord> recordFilter)
channelId
- The PV name to monitor.recordFilter
- The filter to apply to the channel's records.public final void addChannel(Channel channel)
channel
- The channel to monitor for correlations.public final void addChannel(Channel channel, RecordFilter<ChannelTimeRecord> recordFilter)
channel
- The channel to monitor for correlations.recordFilter
- The filter to apply to the channel's records.public final void addChannel(Channel channel, java.lang.String channelId)
channel
- The channel to monitor for correlations.channelId
- A unique identifier of the channel.public final void addChannel(Channel channel, java.lang.String channelId, RecordFilter<ChannelTimeRecord> recordFilter)
channel
- The channel to monitor for correlations.channelId
- ID to associate with the channel.recordFilter
- The filter to apply to the channel's records.public void removeChannel(Channel channel)
channel
- The channel we are requesting to stop monitoring and correlating.public void removeChannel(java.lang.String channelId)
channelId
- The id of the channel we are requesting to stop monitoring and correlating.public void removeAllChannels()