|
|
@ -231,8 +231,8 @@ public class PolicyManagementServiceImpl implements PolicyManagementService {
|
|
|
|
policyDeleted = false;
|
|
|
|
policyDeleted = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(policyDeleted) {
|
|
|
|
if (policyDeleted) {
|
|
|
|
for(int i : policyIds) {
|
|
|
|
for (int i : policyIds) {
|
|
|
|
Policy policy = pap.getPolicy(i);
|
|
|
|
Policy policy = pap.getPolicy(i);
|
|
|
|
pap.deletePolicy(policy);
|
|
|
|
pap.deletePolicy(policy);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -244,13 +244,16 @@ public class PolicyManagementServiceImpl implements PolicyManagementService {
|
|
|
|
new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build();
|
|
|
|
new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (policyDeleted) {
|
|
|
|
if (policyDeleted) {
|
|
|
|
return Response.status(Response.Status.OK).entity("Policies have been successfully deleted").build();
|
|
|
|
return Response.status(Response.Status.OK).entity("Policies have been successfully " +
|
|
|
|
|
|
|
|
"deleted").build();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//TODO:Check of this logic is correct
|
|
|
|
//TODO:Check of this logic is correct
|
|
|
|
String ModifiedInvalidPolicyIds = invalidPolicyIds.substring(0, invalidPolicyIds.length()-1);
|
|
|
|
String modifiedInvalidPolicyIds =
|
|
|
|
return Response.status(Response.Status.BAD_REQUEST).entity(
|
|
|
|
invalidPolicyIds.substring(0, invalidPolicyIds.length() - 1);
|
|
|
|
new ErrorResponse.ErrorResponseBuilder().setMessage("Policies with the policy ID " +
|
|
|
|
return Response.status(Response.Status.BAD_REQUEST).
|
|
|
|
ModifiedInvalidPolicyIds + " doesn't exist").build()).build();
|
|
|
|
entity(new ErrorResponse.ErrorResponseBuilder().
|
|
|
|
|
|
|
|
setMessage("Policies with the policy ID " + modifiedInvalidPolicyIds +
|
|
|
|
|
|
|
|
" doesn't exist").build()).build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|