gov.sns.tools.pvlogger
Class ChannelGroup

java.lang.Object
  |
  +--gov.sns.tools.pvlogger.ChannelGroup

public class ChannelGroup
extends java.lang.Object

ChannelGroup is a wrapper for the PV_SET data source which defines a group of related PVs.


Nested Class Summary
protected  class ChannelGroup.ConnectionHandler
           
 
Field Summary
protected  ChannelWrapper[] _channelWrappers
          array of channel wrappers
protected  ChannelGroup.ConnectionHandler _connectionHandler
          handler of channel connection events
protected  double DEFAULT_LOGGING_PERIOD
          default logging period (seconds) for the group
protected  java.lang.String DESCRIPTION
          description of the channel group
protected  java.lang.String LABEL
          label of the channel group
 
Constructor Summary
ChannelGroup(java.lang.String groupLabel, java.lang.String[] pvs, double loggingPeriod)
          Constructor
ChannelGroup(java.lang.String label, java.lang.String description, java.lang.String[] pvs, double loggingPeriod)
          Constructor
 
Method Summary
 void dispose()
          Dispose of this channel group's resources
 int getChannelCount()
          Get the number of channels in this group
 java.util.Collection getChannels()
          Get the collection of channels which we attempt to monitor
 ChannelWrapper[] getChannelWrappers()
          Get the channel wrappers for the channels associated with this group.
 double getDefaultLoggingPeriod()
          Get the default logging period for this group
 java.lang.String getDescription()
          Get a description of the group
 java.lang.String getLabel()
          Get the group label.
 java.util.Date getLastChannelEventTime()
          Get the timestamp of the last channel event (e.g.
 java.lang.String toString()
          Override toString() to return the group label and a description
protected  void wrapPVs(java.lang.String[] pvs)
          Create ChannelWrappers for the specified pvs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_LOGGING_PERIOD

protected final double DEFAULT_LOGGING_PERIOD
default logging period (seconds) for the group


LABEL

protected final java.lang.String LABEL
label of the channel group


DESCRIPTION

protected final java.lang.String DESCRIPTION
description of the channel group


_channelWrappers

protected ChannelWrapper[] _channelWrappers
array of channel wrappers


_connectionHandler

protected ChannelGroup.ConnectionHandler _connectionHandler
handler of channel connection events

Constructor Detail

ChannelGroup

public ChannelGroup(java.lang.String label,
                    java.lang.String description,
                    java.lang.String[] pvs,
                    double loggingPeriod)
Constructor

Parameters:
label - The group's label
description - A description of the group
pvs - The PVs in the group
loggingPeriod - The default logging period for the group

ChannelGroup

public ChannelGroup(java.lang.String groupLabel,
                    java.lang.String[] pvs,
                    double loggingPeriod)
Constructor

Parameters:
groupLabel - The group's label
pvs - The PVs in the group
loggingPeriod - The default logging period for the group
Method Detail

dispose

public void dispose()
Dispose of this channel group's resources


getLabel

public java.lang.String getLabel()
Get the group label.

Returns:
the group label.

getDescription

public java.lang.String getDescription()
Get a description of the group

Returns:
a description of this group

getDefaultLoggingPeriod

public double getDefaultLoggingPeriod()
Get the default logging period for this group

Returns:
the default logging period in seconds

wrapPVs

protected void wrapPVs(java.lang.String[] pvs)
Create ChannelWrappers for the specified pvs.

Parameters:
pvs - the list of PVs to wrap

getChannelWrappers

public ChannelWrapper[] getChannelWrappers()
Get the channel wrappers for the channels associated with this group.

Returns:
The array of channel wrappers of this group.

getChannels

public java.util.Collection getChannels()
Get the collection of channels which we attempt to monitor

Returns:
a collection of channels corresponding to the channel wrappers

getChannelCount

public int getChannelCount()
Get the number of channels in this group

Returns:
The number of channels in this group

getLastChannelEventTime

public java.util.Date getLastChannelEventTime()
Get the timestamp of the last channel event (e.g. channel connected/disconnected event)

Returns:
the wall clock timestamp of the last channel event

toString

public java.lang.String toString()
Override toString() to return the group label and a description

Overrides:
toString in class java.lang.Object
Returns:
the group label and description