skip to main content
Programmers documentation > Business objects and data sources > States > Trap states
 
Trap states
JViews TGO provides another concept of alarm that is based on RFC 1157 - A Simple Network Management Protocol (SNMP). Basically, a trap represents something unusual that occurs in an object. Traps, as well as alarms, are represented graphically using the alarm balloon and alarm count decorations. The graphical cues described in the Graphical cues for alarm states are also valid when representing traps. Another similarity with alarms is the concept of new, acknowledged and outstanding traps, which were explained in Alarm state details.
Trap type coding
JViews TGO provides the following range of trap types and their associated graphic representations. These types are based on the generic traps defined in RFC 1157.
Trap color coding scheme
Type
Color
Letter
Link Failure
Red
LF
Authentication Failure
Red
AF
Cold Start
Blue
CS
Warm Start
Orange
WS
EGP Neighbor Loss
Yellow
NL
You can add new trap types and associate them with a color and label. Functions for extending traps, as well as examples, are provided in Customizing trap types.
Trap state graphical representations illustrates some alarm status examples and their associated visual representations.
Trap state graphical representations
Trap Status
Visual
Comment
New Link Failure
The resource has received a link failure trap.
New Link Failure
The resource has received one new link failure trap, plus other less severe new traps.
Acknowledged Cold Start
The resource has received one new link failure trap, plus other less severe new traps.
Acknowledged Link Failure traps and New Neighbor loss traps
The resource has acknowledged link failure traps, as well as new EGP neighbor loss traps.
Trap types
JViews TGO defines five trap types based on RFC 1157; they are the elements of the IltTrap.Type enumeration. These instances of IltTrap.Type are statically allocated and are stored in static data members of IltTrap.
Available severity values are:
*IltTrap.Type. LinkFailure
*IltTrap.Type. AuthenticationFailure
*IltTrap.Type. EGPNeighborLoss
*IltTrap.Type. ColdStart
*IltTrap.Type. WarmStart
Other types can be defined to extend the default trap model. See Customizing trap types for an explanation of how to do this.
Defining trap states with the API
Traps carried by telecom objects are described in the same way as states. Traps are held by one of the IltObjectState object attributes and are modeled using an instance of the class IltTrap.State, which is a subclass of IltState.
Make sure output of the apilink is IltTrap.State
For each trap type, the alarm object includes the following information:
*the number of new traps
*the number of acknowledged traps.
The trap model is the alarm representation for SNMP-based objects. To retrieve the information about traps, you should use the method IltObject. getTrapState.
The following code shows how traps are managed on the paris network element. The API for managing traps is directly available from the IltObject class.
How to set traps directly
The following code line retrieves the object state corresponding to the alarms for Paris:
 
IltTrap.State alarms = paris.getTrapState();
The following code line shows how to set new alarms on the object.
 
alarms.setNewAlarmCount(IltTrap.Type.LinkFailure, 2);
To set acknowledged traps, use the following code:
 
alarms.setAcknowledgedAlarmCount(IltTrap.Type.LinkFailure, 2);
Traps can be set either directly as shown above, or incrementally as in the following code sample, where a new Link Failure trap is added to the same network element.
How to set traps incrementally
 
alarms.addNewAlarm(IltTrap.Type.LinkFailure);
System.out.println("Link Failure traps on Paris: "
        + alarms.getNewAlarmCount(IltTrap.Type.LinkFailure));
The printed output is the following:
 
Link Failure traps on Paris: 3 new
Defining trap states in XML
For details on how to load alarm states in XML, refer to Trap states.

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.