- String message = "";
- String responseCode = "";
- PceSendingPceRPCs sendingPCE = new PceSendingPceRPCs(input, dataBroker);
- sendingPCE.pathComputation();
- message = sendingPCE.getMessage();
- responseCode = sendingPCE.getResponseCode();
- PathDescriptionBuilder path = null;
- path = sendingPCE.getPathDescription();
-
-
- LOG.info("PCE response: {} {}", message, responseCode);
- if ((sendingPCE.getSuccess() == false) || (path == null)) {
- configurationResponseCommon
- .setAckFinalIndicator("Yes")
- .setRequestId(input.getServiceHandlerHeader().getRequestId())
- .setResponseCode(responseCode)
- .setResponseMessage(message);
-
- output.setConfigurationResponseCommon(configurationResponseCommon.build());
- return output.build();
- }
+ @Override
+ public PathComputationRequestOutput call() throws Exception {
+ PathComputationRequestOutputBuilder output = new PathComputationRequestOutputBuilder();
+ ConfigurationResponseCommonBuilder configurationResponseCommon =
+ new ConfigurationResponseCommonBuilder();
+ PceComplianceCheckResult check = PceComplianceCheck.check(input);
+ if (!check.hasPassed()) {
+ LOG.error("Path not calculated, service not compliant : {}", check.getMessage());
+ sendNotifications(ServicePathNotificationTypes.PathComputationRequest, input.getServiceName(),
+ RpcStatusEx.Failed, "Path not calculated, service not compliant", null);
+ configurationResponseCommon.setAckFinalIndicator("Yes")
+ .setRequestId(input.getServiceHandlerHeader().getRequestId())
+ .setResponseCode("Path not calculated").setResponseMessage(check.getMessage());
+ output.setConfigurationResponseCommon(configurationResponseCommon.build())
+ .setResponseParameters(null);
+ return output.build();
+ }
+ sendNotifications(ServicePathNotificationTypes.PathComputationRequest, input.getServiceName(),
+ RpcStatusEx.Pending, "Service compliant, submitting pathComputation Request ...", null);
+ String message = "";
+ String responseCode = "";
+ PceSendingPceRPCs sendingPCE = new PceSendingPceRPCs(input, networkTransactionService);
+ sendingPCE.pathComputation();
+ message = sendingPCE.getMessage();
+ responseCode = sendingPCE.getResponseCode();
+ PathDescriptionBuilder path = null;
+ path = sendingPCE.getPathDescription();
+ LOG.info("PCE response: {} {}", message, responseCode);
+ if (!(sendingPCE.getSuccess()) || (path == null)) {
+ configurationResponseCommon.setAckFinalIndicator("Yes")
+ .setRequestId(input.getServiceHandlerHeader().getRequestId()).setResponseCode(responseCode)
+ .setResponseMessage(message);
+ output.setConfigurationResponseCommon(configurationResponseCommon.build());
+ sendNotifications(ServicePathNotificationTypes.PathComputationRequest, input.getServiceName(),
+ RpcStatusEx.Failed, "Path not calculated", null);
+ return output.build();
+ }
+ // Path calculator returned Success
+ configurationResponseCommon.setAckFinalIndicator("Yes")
+ .setRequestId(input.getServiceHandlerHeader().getRequestId()).setResponseCode(responseCode)
+ .setResponseMessage(message);
+ PathDescription pathDescription = new org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce
+ .pce.rev190624.service.path.rpc.result.PathDescriptionBuilder()
+ .setAToZDirection(path.getAToZDirection()).setZToADirection(path.getZToADirection())
+ .build();
+ sendNotifications(ServicePathNotificationTypes.PathComputationRequest, input.getServiceName(),
+ RpcStatusEx.Successful, message, pathDescription);
+ org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev191009.response
+ .parameters.sp.response.parameters.PathDescription pathDescription1 = new org.opendaylight.yang.gen
+ .v1.http.org.transportpce.b.c._interface.service.types.rev191009.response.parameters.sp
+ .response.parameters.PathDescriptionBuilder()
+ .setAToZDirection(path.getAToZDirection()).setZToADirection(path.getZToADirection())
+ .build();
+ ResponseParametersBuilder rpb = new ResponseParametersBuilder().setPathDescription(pathDescription1);
+ output.setConfigurationResponseCommon(configurationResponseCommon.build())
+ .setResponseParameters(rpb.build());