use of com.emc.storageos.model.file.policy.FilePolicyUnAssignParam in project coprhd-controller by CoprHD.
the class FileProtectionPolicies method saveUnAssignPolicy.
@FlashException(keep = true, referrer = { "unassign" })
public static void saveUnAssignPolicy(AssignPolicyForm assignPolicy) {
if (assignPolicy == null) {
Logger.error("No Unassign policy parameters passed");
badRequest("No Unassign policy parameters passed");
return;
}
assignPolicy.validate("UnassignPolicy");
if (Validation.hasErrors()) {
Common.handleError();
}
assignPolicy.id = params.get("id");
FilePolicyUnAssignParam unAssignPolicyParam = new FilePolicyUnAssignParam();
try {
if (updateUnAssignPolicyParam(assignPolicy, unAssignPolicyParam)) {
TaskResourceRep taskRes = getViprClient().fileProtectionPolicies().unassignPolicy(uri(assignPolicy.id), unAssignPolicyParam);
if (isTaskSuccessful(assignPolicy.id, taskRes)) {
flash.success(MessagesUtils.get("unAssignPolicy.request.saved", assignPolicy.policyName));
}
}
} catch (Exception ex) {
flash.error(ex.getMessage(), assignPolicy.policyName);
}
if (StringUtils.isNotBlank(assignPolicy.referrerUrl)) {
redirect(assignPolicy.referrerUrl);
} else {
list();
}
}
Aggregations