Cisco Cisco License Manager SDK Bulletins
Guide
© 2010 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information.
Page 43 of 66
}
See Also
●
For login functions to the Cisco License Manager server, see Chapter 3.
●
For detailed descriptions of functions used in this program, see Chapter 16 of the Java API Reference Guide
for Cisco License Manager.
Chapter 10: Listening to Device Notifications
●
How do I register a listener?
●
What do I do with the incoming notifications from devices?
Solution
In this chapter, the program CLMRegisterNotificationApp is developed to show how to listen for device notifications.
To achieve this, your program will do the following:
●
Log in to the Cisco License Manager server
●
Register for notifications
●
Log out from the Cisco License Manager server
Register for Notifications
Use the call
registerNotificationListener
to register a listener for all notifications. Passed in the listener is a
NotificationListener object. NotificationListener.onNotification() is invoked when a notification event arrives. The
Notification object contains the detailed information.
boolean rc = m_instance.registerNotificationListener(token,
new NotificationListener() {
public void onNotification(Notification arg0) {
…
}
});
public void onNotification(Notification arg0) {
// TODO Auto-generated method stub
Notification notification = arg0;
Notification.Operation op = notification.getOperation();
String devId = null;
String licLineId = null;
System.out.println("Notification, type is: " + op.toString());
if (op.equals(Notification.Operation.EXPIRED)) {