The Java CMIS Messaging API service message classes
correspond to the different CMIS
services defined in the Common Management Information Service
ITU standard (X.710). For example, some of the Java CMIS message
classes are:
M_GET_Req : M-GET Request
M_GET_Ind : M-GET Indication
M_GET_Cnf : M-GET Confirmation
M_GET_Rsp : M-GET Response
M_SET_Req : M-SET Request
M_SET_Ind : M-SET Indication
M_SET_Cnf : M-SET Confirmation
M_SET_Rsp : M-SET Response
... and so on for M-CREATE, M-DELETE, M-ACTION,
... M-EVENT-REPORT and M-CANCEL-GET
In addition to the message classes, the CMIS Messaging API provides
high-level parameter and error classes for the CMIP datatypes defined
in the Common Management Information Protocol ITU standard (X.710).
Some of the parameter and error classes are:
ObjectClass AttributeId
ObjectInstance EventTypeId
Scope ActionTypeId
Filter Attribute
Mode Modification
AttributeList GetListError
Sync SetListError
And finally, the API includes high-level CMIS communications classes for
managing associations with remote agents and handling messages sent and received by your application. These communications classes are listed below:
AgentHandle : handle to a remote agent
Assocation : association with remote entity
AE : local application entity
CMISE : CMIS messing 'sending' interface
Notification : incoming notification
NotificationListener : CMIS event listener
IndicationListener : CMIS indication listener
M_GET_PendingIndication : represents uncompleted indication
M_GET_PendingRequest : represents outstanding request
... and so on for the other CMIS services
For a complete set of API Javadoc, developer guides,
agent simulators and much more, please click here to download the DynamicTMN® CMIP Suite evaluation package.
The following example demonstrates the use of the CMIS Messaging API to create an association, send an M-GET request, receive the M-GET response, and view the results:
// -- create an M-GET request to retrieve 2
// -- attributes from the specified network element
// --
M_GET_Req req = new M_GET_Req("managedElement",
"/managedElementId=1");
req.addAttrid("locationName");
req.addAttrid("administrativeState");
// -- get the AgentHandle from the API's naming service
// -- for the remote agent based on the object instance
// --
NamingService nameserv = TMNFramework.GetNamingService();
AgentHandle agent_handle =
nameserv.getAgentHandle(req.getObjectInstance());
// -- create and return association to the agent
// --
Association assoc = agent_handle.getValidAssociation();
// -- send the M-GET request to the agent
// --
M_GET_PendingRequest pr = assoc.cmise().send(req, 10);
// -- block awaiting the M-GET confirmation (response)
// --
M_GET_Cnf cnf = pr.cnf();
if ( ! (cnf.isError() || cnf.isReject()) )
{
Attribute.Iterator iter = cnf.getAttributes();
while(iter.hasNext())
{
Attribute attr = iter.next();
AttributeId id = attr.getAttributeId();
AbstractData val = attr.getAttributeValue();
System.out.println("(" + id + " = " + val + ")");
}
}
else
{
System.out.println("error: " + cnf);
}
For a complete set of API examples, API Javadoc, developer guides,
agent simulators and much more, please download the DynamicTMN® CMIP Suite evaluation package.