Customizing SONET states

The SONET State Dictionary groups states and indicators that are used most often to display transport links with the protection process. Such link state graphics are useful only in applications in which the end user must be informed about link states and protection switching information (as in a fiber transport network, for example).
For a description of the state system and its graphical representation, refer to
SONET states explains how to customize the object representation according to the SONET state information.

How to customize the SONET state system

To create a new SONET primary state:
  • Create the new state using the method NewState.
    This method takes two arguments: a name and a description. The name is used to identify the state in the application. The description is used to provide information about the semantics of the state.
    IltState inErrorState = IltSONET.NewState("InError", "In error state");
    
    The state defined above can be used in XML in the following way:
    <state>InError</state>
    
  • Customize the primary state representation using an attribute-based CSS selector. For more information on CSS, see section Introducing cascading style sheets in this documentation. For more information on how to customize the object representation based on states, see Customizing the object representation based on states.
    The following CSS selector modifies the configuration of all IltObject instances that have the primary state SONET InError .
    object."ilog.tgo.model.IltObject"["objectState.SONET.State"=InError] {
       foreground: red;
       centerWidth: 6;
       reliefBorders: true;
    }
    
The following example illustrates how the new SONET state is represented.
IltLink link = new IltLink(new IltSONETObjectState(), null);
link.setState(InErrorState);
The graphical results can be seen in Customizing the SONET state system.
fig18-8.gif
Customizing the SONET state system

How to use the new SONET state as a BiSONET state

A new state can also be used as a BiSONET state. In this case, you should define how the state will be represented as a state and as a reverse state.
  • Customize the link representation when it uses the BiSONET object state and its primary state is set to the newly created state. This configuration is illustrated by the following selector which indicates all objects that have the primary state InError and contain a reverse state.
    object."ilog.tgo.model.IltLink"["objectState.SONET.State"=InError]["objectSt
    ate.SONET.ReverseState"] {
      foreground:'';
      innerCenterWidth: 2;
      innerForeground: red;
      toArrowColor: red;
      toArrowReliefBorders: true;
      toArrowBorderColor: red;
      toArrowBorderColor2: red;
    }
    
  • Customize the link representation when the new state is set to the reverse state. Use the following selector.
    object."ilog.tgo.model.IltLink"["objectState.SONET.ReverseState"=InError] {
      fromArrowColor: red;
      fromArrowReliefBorders: true;
      fromArrowBorderColor: red;
      fromArrowBorderColor2: red;
      foreground: red;
      centerWidth: 6;
    }
    
  • Define a generic rule to be matched when the new state is not set. This generic rule specifies that, for the states that are not defined in the cascading style sheets, the default configuration will be applied. The corresponding selector simply sets all properties set by the other selectors to their default value, so that the configuration of the other SONET states is appropriately applied to the objects.
    object."ilog.tgo.model.IltLink" {
      foreground: '';
      centerWidth: -1;
      reliefBorders: '';
      innerCenterWidth: -1;
      innerForeground:'';
      toArrowColor:'';
      toArrowBorderColor:'';
      toArrowBorderColor2:'';
      toArrowReliefBorders: '';
      fromArrowColor:'';
      fromArrowBorderColor:'';
      fromArrowBorderColor2:'';
      fromArrowReliefBorders: '';
    }
    
The created state can be set on the object in the following way.
IltBiSONETObjectState ostate = new IltBiSONETObjectState();
ostate.setState(IltSONET.State.ActiveProtecting);
ostate.setReverseState(inErrorState);
IltLink link = new IltLink(ostate, null);