X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=nemo-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnemo%2Fuser%2Fvnspacemanager%2Fstructurestyle%2Fdeleteintent%2FDeleteOperation.java;fp=nemo-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnemo%2Fuser%2Fvnspacemanager%2Fstructurestyle%2Fdeleteintent%2FDeleteOperation.java;h=5d9a0c9aed8bb7225361c45367d0d8b06e74ae51;hb=c0433f1ea880f7dc5b478abadfad9af2e24279e1;hp=81cb365106ecd3f4f533e79c8c8553a427ba918a;hpb=4df8282f410f6c258adeb39d90cd6f0463588fea;p=nemo.git diff --git a/nemo-impl/src/main/java/org/opendaylight/nemo/user/vnspacemanager/structurestyle/deleteintent/DeleteOperation.java b/nemo-impl/src/main/java/org/opendaylight/nemo/user/vnspacemanager/structurestyle/deleteintent/DeleteOperation.java index 81cb365..5d9a0c9 100644 --- a/nemo-impl/src/main/java/org/opendaylight/nemo/user/vnspacemanager/structurestyle/deleteintent/DeleteOperation.java +++ b/nemo-impl/src/main/java/org/opendaylight/nemo/user/vnspacemanager/structurestyle/deleteintent/DeleteOperation.java @@ -38,61 +38,46 @@ public class DeleteOperation { private TenantManage tenantManage; private static final Logger LOG = LoggerFactory.getLogger(DeleteOperation.class); - public DeleteOperation(DataBroker dataBroker, TenantManage tenantManage) - { + public DeleteOperation(DataBroker dataBroker, TenantManage tenantManage){ this.dataBroker = dataBroker; this.tenantManage = tenantManage; } - public String DeleteOperationhandling(UserId userId, OperationId operationId) - { + public String DeleteOperationhandling(UserId userId, OperationId operationId){ Boolean OperationExist = false; String errorInfo = null; tenantManage.fetchVNSpace(userId); - User user = tenantManage.getUser(); - if (user != null) - { - if (user.getOperations() != null) - { - if (user.getOperations().getOperation() != null) - { + if (user != null){ + if (user.getOperations() != null){ + if (user.getOperations().getOperation() != null){ List operationList = tenantManage.getUser().getOperations().getOperation(); - - for (Operation operation : operationList) - { - if (operation.getOperationId().equals(operationId)) - { + for (Operation operation : operationList){ + if (operation.getOperationId().equals(operationId)){ OperationExist = true; break; } } - - if (OperationExist) - { + if (OperationExist){ DeleteOperationInstance(userId,operationId); } - else - { - errorInfo = "The operation instance" +operationId.toString()+"is not exist. Could not be deleted."; + else{ + errorInfo = "The operation instance " +operationId.getValue()+" is not exist. Could not be deleted."; } } - else - { + else{ errorInfo = "There are no operation instances in the data store."; } } } - else - { + else{ errorInfo = "There are no user in the data store."; } return errorInfo; } - private void DeleteOperationInstance(UserId userId, OperationId operationId) - { + private void DeleteOperationInstance(UserId userId, OperationId operationId){ WriteTransaction t = dataBroker.newWriteOnlyTransaction(); UserKey userKey = new UserKey(userId); OperationKey operationKey = new OperationKey(operationId);