use of org.wso2.carbon.apimgt.core.models.PolicyValidationData in project carbon-apimgt by wso2.
the class APIMgtAdminServiceImpl method deletePolicy.
@Override
public void deletePolicy(String policyName, PolicyLevel policyLevel) throws APIManagementException {
try {
Policy policy = policyDAO.getPolicyByLevelAndName(policyLevel, policyName);
policyDAO.deletePolicy(policyLevel, policyName);
PolicyValidationData policyValidationData = new PolicyValidationData(policy.getUuid(), policy.getPolicyName(), false);
apiGateway.deletePolicy(policyValidationData);
} catch (APIMgtDAOException e) {
String errorMessage = "Couldn't delete policy with name: " + policyName + ", level: " + policyLevel;
log.error(errorMessage, e);
throw new APIManagementException(errorMessage, e, e.getErrorHandler());
}
}
Aggregations