Cisco Cisco Prime Central 1.5.2 Developer's Guide

Page of 223
Appendix II – 3GPP-Miscellaneous
 
11.7.2 Useful Code Snippets for 3GPP Notification Consumer 
Developing a notification consumer involves implementing the 3GPP 
Notification IRP Webservice interface and publishing it.  
•  Sample Implementation of the Notification IRP Webservice interface: 
 
import java.io.StringWriter; 
 
import javax.jws.Oneway; 
import javax.jws.WebMethod; 
import javax.jws.WebParam; 
import javax.xml.bind.JAXBContext; 
import javax.xml.bind.JAXBElement; 
import javax.xml.bind.JAXBException; 
import javax.xml.bind.Marshaller; 
import javax.xml.namespace.QName; 
import javax.xml.ws.RequestWrapper; 
 
import 
org._3gpp.ftp.specs.archive._32_series._32_307.schema._32307_810.notificat
ion.notificationirpntfdata.AnySequenceType; 
import 
org._3gpp.ftp.specs.archive._32_series._32_307.schema._32307_810.notificat
ion.notificationirpntfsystem.NotificationIRPNtf; 
 
@javax.jws.WebService(serviceName = "NotificationIRPNtf", portName = 
"NotificationIRPNtf", targetNamespace = 
"http://www.3gpp.org/ftp/Specs/archive/32_series/32.307/schema/32307-
810/notification/NotificationIRPNtfSystem", name = "NotificationIRPNtf", 
endpointInterface = 
"org._3gpp.ftp.specs.archive._32_series._32_307.schema._32307_810.notifica
tion.notificationirpntfsystem.NotificationIRPNtf") 
public class TGPPNotificationConsumerImpl implements NotificationIRPNtf{ 
   
  @Oneway 
  @RequestWrapper(localName = "notify", targetNamespace = 
"http://www.3gpp.org/ftp/Specs/archive/32_series/32.307/schema/32307-
810/notification/NotificationIRPNtfData", className = 
"org._3gpp.ftp.specs.archive._32_series._32_307.schema._32307_810.notifica
tion.notificationirpntfdata.Notify") 
  @WebMethod(action = 
"http://www.3gpp.org/ftp/Specs/archive/32_series/32.307/schema/32307-
810/notification/notify") 
  public void notify(@WebParam(name = "notificationHeaderAndBody", 
targetNamespace = "") AnySequenceType anySequence) { 
   
// Do something with the notification 
   
// This implementation just marshalls the notification and prints 
it. 
   
parseJAXBElement(anySequence); 
  } 
 
  @SuppressWarnings({ "unchecked", "rawtypes" }) 
  public void parseJAXBElement(AnySequenceType anySequence) { 
 
   
try { 
   
 
JAXBContext jaxbContext = 
JAXBContext.newInstance(anySequence.getClass(),  
   
 
 
  org._3gpp.ftp.specs.archive._32_series._32.ObjectFactory.class); 
 
   
 
Marshaller jaxbMarshaller = jaxbContext.createMarshaller(); 
 
   
 
// output pretty printed 
 
Cisco Prime OSS  Integration  Guide for  MTOSI and 3GPP 
 
 
221