use of org.wso2.carbon.apimgt.core.exception.GatewayException in project carbon-apimgt by wso2.
the class APIGatewayPublisherImpl method deleteAPISubscription.
/**
* {@inheritDoc}
*/
@Override
public void deleteAPISubscription(List<SubscriptionValidationData> subscriptionValidationDataList) throws GatewayException {
SubscriptionEvent subscriptionDeleteEvent = new SubscriptionEvent(APIMgtConstants.GatewayEventTypes.SUBSCRIPTION_DELETE);
subscriptionDeleteEvent.setSubscriptionsList(subscriptionValidationDataList);
publishToStoreTopic(subscriptionDeleteEvent);
if (log.isDebugEnabled()) {
log.debug("Subscription deleted event has been successfully published to broker");
}
}
use of org.wso2.carbon.apimgt.core.exception.GatewayException in project carbon-apimgt by wso2.
the class APIGatewayPublisherImpl method addApplication.
@Override
public void addApplication(Application application) throws GatewayException {
if (application != null) {
ApplicationEvent applicationEvent = new ApplicationEvent(APIMgtConstants.GatewayEventTypes.APPLICATION_CREATE);
applicationEvent.setApplicationId(application.getId());
applicationEvent.setName(application.getName());
applicationEvent.setThrottlingTier(application.getPolicy().getUuid());
applicationEvent.setSubscriber(application.getCreatedUser());
publishToStoreTopic(applicationEvent);
if (log.isDebugEnabled()) {
log.debug("Application : " + application.getName() + " created event has been successfully published " + "to broker");
}
}
}
use of org.wso2.carbon.apimgt.core.exception.GatewayException in project carbon-apimgt by wso2.
the class APIGatewayPublisherImpl method addEndpoint.
@Override
public void addEndpoint(Endpoint endpoint) throws GatewayException {
EndpointEvent dto = new EndpointEvent(APIMgtConstants.GatewayEventTypes.ENDPOINT_CREATE);
dto.setEndpoint(endpoint);
publishToPublisherTopic(dto);
}
use of org.wso2.carbon.apimgt.core.exception.GatewayException in project carbon-apimgt by wso2.
the class APIGatewayPublisherImpl method addBlockCondition.
@Override
public void addBlockCondition(BlockConditions blockConditions) throws GatewayException {
if (blockConditions != null) {
BlockEvent blockEvent = new BlockEvent(APIMgtConstants.GatewayEventTypes.BLOCK_CONDITION_ADD);
blockEvent.setConditionId(blockConditions.getConditionId());
blockEvent.setUuid(blockConditions.getUuid());
blockEvent.setConditionType(blockConditions.getConditionType());
blockEvent.setEnabled(blockConditions.isEnabled());
blockEvent.setConditionValue(blockConditions.getConditionValue());
if (APIMgtConstants.ThrottlePolicyConstants.BLOCKING_CONDITIONS_IP.equals(blockConditions.getConditionType())) {
blockEvent.setFixedIp(APIUtils.ipToLong(blockConditions.getConditionValue()));
}
if (APIMgtConstants.ThrottlePolicyConstants.BLOCKING_CONDITION_IP_RANGE.equals(blockConditions.getConditionType())) {
blockEvent.setStartingIP(APIUtils.ipToLong(blockConditions.getStartingIP()));
blockEvent.setEndingIP(APIUtils.ipToLong(blockConditions.getEndingIP()));
}
publishToThrottleTopic(blockEvent);
if (log.isDebugEnabled()) {
log.debug("BlockCondition : " + blockConditions.getUuid() + " add event has been successfully " + "published " + "to broker");
}
}
}
use of org.wso2.carbon.apimgt.core.exception.GatewayException in project carbon-apimgt by wso2.
the class APIGatewayPublisherImpl method deleteThreatProtectionPolicy.
/**
* {@inheritDoc}
*/
@Override
public void deleteThreatProtectionPolicy(ThreatProtectionPolicy policy) throws GatewayException {
ThreatProtectionEvent event = new ThreatProtectionEvent(APIMgtConstants.GatewayEventTypes.THREAT_PROTECTION_POLICY_DELETE);
event.setPolicy(policy);
publishToThreatProtectionTopic(event);
}
Aggregations