input, ResponseCodes.FINAL_ACK_YES,
validationResult.getResultMessage(), ResponseCodes.RESPONSE_FAILED);
}
- PublishNotificationService nbiNotification = new PublishNotificationServiceBuilder()
- .setServiceName(input.getServiceName())
- .setServiceAEnd(new ServiceAEndBuilder(input.getServiceAEnd()).build())
- .setServiceZEnd(new ServiceZEndBuilder(input.getServiceZEnd()).build())
- .setCommonId(input.getCommonId()).setConnectionType(input.getConnectionType())
- .setResponseFailed("")
- .setMessage("ServiceCreate request received ...")
- .setOperationalState(State.OutOfService)
- .setTopic(topic)
- .build();
- sendNbiNotification(nbiNotification);
this.pceListenerImpl.setInput(new ServiceInput(input));
this.pceListenerImpl.setServiceReconfigure(false);
this.pceListenerImpl.setserviceDataStoreOperations(this.serviceDataStoreOperations);
PathComputationRequestOutput output = this.pceServiceWrapper.performPCE(input, true);
if (output == null) {
LOG.warn(SERVICE_CREATE_MSG, LogMessages.ABORT_PCE_FAILED);
- nbiNotification = new PublishNotificationServiceBuilder(nbiNotification)
+ sendNbiNotification(new PublishNotificationServiceBuilder()
+ .setServiceName(input.getServiceName())
+ .setServiceAEnd(new ServiceAEndBuilder(input.getServiceAEnd()).build())
+ .setServiceZEnd(new ServiceZEndBuilder(input.getServiceZEnd()).build())
+ .setCommonId(input.getCommonId()).setConnectionType(input.getConnectionType())
.setResponseFailed(LogMessages.ABORT_PCE_FAILED)
.setMessage("ServiceCreate request failed ...")
.setOperationalState(State.Degraded)
- .build();
- sendNbiNotification(nbiNotification);
+ .build());
return ModelMappingUtils.createCreateServiceReply(input, ResponseCodes.FINAL_ACK_YES,
LogMessages.PCE_FAILED, ResponseCodes.RESPONSE_FAILED);
}
LogMessages.serviceNotInDS(serviceName), ResponseCodes.RESPONSE_FAILED);
}
service = serviceOpt.get();
- PublishNotificationService nbiNotification = new PublishNotificationServiceBuilder()
- .setServiceName(service.getServiceName())
- .setServiceAEnd(new ServiceAEndBuilder(service.getServiceAEnd()).build())
- .setServiceZEnd(new ServiceZEndBuilder(service.getServiceZEnd()).build())
- .setCommonId(service.getCommonId()).setConnectionType(service.getConnectionType())
- .setMessage("ServiceDelete request received ...")
- .setOperationalState(service.getOperationalState())
- .setResponseFailed("")
- .setTopic(topic)
- .build();
- sendNbiNotification(nbiNotification);
LOG.debug("serviceDelete: Service '{}' found in datastore", serviceName);
this.pceListenerImpl.setInput(new ServiceInput(input));
this.pceListenerImpl.setServiceReconfigure(false);
if (output == null) {
LOG.error(SERVICE_DELETE_MSG, LogMessages.RENDERER_DELETE_FAILED);
- nbiNotification = new PublishNotificationServiceBuilder(nbiNotification)
+ sendNbiNotification(new PublishNotificationServiceBuilder()
+ .setServiceName(service.getServiceName())
+ .setServiceAEnd(new ServiceAEndBuilder(service.getServiceAEnd()).build())
+ .setServiceZEnd(new ServiceZEndBuilder(service.getServiceZEnd()).build())
+ .setCommonId(service.getCommonId()).setConnectionType(service.getConnectionType())
.setMessage("ServiceDelete request failed ...")
.setOperationalState(State.InService)
.setResponseFailed(LogMessages.RENDERER_DELETE_FAILED)
- .build();
- sendNbiNotification(nbiNotification);
+ .build());
return ModelMappingUtils.createDeleteServiceReply(
input, ResponseCodes.FINAL_ACK_YES,
LogMessages.RENDERER_DELETE_FAILED, ResponseCodes.RESPONSE_FAILED);
@classmethod
def setUpClass(cls):
# TODO: for lighty manage the activation of NBI notification feature
+ cls.init_failed = False
cls.processes = test_utils.start_tpce()
# NBI notification feature is not installed by default in Karaf
if "USE_LIGHTY" not in os.environ or os.environ['USE_LIGHTY'] != 'True':
response = test_utils.get_notifications_service_request(data)
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
- self.assertEqual(res['output']['notification-service'][-2]['service-name'], 'service1')
- self.assertEqual(res['output']['notification-service'][-2]['connection-type'], 'service')
- self.assertEqual(res['output']['notification-service'][-2]['message'], 'ServiceCreate request received ...')
self.assertEqual(res['output']['notification-service'][-1]['service-name'], 'service1')
+ self.assertEqual(res['output']['notification-service'][-1]['connection-type'], 'service')
self.assertEqual(res['output']['notification-service'][-1]['message'], 'ServiceCreate request failed ...')
self.assertEqual(res['output']['notification-service'][-1]['response-failed'],
'PCE path computation failed !')
response = test_utils.get_notifications_service_request(data)
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
- self.assertEqual(res['output']['notification-service'][-3]['service-name'], 'service1')
- self.assertEqual(res['output']['notification-service'][-3]['connection-type'], 'service')
- self.assertEqual(res['output']['notification-service'][-3]['message'], 'ServiceCreate request received ...')
- self.assertEqual(res['output']['notification-service'][-2]['service-name'], 'service1')
- self.assertEqual(res['output']['notification-service'][-2]['message'], 'PCE calculation done OK !')
self.assertEqual(res['output']['notification-service'][-1]['service-name'], 'service1')
+ self.assertEqual(res['output']['notification-service'][-1]['connection-type'], 'service')
self.assertEqual(res['output']['notification-service'][-1]['message'], 'Service implemented !')
time.sleep(2)
response = test_utils.get_notifications_service_request(data)
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
- self.assertEqual(res['output']['notification-service'][-2]['service-name'], 'service1')
- self.assertEqual(res['output']['notification-service'][-2]['connection-type'], 'service')
- self.assertEqual(res['output']['notification-service'][-2]['message'], 'ServiceDelete request received ...')
self.assertEqual(res['output']['notification-service'][-1]['service-name'], 'service1')
+ self.assertEqual(res['output']['notification-service'][-1]['connection-type'], 'service')
self.assertEqual(res['output']['notification-service'][-1]['message'], 'Service deleted !')
time.sleep(2)