private TenantManage tenantManage;\r
private static final Logger LOG = LoggerFactory.getLogger(DeleteOperation.class);\r
\r
- public DeleteOperation(DataBroker dataBroker, TenantManage tenantManage)\r
- {\r
+ public DeleteOperation(DataBroker dataBroker, TenantManage tenantManage){\r
this.dataBroker = dataBroker;\r
this.tenantManage = tenantManage;\r
}\r
\r
- public String DeleteOperationhandling(UserId userId, OperationId operationId)\r
- {\r
+ public String DeleteOperationhandling(UserId userId, OperationId operationId){\r
Boolean OperationExist = false;\r
String errorInfo = null;\r
tenantManage.fetchVNSpace(userId);\r
-\r
User user = tenantManage.getUser();\r
\r
- if (user != null)\r
- {\r
- if (user.getOperations() != null)\r
- {\r
- if (user.getOperations().getOperation() != null)\r
- {\r
+ if (user != null){\r
+ if (user.getOperations() != null){\r
+ if (user.getOperations().getOperation() != null){\r
List<Operation> operationList = tenantManage.getUser().getOperations().getOperation();\r
-\r
- for (Operation operation : operationList)\r
- {\r
- if (operation.getOperationId().equals(operationId))\r
- {\r
+ for (Operation operation : operationList){\r
+ if (operation.getOperationId().equals(operationId)){\r
OperationExist = true;\r
break;\r
}\r
}\r
-\r
- if (OperationExist)\r
- {\r
+ if (OperationExist){\r
DeleteOperationInstance(userId,operationId);\r
}\r
- else\r
- {\r
- errorInfo = "The operation instance" +operationId.toString()+"is not exist. Could not be deleted.";\r
+ else{\r
+ errorInfo = "The operation instance " +operationId.getValue()+" is not exist. Could not be deleted.";\r
}\r
}\r
- else\r
- {\r
+ else{\r
errorInfo = "There are no operation instances in the data store.";\r
}\r
}\r
}\r
- else\r
- {\r
+ else{\r
errorInfo = "There are no user in the data store.";\r
}\r
return errorInfo;\r
}\r
\r
- private void DeleteOperationInstance(UserId userId, OperationId operationId)\r
- {\r
+ private void DeleteOperationInstance(UserId userId, OperationId operationId){\r
WriteTransaction t = dataBroker.newWriteOnlyTransaction();\r
UserKey userKey = new UserKey(userId);\r
OperationKey operationKey = new OperationKey(operationId);\r