Class AnnexModemStatusBean

All Implemented Interfaces:
Runnable, Observer, TreeNode

public class AnnexModemStatusBean extends SNMPRunBean implements Observer, TreeNode

This bean is written for Remote Annex 2000 access server.

The server comes with the Xylogics specific MIBs, you can find them in the Annex software installation, I couldn't find them on the Web. I did not use them for this bean, however.

This bean uses the CHARACTER-MIB and RS-232-MIB.

This bean collects information about the modem status, connected to the server. It will only collect those modems (see charPortOperStatus) that are "up". It will then show if the modem is in use of not (see rs232InSigState).

You can get the data via the getModemIndexes() and getPortStatus(Long index) methods. This way you can visualise the data yourself.

You can also use the Swing JTree to visualise the modems. 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 Annex server, so I don't know how and if it works with more than 1. Please let us know if it doesn't work.

Version:
$Revision: 1.22 $ $Date: 2006/03/23 14:54:09 $
Author:
Birgit Arkesteijn
See Also:
  • Field Details

    • charPortIndex

      public static final String charPortIndex
      A unique value for each character port. This perhaps corresponding to the same value of ifIndex when the character port is associated with a hardware port represented by an ifIndex.

      Syntax: INTEGER

      See the CHARACTER-MIB.
      See Also:
    • charPortName

      public static final String charPortName
      An administratively assigned name for the port, typically with some local significance.

      Syntax: DisplayString

      See CHARACTER-MIB.
      See Also:
    • charPortOperStatus

      public static final String charPortOperStatus
      The port's actual, operational state, independent of flow control.
      1. 'up' indicates able to function normally.
      2. 'down' indicates inability to function for administrative or operational reasons.
      3. 'maintenance' indicates a maintenance mode, exclusive of normal operation, such as running a test.
      4. 'absent' indicates that port hardware is not present.
      5. 'active' indicates up with a user present (e.g. logged in).

      'up' and 'active' correspond to ifOperStatus (rfc2863.mib) 'up'. 'down' and 'absent' correspond to ifOperStatus 'down'. 'maintenance' corresponds to ifOperStatus 'test'.

      Syntax: INTEGER

      See CHARACTER-MIB and IF-MIB-MIB.
      See Also:
    • rs232InSigState

      public static final String rs232InSigState
      The current signal state.

      Syntax: INTEGER

      See RS-232-MIB.
      See Also:
    • portUP

      public static final int portUP
      charPortOperStatus up.
      See Also:
    • portDOWN

      public static final int portDOWN
      charPortOperStatus down.
      See Also:
    • portMAINTENANCE

      public static final int portMAINTENANCE
      charPortOperStatus maintenance.
      See Also:
    • portABSENT

      public static final int portABSENT
      charPortOperStatus absent.
      See Also:
    • portACTIVE

      public static final int portACTIVE
      charPortOperStatus active.
      See Also:
    • DCD

      public static final int DCD
      One of rs232InSigName values. If the dcd of rs232InSigState is on, that means that there is contact.
      See Also:
    • sigNONE

      public static final int sigNONE
      rs232InSigState none.
      See Also:
    • sigON

      public static final int sigON
      rs232InSigState on.
      See Also:
    • sigOFF

      public static final int sigOFF
      rs232InSigState off.
      See Also:
    • sig_state

      public static final String[] sig_state
  • Constructor Details

  • Method Details

    • getLastUpdateDate

      public 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
    • getModemIndexes

      public Enumeration getModemIndexes()
      Returns the indexes (as Integers) of the voice modems that are open. Only the open voice modems of the card are saved. Use getPortStatus() or getPortStatusString() to get the status of the modem.
      See Also:
    • getModemCount

      public int getModemCount()
      Returns the number of voice modems in the table.
    • getPortName

      public String getPortName(Long index)
      Returns the name of the port.
      Parameters:
      index - The index of the port
      Returns:
      The name
    • getPortStatus

      public int getPortStatus(Long index)
      Returns the status of the modem as an int.
      Parameters:
      index - The index of the modem
      Returns:
      The status
      See Also:
    • getPortStatusString

      public String getPortStatusString(Long index)
      Returns the String representation of the status of the modem.
      Parameters:
      index - The index of the modem
      Returns:
      The status
      See Also:
    • children

      public Enumeration children()
      Returns the children of the reciever as an Enumeration.
      Specified by:
      children in interface TreeNode
    • getChildCount

      public int getChildCount()
      Returns the number of children TreeNodes the receiver contains.
      Specified by:
      getChildCount in interface TreeNode
    • getChildAt

      public TreeNode getChildAt(int childIndex)
      Returns the child TreeNode at index childIndex.
      Specified by:
      getChildAt in interface TreeNode
    • getIndex

      public int getIndex(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 TreeNode
    • getParent

      public TreeNode getParent()
      Returns the parent TreeNode of the receiver.
      Specified by:
      getParent in interface TreeNode
    • getAllowsChildren

      public boolean getAllowsChildren()
      Returns true if the receiver allows children.
      Specified by:
      getAllowsChildren in interface TreeNode
    • isLeaf

      public boolean isLeaf()
      Returns true if the receiver is a leaf.
      Specified by:
      isLeaf in interface 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 Runnable
      Specified by:
      run in class SNMPRunBean
      See Also:
    • update

      public void update(Observable obs, 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 Observer
    • setParent

      public void setParent(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(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.