Search in sources :

Example 1 with WebhooksAnalyticsDataProvider

use of org.wso2.carbon.apimgt.gateway.handlers.streaming.webhook.WebhooksAnalyticsDataProvider in project carbon-apimgt by wso2.

the class WebhooksUtils method publishAnalyticsData.

public static void publishAnalyticsData(MessageContext messageContext) {
    org.apache.axis2.context.MessageContext axisCtx = ((Axis2MessageContext) messageContext).getAxis2MessageContext();
    axisCtx.setProperty(PassThroughConstants.SYNAPSE_ARTIFACT_TYPE, APIConstants.API_TYPE_WEBSUB);
    WebhooksAnalyticsDataProvider provider = new WebhooksAnalyticsDataProvider(messageContext);
    GenericRequestDataCollector dataCollector = new GenericRequestDataCollector(provider);
    try {
        dataCollector.collectData();
    } catch (AnalyticsException e) {
        log.error("Error occurred when collecting data", e);
    }
}
Also used : WebhooksAnalyticsDataProvider(org.wso2.carbon.apimgt.gateway.handlers.streaming.webhook.WebhooksAnalyticsDataProvider) GenericRequestDataCollector(org.wso2.carbon.apimgt.common.analytics.collectors.impl.GenericRequestDataCollector) AnalyticsException(org.wso2.carbon.apimgt.common.analytics.exceptions.AnalyticsException) Axis2MessageContext(org.apache.synapse.core.axis2.Axis2MessageContext)

Aggregations

Axis2MessageContext (org.apache.synapse.core.axis2.Axis2MessageContext)1 GenericRequestDataCollector (org.wso2.carbon.apimgt.common.analytics.collectors.impl.GenericRequestDataCollector)1 AnalyticsException (org.wso2.carbon.apimgt.common.analytics.exceptions.AnalyticsException)1 WebhooksAnalyticsDataProvider (org.wso2.carbon.apimgt.gateway.handlers.streaming.webhook.WebhooksAnalyticsDataProvider)1