2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
21 package org.openecomp.mso.bpmn.common.workflow.service;
\r
23 import javax.jws.Oneway;
\r
24 import javax.jws.WebMethod;
\r
25 import javax.jws.WebParam;
\r
26 import javax.jws.WebService;
\r
27 import javax.ws.rs.core.Context;
\r
28 import javax.xml.ws.Action;
\r
29 import javax.xml.ws.RequestWrapper;
\r
30 import javax.xml.ws.WebServiceContext;
\r
32 import org.openecomp.mso.bpmn.common.adapter.vnf.CreateVnfNotification;
\r
33 import org.openecomp.mso.bpmn.common.adapter.vnf.DeleteVnfNotification;
\r
34 import org.openecomp.mso.bpmn.common.adapter.vnf.MsoExceptionCategory;
\r
35 import org.openecomp.mso.bpmn.common.adapter.vnf.QueryVnfNotification;
\r
36 import org.openecomp.mso.bpmn.common.adapter.vnf.RollbackVnfNotification;
\r
37 import org.openecomp.mso.bpmn.common.adapter.vnf.UpdateVnfNotification;
\r
38 import org.openecomp.mso.bpmn.common.adapter.vnf.VnfAdapterNotify;
\r
39 import org.openecomp.mso.bpmn.common.adapter.vnf.VnfRollback;
\r
40 import org.openecomp.mso.bpmn.common.adapter.vnf.VnfStatus;
\r
41 import org.openecomp.mso.logger.MsoLogger;
\r
44 * Implementation of the VnfAdapterNotify service.
\r
46 @WebService(serviceName = "vnfAdapterNotify", targetNamespace = "http://org.openecomp.mso/vnfNotify")
\r
47 public class VnfAdapterNotifyServiceImpl extends AbstractCallbackService implements VnfAdapterNotify{
\r
49 private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
51 private final String logMarker = "[VNF-NOTIFY]";
\r
53 @Context WebServiceContext wsContext;
\r
55 @WebMethod(operationName = "rollbackVnfNotification")
\r
57 @RequestWrapper(localName = "rollbackVnfNotification", targetNamespace = "http://org.openecomp.mso/vnfNotify", className = "org.openecomp.mso.adapters.vnf.async.client.RollbackVnfNotification")
\r
58 @Action(input = "http://org.openecomp.mso/notify/adapterNotify/rollbackVnfNotificationRequest")
59 public void rollbackVnfNotification(
\r
60 @WebParam(name = "messageId", targetNamespace = "")
\r
62 @WebParam(name = "completed", targetNamespace = "")
\r
64 @WebParam(name = "exception", targetNamespace = "")
\r
65 MsoExceptionCategory exception,
\r
66 @WebParam(name = "errorMessage", targetNamespace = "")
\r
67 String errorMessage) {
\r
69 RollbackVnfNotification rollbackVnfNotification = new RollbackVnfNotification();
\r
71 rollbackVnfNotification.setMessageId(messageId);
\r
72 rollbackVnfNotification.setCompleted(completed);
\r
73 rollbackVnfNotification.setException(exception);
\r
74 rollbackVnfNotification.setErrorMessage(errorMessage);
\r
76 String method = "rollbackVnfNotification";
\r
77 Object message = rollbackVnfNotification;
\r
78 String messageEventName = "rollbackVnfNotificationCallback";
\r
79 String messageVariable = "rollbackVnfNotificationCallback";
\r
80 String correlationVariable = "VNFRB_messageId";
\r
81 String correlationValue = messageId;
\r
83 handleCallback(method, message, messageEventName, messageVariable,
\r
84 correlationVariable, correlationValue, logMarker);
\r
87 @WebMethod(operationName = "queryVnfNotification")
\r
89 @RequestWrapper(localName = "queryVnfNotification", targetNamespace = "http://org.openecomp.mso/vnfNotify", className = "org.openecomp.mso.adapters.vnf.async.client.QueryVnfNotification")
90 @Action(input = "http://org.openecomp.mso/notify/adapterNotify/queryVnfNotificationRequest")
91 public void queryVnfNotification(
\r
92 @WebParam(name = "messageId", targetNamespace = "")
\r
94 @WebParam(name = "completed", targetNamespace = "")
\r
96 @WebParam(name = "exception", targetNamespace = "")
\r
97 MsoExceptionCategory exception,
\r
98 @WebParam(name = "errorMessage", targetNamespace = "")
\r
99 String errorMessage,
\r
100 @WebParam(name = "vnfExists", targetNamespace = "")
\r
102 @WebParam(name = "vnfId", targetNamespace = "")
\r
104 @WebParam(name = "status", targetNamespace = "")
\r
106 @WebParam(name = "outputs", targetNamespace = "")
\r
107 QueryVnfNotification.Outputs outputs){
\r
109 String method = "queryVnfNotification";
\r
110 String messageEventName = "queryVnfNotificationCallback";
\r
111 String messageVariable = "queryVnfNotificationCallback";
\r
112 String correlationVariable = "VNFQ_messageId";
\r
113 String correlationValue = messageId;
\r
115 MsoLogger.setServiceName("MSO." + method);
\r
116 MsoLogger.setLogContext(correlationValue, "N/A");
\r
118 QueryVnfNotification message = new QueryVnfNotification();
\r
120 message.setMessageId(messageId);
\r
121 message.setCompleted(completed);
\r
122 message.setException(exception);
\r
123 message.setErrorMessage(errorMessage);
\r
124 message.setVnfExists(vnfExists);
\r
125 message.setVnfId(vnfId);
\r
126 message.setStatus(status);
\r
127 message.setOutputs(outputs);
\r
129 handleCallback(method, message, messageEventName, messageVariable,
\r
130 correlationVariable, correlationValue, logMarker);
\r
133 @WebMethod(operationName = "createVnfNotification")
\r
135 @RequestWrapper(localName = "createVnfNotification", targetNamespace = "http://org.openecomp.mso/vnfNotify", className = "org.openecomp.mso.adapters.vnf.async.client.CreateVnfNotification")
136 @Action(input = "http://org.openecomp.mso/notify/adapterNotify/createVnfNotificationRequest")
137 public void createVnfNotification(
\r
138 @WebParam(name = "messageId", targetNamespace = "")
\r
140 @WebParam(name = "completed", targetNamespace = "")
\r
142 @WebParam(name = "exception", targetNamespace = "")
\r
143 MsoExceptionCategory exception,
\r
144 @WebParam(name = "errorMessage", targetNamespace = "")
\r
145 String errorMessage,
\r
146 @WebParam(name = "vnfId", targetNamespace = "")
\r
148 @WebParam(name = "outputs", targetNamespace = "")
\r
149 CreateVnfNotification.Outputs outputs,
\r
150 @WebParam(name = "rollback", targetNamespace = "")
\r
151 VnfRollback rollback){
\r
153 String method = "createVnfNotification";
\r
154 String messageEventName = "createVnfNotificationCallback";
\r
155 String messageVariable = "createVnfNotificationCallback";
\r
156 String correlationVariable = "VNFC_messageId";
\r
157 String correlationValue = messageId;
\r
159 MsoLogger.setServiceName("MSO." + method);
\r
160 MsoLogger.setLogContext(correlationValue, "N/A");
\r
162 CreateVnfNotification message = new CreateVnfNotification();
\r
164 message.setMessageId(messageId);
\r
165 message.setCompleted(completed);
\r
166 message.setException(exception);
\r
167 message.setErrorMessage(errorMessage);
\r
168 message.setVnfId(vnfId);
\r
169 message.setOutputs(outputs);
\r
170 message.setRollback(rollback);
\r
172 handleCallback(method, message, messageEventName, messageVariable,
\r
173 correlationVariable, correlationValue, logMarker);
\r
176 @WebMethod(operationName = "updateVnfNotification")
\r
178 @RequestWrapper(localName = "updateVnfNotification", targetNamespace = "http://org.openecomp.mso/vnfNotify", className = "org.openecomp.mso.adapters.vnf.async.client.UpdateVnfNotification")
179 @Action(input = "http://org.openecomp.mso/notify/adapterNotify/updateVnfNotificationRequest")
180 public void updateVnfNotification(
\r
181 @WebParam(name = "messageId", targetNamespace = "")
\r
183 @WebParam(name = "completed", targetNamespace = "")
\r
185 @WebParam(name = "exception", targetNamespace = "")
\r
186 MsoExceptionCategory exception,
\r
187 @WebParam(name = "errorMessage", targetNamespace = "")
\r
188 String errorMessage,
\r
189 @WebParam(name = "outputs", targetNamespace = "")
\r
190 UpdateVnfNotification.Outputs outputs,
\r
191 @WebParam(name = "rollback", targetNamespace = "")
\r
192 VnfRollback rollback){
\r
194 String method = "updateVnfNotification";
\r
195 String messageEventName = "updateVnfNotificationCallback";
\r
196 String messageVariable = "updateVnfNotificationCallback";
\r
197 String correlationVariable = "VNFU_messageId";
\r
198 String correlationValue = messageId;
\r
200 MsoLogger.setServiceName("MSO." + method);
\r
201 MsoLogger.setLogContext(correlationValue, "N/A");
\r
203 UpdateVnfNotification message = new UpdateVnfNotification();
\r
205 message.setMessageId(messageId);
\r
206 message.setCompleted(completed);
\r
207 message.setException(exception);
\r
208 message.setErrorMessage(errorMessage);
\r
209 message.setOutputs(outputs);
\r
210 message.setRollback(rollback);
\r
212 handleCallback(method, message, messageEventName, messageVariable,
\r
213 correlationVariable, correlationValue, logMarker);
\r
216 @WebMethod(operationName = "deleteVnfNotification")
\r
218 @RequestWrapper(localName = "deleteVnfNotification", targetNamespace = "http://org.openecomp.mso/vnfNotify", className = "org.openecomp.mso.adapters.vnf.async.client.DeleteVnfNotification")
219 @Action(input = "http://org.openecomp.mso/notify/adapterNotify/deleteVnfNotificationRequest")
220 public void deleteVnfNotification(
\r
221 @WebParam(name = "messageId", targetNamespace = "")
\r
223 @WebParam(name = "completed", targetNamespace = "")
\r
225 @WebParam(name = "exception", targetNamespace = "")
\r
226 MsoExceptionCategory exception,
\r
227 @WebParam(name = "errorMessage", targetNamespace = "")
\r
228 String errorMessage) {
\r
230 String method = "deleteVnfNotification";
\r
231 String messageEventName = "deleteVnfACallback";
\r
232 String messageVariable = "deleteVnfACallback";
\r
233 String correlationVariable = "VNFDEL_uuid";
\r
234 String correlationValue = messageId;
\r
236 MsoLogger.setServiceName("MSO." + method);
\r
237 MsoLogger.setLogContext(correlationValue, "N/A");
\r
239 DeleteVnfNotification message = new DeleteVnfNotification();
\r
241 message.setMessageId(messageId);
\r
242 message.setCompleted(completed);
\r
243 message.setException(exception);
\r
244 message.setErrorMessage(errorMessage);
\r
246 handleCallback(method, message, messageEventName, messageVariable,
\r
247 correlationVariable, correlationValue, logMarker);
\r