Modifying states and statuses

Setting a network element state in the OSI state system

The following code shows how to modify the usage state of the neast node and set it to the active value:
neast.setState(IltOSI.State.Usage.Active);
The Active symbol is the name of a global variable that contains a state value. This value is an instance of the IltOSI.State.Usage class (which is itself an IltState subclass).

Setting network element states in the Bellcore state system

The following code fragment shows how to change the primary state of the berlin node to EnabledActive and how to set the Busy secondary state on this node:
berlin.setState(IltBellcore.State.EnabledActive);
berlin.setState(IltBellcore.SecState.Busy);
Note that the use of the functional interface is the same for all the telecom object classes and the state systems.

Setting network element states in the SNMP state system

The following code fragment shows how to change the primary state of the berlin node to Shutdown and how to set the Interface.InOctets secondary state on this node. This code is an extract from the snmp sample in the distribution.

How to change the primary state of a node and set the secondary state

berlin.setState(IltSNMP.State.Shutdown);
berlin.setState (IltMisc.SecState.TestFailed);
berlin.set (IltSNMP.Interface.InOctets, new Integer (123));
In the SNMP state dictionary, most of the states have numeric values. In order to set the values for these states you can use either IltSNMPObjectState or IltObject. Both of these APIs provide methods to set and retrieve the value of a numeric state.
  • set sets the value of the given state.
  • get returns the value of the given state.
Besides the numeric and Boolean states present in the SNMP state dictionary, there is also a set of information that is related to the system being managed and that is defined in the MIB-II System Group. The information in the group is displayed in a System window (explained in detail in System window). The graphical representation of this information is an icon that, when clicked, opens the System window containing the list of all the attributes set in the telecom object. For information regarding the insertion of new attributes, see Creating a new attribute in the System group.
The following code extract shows how to change the values of the attributes defined by the System Group.

How to change the attribute values defined by the system group

IltSNMPObjectState objstate = (IltSNMPObjectState) berlin.getObjectState();
IltSNMP.SystemInfo sysinfo = objstate.getSystemInfo();
Sysinfo.setDescription ("Berlin station");
Sysinfo.setContact ("John Doe");

Setting link states

In this example, we modify the berlin_west link, which uses the SONET state system.

How to set link states

berlin_west.setState(IltSONET.State.Active);