Overview | Package | Class | Tree | Deprecated | Index | Help
| SNMP Stack 5_1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## uk.co.westhawk.snmp.beans
Class DialogChannelStatusBean

    java.lang.Object
      |
      +--uk.co.westhawk.snmp.beans.SNMPBean
            |
            +--uk.co.westhawk.snmp.beans.SNMPRunBean
                  |
                  +--uk.co.westhawk.snmp.beans.DialogChannelStatusBean

All Implemented Interfaces:
  java.util.Observer, java.lang.Runnable, javax.swing.tree.TreeNode

public class DialogChannelStatusBean
extends SNMPRunBean
implements java.util.Observer, javax.swing.tree.TreeNode

This bean is written for a Dialogic card. The Dialogic MIBs come with their BoardWatch package. You will have to fill in a form before downloading it.

This bean collects information about the voice channel status of the Dialogic card. It will only collect those channels that are open.

You can get the data via the getChannelIndexes() and getChannelStatus(Integer index) methods. This way you can visualise the data yourself.

You can also use the Swing JTree to visualise the channels. This bean implements the Swing TreeNode interface. The user has to set the setDefaultTreeModel, so this class can update all the nodes that are added, removed of changed. If this class is not the root of the JTree, you have to set the (TreeNode) parent of this class.

The properties in the parent classes should be set, before calling the action() method. Via a TreeModelEvent the application/applet will be notified.

We only have one (1) Dialogics card, so I don't know how and if it works with more than 1 card. Please let us know if it doesn't work.

Version:
  $Revision: 1.18 $ $Date: 2006/02/02 15:49:39 $
Author:
  Birgit Arkesteijn
See Also:
  `SNMPBean.setHost(java.lang.String)`, `SNMPBean.setPort(int)`, `SNMPBean.setCommunityName(java.lang.String)`, `SNMPRunBean.setUpdateInterval(int)`, `SNMPBean.addPropertyChangeListener(java.beans.PropertyChangeListener)`, `SNMPBean.action()`, `GetNextPdu_vec`

Field Summary
`static int` | `betweenFAXPages`
`static int` | `blocked`
`static int` | `callProgess`
`static int` | `dialing`
`static java.lang.String` | `dlgR4DeviceIndex` A unique value for each R4 device contained by the host.
`static java.lang.String` | `dlgR4DeviceName` Release 4 Device Name.
`static java.lang.String` | `dlgR4DeviceOpenCount` An indication of how many instances of this device is currently opened.
`static java.lang.String` | `dlgR4DeviceType` An indication of the type of the device.
`static java.lang.String` | `dlgR4VoiceChannelStatus` Indicates current activity status on the (voice) channel.
`static int` | `dti`
`static int` | `gettingDigits`
`static int` | `gettingR2MF`
`static int` | `hookState`
`static int` | `idle`
`static int` | `isdn`
`static int` | `msi`
`static int` | `playing`
`static int` | `playTone`
`static int` | `receivingFax`
`static int` | `recording`
`static int` | `sendingFax`
`static int` | `unknown`
`static java.lang.String[]` | `vch_status`
`static int` | `voice`
`static int` | `winking`

Fields inherited from class uk.co.westhawk.snmp.beans.SNMPRunBean
`interval, me, running`

Fields inherited from class uk.co.westhawk.snmp.beans.SNMPBean
`bindAddr, community, context, host, message, port, propertyChangeListener, socketType`

Constructor Summary
`DialogChannelStatusBean()` The default constructor.
`DialogChannelStatusBean(java.lang.String h, int p)` The constructor that will set the host and the port no.
`DialogChannelStatusBean(java.lang.String h, int p, java.lang.String b)` The constructor that will set the host, the port no and the local bind address.

Method Summary
`void` | `action()` This method starts the action of the bean.
`java.util.Enumeration` | `children()` Returns the children of the reciever as an Enumeration.
`protected void` | `fireTreeModelChanged()` Fire the property event.
`boolean` | `getAllowsChildren()` Returns true if the receiver allows children.
`int` | `getChannelCount()` Returns the number of voice channels in the table.
`java.util.Enumeration` | `getChannelIndexes()` Returns the indexes (as Integers) of the voice channels that are open.
`java.lang.String` | `getChannelName(java.lang.Integer index)` Returns the name of the channel.
`int` | `getChannelStatus(java.lang.Integer index)` Returns the status of the channel as an int.
`java.lang.String` | `getChannelStatusString(java.lang.Integer index)` Returns the String representation of the status of the channel.
`javax.swing.tree.TreeNode` | `getChildAt(int childIndex)` Returns the child `TreeNode` at index `childIndex`.
`int` | `getChildCount()` Returns the number of children `TreeNode`s the receiver contains.
`int` | `getIndex(javax.swing.tree.TreeNode node)` Returns the index of `node` in the receivers children.
`java.util.Date` | `getLastUpdateDate()` Returns the date of the moment when this bean was last updated.
`javax.swing.tree.TreeNode` | `getParent()` Returns the parent `TreeNode` of the receiver.
`boolean` | `isLeaf()` Returns true if the receiver is a leaf.
`void` | `run()` Implements the running of the bean.
`void` | `setDefaultTreeModel(javax.swing.tree.DefaultTreeModel model)` Sets the DefaultTreeModel for this TreeNode.
`void` | `setParent(javax.swing.tree.TreeNode p)` Sets the parent for this TreeNode.
`void` | `update(java.util.Observable obs, java.lang.Object ov)` This method is called when the Pdu response is received.

Methods inherited from class uk.co.westhawk.snmp.beans.SNMPRunBean
`getUpdateInterval, isRunning, setRunning, setUpdateInterval, setUpdateInterval`

Methods inherited from class uk.co.westhawk.snmp.beans.SNMPBean
`addPropertyChangeListener, firePropertyChange, getBindAddress, getCommunityName, getHost, getMessage, getPort, getSocketType, isHostPortReachable, removePropertyChangeListener, setBindAddress, setCommunityName, setHost, setMessage, setPort, setPort, setSocketType`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### dlgR4DeviceIndex

    public static final java.lang.String dlgR4DeviceIndex

  A unique value for each R4 device contained by the host. The value for each R4 device must remain constant at least from one re-initialization of the agent to the next re-initialization. See the dlgr4dev.mib.

  See Also:
    Constant Field Values

### dlgR4DeviceName

    public static final java.lang.String dlgR4DeviceName

  Release 4 Device Name. This is the name the application will use when opening the device (e.g. dxxxB1C1, dtiB1T1, msiB1C1) See the dlgr4dev.mib.

  See Also:
    Constant Field Values

### dlgR4DeviceType

    public static final java.lang.String dlgR4DeviceType

  An indication of the type of the device.
  1. other - some other type of device unknown to the agent.
  2. voice - A voice channel device. An entry exits in the dlgR4VoiceTable for this device.
  3. dti - A DTI timeslot device. An entry exits in the dlgR4DTITable for this device.
  4. isdn - An ISDN B-Channel device. An entry exits in the dlgR4ISDNTable for this device.
  5. msi - An MSI station set device. An entry exits in the dlgR4MSITable for this device.
  See the dlgr4dev.mib.

  See Also:
    Constant Field Values

### dlgR4DeviceOpenCount

    public static final java.lang.String dlgR4DeviceOpenCount

  An indication of how many instances of this device is currently opened. See the dlgr4dev.mib.

  See Also:
    Constant Field Values

### dlgR4VoiceChannelStatus

    public static final java.lang.String dlgR4VoiceChannelStatus

  Indicates current activity status on the (voice) channel. See the dlgr4dev.mib.

  See Also:
    Constant Field Values

### unknown

    public static final int unknown

See Also:
  Constant Field Values

### voice

    public static final int voice

See Also:
  Constant Field Values

### dti

    public static final int dti

See Also:
  Constant Field Values

### isdn

    public static final int isdn

See Also:
  Constant Field Values

### msi

    public static final int msi

See Also:
  Constant Field Values

### idle

    public static final int idle

See Also:
  Constant Field Values

### playing

    public static final int playing

See Also:
  Constant Field Values

### recording

    public static final int recording

See Also:
  Constant Field Values

### gettingDigits

    public static final int gettingDigits

See Also:
  Constant Field Values

### blocked

    public static final int blocked

See Also:
  Constant Field Values

### dialing

    public static final int dialing

See Also:
  Constant Field Values

### playTone

    public static final int playTone

See Also:
  Constant Field Values

### sendingFax

    public static final int sendingFax

See Also:
  Constant Field Values

### receivingFax

    public static final int receivingFax

See Also:
  Constant Field Values

### betweenFAXPages

    public static final int betweenFAXPages

See Also:
  Constant Field Values

### hookState

    public static final int hookState

See Also:
  Constant Field Values

### winking

    public static final int winking

See Also:
  Constant Field Values

### callProgess

    public static final int callProgess

See Also:
  Constant Field Values

### gettingR2MF

    public static final int gettingR2MF

See Also:
  Constant Field Values

### vch_status

    public static final java.lang.String[] vch_status

Constructor Detail

### DialogChannelStatusBean

    public DialogChannelStatusBean()

  The default constructor.

### DialogChannelStatusBean

    public DialogChannelStatusBean(java.lang.String h,
                                   int p)

  The constructor that will set the host and the port no.

Parameters:
  `h` - the hostname
  `p` - the port no
