2 * Copyright © 2017 Orange, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.transportpce.servicehandler.impl;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import java.time.OffsetDateTime;
12 import java.time.ZoneOffset;
13 import java.time.format.DateTimeFormatter;
15 import java.util.Optional;
16 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
17 import org.opendaylight.transportpce.common.OperationResult;
18 import org.opendaylight.transportpce.common.ResponseCodes;
19 import org.opendaylight.transportpce.pce.service.PathComputationService;
20 import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
21 import org.opendaylight.transportpce.servicehandler.CatalogInput;
22 import org.opendaylight.transportpce.servicehandler.DowngradeConstraints;
23 import org.opendaylight.transportpce.servicehandler.ModelMappingUtils;
24 import org.opendaylight.transportpce.servicehandler.ServiceInput;
25 import org.opendaylight.transportpce.servicehandler.catalog.CatalogDataStoreOperations;
26 import org.opendaylight.transportpce.servicehandler.catalog.CatalogMapper;
27 import org.opendaylight.transportpce.servicehandler.listeners.NetworkListener;
28 import org.opendaylight.transportpce.servicehandler.listeners.PceListener;
29 import org.opendaylight.transportpce.servicehandler.listeners.RendererListener;
30 import org.opendaylight.transportpce.servicehandler.service.PCEServiceWrapper;
31 import org.opendaylight.transportpce.servicehandler.service.RendererServiceWrapper;
32 import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
33 import org.opendaylight.transportpce.servicehandler.validation.CatalogValidation;
34 import org.opendaylight.transportpce.servicehandler.validation.ServiceCreateValidation;
35 import org.opendaylight.transportpce.servicehandler.validation.checks.ComplianceCheckResult;
36 import org.opendaylight.transportpce.servicehandler.validation.checks.ServicehandlerComplianceCheck;
37 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.PathComputationRequestOutput;
38 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.PathComputationRerouteRequestOutput;
39 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.path.computation.reroute.request.input.EndpointsBuilder;
40 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.RpcActions;
41 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.ServiceNotificationTypes;
42 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.configuration.response.common.ConfigurationResponseCommon;
43 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.sdnc.request.header.SdncRequestHeaderBuilder;
44 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
45 import org.opendaylight.yang.gen.v1.http.org.openroadm.operational.mode.catalog.rev230526.operational.mode.catalog.OpenroadmOperationalModes;
46 import org.opendaylight.yang.gen.v1.http.org.openroadm.operational.mode.catalog.rev230526.operational.mode.catalog.SpecificOperationalModes;
47 import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209.routing.constraints.HardConstraints;
48 import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209.routing.constraints.SoftConstraints;
49 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.AddOpenroadmOperationalModesToCatalogInput;
50 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.AddOpenroadmOperationalModesToCatalogOutput;
51 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.AddSpecificOperationalModesToCatalogInput;
52 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.AddSpecificOperationalModesToCatalogOutput;
53 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.EndTerminalActivationRequestInput;
54 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.EndTerminalActivationRequestOutput;
55 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.EndTerminalDeactivationRequestInput;
56 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.EndTerminalDeactivationRequestOutput;
57 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.EndTerminalPerformanceInfoRequestInput;
58 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.EndTerminalPerformanceInfoRequestOutput;
59 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.EndTerminalPowerControlInput;
60 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.EndTerminalPowerControlOutput;
61 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.EquipmentNotificationInput;
62 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.EquipmentNotificationOutput;
63 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.NetworkReOptimizationInput;
64 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.NetworkReOptimizationOutput;
65 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.OpticalTunnelCreateInput;
66 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.OpticalTunnelCreateOutput;
67 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.OpticalTunnelRequestCancelInput;
68 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.OpticalTunnelRequestCancelOutput;
69 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.OrgOpenroadmServiceService;
70 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceCreateBulkInput;
71 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceCreateBulkOutput;
72 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceCreateComplexResultNotificationRequestInput;
73 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceCreateComplexResultNotificationRequestOutput;
74 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceCreateInput;
75 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceCreateOutput;
76 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceCreateResultNotificationRequestInput;
77 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceCreateResultNotificationRequestOutput;
78 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceDeleteComplexResultNotificationRequestInput;
79 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceDeleteComplexResultNotificationRequestOutput;
80 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceDeleteInput;
81 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceDeleteInputBuilder;
82 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceDeleteOutput;
83 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceDeleteResultNotificationRequestInput;
84 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceDeleteResultNotificationRequestOutput;
85 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceFeasibilityCheckBulkInput;
86 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceFeasibilityCheckBulkOutput;
87 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceFeasibilityCheckInput;
88 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceFeasibilityCheckOutput;
89 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceReconfigureBulkInput;
90 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceReconfigureBulkOutput;
91 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceReconfigureInput;
92 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceReconfigureOutput;
93 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceReconfigureResultNotificationRequestInput;
94 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceReconfigureResultNotificationRequestOutput;
95 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceRerouteConfirmInput;
96 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceRerouteConfirmOutput;
97 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceRerouteConfirmResultNotificationRequestInput;
98 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceRerouteConfirmResultNotificationRequestOutput;
99 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceRerouteInput;
100 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceRerouteOutput;
101 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceRestorationInput;
102 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceRestorationOutput;
103 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceRestorationResultNotificationRequestInput;
104 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceRestorationResultNotificationRequestOutput;
105 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceReversionInput;
106 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceReversionOutput;
107 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceReversionResultNotificationRequestInput;
108 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceReversionResultNotificationRequestOutput;
109 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceRollInput;
110 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceRollOutput;
111 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceRollResultNotificationRequestInput;
112 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceRollResultNotificationRequestOutput;
113 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceSrlgGetInput;
114 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceSrlgGetOutput;
115 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.TempServiceCreateBulkInput;
116 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.TempServiceCreateBulkOutput;
117 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.TempServiceCreateInput;
118 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.TempServiceCreateOutput;
119 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.TempServiceDeleteInput;
120 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.TempServiceDeleteOutput;
121 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.delete.input.ServiceDeleteReqInfo.TailRetention;
122 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.delete.input.ServiceDeleteReqInfoBuilder;
123 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.list.Services;
124 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.path.description.atoz.direction.AToZ;
125 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.path.description.atoz.direction.AToZKey;
126 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.pce.resource.resource.resource.TerminationPoint;
127 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePaths;
128 import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessService;
129 import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessServiceBuilder;
130 import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceAEndBuilder;
131 import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceZEndBuilder;
132 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
133 import org.opendaylight.yangtools.yang.common.RpcResult;
134 import org.osgi.service.component.annotations.Activate;
135 import org.osgi.service.component.annotations.Component;
136 import org.osgi.service.component.annotations.Reference;
137 import org.slf4j.Logger;
138 import org.slf4j.LoggerFactory;
142 * Top level service interface providing main OpenROADM controller services.
145 public class ServicehandlerImpl implements OrgOpenroadmServiceService {
146 private static final Logger LOG = LoggerFactory.getLogger(ServicehandlerImpl.class);
147 private static final String PUBLISHER = "ServiceHandler";
148 private static final String TEMP_SERVICE_CREATE_MSG = "tempServiceCreate: {}";
149 private static final String TEMP_SERVICE_DELETE_MSG = "tempServiceDelete: {}";
150 private static final String SERVICE_RESTORATION_MSG = "serviceRestoration: {}";
151 private static final String SERVICE_RECONFIGURE_MSG = "serviceReconfigure: {}";
152 private static final String SERVICE_FEASIBILITY_CHECK_MSG = "serviceFeasibilityCheck: {}";
153 private static final String SERVICE_DELETE_MSG = "serviceDelete: {}";
154 private static final String SERVICE_CREATE_MSG = "serviceCreate: {}";
155 private static final String ADD_OR_TO_CATALOG_MSG = "addORToCatalog: {}";
156 private static final String ADD_SPECIFIC_TO_CATALOG_MSG = "addSpecificToCatalog: {}";
158 private ServiceDataStoreOperations serviceDataStoreOperations;
159 private PCEServiceWrapper pceServiceWrapper;
160 private RendererServiceWrapper rendererServiceWrapper;
161 private PceListener pceListenerImpl;
162 private RendererListener rendererListenerImpl;
163 private NetworkListener networkModelListenerImpl;
164 private NotificationPublishService notificationPublishService;
165 private CatalogDataStoreOperations catalogDataStoreOperations;
168 public ServicehandlerImpl(@Reference PathComputationService pathComputationService,
169 @Reference RendererServiceOperations rendererServiceOperations,
170 @Reference NotificationPublishService notificationPublishService,
171 @Reference PceListener pceListenerImpl,
172 @Reference RendererListener rendererListenerImpl,
173 @Reference NetworkListener networkModelListenerImpl,
174 @Reference ServiceDataStoreOperations serviceDataStoreOperations,
175 @Reference CatalogDataStoreOperations catalogDataStoreOperations) {
176 this.catalogDataStoreOperations = catalogDataStoreOperations;
177 this.serviceDataStoreOperations = serviceDataStoreOperations;
178 this.notificationPublishService = notificationPublishService;
179 this.pceServiceWrapper = new PCEServiceWrapper(pathComputationService, notificationPublishService);
180 this.rendererServiceWrapper = new RendererServiceWrapper(rendererServiceOperations, notificationPublishService);
181 this.pceListenerImpl = pceListenerImpl;
182 this.rendererListenerImpl = rendererListenerImpl;
183 this.networkModelListenerImpl = networkModelListenerImpl;
184 LOG.info("ServicehandlerImpl Initiated");
188 // This is class is public so that these messages can be accessed from Junit (avoid duplications).
189 public static final class LogMessages {
191 public static final String PCE_CALLING;
192 public static final String ABORT_PCE_FAILED;
193 public static final String PCE_FAILED;
194 public static final String ABORT_SERVICE_NON_COMPLIANT;
195 public static final String SERVICE_NON_COMPLIANT;
196 public static final String RENDERER_DELETE_FAILED;
197 public static final String ABORT_VALID_FAILED;
198 public static final String ABORT_OR_TO_CATALOG_FAILED;
199 public static final String ABORT_SPECIFIC_TO_CATALOG_FAILED;
201 // Static blocks are generated once and spare memory.
203 PCE_CALLING = "Calling PCE";
204 ABORT_PCE_FAILED = "Aborting: PCE calculation failed ";
205 PCE_FAILED = "PCE calculation failed";
206 ABORT_SERVICE_NON_COMPLIANT = "Aborting: non-compliant service ";
207 SERVICE_NON_COMPLIANT = "non-compliant service";
208 RENDERER_DELETE_FAILED = "Renderer service delete failed";
209 ABORT_VALID_FAILED = "Aborting: validation of service create request failed";
210 ABORT_OR_TO_CATALOG_FAILED = "Aborting: validation of add OR to catalog request failed";
211 ABORT_SPECIFIC_TO_CATALOG_FAILED = "Aborting: validation of add Specific to catalog request failed";
214 public static String serviceInDS(String serviceName) {
215 return "Service '" + serviceName + "' already exists in datastore";
218 public static String serviceNotInDS(String serviceName) {
219 return "Service '" + serviceName + "' does not exist in datastore";
222 public static String servicePathNotInDS(String serviceName) {
223 return "Service Path from '" + serviceName + "' does not exist in datastore";
226 public static String serviceInService(String serviceName) {
227 return "Service '" + serviceName + "' is in 'inService' state";
230 private LogMessages() {
235 public ListenableFuture<RpcResult<ServiceCreateOutput>> serviceCreate(ServiceCreateInput input) {
236 LOG.info("RPC serviceCreate received");
238 OperationResult validationResult = ServiceCreateValidation.validateServiceCreateRequest(
239 new ServiceInput(input), RpcActions.ServiceCreate);
240 if (!validationResult.isSuccess()) {
241 LOG.warn(SERVICE_CREATE_MSG, LogMessages.ABORT_VALID_FAILED);
242 return ModelMappingUtils.createCreateServiceReply(
243 input, ResponseCodes.FINAL_ACK_YES,
244 validationResult.getResultMessage(), ResponseCodes.RESPONSE_FAILED);
246 //Check any presence of services with the same name
247 String serviceName = input.getServiceName();
248 if (this.serviceDataStoreOperations.getService(serviceName).isPresent()) {
249 LOG.warn(SERVICE_CREATE_MSG, LogMessages.serviceInDS(serviceName));
250 return ModelMappingUtils.createCreateServiceReply(input, ResponseCodes.FINAL_ACK_YES,
251 LogMessages.serviceInDS(serviceName), ResponseCodes.RESPONSE_FAILED);
253 // TODO: Here we also have to check if there is an associated temp-service.
254 // TODO: If there is one, delete it from the temp-service-list??
255 this.pceListenerImpl.setInput(new ServiceInput(input));
256 this.pceListenerImpl.setServiceReconfigure(false);
257 this.pceListenerImpl.setTempService(false);
258 this.pceListenerImpl.setserviceDataStoreOperations(this.serviceDataStoreOperations);
259 this.rendererListenerImpl.setserviceDataStoreOperations(serviceDataStoreOperations);
260 this.rendererListenerImpl.setServiceInput(new ServiceInput(input));
261 // This ensures that the temp-service boolean is false, especially, when
262 // service-create is initiated after the temp-service-create
263 this.rendererListenerImpl.setTempService(false);
264 this.networkModelListenerImpl.setserviceDataStoreOperations(serviceDataStoreOperations);
265 LOG.debug(SERVICE_CREATE_MSG, LogMessages.PCE_CALLING);
266 PathComputationRequestOutput output = this.pceServiceWrapper.performPCE(input, true);
267 if (output == null) {
268 LOG.warn(SERVICE_CREATE_MSG, LogMessages.ABORT_PCE_FAILED);
269 sendNbiNotification(new PublishNotificationProcessServiceBuilder()
270 .setServiceName(serviceName)
271 .setServiceAEnd(new ServiceAEndBuilder(input.getServiceAEnd()).build())
272 .setServiceZEnd(new ServiceZEndBuilder(input.getServiceZEnd()).build())
273 .setCommonId(input.getCommonId())
274 .setConnectionType(input.getConnectionType())
275 .setResponseFailed(LogMessages.ABORT_PCE_FAILED)
276 .setMessage("ServiceCreate request failed ...")
277 .setOperationalState(State.Degraded)
278 .setPublisherName(PUBLISHER)
280 return ModelMappingUtils.createCreateServiceReply(input, ResponseCodes.FINAL_ACK_YES,
281 LogMessages.PCE_FAILED, ResponseCodes.RESPONSE_FAILED);
283 LOG.info("RPC serviceCreate in progress...");
284 ConfigurationResponseCommon common = output.getConfigurationResponseCommon();
285 return ModelMappingUtils.createCreateServiceReply(
286 input, common.getAckFinalIndicator(),
287 common.getResponseMessage(), common.getResponseCode());
291 public ListenableFuture<RpcResult<ServiceDeleteOutput>> serviceDelete(ServiceDeleteInput input) {
292 String serviceName = input.getServiceDeleteReqInfo().getServiceName();
293 LOG.info("RPC serviceDelete request received for {}", serviceName);
296 * Upon receipt of service-deleteService RPC, service header and sdnc-request
297 * header compliance are verified.
299 ComplianceCheckResult serviceHandlerCheckResult =
300 ServicehandlerComplianceCheck.check(
301 input.getServiceDeleteReqInfo().getServiceName(),
302 input.getSdncRequestHeader(), null, RpcActions.ServiceDelete, false, true);
303 if (!serviceHandlerCheckResult.hasPassed()) {
304 LOG.warn(SERVICE_DELETE_MSG, LogMessages.ABORT_SERVICE_NON_COMPLIANT);
305 return ModelMappingUtils.createDeleteServiceReply(
306 input, ResponseCodes.FINAL_ACK_YES,
307 LogMessages.SERVICE_NON_COMPLIANT, ResponseCodes.RESPONSE_FAILED);
310 //Check presence of service to be deleted
311 Optional<Services> serviceOpt = this.serviceDataStoreOperations.getService(serviceName);
313 if (serviceOpt.isEmpty()) {
314 LOG.warn(SERVICE_DELETE_MSG, LogMessages.serviceNotInDS(serviceName));
315 return ModelMappingUtils.createDeleteServiceReply(
316 input, ResponseCodes.FINAL_ACK_YES,
317 LogMessages.serviceNotInDS(serviceName), ResponseCodes.RESPONSE_FAILED);
319 service = serviceOpt.orElseThrow();
320 LOG.debug("serviceDelete: Service '{}' found in datastore", serviceName);
321 this.pceListenerImpl.setInput(new ServiceInput(input));
322 this.pceListenerImpl.setServiceReconfigure(false);
323 this.pceListenerImpl.setserviceDataStoreOperations(this.serviceDataStoreOperations);
324 this.rendererListenerImpl.setserviceDataStoreOperations(serviceDataStoreOperations);
325 this.rendererListenerImpl.setServiceInput(new ServiceInput(input));
326 this.networkModelListenerImpl.setserviceDataStoreOperations(serviceDataStoreOperations);
327 org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.ServiceDeleteInput
328 serviceDeleteInput = ModelMappingUtils.createServiceDeleteInput(new ServiceInput(input));
329 org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.ServiceDeleteOutput output =
330 this.rendererServiceWrapper.performRenderer(
331 serviceDeleteInput, ServiceNotificationTypes.ServiceDeleteResult, service);
333 if (output == null) {
334 LOG.error(SERVICE_DELETE_MSG, LogMessages.RENDERER_DELETE_FAILED);
335 sendNbiNotification(new PublishNotificationProcessServiceBuilder()
336 .setServiceName(service.getServiceName())
337 .setServiceAEnd(new ServiceAEndBuilder(service.getServiceAEnd()).build())
338 .setServiceZEnd(new ServiceZEndBuilder(service.getServiceZEnd()).build())
339 .setCommonId(service.getCommonId())
340 .setConnectionType(service.getConnectionType())
341 .setMessage("ServiceDelete request failed ...")
342 .setOperationalState(State.InService)
343 .setResponseFailed(LogMessages.RENDERER_DELETE_FAILED)
344 .setPublisherName(PUBLISHER)
346 return ModelMappingUtils.createDeleteServiceReply(
347 input, ResponseCodes.FINAL_ACK_YES,
348 LogMessages.RENDERER_DELETE_FAILED, ResponseCodes.RESPONSE_FAILED);
351 LOG.debug("RPC serviceDelete in progress...");
352 ConfigurationResponseCommon common = output.getConfigurationResponseCommon();
353 return ModelMappingUtils.createDeleteServiceReply(
354 input, common.getAckFinalIndicator(),
355 common.getResponseMessage(), common.getResponseCode());
359 public ListenableFuture<RpcResult<ServiceFeasibilityCheckOutput>> serviceFeasibilityCheck(
360 ServiceFeasibilityCheckInput input) {
361 LOG.info("RPC serviceFeasibilityCheck received");
363 ServiceInput serviceInput = new ServiceInput(input);
364 OperationResult validationResult = ServiceCreateValidation.validateServiceCreateRequest(serviceInput,
365 RpcActions.ServiceFeasibilityCheck);
366 if (! validationResult.isSuccess()) {
367 LOG.warn(SERVICE_FEASIBILITY_CHECK_MSG, LogMessages.ABORT_VALID_FAILED);
368 return ModelMappingUtils.createCreateServiceReply(
369 input, ResponseCodes.FINAL_ACK_YES,
370 validationResult.getResultMessage(), ResponseCodes.RESPONSE_FAILED);
372 this.pceListenerImpl.setInput(new ServiceInput(input));
373 this.pceListenerImpl.setServiceReconfigure(false);
374 this.pceListenerImpl.setServiceFeasiblity(true);
375 this.pceListenerImpl.setserviceDataStoreOperations(this.serviceDataStoreOperations);
376 this.rendererListenerImpl.setserviceDataStoreOperations(serviceDataStoreOperations);
377 this.rendererListenerImpl.setServiceInput(new ServiceInput(input));
378 this.networkModelListenerImpl.setserviceDataStoreOperations(serviceDataStoreOperations);
379 LOG.debug(SERVICE_FEASIBILITY_CHECK_MSG, LogMessages.PCE_CALLING);
380 PathComputationRequestOutput output = this.pceServiceWrapper.performPCE(input, true);
381 if (output == null) {
382 LOG.warn(SERVICE_FEASIBILITY_CHECK_MSG, LogMessages.ABORT_PCE_FAILED);
383 return ModelMappingUtils.createCreateServiceReply(input, ResponseCodes.FINAL_ACK_YES,
384 LogMessages.PCE_FAILED, ResponseCodes.RESPONSE_FAILED);
386 LOG.info("RPC serviceFeasibilityCheck in progress...");
387 ConfigurationResponseCommon common = output.getConfigurationResponseCommon();
388 return ModelMappingUtils.createCreateServiceReply(
389 input, common.getAckFinalIndicator(),
390 common.getResponseMessage(), common.getResponseCode());
394 public ListenableFuture<RpcResult<ServiceReconfigureOutput>> serviceReconfigure(ServiceReconfigureInput input) {
395 String serviceName = input.getServiceName();
396 LOG.info("RPC serviceReconfigure received for {}", serviceName);
397 Optional<Services> servicesObject = this.serviceDataStoreOperations.getService(serviceName);
398 if (servicesObject.isEmpty()) {
399 LOG.warn(SERVICE_RECONFIGURE_MSG, LogMessages.serviceNotInDS(serviceName));
400 return ModelMappingUtils.createCreateServiceReply(
402 LogMessages.serviceNotInDS(serviceName));
404 LOG.debug("Service '{}' found in datastore", serviceName);
405 OperationResult validationResult = ServiceCreateValidation
406 .validateServiceCreateRequest(new ServiceInput(input), RpcActions.ServiceReconfigure);
407 if (!validationResult.isSuccess()) {
408 LOG.warn(SERVICE_RECONFIGURE_MSG, LogMessages.ABORT_VALID_FAILED);
409 return ModelMappingUtils.createCreateServiceReply(
411 validationResult.getResultMessage());
413 this.pceListenerImpl.setInput(new ServiceInput(input));
414 this.pceListenerImpl.setServiceReconfigure(true);
415 this.pceListenerImpl.setserviceDataStoreOperations(this.serviceDataStoreOperations);
416 this.rendererListenerImpl.setserviceDataStoreOperations(serviceDataStoreOperations);
417 this.rendererListenerImpl.setServiceInput(new ServiceInput(input));
418 this.networkModelListenerImpl.setserviceDataStoreOperations(serviceDataStoreOperations);
419 org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915
420 .ServiceDeleteInput serviceDeleteInput =
421 ModelMappingUtils.createServiceDeleteInput(new ServiceInput(input));
422 org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915
423 .ServiceDeleteOutput output = this.rendererServiceWrapper.performRenderer(serviceDeleteInput,
424 ServiceNotificationTypes.ServiceDeleteResult, null);
425 if (output == null) {
426 LOG.error(SERVICE_RECONFIGURE_MSG, LogMessages.RENDERER_DELETE_FAILED);
427 return ModelMappingUtils.createCreateServiceReply(
429 LogMessages.RENDERER_DELETE_FAILED);
430 //TODO check if RpcStatus.Successful is really expected here
432 LOG.info("RPC serviceReconfigure in progress...");
433 ConfigurationResponseCommon common = output.getConfigurationResponseCommon();
434 return ModelMappingUtils.createCreateServiceReply(
436 common.getResponseMessage());
440 public ListenableFuture<RpcResult<ServiceRestorationOutput>> serviceRestoration(ServiceRestorationInput input) {
441 String serviceName = input.getServiceName();
442 LOG.info("RPC serviceRestoration received for {}", serviceName);
443 Optional<Services> servicesObject = this.serviceDataStoreOperations.getService(serviceName);
445 if (!servicesObject.isPresent()) {
446 LOG.warn(SERVICE_RESTORATION_MSG, LogMessages.serviceNotInDS(serviceName));
447 return ModelMappingUtils.createRestoreServiceReply(
448 LogMessages.serviceNotInDS(serviceName));
451 Services service = servicesObject.orElseThrow();
452 State state = service.getOperationalState();
454 if (state == State.InService) {
455 LOG.error(SERVICE_RESTORATION_MSG, LogMessages.serviceInService(serviceName));
456 return ModelMappingUtils.createRestoreServiceReply(
457 LogMessages.serviceInService(serviceName));
460 DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx");
461 OffsetDateTime offsetDateTime = OffsetDateTime.now(ZoneOffset.UTC);
462 DateAndTime datetime = new DateAndTime(dtf.format(offsetDateTime));
463 SdncRequestHeaderBuilder sdncBuilder = new SdncRequestHeaderBuilder()
464 .setNotificationUrl(service.getSdncRequestHeader().getNotificationUrl())
465 .setRequestId(service.getSdncRequestHeader().getRequestId())
466 .setRequestSystemId(service.getSdncRequestHeader().getRequestSystemId())
467 .setRpcAction(RpcActions.ServiceDelete);
468 ServiceDeleteInputBuilder deleteInputBldr = new ServiceDeleteInputBuilder()
469 .setServiceDeleteReqInfo(new ServiceDeleteReqInfoBuilder()
470 .setServiceName(serviceName)
471 .setDueDate(datetime)
472 .setTailRetention(TailRetention.No).build())
473 .setSdncRequestHeader(sdncBuilder.build());
474 ServiceInput serviceInput = new ServiceInput(deleteInputBldr.build());
475 serviceInput.setServiceAEnd(service.getServiceAEnd());
476 serviceInput.setServiceZEnd(service.getServiceZEnd());
477 serviceInput.setConnectionType(service.getConnectionType());
478 HardConstraints hardConstraints = service.getHardConstraints();
479 if (hardConstraints == null) {
480 LOG.warn("service '{}' HardConstraints is not set !", serviceName);
482 SoftConstraints softConstraints = service.getSoftConstraints();
483 if (softConstraints == null) {
484 LOG.warn("service '{}' SoftConstraints is not set !", serviceName);
485 serviceInput.setSoftConstraints(DowngradeConstraints.convertToSoftConstraints(hardConstraints));
487 LOG.info("converting hard constraints to soft constraints ...");
488 serviceInput.setSoftConstraints(
489 DowngradeConstraints.updateSoftConstraints(hardConstraints, softConstraints));
491 serviceInput.setHardConstraints(DowngradeConstraints.downgradeHardConstraints(hardConstraints));
493 this.pceListenerImpl.setInput(serviceInput);
494 this.pceListenerImpl.setServiceReconfigure(true);
495 this.pceListenerImpl.setserviceDataStoreOperations(this.serviceDataStoreOperations);
496 this.rendererListenerImpl.setServiceInput(serviceInput);
497 this.rendererListenerImpl.setserviceDataStoreOperations(this.serviceDataStoreOperations);
498 this.networkModelListenerImpl.setserviceDataStoreOperations(serviceDataStoreOperations);
499 org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915
500 .ServiceDeleteInput serviceDeleteInput = ModelMappingUtils.createServiceDeleteInput(
501 new ServiceInput(deleteInputBldr.build()));
502 org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915
503 .ServiceDeleteOutput output = this.rendererServiceWrapper.performRenderer(serviceDeleteInput,
504 ServiceNotificationTypes.ServiceDeleteResult, null);
505 if (output == null) {
506 LOG.error(SERVICE_RESTORATION_MSG, LogMessages.RENDERER_DELETE_FAILED);
507 return ModelMappingUtils.createRestoreServiceReply(LogMessages.RENDERER_DELETE_FAILED);
509 LOG.info("RPC serviceRestore in progress...");
510 ConfigurationResponseCommon common = output.getConfigurationResponseCommon();
511 return ModelMappingUtils.createRestoreServiceReply(common.getResponseMessage());
516 public ListenableFuture<RpcResult<EquipmentNotificationOutput>>
517 equipmentNotification(EquipmentNotificationInput input) {
518 // TODO Auto-generated method stub
523 public ListenableFuture<RpcResult<ServiceRerouteConfirmOutput>>
524 serviceRerouteConfirm(ServiceRerouteConfirmInput input) {
525 // TODO Auto-generated method stub
530 public ListenableFuture<RpcResult<ServiceRerouteOutput>> serviceReroute(ServiceRerouteInput input) {
531 String serviceName = input.getServiceName();
532 LOG.info("RPC serviceReroute received for {}", serviceName);
533 Optional<Services> servicesObject = this.serviceDataStoreOperations.getService(serviceName);
534 if (servicesObject.isEmpty()) {
535 LOG.warn("serviceReroute: {}", LogMessages.serviceNotInDS(serviceName));
536 return ModelMappingUtils.createRerouteServiceReply(
537 input, ResponseCodes.FINAL_ACK_YES,
538 LogMessages.serviceNotInDS(serviceName),
539 ResponseCodes.RESPONSE_FAILED);
541 Services service = servicesObject.orElseThrow();
542 Optional<ServicePaths> servicePathsObject = this.serviceDataStoreOperations.getServicePath(serviceName);
543 if (servicePathsObject.isEmpty()) {
544 LOG.warn("serviceReroute: {}", LogMessages.servicePathNotInDS(serviceName));
545 return ModelMappingUtils.createRerouteServiceReply(
546 input, ResponseCodes.FINAL_ACK_YES,
547 LogMessages.servicePathNotInDS(serviceName),
548 ResponseCodes.RESPONSE_FAILED);
550 ServicePaths servicePaths = servicePathsObject.orElseThrow();
551 // serviceInput for later use maybe...
552 ServiceInput serviceInput = new ServiceInput(input);
553 serviceInput.setServiceAEnd(service.getServiceAEnd());
554 serviceInput.setServiceZEnd(service.getServiceZEnd());
555 serviceInput.setConnectionType(service.getConnectionType());
556 serviceInput.setCommonId(service.getCommonId());
557 serviceInput.setHardConstraints(service.getHardConstraints());
558 serviceInput.setSoftConstraints(service.getSoftConstraints());
559 serviceInput.setCustomer(service.getCustomer());
560 serviceInput.setCustomerContact(service.getCustomerContact());
562 // Get the network xpdr termination points
563 Map<AToZKey, AToZ> mapaToz = servicePaths.getPathDescription().getAToZDirection().getAToZ();
564 String aendtp = ((TerminationPoint) mapaToz.get(new AToZKey(String.valueOf(mapaToz.size() - 3)))
568 String zendtp = ((TerminationPoint) mapaToz.get(new AToZKey("2"))
573 PathComputationRerouteRequestOutput output = this.pceServiceWrapper.performPCEReroute(
574 service.getHardConstraints(), service.getSoftConstraints(), input.getSdncRequestHeader(),
575 service.getServiceAEnd(), service.getServiceZEnd(),
576 new EndpointsBuilder().setAEndTp(aendtp).setZEndTp(zendtp).build());
578 if (output == null) {
579 LOG.error("serviceReroute: {}", LogMessages.PCE_FAILED);
580 return ModelMappingUtils.createRerouteServiceReply(
581 input, ResponseCodes.FINAL_ACK_YES,
582 LogMessages.PCE_FAILED, ResponseCodes.RESPONSE_FAILED);
584 LOG.info("RPC ServiceReroute is done");
585 ConfigurationResponseCommon common = output.getConfigurationResponseCommon();
586 return ModelMappingUtils.createRerouteServiceReply(input, common.getAckFinalIndicator(),
587 common.getResponseMessage(), common.getResponseCode());
591 public ListenableFuture<RpcResult<ServiceReversionOutput>> serviceReversion(ServiceReversionInput input) {
592 // TODO Auto-generated method stub
597 public ListenableFuture<RpcResult<ServiceRollOutput>> serviceRoll(ServiceRollInput input) {
598 // TODO Auto-generated method stub
603 public ListenableFuture<RpcResult<NetworkReOptimizationOutput>>
604 networkReOptimization(NetworkReOptimizationInput input) {
605 // TODO Auto-generated method stub
610 public ListenableFuture<RpcResult<TempServiceDeleteOutput>> tempServiceDelete(TempServiceDeleteInput input) {
611 String commonId = input.getCommonId();
612 LOG.info("RPC temp serviceDelete request received for {}", commonId);
615 * Upon receipt of service-deleteService RPC, service header and sdnc-request
616 * header compliance are verified.
618 LOG.debug("checking Service Compliance ...");
619 ComplianceCheckResult serviceHandlerCheckResult = ServicehandlerComplianceCheck.check(
620 commonId, null, null, RpcActions.ServiceDelete, false, false
622 if (!serviceHandlerCheckResult.hasPassed()) {
623 LOG.warn(TEMP_SERVICE_DELETE_MSG, LogMessages.ABORT_SERVICE_NON_COMPLIANT);
624 return ModelMappingUtils.createDeleteServiceReply(
625 input, ResponseCodes.FINAL_ACK_YES,
626 LogMessages.SERVICE_NON_COMPLIANT, ResponseCodes.RESPONSE_FAILED);
629 //Check presence of service to be deleted
630 LOG.debug("service common-id '{}' is compliant", commonId);
631 Optional<org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.temp.service.list.Services>
633 this.serviceDataStoreOperations.getTempService(commonId);
634 if (service.isEmpty()) {
635 LOG.error(TEMP_SERVICE_DELETE_MSG, LogMessages.serviceNotInDS(commonId));
636 return ModelMappingUtils.createDeleteServiceReply(
637 input, ResponseCodes.FINAL_ACK_YES,
638 LogMessages.serviceNotInDS(commonId), ResponseCodes.RESPONSE_FAILED);
641 LOG.info("Service '{}' present in datastore !", commonId);
642 this.pceListenerImpl.setInput(new ServiceInput(input));
643 this.pceListenerImpl.setServiceReconfigure(false);
644 this.pceListenerImpl.setserviceDataStoreOperations(this.serviceDataStoreOperations);
645 this.rendererListenerImpl.setserviceDataStoreOperations(this.serviceDataStoreOperations);
646 this.rendererListenerImpl.setServiceInput(new ServiceInput(input));
647 this.rendererListenerImpl.setTempService(true);
648 this.networkModelListenerImpl.setserviceDataStoreOperations(serviceDataStoreOperations);
649 org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.ServiceDeleteOutput output =
650 this.rendererServiceWrapper.performRenderer(input, ServiceNotificationTypes.ServiceDeleteResult);
651 if (output == null) {
652 LOG.error(TEMP_SERVICE_DELETE_MSG, LogMessages.RENDERER_DELETE_FAILED);
653 return ModelMappingUtils.createDeleteServiceReply(
654 input, ResponseCodes.FINAL_ACK_YES,
655 LogMessages.RENDERER_DELETE_FAILED, ResponseCodes.RESPONSE_FAILED);
657 LOG.info("RPC tempServiceDelete in progress...");
658 ConfigurationResponseCommon common = output.getConfigurationResponseCommon();
659 return ModelMappingUtils.createDeleteServiceReply(
660 input, common.getAckFinalIndicator(),
661 common.getResponseMessage(), common.getResponseCode());
665 public ListenableFuture<RpcResult<TempServiceCreateOutput>> tempServiceCreate(TempServiceCreateInput input) {
666 LOG.info("RPC tempServiceCreate received");
668 OperationResult validationResult = ServiceCreateValidation.validateServiceCreateRequest(
669 new ServiceInput(input), RpcActions.TempServiceCreate);
670 if (! validationResult.isSuccess()) {
671 LOG.warn(TEMP_SERVICE_CREATE_MSG, LogMessages.ABORT_VALID_FAILED);
672 return ModelMappingUtils.createCreateServiceReply(
673 input, ResponseCodes.FINAL_ACK_YES,
674 validationResult.getResultMessage(), ResponseCodes.RESPONSE_FAILED);
677 //Check any presence of temp-service with the same commonId
678 String commonId = input.getCommonId();
679 if (this.serviceDataStoreOperations.getTempService(commonId).isPresent()) {
680 LOG.warn(TEMP_SERVICE_CREATE_MSG, LogMessages.serviceInDS("Temp (" + commonId + ")"));
681 return ModelMappingUtils.createCreateServiceReply(input, ResponseCodes.FINAL_ACK_YES,
682 LogMessages.serviceInDS("Temp (" + commonId + ")"), ResponseCodes.RESPONSE_FAILED);
685 // Starting service create operation
686 LOG.debug(TEMP_SERVICE_CREATE_MSG, LogMessages.PCE_CALLING);
687 this.pceListenerImpl.setInput(new ServiceInput(input));
688 this.pceListenerImpl.setServiceReconfigure(false);
689 this.pceListenerImpl.setserviceDataStoreOperations(this.serviceDataStoreOperations);
690 this.pceListenerImpl.setTempService(true);
691 this.rendererListenerImpl.setserviceDataStoreOperations(serviceDataStoreOperations);
692 this.rendererListenerImpl.setServiceInput(new ServiceInput(input));
693 this.rendererListenerImpl.setTempService(true);
694 this.networkModelListenerImpl.setserviceDataStoreOperations(serviceDataStoreOperations);
695 PathComputationRequestOutput output = this.pceServiceWrapper.performPCE(input, true);
696 if (output == null) {
697 LOG.warn(TEMP_SERVICE_CREATE_MSG, LogMessages.ABORT_PCE_FAILED);
698 return ModelMappingUtils.createCreateServiceReply(
699 input, ResponseCodes.FINAL_ACK_YES,
700 LogMessages.PCE_FAILED, ResponseCodes.RESPONSE_FAILED);
702 LOG.info("RPC tempServiceCreate in progress...");
703 ConfigurationResponseCommon common = output.getConfigurationResponseCommon();
704 return ModelMappingUtils.createCreateServiceReply(
705 input, common.getAckFinalIndicator(),
706 common.getResponseMessage(), common.getResponseCode());
710 public ListenableFuture<RpcResult<
711 ServiceDeleteComplexResultNotificationRequestOutput>> serviceDeleteComplexResultNotificationRequest(
712 ServiceDeleteComplexResultNotificationRequestInput input) {
713 // TODO Auto-generated method stub
718 public ListenableFuture<RpcResult<
719 ServiceCreateResultNotificationRequestOutput>> serviceCreateResultNotificationRequest(
720 ServiceCreateResultNotificationRequestInput input) {
721 // TODO Auto-generated method stub
726 public ListenableFuture<RpcResult<
727 ServiceDeleteResultNotificationRequestOutput>> serviceDeleteResultNotificationRequest(
728 ServiceDeleteResultNotificationRequestInput input) {
729 // TODO Auto-generated method stub
734 public ListenableFuture<RpcResult<
735 ServiceCreateComplexResultNotificationRequestOutput>> serviceCreateComplexResultNotificationRequest(
736 ServiceCreateComplexResultNotificationRequestInput input) {
737 // TODO Auto-generated method stub
742 public ListenableFuture<RpcResult<ServiceFeasibilityCheckBulkOutput>> serviceFeasibilityCheckBulk(
743 ServiceFeasibilityCheckBulkInput input) {
744 // TODO Auto-generated method stub
749 * Send notification to NBI notification in order to publish message.
750 * @param service PublishNotificationService
752 private void sendNbiNotification(PublishNotificationProcessService service) {
754 notificationPublishService.putNotification(service);
755 } catch (InterruptedException e) {
756 LOG.warn("Cannot send notification to nbi", e);
757 Thread.currentThread().interrupt();
763 public ListenableFuture<RpcResult<ServiceCreateBulkOutput>> serviceCreateBulk(ServiceCreateBulkInput input) {
764 // TODO Auto-generated method stub
769 public ListenableFuture<RpcResult<TempServiceCreateBulkOutput>> tempServiceCreateBulk(
770 TempServiceCreateBulkInput input) {
771 // TODO Auto-generated method stub
776 public ListenableFuture<RpcResult<ServiceRollResultNotificationRequestOutput>> serviceRollResultNotificationRequest(
777 ServiceRollResultNotificationRequestInput input) {
778 // TODO Auto-generated method stub
783 public ListenableFuture<RpcResult<ServiceReconfigureBulkOutput>> serviceReconfigureBulk(
784 ServiceReconfigureBulkInput input) {
785 // TODO Auto-generated method stub
790 public ListenableFuture<RpcResult<ServiceReconfigureResultNotificationRequestOutput>>
791 serviceReconfigureResultNotificationRequest(ServiceReconfigureResultNotificationRequestInput input) {
792 // TODO Auto-generated method stub
797 public ListenableFuture<RpcResult<ServiceRestorationResultNotificationRequestOutput>>
798 serviceRestorationResultNotificationRequest(ServiceRestorationResultNotificationRequestInput input) {
799 // TODO Auto-generated method stub
804 public ListenableFuture<RpcResult<ServiceReversionResultNotificationRequestOutput>>
805 serviceReversionResultNotificationRequest(ServiceReversionResultNotificationRequestInput input) {
806 // TODO Auto-generated method stub
811 public ListenableFuture<RpcResult<ServiceRerouteConfirmResultNotificationRequestOutput>>
812 serviceRerouteConfirmResultNotificationRequest(ServiceRerouteConfirmResultNotificationRequestInput input) {
813 // TODO Auto-generated method stub
818 public ListenableFuture<RpcResult<OpticalTunnelCreateOutput>> opticalTunnelCreate(OpticalTunnelCreateInput input) {
819 // TODO Auto-generated method stub
824 public ListenableFuture<RpcResult<OpticalTunnelRequestCancelOutput>> opticalTunnelRequestCancel(
825 OpticalTunnelRequestCancelInput input) {
826 // TODO Auto-generated method stub
832 * Implementation of the RPC to set OR operational modes in the catalog of the controller.
833 * Semantics of the RPC is such that the information in the input replaces the full content
834 * of the OR operational modes catalog in the config data store. Incremental changes to the
835 * catalog, if required, must be done via individual PUT/POST/DELETE RESTconf APIs.
837 * @param input AddOpenroadmOperationalModesToCatalogInput to be added to Catalog
838 * @return Result of the request
840 public ListenableFuture<RpcResult<AddOpenroadmOperationalModesToCatalogOutput>>
841 addOpenroadmOperationalModesToCatalog(AddOpenroadmOperationalModesToCatalogInput input) {
843 LOG.info("RPC addOpenroadmOperationalModesToCatalog in progress");
844 LOG.debug(" Input openRoadm {}", input);
846 OperationResult validationResult = CatalogValidation.validateORCatalogRequest(
847 new CatalogInput(input), RpcActions.FillCatalogWithOrOperationalModes);
848 if (! validationResult.isSuccess()) {
849 LOG.warn(ADD_OR_TO_CATALOG_MSG, LogMessages.ABORT_OR_TO_CATALOG_FAILED);
850 return ModelMappingUtils.addOpenroadmServiceReply(
851 input, ResponseCodes.FINAL_ACK_YES,
852 validationResult.getResultMessage(), ResponseCodes.RESPONSE_FAILED);
854 LOG.info(" Request System Id {} " ,input.getSdncRequestHeader().getRequestSystemId());
855 LOG.info(" Rpc Action {} " ,input.getSdncRequestHeader().getRpcAction());
857 OpenroadmOperationalModes objToSave = CatalogMapper.createORModesToSave(input);
858 catalogDataStoreOperations.addOpenroadmOperationalModesToCatalog(objToSave);
859 LOG.info("RPC addOpenroadmOperationalModesToCatalog Completed");
860 return ModelMappingUtils.addOpenroadmServiceReply(input, ResponseCodes.FINAL_ACK_YES,
861 validationResult.getResultMessage(), ResponseCodes.RESPONSE_OK);
866 * Implementation of the RPC to set specific operational modes in the catalog of the controller.
867 * Semantics of the RPC is such that the information in the input replaces the full content
868 * of the specific operational modes catalog in the config data store. Incremental changes to the
869 * catalog, if required, must be done via individual PUT/POST/DELETE RESTconf APIs.
871 * @param input AddSpecificOperationalModesToCatalogInput to be added to Catalog
872 * @return Result of the request
874 public ListenableFuture<RpcResult<AddSpecificOperationalModesToCatalogOutput>> addSpecificOperationalModesToCatalog(
875 AddSpecificOperationalModesToCatalogInput input) {
877 LOG.info("RPC addSpecificOperationalModesToCatalog in progress");
878 LOG.debug(" Input openSpecificRoadm {}", input);
880 OperationResult validationResult = CatalogValidation.validateSpecificCatalogRequest(
881 new CatalogInput(input), RpcActions.FillCatalogWithSpecificOperationalModes);
882 if (! validationResult.isSuccess()) {
883 LOG.warn(ADD_SPECIFIC_TO_CATALOG_MSG, LogMessages.ABORT_SPECIFIC_TO_CATALOG_FAILED);
884 return ModelMappingUtils.addSpecificOpenroadmServiceReply(
885 input, ResponseCodes.FINAL_ACK_YES,
886 validationResult.getResultMessage(), ResponseCodes.RESPONSE_FAILED);
888 LOG.info(" Request System Id {} " ,input.getSdncRequestHeader().getRequestSystemId());
889 LOG.info(" Rpc Action {} " ,input.getSdncRequestHeader().getRpcAction());
891 SpecificOperationalModes objToSave = CatalogMapper.createSpecificModesToSave(input);
892 catalogDataStoreOperations.addSpecificOperationalModesToCatalog(objToSave);
893 LOG.info("RPC addSpecificOperationalModesToCatalog Completed");
894 return ModelMappingUtils.addSpecificOpenroadmServiceReply(input, ResponseCodes.FINAL_ACK_YES,
895 validationResult.getResultMessage(), ResponseCodes.RESPONSE_OK);
899 public ListenableFuture<RpcResult<ServiceSrlgGetOutput>> serviceSrlgGet(ServiceSrlgGetInput input) {
900 // TODO Auto-generated method stub
905 public ListenableFuture<RpcResult<EndTerminalPerformanceInfoRequestOutput>> endTerminalPerformanceInfoRequest(
906 EndTerminalPerformanceInfoRequestInput input) {
907 // TODO Auto-generated method stub
912 public ListenableFuture<RpcResult<EndTerminalActivationRequestOutput>> endTerminalActivationRequest(
913 EndTerminalActivationRequestInput input) {
914 // TODO Auto-generated method stub
919 public ListenableFuture<RpcResult<EndTerminalDeactivationRequestOutput>> endTerminalDeactivationRequest(
920 EndTerminalDeactivationRequestInput input) {
921 // TODO Auto-generated method stub
926 public ListenableFuture<RpcResult<EndTerminalPowerControlOutput>> endTerminalPowerControl(
927 EndTerminalPowerControlInput input) {
928 // TODO Auto-generated method stub