Class AnnexModemStatusBean
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA unique value for each character port.static final StringAn administratively assigned name for the port, typically with some local significance.static final StringThe port's actual, operational state, independent of flow control.static final intOne of rs232InSigName values.static final intcharPortOperStatus absent.static final intcharPortOperStatus active.static final intcharPortOperStatus down.static final intcharPortOperStatus maintenance.static final intcharPortOperStatus up.static final StringThe current signal state.static final String[]static final intrs232InSigState none.static final intrs232InSigState off.static final intrs232InSigState on. - 
Constructor Summary
ConstructorsConstructorDescriptionThe default constructor.AnnexModemStatusBean(String h, int p) The constructor that will set the host and the port no.AnnexModemStatusBean(String h, int p, String b) The constructor that will set the host, the port no and the local bind address. - 
Method Summary
Modifier and TypeMethodDescriptionvoidaction()This method starts the action of the bean.children()Returns the children of the reciever as an Enumeration.booleanReturns true if the receiver allows children.getChildAt(int childIndex) Returns the childTreeNodeat indexchildIndex.intReturns the number of childrenTreeNodes the receiver contains.intReturns the index ofnodein the receivers children.Returns the date of the moment when this bean was last updated.intReturns the number of voice modems in the table.Returns the indexes (as Integers) of the voice modems that are open.Returns the parentTreeNodeof the receiver.getPortName(Long index) Returns the name of the port.intgetPortStatus(Long index) Returns the status of the modem as an int.getPortStatusString(Long index) Returns the String representation of the status of the modem.booleanisLeaf()Returns true if the receiver is a leaf.voidrun()Implements the running of the bean.voidSets the DefaultTreeModel for this TreeNode.voidSets the parent for this TreeNode.voidupdate(Observable obs, 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, setUpdateIntervalMethods inherited from class uk.co.westhawk.snmp.beans.SNMPBean
addPropertyChangeListener, getBindAddress, getCommunityName, getHost, getMessage, getPort, getSocketType, removePropertyChangeListener, setBindAddress, setCommunityName, setHost, setPort, setPort, setSocketType 
- 
Field Details
- 
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
An administratively assigned name for the port, typically with some local significance.Syntax: DisplayString
See CHARACTER-MIB.- See Also:
 
 - 
charPortOperStatus
The port's actual, operational state, independent of flow control.- 'up' indicates able to function normally.
 - 'down' indicates inability to function for administrative or operational reasons.
 - 'maintenance' indicates a maintenance mode, exclusive of normal operation, such as running a test.
 - 'absent' indicates that port hardware is not present.
 - '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
The current signal state.Syntax: INTEGER
See RS-232-MIB.- See Also:
 
 - 
portUP
public static final int portUPcharPortOperStatus up.- See Also:
 
 - 
portDOWN
public static final int portDOWNcharPortOperStatus down.- See Also:
 
 - 
portMAINTENANCE
public static final int portMAINTENANCEcharPortOperStatus maintenance.- See Also:
 
 - 
portABSENT
public static final int portABSENTcharPortOperStatus absent.- See Also:
 
 - 
portACTIVE
public static final int portACTIVEcharPortOperStatus active.- See Also:
 
 - 
DCD
public static final int DCDOne of rs232InSigName values. If the dcd of rs232InSigState is on, that means that there is contact.- See Also:
 
 - 
sigNONE
public static final int sigNONErs232InSigState none.- See Also:
 
 - 
sigON
public static final int sigONrs232InSigState on.- See Also:
 
 - 
sigOFF
public static final int sigOFFrs232InSigState off.- See Also:
 
 - 
sig_state
 
 - 
 - 
Constructor Details
- 
AnnexModemStatusBean
public AnnexModemStatusBean()The default constructor. - 
AnnexModemStatusBean
The constructor that will set the host and the port no.- Parameters:
 h- the hostnamep- the port no- See Also:
 
 - 
AnnexModemStatusBean
The constructor that will set the host, the port no and the local bind address.- Parameters:
 h- the hostnamep- the port nob- the local bind address- Since:
 - 4_14
 - See Also:
 
 
 - 
 - 
Method Details
- 
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
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. - 
getModemCount
public int getModemCount()Returns the number of voice modems in the table. - 
getPortName
Returns the name of the port.- Parameters:
 index- The index of the port- Returns:
 - The name
 
 - 
getPortStatus
Returns the status of the modem as an int.- Parameters:
 index- The index of the modem- Returns:
 - The status
 - See Also:
 
 - 
getPortStatusString
Returns the String representation of the status of the modem.- Parameters:
 index- The index of the modem- Returns:
 - The status
 - See Also:
 
 - 
children
Returns the children of the reciever as an Enumeration. - 
getChildCount
public int getChildCount()Returns the number of childrenTreeNodes the receiver contains.- Specified by:
 getChildCountin interfaceTreeNode
 - 
getChildAt
Returns the childTreeNodeat indexchildIndex.- Specified by:
 getChildAtin interfaceTreeNode
 - 
getIndex
Returns the index ofnodein the receivers children. If the receiver does not containnode, -1 will be returned. - 
getParent
Returns the parentTreeNodeof the receiver. - 
getAllowsChildren
public boolean getAllowsChildren()Returns true if the receiver allows children.- Specified by:
 getAllowsChildrenin interfaceTreeNode
 - 
isLeaf
public boolean isLeaf()Returns true if the receiver is a leaf. - 
action
public void action()This method starts the action of the bean. It will initialises all variables before starting. - 
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:
 runin interfaceRunnable- Specified by:
 runin classSNMPRunBean- See Also:
 
 - 
update
This method is called when the Pdu response is received. When all answers are received it will fire the property change event. - 
setParent
Sets the parent for this TreeNode. If the parent is not set, this class should be the root of the TreeModel. - 
setDefaultTreeModel
Sets the DefaultTreeModel for this TreeNode. The tree model is used for notifying when any of the nodes were added, removed or changed. 
 -