public interface NotificationHandler
Java interface must be implemented by your classes that must manage
incoming notifications sent by the connected SAP CC system.handleNotification(..) method:
Example
This notification handler prints information relating to each received notification:
public void handleNotification(String systemId, InstanceId systemInstanceId, long timestamp, int descUid, String... args) {
NotificationDescription description = NotifBook.searchNotificationDescription(descUid);
if (description == null) {
// Should never occur
System.out.println("Unknown notification");
return;
}
System.out.println("notification received @"+timestamp);
System.out.println(" > SID: "+systemId);
System.out.println(" > Instance ID: "+systemInstanceId);
System.out.println(" > uid: "+descUid);
System.out.println(" > name: "+description.getName());
System.out.println(" > technical name: "+description.getPrettyName());
System.out.println(" > level: "+description.getSeverityLevel());
if (description.getAdditionalInfoKeys().length != 0) {
System.out.println(" >>>> additional info >>>>");
for (int i = 0; i < description.getAdditionalInfoKeys().length; i++) {
System.out.println(" > "+description.getAdditionalInfoKeys()[i]+": "+args[i]);
}
}
System.out.println();
...
You release the thread calling this method as soon as possible since it may be the thread responsible for reading the notifications from the network.
Notification,
NotifBook,
NotificationServiceClient| Modifier and Type | Method and Description |
|---|---|
void |
handleNotification(java.lang.String systemName,
InstanceId instanceID,
long timestamp,
int uid,
java.lang.String... args)
Invoked each time a
notification must be managed by the client application. |
void handleNotification(java.lang.String systemName,
InstanceId instanceID,
long timestamp,
int uid,
java.lang.String... args)
notification must be managed by the client application.
The notification description is available thanks to the
NotifBook invoking its searchNotificationDescription(..) method
with uid as argument.
Recommendation
SAP strongly recommends to release the thread calling this method as soon as possible since it may be the thread responsible for reading the notifications from the network.
systemName - The unique SAP Identifier (SID) of the SAP CC system that threw the notificationinstanceID - The identifier of the system instance (e.g. rater#1) that threw the notificationtimestamp - The date when the notification has been thrownuid - The unique identifier of the notification class; Use this ID to determine the class and the related description of the received notification.args - The arguments of the notification