summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
1f09176)
- Move the sending of the notification (Service deleted !) to the
correct end of the service-create operation
- Move the sending of the notification (Service implemented !) to the
correct end of the service-delete operation
- Send a service-create notification failure when Renderer service
implementation failed
- Send a service-delete notification failure when PCE cancel ressource
failed
- Send a service-delete notification failure when Renderer service
delete failed
JIRA: TRNSPRTPCE-447
Signed-off-by: Thierry Jiao <thierry.jiao@orange.com>
Change-Id: If38f004e2de64febd456fd0a5d778ce1fa1bb0f2
(cherry picked from commit
ffb5a8b2f12b498f367562c06d926e0dd059fb68)
.setServiceZEnd(new ServiceZEndBuilder(service.getServiceZEnd()).build())
.setCommonId(service.getCommonId()).setConnectionType(service.getConnectionType())
.setMessage("ServiceDelete request received ...")
.setServiceZEnd(new ServiceZEndBuilder(service.getServiceZEnd()).build())
.setCommonId(service.getCommonId()).setConnectionType(service.getConnectionType())
.setMessage("ServiceDelete request received ...")
- .setOperationalState(State.OutOfService)
+ .setOperationalState(service.getOperationalState())
.setResponseFailed("")
.setTopic(topic)
.build();
.setResponseFailed("")
.setTopic(topic)
.build();
if (output == null) {
LOG.error(SERVICE_DELETE_MSG, LogMessages.RENDERER_DELETE_FAILED);
nbiNotification = new PublishNotificationServiceBuilder(nbiNotification)
if (output == null) {
LOG.error(SERVICE_DELETE_MSG, LogMessages.RENDERER_DELETE_FAILED);
nbiNotification = new PublishNotificationServiceBuilder(nbiNotification)
- .setMessage("ServiceCreate request failed ...")
- .setOperationalState(State.OutOfService)
- .setResponseFailed(LogMessages.ABORT_PCE_FAILED)
+ .setMessage("ServiceDelete request failed ...")
+ .setOperationalState(State.InService)
+ .setResponseFailed(LogMessages.RENDERER_DELETE_FAILED)
.build();
sendNbiNotification(nbiNotification);
return ModelMappingUtils.createDeleteServiceReply(
.build();
sendNbiNotification(nbiNotification);
return ModelMappingUtils.createDeleteServiceReply(
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.service.path.rpc.result.PathDescriptionBuilder;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.ServiceImplementationRequestInput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev181130.State;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.service.path.rpc.result.PathDescriptionBuilder;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.ServiceImplementationRequestInput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev181130.State;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.Services;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.RpcStatusEx;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.response.parameters.sp.ResponseParameters;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.response.parameters.sp.ResponseParametersBuilder;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.RpcStatusEx;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.response.parameters.sp.ResponseParameters;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.response.parameters.sp.ResponseParametersBuilder;
sendNbiNotification(nbiNotification);
return false;
case Pending:
sendNbiNotification(nbiNotification);
return false;
case Pending:
- LOG.warn("PCE path computation returned a Penging RpcStatusEx code!");
+ LOG.warn("PCE path computation returned a Pending RpcStatusEx code!");
return false;
case Successful:
LOG.info("PCE calculation done OK !");
return false;
case Successful:
LOG.info("PCE calculation done OK !");
* Process cancel resource result.
*/
private void onCancelResourceResult() {
* Process cancel resource result.
*/
private void onCancelResourceResult() {
- if (servicePathRpcResult.getStatus() == RpcStatusEx.Failed) {
- LOG.info("PCE cancel resource failed !");
+ if (servicePathRpcResult.getStatus() == RpcStatusEx.Pending) {
+ LOG.warn("PCE cancel returned a Pending RpcStatusEx code !");
- } else if (servicePathRpcResult.getStatus() == RpcStatusEx.Pending) {
- LOG.warn("PCE cancel returned a Penging RpcStatusEx code!");
+ } else if (servicePathRpcResult.getStatus() != RpcStatusEx.Successful
+ && servicePathRpcResult.getStatus() != RpcStatusEx.Failed) {
+ LOG.error("PCE cancel returned an unknown RpcStatusEx code !");
- } else if (servicePathRpcResult.getStatus() != RpcStatusEx.Successful) {
- LOG.error("PCE cancel returned an unknown RpcStatusEx code!");
+ }
+ Services service = serviceDataStoreOperations.getService(input.getServiceName()).get();
+ PublishNotificationServiceBuilder nbiNotificationBuilder = new PublishNotificationServiceBuilder()
+ .setServiceName(service.getServiceName())
+ .setServiceAEnd(new ServiceAEndBuilder(service.getServiceAEnd()).build())
+ .setServiceZEnd(new ServiceZEndBuilder(service.getServiceZEnd()).build())
+ .setCommonId(service.getCommonId())
+ .setConnectionType(service.getConnectionType())
+ .setTopic(TOPIC);
+ if (servicePathRpcResult.getStatus() == RpcStatusEx.Failed) {
+ LOG.info("PCE cancel resource failed !");
+ sendNbiNotification(nbiNotificationBuilder
+ .setResponseFailed("PCE cancel resource failed !")
+ .setMessage("ServiceDelete request failed ...")
+ .setOperationalState(service.getOperationalState())
+ .build());
return;
}
LOG.info("PCE cancel resource done OK !");
OperationResult deleteServicePathOperationResult =
this.serviceDataStoreOperations.deleteServicePath(input.getServiceName());
if (!deleteServicePathOperationResult.isSuccess()) {
return;
}
LOG.info("PCE cancel resource done OK !");
OperationResult deleteServicePathOperationResult =
this.serviceDataStoreOperations.deleteServicePath(input.getServiceName());
if (!deleteServicePathOperationResult.isSuccess()) {
- LOG.warn("Service path was not removed from datastore!");
+ LOG.warn("Service path was not removed from datastore !");
- OperationResult deleteServiceOperationResult = null;
+ OperationResult deleteServiceOperationResult;
+ String serviceType = "";
- deleteServiceOperationResult =
- this.serviceDataStoreOperations.deleteTempService(input.getServiceName());
- if (!deleteServiceOperationResult.isSuccess()) {
- LOG.warn("Temp Service was not removed from datastore!");
- }
+ deleteServiceOperationResult = this.serviceDataStoreOperations.deleteTempService(input.getServiceName());
+ serviceType = "Temp ";
- deleteServiceOperationResult =
- this.serviceDataStoreOperations.deleteService(input.getServiceName());
- if (!deleteServiceOperationResult.isSuccess()) {
- LOG.warn("Service was not removed from datastore!");
- }
+ deleteServiceOperationResult = this.serviceDataStoreOperations.deleteService(input.getServiceName());
+ }
+ if (deleteServiceOperationResult.isSuccess()) {
+ sendNbiNotification(nbiNotificationBuilder
+ .setResponseFailed("")
+ .setMessage("Service deleted !")
+ .setOperationalState(State.Degraded)
+ .build());
+ } else {
+ LOG.warn("{}Service was not removed from datastore !", serviceType);
+ sendNbiNotification(nbiNotificationBuilder
+ .setResponseFailed(serviceType + "Service was not removed from datastore !")
+ .setMessage("ServiceDelete request failed ...")
+ .setOperationalState(service.getOperationalState())
+ .build());
}
/**
* if it was an RPC serviceReconfigure, re-launch PCR.
}
/**
* if it was an RPC serviceReconfigure, re-launch PCR.
notification);
switch (notifType) {
/* service-implementation-request. */
notification);
switch (notifType) {
/* service-implementation-request. */
onServiceImplementationResult(notification);
break;
/* service-delete. */
onServiceImplementationResult(notification);
break;
/* service-delete. */
onServiceDeleteResult(notification);
break;
default:
onServiceDeleteResult(notification);
break;
default:
break;
case Failed:
LOG.error("Renderer service delete failed !");
break;
case Failed:
LOG.error("Renderer service delete failed !");
+ Services service = serviceDataStoreOperations.getService(input.getServiceName()).get();
+ sendNbiNotification(new PublishNotificationServiceBuilder()
+ .setServiceName(service.getServiceName())
+ .setServiceAEnd(new ServiceAEndBuilder(service.getServiceAEnd()).build())
+ .setServiceZEnd(new ServiceZEndBuilder(service.getServiceZEnd()).build())
+ .setCommonId(service.getCommonId())
+ .setConnectionType(service.getConnectionType())
+ .setResponseFailed("Renderer service delete failed !")
+ .setMessage("ServiceDelete request failed ...")
+ .setOperationalState(service.getOperationalState())
+ .setTopic(TOPIC)
+ .build());
- case Pending:
- LOG.warn("Renderer service delete returned a Penging RpcStatusEx code!");
+ case Pending:
+ LOG.warn("Renderer service delete returned a Pending RpcStatusEx code!");
return;
default:
LOG.error("Renderer service delete returned an unknown RpcStatusEx code!");
return;
}
return;
default:
LOG.error("Renderer service delete returned an unknown RpcStatusEx code!");
return;
}
- Services service = serviceDataStoreOperations.getService(notification.getServiceName()).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())
- .setResponseFailed("")
- .setMessage("Service deleted !")
- .setOperationalState(org.opendaylight.yang.gen.v1.http
- .org.openroadm.common.state.types.rev181130.State.Degraded)
- .setTopic(TOPIC)
- .build();
- sendNbiNotification(nbiNotification);
LOG.info("Service '{}' deleted !", notification.getServiceName());
if (this.input == null) {
LOG.error("ServiceInput parameter is null !");
return;
}
LOG.info("Service '{}' deleted !", notification.getServiceName());
if (this.input == null) {
LOG.error("ServiceInput parameter is null !");
return;
}
- LOG.info("sending PCE cancel resource reserve for '{}'", this.input.getServiceName());
+ LOG.info("sending PCE cancel resource reserve for '{}'", this.input.getServiceName());
this.pceServiceWrapper.cancelPCEResource(this.input.getServiceName(),
ServiceNotificationTypes.ServiceDeleteResult);
sendServiceHandlerNotification(notification, ServiceNotificationTypes.ServiceDeleteResult);
this.pceServiceWrapper.cancelPCEResource(this.input.getServiceName(),
ServiceNotificationTypes.ServiceDeleteResult);
sendServiceHandlerNotification(notification, ServiceNotificationTypes.ServiceDeleteResult);
case Failed:
onFailedServiceImplementation(notification.getServiceName());
break;
case Failed:
onFailedServiceImplementation(notification.getServiceName());
break;
LOG.warn("Service Implementation still pending according to RpcStatusEx");
break;
default:
LOG.warn("Service Implementation still pending according to RpcStatusEx");
break;
default:
*/
private void onSuccededServiceImplementation(RendererRpcResultSp notification) {
LOG.info("Service implemented !");
*/
private void onSuccededServiceImplementation(RendererRpcResultSp notification) {
LOG.info("Service implemented !");
- 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("Service implemented !")
- .setOperationalState(org.opendaylight.yang.gen.v1.http
- .org.openroadm.common.state.types.rev181130.State.InService)
- .setTopic(TOPIC)
- .build();
- sendNbiNotification(nbiNotification);
if (serviceDataStoreOperations == null) {
LOG.debug("serviceDataStoreOperations is null");
return;
}
if (serviceDataStoreOperations == null) {
LOG.debug("serviceDataStoreOperations is null");
return;
}
- OperationResult operationResult = null;
+ PublishNotificationServiceBuilder nbiNotificationBuilder = new PublishNotificationServiceBuilder()
+ .setServiceName(input.getServiceName())
+ .setServiceAEnd(new ServiceAEndBuilder(input.getServiceAEnd()).build())
+ .setServiceZEnd(new ServiceZEndBuilder(input.getServiceZEnd()).build())
+ .setCommonId(input.getCommonId()).setConnectionType(input.getConnectionType())
+ .setTopic(TOPIC);
+ OperationResult operationResult;
+ String serviceType = "";
if (tempService) {
operationResult = this.serviceDataStoreOperations.modifyTempService(
serviceRpcResultSp.getServiceName(), State.InService, AdminStates.InService);
if (tempService) {
operationResult = this.serviceDataStoreOperations.modifyTempService(
serviceRpcResultSp.getServiceName(), State.InService, AdminStates.InService);
- if (!operationResult.isSuccess()) {
- LOG.warn("Temp Service status not updated in datastore !");
- }
} else {
operationResult = this.serviceDataStoreOperations.modifyService(
serviceRpcResultSp.getServiceName(), State.InService, AdminStates.InService);
} else {
operationResult = this.serviceDataStoreOperations.modifyService(
serviceRpcResultSp.getServiceName(), State.InService, AdminStates.InService);
- if (!operationResult.isSuccess()) {
- LOG.warn("Service status not updated in datastore !");
- } else {
+ }
+ if (operationResult.isSuccess()) {
+ sendNbiNotification(nbiNotificationBuilder
+ .setResponseFailed("")
+ .setMessage("Service implemented !")
+ .setOperationalState(org.opendaylight.yang.gen.v1.http
+ .org.openroadm.common.state.types.rev181130.State.InService)
+ .build());
+ if (!tempService) {
sendServiceHandlerNotification(notification, ServiceNotificationTypes.ServiceCreateResult);
}
sendServiceHandlerNotification(notification, ServiceNotificationTypes.ServiceCreateResult);
}
+ } else {
+ LOG.warn("{}Service status not updated in datastore !", serviceType);
+ sendNbiNotification(nbiNotificationBuilder
+ .setResponseFailed(serviceType + "Service status not updated in datastore !")
+ .setMessage("ServiceCreate request failed ...")
+ .setOperationalState(org.opendaylight.yang.gen.v1.http
+ .org.openroadm.common.state.types.rev181130.State.OutOfService)
+ .build());
notificationPublishService.putNotification(
serviceHandlerNotification);
} catch (InterruptedException e) {
notificationPublishService.putNotification(
serviceHandlerNotification);
} catch (InterruptedException e) {
- LOG.warn("Something went wrong while sending notification for sevice {}",
+ LOG.warn("Something went wrong while sending notification for service {}",
serviceRpcResultSp.getServiceName(), e);
Thread.currentThread().interrupt();
}
serviceRpcResultSp.getServiceName(), e);
Thread.currentThread().interrupt();
}
*/
private void onFailedServiceImplementation(String serviceName) {
LOG.error("Renderer implementation failed !");
*/
private void onFailedServiceImplementation(String serviceName) {
LOG.error("Renderer implementation failed !");
+ Services service = serviceDataStoreOperations.getService(input.getServiceName()).get();
+ sendNbiNotification(new PublishNotificationServiceBuilder()
+ .setServiceName(service.getServiceName())
+ .setServiceAEnd(new ServiceAEndBuilder(service.getServiceAEnd()).build())
+ .setServiceZEnd(new ServiceZEndBuilder(service.getServiceZEnd()).build())
+ .setCommonId(service.getCommonId())
+ .setConnectionType(service.getConnectionType())
+ .setResponseFailed("Renderer implementation failed !")
+ .setMessage("ServiceCreate request failed ...")
+ .setOperationalState(service.getOperationalState())
+ .setTopic(TOPIC)
+ .build());
OperationResult deleteServicePathOperationResult =
this.serviceDataStoreOperations.deleteServicePath(serviceName);
if (!deleteServicePathOperationResult.isSuccess()) {
LOG.warn("Service path was not removed from datastore!");
}
OperationResult deleteServicePathOperationResult =
this.serviceDataStoreOperations.deleteServicePath(serviceName);
if (!deleteServicePathOperationResult.isSuccess()) {
LOG.warn("Service path was not removed from datastore!");
}
+ OperationResult deleteServiceOperationResult;
+ String serviceType = "";
- OperationResult deleteServiceOperationResult =
- this.serviceDataStoreOperations.deleteTempService(serviceName);
- if (!deleteServiceOperationResult.isSuccess()) {
- LOG.warn("Temp Service was not removed from datastore!");
- }
+ deleteServiceOperationResult = this.serviceDataStoreOperations.deleteTempService(serviceName);
+ serviceType = "Temp ";
- OperationResult deleteServiceOperationResult =
- this.serviceDataStoreOperations.deleteService(serviceName);
- if (!deleteServiceOperationResult.isSuccess()) {
- LOG.warn("Service was not removed from datastore!");
- }
+ deleteServiceOperationResult = this.serviceDataStoreOperations.deleteService(serviceName);
+ }
+ if (deleteServiceOperationResult.isSuccess()) {
+ LOG.warn("{}Service was not removed from datastore!", serviceType);