See Also:
  `SNMPBean.setHost(java.lang.String)`, `SNMPBean.setPort(int)`

### DialogChannelStatusBean

    public DialogChannelStatusBean(java.lang.String h,
                                   int p,
                                   java.lang.String b)

  The constructor that will set the host, the port no and the local bind address.

Parameters:
  `h` - the hostname
  `p` - the port no
  `b` - the local bind address
Since:
  4_14
See Also:
  `SNMPBean.setHost(java.lang.String)`, `SNMPBean.setPort(int)`, `SNMPBean.setBindAddress(java.lang.String)`

Method Detail

### getLastUpdateDate

    public java.util.Date getLastUpdateDate()

  Returns the date of the moment when this bean was last updated. This might be null when the first time the update was not finished.

  Returns:
    the last update date

### getChannelIndexes

    public java.util.Enumeration getChannelIndexes()

  Returns the indexes (as Integers) of the voice channels that are open. Only the open voice channels of the card are saved. Use getChannelStatus() or getChannelStatusString() to get the status of the channel.

  See Also:
    `getChannelStatus(java.lang.Integer)`, `getChannelStatusString(java.lang.Integer)`

### getChannelCount

    public int getChannelCount()

  Returns the number of voice channels in the table.

### getChannelName

    public java.lang.String getChannelName(java.lang.Integer index)

  Returns the name of the channel.

  Parameters:
    `index` - The index of the channel
  Returns:
    The name

### getChannelStatus

    public int getChannelStatus(java.lang.Integer index)

  Returns the status of the channel as an int.

  Parameters:
    `index` - The index of the channel
  Returns:
    The status
  See Also:
    `getChannelIndexes()`

### getChannelStatusString

    public java.lang.String getChannelStatusString(java.lang.Integer index)

  Returns the String representation of the status of the channel.

  Parameters:
    `index` - The index of the channel
  Returns:
    The status
  See Also:
    `getChannelIndexes()`

### children

    public java.util.Enumeration children()

  Returns the children of the reciever as an Enumeration.

  Specified by:
    `children` in interface `javax.swing.tree.TreeNode`

### getChildCount

    public int getChildCount()

  Returns the number of children `TreeNode`s the receiver contains.

  Specified by:
    `getChildCount` in interface `javax.swing.tree.TreeNode`

### getChildAt

    public javax.swing.tree.TreeNode getChildAt(int childIndex)

  Returns the child `TreeNode` at index `childIndex`.

  Specified by:
    `getChildAt` in interface `javax.swing.tree.TreeNode`

### getIndex

    public int getIndex(javax.swing.tree.TreeNode node)

  Returns the index of `node` in the receivers children. If the receiver does not contain `node`, -1 will be returned.

  Specified by:
    `getIndex` in interface `javax.swing.tree.TreeNode`

### getParent

    public javax.swing.tree.TreeNode getParent()

  Returns the parent `TreeNode` of the receiver.

  Specified by:
    `getParent` in interface `javax.swing.tree.TreeNode`

### getAllowsChildren

    public boolean getAllowsChildren()

  Returns true if the receiver allows children.

  Specified by:
    `getAllowsChildren` in interface `javax.swing.tree.TreeNode`

### isLeaf

    public boolean isLeaf()

  Returns true if the receiver is a leaf.

  Specified by:
    `isLeaf` in interface `javax.swing.tree.TreeNode`

### action

    public void action()

  This method starts the action of the bean. It will initialises all variables before starting.

  Specified by:
    `action` in class `SNMPBean`

### run

    public void run()

  Implements the running of the bean. It will send the Pdu, if the previous one is not still in flight.

  Specified by:
    `run` in interface `java.lang.Runnable`
  Specified by:
    `run` in class `SNMPRunBean`
  See Also:
    `SNMPRunBean.isRunning()`

### update

    public void update(java.util.Observable obs,
                       java.lang.Object ov)

  This method is called when the Pdu response is received. When all answers are received it will fire the property change event.

  Specified by:
    `update` in interface `java.util.Observer`

### setParent

    public void setParent(javax.swing.tree.TreeNode p)

  Sets the parent for this TreeNode. If the parent is not set, this class should be the root of the TreeModel.

### setDefaultTreeModel

    public void setDefaultTreeModel(javax.swing.tree.DefaultTreeModel model)

  Sets the DefaultTreeModel for this TreeNode. The tree model is used for notifying when any of the nodes were added, removed or changed.

### fireTreeModelChanged

    protected void fireTreeModelChanged()

  Fire the property event.

  See Also:
    `DefaultTreeModel.nodeStructureChanged(javax.swing.tree.TreeNode)`

Overview | Package | Class | Tree | Deprecated | Index | Help
| SNMP Stack 5_1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD