use of org.wso2.carbon.apimgt.common.analytics.exceptions.AnalyticsException in project carbon-apimgt by wso2.
the class SseResponseStreamInterceptor method publishAnalyticsData.
private void publishAnalyticsData(int eventCount, MessageContext axi2Ctx) throws AnalyticsException {
Object responseEventProvider = axi2Ctx.getProperty(SSE_ANALYTICS_INFO);
if (responseEventProvider == null) {
log.error("SSE Analytics event provider is null.");
return;
}
SseResponseEventDataProvider provider = (SseResponseEventDataProvider) responseEventProvider;
provider.setResponseCode((int) axi2Ctx.getProperty(SynapseConstants.HTTP_SC));
GenericRequestDataCollector dataCollector = new GenericRequestDataCollector(provider);
for (int count = 0; count < eventCount; count++) {
dataCollector.collectData();
}
}
use of org.wso2.carbon.apimgt.common.analytics.exceptions.AnalyticsException in project carbon-apimgt by wso2.
the class WebSocketAnalyticsMetricsHandler method collectData.
private void collectData(ChannelHandlerContext ctx) {
AnalyticsDataProvider provider = new WebSocketAnalyticsDataProvider(ctx);
GenericRequestDataCollector collector = new GenericRequestDataCollector(provider);
try {
collector.collectData();
} catch (AnalyticsException e) {
log.error("Error Occurred when collecting analytics data", e);
}
}
use of org.wso2.carbon.apimgt.common.analytics.exceptions.AnalyticsException in project carbon-apimgt by wso2.
the class AuthFaultDataCollector method collectFaultData.
@Override
public void collectFaultData(Event faultyEvent) throws AnalyticsException {
log.debug("handling auth failure analytics events");
Application application = getUnknownApp();
faultyEvent.setApplication(application);
this.processRequest(faultyEvent);
}
use of org.wso2.carbon.apimgt.common.analytics.exceptions.AnalyticsException in project carbon-apimgt by wso2.
the class ResourceNotFoundFaultDataCollector method collectFaultData.
@Override
public void collectFaultData(Event faultyEvent) throws AnalyticsException {
log.debug("handling method not allowed failure analytics events");
Application application = getUnknownApp();
faultyEvent.setApplication(application);
this.processRequest(faultyEvent);
}
use of org.wso2.carbon.apimgt.common.analytics.exceptions.AnalyticsException in project carbon-apimgt by wso2.
the class ThrottledFaultDataCollector method collectFaultData.
@Override
public void collectFaultData(Event faultyEvent) throws AnalyticsException {
log.debug("handling throttled failure analytics events");
Application application;
if (provider.isAuthenticated() && provider.isAnonymous()) {
application = getAnonymousApp();
} else {
application = provider.getApplication();
}
faultyEvent.setApplication(application);
this.processRequest(faultyEvent);
}
Aggregations