1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.miloss.fgsms.wsn.broker;
23
24 import javax.annotation.Resource;
25 import javax.jws.*;
26 import javax.jws.soap.SOAPBinding;
27 import javax.xml.bind.annotation.XmlSeeAlso;
28 import javax.xml.datatype.DatatypeFactory;
29 import javax.xml.ws.WebServiceContext;
30 import org.apache.log4j.Logger;
31 import org.oasis_open.docs.wsn.b_2.*;
32 import org.oasis_open.docs.wsn.brw_2.ResourceUnknownFault;
33 import org.oasis_open.docs.wsn.brw_2.UnableToDestroyPullPointFault;
34 import org.oasis_open.docs.wsn.brw_2.UnableToGetMessagesFault;
35
36
37
38
39
40
41 @WebService(name = "PullPoint", targetNamespace = "http://docs.oasis-open.org/wsn/brw-2", serviceName = "PullPointService", portName = "PullPointBindingPort"
42 ,wsdlLocation = "brw-2impl.wsdl")
43 @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
44 @XmlSeeAlso({
45 org.oasis_open.docs.wsrf.r_2.ObjectFactory.class,
46 org.oasis_open.docs.wsrf.bf_2.ObjectFactory.class,
47 org.oasis_open.docs.wsn.t_1.ObjectFactory.class,
48 org.oasis_open.docs.wsn.b_2.ObjectFactory.class,
49 org.oasis_open.docs.wsn.br_2.ObjectFactory.class
50 })
51 public class PullPointService implements org.oasis_open.docs.wsn.brw_2.PullPoint {
52
53 private DatatypeFactory df = null;
54 @Resource
55 private WebServiceContext ctx;
56 final static Logger log = Logger.getLogger("WS-NotificationBroker");
57
58
59
60
61
62
63
64
65 @WebMethod(operationName = "GetMessages", action = "GetMessages")
66 @WebResult(name = "GetMessagesResponse", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "GetMessagesResponse")
67 public GetMessagesResponse getMessages(
68 @WebParam(name = "GetMessages", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "GetMessagesRequest") GetMessages getMessagesRequest)
69 throws ResourceUnknownFault, UnableToGetMessagesFault {
70 SingletonBroker.getInstance();
71 return SingletonBroker.GetMessages(getMessagesRequest);
72
73 }
74
75
76
77
78
79
80
81
82 @WebMethod(operationName = "DestroyPullPoint", action = "DestroyPullPoint")
83 @WebResult(name = "DestroyPullPointResponse", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "DestroyPullPointResponse")
84 public DestroyPullPointResponse destroyPullPoint(
85 @WebParam(name = "DestroyPullPoint", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "DestroyPullPointRequest") DestroyPullPoint destroyPullPointRequest)
86 throws ResourceUnknownFault, UnableToDestroyPullPointFault {
87
88 SingletonBroker.getInstance();
89 SingletonBroker.DestroyMailBox(destroyPullPointRequest.getAny());
90 DestroyPullPointResponse res = new DestroyPullPointResponse();
91 return res;
92 }
93
94
95
96
97
98 @WebMethod(operationName = "Notify", action = "Notify")
99 @Oneway
100 public void notify(
101 @WebParam(name = "Notify", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "Notify") Notify notify) {
102
103
104
105 SingletonBroker.getInstance();
106 SingletonBroker.Dispatch(notify);
107 }
108 }