use of org.wso2.carbon.apimgt.core.models.BlockConditions in project carbon-apimgt by wso2.
the class APIMgtAdminServiceImpl method addBlockCondition.
@Override
public String addBlockCondition(BlockConditions blockConditions) throws APIManagementException {
try {
if (StringUtils.isEmpty(blockConditions.getUuid())) {
blockConditions.setUuid(UUID.randomUUID().toString());
}
policyDAO.addBlockConditions(blockConditions);
apiGateway.addBlockCondition(blockConditions);
return blockConditions.getUuid();
} catch (APIMgtDAOException e) {
String errorMessage = "Couldn't add block condition with condition type: " + blockConditions.getConditionType() + ", condition value: " + blockConditions.getConditionValue();
log.error(errorMessage, e);
throw new APIManagementException(errorMessage, ExceptionCodes.APIMGT_DAO_EXCEPTION);
}
}
Aggregations