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 String
A unique value for each character port.static final String
An administratively assigned name for the port, typically with some local significance.static final String
The port's actual, operational state, independent of flow control.static final int
One of rs232InSigName values.static final int
charPortOperStatus absent.static final int
charPortOperStatus active.static final int
charPortOperStatus down.static final int
charPortOperStatus maintenance.static final int
charPortOperStatus up.static final String
The current signal state.static final String[]
static final int
rs232InSigState none.static final int
rs232InSigState off.static final int
rs232InSigState 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 TypeMethodDescriptionvoid
action()
This method starts the action of the bean.children()
Returns the children of the reciever as an Enumeration.boolean
Returns true if the receiver allows children.getChildAt
(int childIndex) Returns the childTreeNode
at indexchildIndex
.int
Returns the number of childrenTreeNode
s the receiver contains.int
Returns the index ofnode
in the receivers children.Returns the date of the moment when this bean was last updated.int
Returns the number of voice modems in the table.Returns the indexes (as Integers) of the voice modems that are open.Returns the parentTreeNode
of the receiver.getPortName
(Long index) Returns the name of the port.int
getPortStatus
(Long index) Returns the status of the modem as an int.getPortStatusString
(Long index) Returns the String representation of the status of the modem.boolean
isLeaf()
Returns true if the receiver is a leaf.void
run()
Implements the running of the bean.void
Sets the DefaultTreeModel for this TreeNode.void
Sets the parent for this TreeNode.void
update
(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, setUpdateInterval
Methods 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 childrenTreeNode
s the receiver contains.- Specified by:
getChildCount
in interfaceTreeNode
-
getChildAt
Returns the childTreeNode
at indexchildIndex
.- Specified by:
getChildAt
in interfaceTreeNode
-
getIndex
Returns the index ofnode
in the receivers children. If the receiver does not containnode
, -1 will be returned. -
getParent
Returns the parentTreeNode
of the receiver. -
getAllowsChildren
public boolean getAllowsChildren()Returns true if the receiver allows children.- Specified by:
getAllowsChildren
in 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:
run
in interfaceRunnable
- Specified by:
run
in 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.
-