Cisco Voice CORBA Gateway sends asynchronous events to subscribed Network Management (NM) layer applications as CORBA Notifications via CORBA Notification Service. Orbix Notification Service provided by Iona Technologies is used as CORBA Notification Service.
Orbix Notification Service provides the consumer applications (notification receivers, in this case, NM layer applications) an interface to filter the notifications based on the notification content.
Cisco Voice CORBA Gateway sends the following types of events:
1. Object events (Inventory events)
2. Alarm events
Two channels are created in Orbix Notification service, Object Event Channel for inventory events and Alarm Event Channel for alarm events. NM layer applications will subscribe for notifications on these channels with Orbix Notification Service.
Cisco Voice CORBA Gateway uses Containment path (Full Distinguished Name - FDN) as the object identifier, so NM applications do not need to have knowledge of EM specific Object Identifiers to identify the managed objects.
Object Events
Three types of Object events are sent by Cisco Voice CORBA Gateway.
Object-Create Event: Generated when an EMS object is created in the EMS object tree
Object-Delete Event: Generated when an EMS object is deleted from EMS object tree
AttributeValue-Change Event: Generated when there is a change in the attribute(s) of an EMS object.
Cisco Voice CORBA Gateway creates a channel in the Orbix Notification Service with the name "cisco.mcg.eventChannel.ObjectEventChannel-Channel" for sending Object Events.
Format of CORBA notifications for object events is shown in the following figure. Remaining body field is present only in case of AttributeValue-Change events.
Table 5-1 CORBA Notifications for Object Events
domain_type (=MCG)
Fixed Header
event_type (=GenericObjectEvent)
event_name (=no value)
CLASS
Value
Filterable body fields
PATH
Value
PARENT
Value
OID
Value
EVENTTYPE
Value
TIMESTAMP
Value
Attribute 1
Value
Remaining body
Attribute 2
Value
Attribute n
Value
Fixed Header:
Domain_type - Indicates the domain type of the event and is always set to MCG
Event_type - Specifies the type of event and for Object Events, it is always set to GenericObjectEvent
Event_name - No value set
Filterable body fields:
CLASS - EMS Class name of the object responsible for the event
PATH - The containment path of the object (Fully Distinguished Name) responsible for the event
PARENT - The containment path of the parent object
OID - Object Identifier in hexa-decimal format (CEMF specific format)
EVENTTYPE - Type of Object Event (Object-Create or Object-Delete or AttributeValue-Change)
TIMESTAMP - Time stamp when the event is generated
Remaining body:
Attribute (1n) - List of attributes and their values that are changed.
Alarm Events
Three types of Alarm events are sent by Cisco Voice CORBA Gateway.
Alarm-Create Event: Generated when an Alarm is created
Alarm-Delete Event: Generated when an Alarm is deleted
Alarm-Change Event: Generated when there is a change in the Alarm state.
Cisco Voice CORBA Gateway creates a channel in the Orbix Notification Service with
the name "cisco.mcg.eventChannel.AlarmEventChannel-Channel" for sending Alarm Events.
Format of CORBA notifications for alarm events is shown in the following figure.
Table 5-2 CORBA Notifications for Alarm Events
domain_type (=MCG)
Fixed Header
event_type (=AlarmEvent)
event_name (=no value)
CLASS
Value
Filterable body fields
PATH
Value
OID
Value
TIMESTAMP
Value
EVENTTYPE
Value
STATUSINFO
Value
ACKSTATUSINFO
Value
SEQUENCNUBER
Value
SEVERITY
Value
PROBABLECAUSE
Value
ADDITIONALINFO
Value
SPECIFICPROBLEM
Value
Fixed Header:
Domain_type - Indicates the domain type of the event and is always set to MCG
Event_type - Specifies the type of event and for Object Events, it is always set to AlarmEvent
Event_name - No value set
Filterable body fields:
CLASS - EMS Class name of the object responsible for the event
PATH - The containment path of the object (Fully Distinguished Name) responsible for the event
OID - Object Identifier in hexa-decimal format (CEMF specific format)
TIMESTAMP - Time stamp when the event is generated
EVENTTYPE - Type of Object Event (Alarm-Creation or Alarm- Deletion or Alarm-Change)
STATUSINFO - Status of the alarm
ACKSTATUSINFO - Acknowledgement status
SEQUENCENUMBER - Sequence number of the alarm
SEVERITY - Severity of the alarm
PROBABLECAUSE - Probable cause of the alarm
ADDITIONAL INFO - Additional information regarding the alarm
Writing an Event Consumer Application
Writing a consumer application requires the Notification Service libraries and IDL files. Cisco Voice CORBA Gateway supports push consumers. The consumer for Cisco Voice CORBA Gateway's event channels is same as writing any other consumer applications.
The following steps are involved in writing a consumer application:
Get the reference to the required channel in the notification service
Reference to the Alarm Event Channel is created in this example and is based on reading the IOR of the channel from a file. Instead, naming service can be used to achieve the same purpose.
// Set PacingInterval and MaxBatchSize QoS on the proxy
CosNotification::QoSProperties prop(2);
prop.length(2);
IT_Duration pi_tmp(1000000, 0); // wait a long time
TimeBase::TimeT pacing_interval = pi_tmp.m_ticks;
prop[0].name = CORBA::string_dup(
CosNotification::PacingInterval );
prop[0].value <<= pacing_interval;
prop[1].name = CORBA::string_dup(
CosNotification::MaximumBatchSize );
prop[1].value <<= CORBA::Long( num_events );
pps->set_qos( prop );
consumers[num_channel][i].connect(pps);
CosNotification::EventTypeSeq *eventType1=0;
eventType1 = pps->obtain_offered_types(
(CosNotifyChannelAdmin::ObtainInfoMode) 1);
cout <<"\nto get the event types offered by "
<< "ObjectEventChannel \n" <<endl;
CORBA::ULong leng=eventType1->length();
cout << "the length of event types is " <<leng <<endl;
for (int k=0; k <leng; k++ ) {
cout << "Domain name = "<<
(*eventType1)[k].domain_name<<endl;
cout << "Type name = "<< (*eventType1)[k].type_name<< endl;
}
CORBA::release(pps);
}
}
Implement the push consumer class that receives the events
The class that implements the method for receiving the events has to inherit from POA_CosNotifyComm::SequencePushConsumer class. And should override the push_structured_events() method and implement the business logic of the application that processes the event.
void
NotifyPushConsumer_i::push_structured_events(
const CosNotification::EventBatch& events
)
IT_THROW_DECL((CORBA::SystemException))
{
// Accept the incoming structured event and
// process it.
//
cout << endl << "Received Event " << endl;
bool rembody=FALSE;
MCG::ObjectAttributes* data;
char *event_type = 0;
char *domain_name =0;
char *event_name =0;
int variableLength=0;
int filterableLength=0;
//cout<< "\n consumer: Received Event Batch # " << m_count++<<
cout << "\nREMAINING BODY: with len= " << len << endl;
for( int i=0; i < len; i++)
{
cout << "Attr-" << i << "-Name: "
<< data->attrs[i].name
<< " Value: "
<< data->attrs[i].value <<endl;
}
}
}
totalEvents += events.length();
cout <<" Total events = " << totalEvents << endl;
}
Wait for the events
The consumer application can start waiting for the events by executing orb->run() in the mainmethod. The events are asynchronously pushed to the consumer.
Example programs for the consumer application are shipped with the VCG package and are available under <VCG_INSTALL_DIR>/src directory.
The IORs of the two channels are also available in the files for convenience in the root directory of the server machine.
/AlarmEventChannel.ref - Contains IOR of Alarm Event Channel
/ObjectEventChannel.ref - Contains IOR of Object Event Channel