|
SNMP Stack 4_12 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.co.westhawk.snmp.beans.SNMPBean | +--uk.co.westhawk.snmp.beans.SNMPRunBean | +--uk.co.westhawk.snmp.beans.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 RFC 1658 (CHARACTER-MIB module) and RFC 1659 (RS-232-MIB module).
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.
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
,
OneGetPdu
Field Summary | |
static java.lang.String |
charPortIndex
A unique value for each character port. |
static java.lang.String |
charPortName
An administratively assigned name for the port, typically with some local significance. |
static java.lang.String |
charPortOperStatus
The port's actual, operational state, independent of flow control. |
static int |
DCD
One of rs232InSigName values. |
static int |
portABSENT
charPortOperStatus absent. |
static int |
portACTIVE
charPortOperStatus active. |
static int |
portDOWN
charPortOperStatus down. |
static int |
portMAINTENANCE
charPortOperStatus maintenance. |
static int |
portUP
charPortOperStatus up. |
static java.lang.String |
rs232InSigState
The current signal state. |
static java.lang.String[] |
sig_state
|
static int |
sigNONE
rs232InSigState none. |
static int |
sigOFF
rs232InSigState off. |
static int |
sigON
rs232InSigState on. |
Fields inherited from class uk.co.westhawk.snmp.beans.SNMPRunBean |
interval, me, running |
Fields inherited from class uk.co.westhawk.snmp.beans.SNMPBean |
community, context, host, message, port, propertyChangeListener |
Constructor Summary | |
AnnexModemStatusBean()
The default constructor. |
|
AnnexModemStatusBean(java.lang.String h,
int p)
The constructor that will set the host and the port no. |
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. |
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. |
int |
getModemCount()
Returns the number of voice modems in the table. |
java.util.Enumeration |
getModemIndexes()
Returns the indexes (as Integers) of the voice modems that are open. |
javax.swing.tree.TreeNode |
getParent()
Returns the parent TreeNode of the receiver. |
java.lang.String |
getPortName(java.lang.Long index)
Returns the name of the port. |
int |
getPortStatus(java.lang.Long index)
Returns the status of the modem as an int. |
java.lang.String |
getPortStatusString(java.lang.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 |
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, getCommunityName, getHost, getMessage, getPort, isHostPortReachable, removePropertyChangeListener, setCommunityName, setHost, setMessage, setPort, setPort |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String charPortIndex
Syntax: INTEGER
See the rfc1658.mib .public static final java.lang.String charPortName
Syntax: DisplayString
See the rfc1658.mib .public static final java.lang.String charPortOperStatus
'up' and 'active' correspond to ifOperStatus (rfc2863.mib) 'up'. 'down' and 'absent' correspond to ifOperStatus 'down'. 'maintenance' corresponds to ifOperStatus 'test'.
Syntax: INTEGER
See the rfc1658.mib .public static final java.lang.String rs232InSigState
Syntax: INTEGER
See the rfc1659.mib .public static final int portUP
public static final int portDOWN
public static final int portMAINTENANCE
public static final int portABSENT
public static final int portACTIVE
public static final int DCD
public static final int sigNONE
public static final int sigON
public static final int sigOFF
public static final java.lang.String[] sig_state
Constructor Detail |
public AnnexModemStatusBean()
public AnnexModemStatusBean(java.lang.String h, int p)
h
- the hostnamep
- the port noSNMPBean.setHost(java.lang.String)
,
SNMPBean.setPort(int)
Method Detail |
public java.util.Date getLastUpdateDate()
public java.util.Enumeration getModemIndexes()
getPortStatus(java.lang.Long)
,
getPortStatusString(java.lang.Long)
public int getModemCount()
public java.lang.String getPortName(java.lang.Long index)
index
- The index of the portpublic int getPortStatus(java.lang.Long index)
index
- The index of the modemgetModemIndexes()
public java.lang.String getPortStatusString(java.lang.Long index)
index
- The index of the modemgetModemIndexes()
public java.util.Enumeration children()
children
in interface javax.swing.tree.TreeNode
public int getChildCount()
TreeNode
s the receiver
contains.getChildCount
in interface javax.swing.tree.TreeNode
public javax.swing.tree.TreeNode getChildAt(int childIndex)
TreeNode
at index
childIndex
.getChildAt
in interface javax.swing.tree.TreeNode
public int getIndex(javax.swing.tree.TreeNode node)
node
in the receivers children.
If the receiver does not contain node
, -1 will be
returned.getIndex
in interface javax.swing.tree.TreeNode
public javax.swing.tree.TreeNode getParent()
TreeNode
of the receiver.getParent
in interface javax.swing.tree.TreeNode
public boolean getAllowsChildren()
getAllowsChildren
in interface javax.swing.tree.TreeNode
public boolean isLeaf()
isLeaf
in interface javax.swing.tree.TreeNode
public void action()
action
in class SNMPBean
public void run()
run
in class SNMPRunBean
SNMPRunBean.isRunning()
public void update(java.util.Observable obs, java.lang.Object ov)
update
in interface java.util.Observer
public void setParent(javax.swing.tree.TreeNode p)
public void setDefaultTreeModel(javax.swing.tree.DefaultTreeModel model)
protected void fireTreeModelChanged()
DefaultTreeModel.nodeStructureChanged(javax.swing.tree.TreeNode)
|
SNMP Stack 4_12 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |