Package org.wso2.carbon.usage.agent.util
Class PublisherUtils
java.lang.Object
org.wso2.carbon.usage.agent.util.PublisherUtils
this class provide utility methods to publish usage statistics
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCreates an async data publisher using the existing data publisher objectstatic voidstatic voidstatic org.wso2.carbon.utils.ConfigurationContextServicemethod to get configurationContextServicestatic StringgetServerUrl(int tenantId) static voidpublish(org.wso2.carbon.statistics.services.util.SystemStatistics statistics, int tenantId) static voidpublish(APIManagerRequestStats statistics, int tenantId) static voidpublish(BandwidthUsage usage) this method get the event payload, construct the SOAP envelop and call the publish method in EventBrokerService.static voidsetConfigurationContextService(org.wso2.carbon.utils.ConfigurationContextService configurationContextService) method to setConfigurationContextServicestatic StringupdateServerName(int tenantId) method to update server name
-
Constructor Details
-
PublisherUtils
public PublisherUtils()
-
-
Method Details
-
updateServerName
method to update server name- Parameters:
tenantId- tenant id- Returns:
- server name
- Throws:
UsageException
-
getServerUrl
-
defineUsageEventStream
- Throws:
Exception
-
createDataPublisher
public static void createDataPublisher() -
createAsynDataPublisher
public static void createAsynDataPublisher()Creates an async data publisher using the existing data publisher object -
publish
this method get the event payload, construct the SOAP envelop and call the publish method in EventBrokerService.- Parameters:
usage- BandwidthUsage- Throws:
UsageException
-
publish
public static void publish(org.wso2.carbon.statistics.services.util.SystemStatistics statistics, int tenantId) throws Exception - Throws:
Exception
-
publish
- Parameters:
statistics- APIManagerRequestStats which contains usage datatenantId- Tenant id of tenant associated with usage stat- Throws:
Exception- UsageException when error in usage stat publishing
-
getConfigurationContextService
public static org.wso2.carbon.utils.ConfigurationContextService getConfigurationContextService()method to get configurationContextService- Returns:
- configurationContextService
-
setConfigurationContextService
public static void setConfigurationContextService(org.wso2.carbon.utils.ConfigurationContextService configurationContextService) method to setConfigurationContextService- Parameters:
configurationContextService-
-