org.wso2.carbon.usage.agent.util
Class PublisherUtils

java.lang.Object
  extended by org.wso2.carbon.usage.agent.util.PublisherUtils

public class PublisherUtils
extends Object

this class provide utility methods to publish usage statistics


Constructor Summary
PublisherUtils()
           
 
Method Summary
static void createAsynDataPublisher()
          Creates an async data publisher using the existing data publisher object
static void createDataPublisher()
           
static void defineUsageEventStream()
           
static org.wso2.carbon.utils.ConfigurationContextService getConfigurationContextService()
          method to get configurationContextService
static String getServerUrl(int tenantId)
           
static void publish(APIManagerRequestStats statistics, int tenantId)
           
static void publish(BandwidthUsage usage)
          this method get the event payload, construct the SOAP envelop and call the publish method in EventBrokerService.
static void publish(org.wso2.carbon.statistics.services.util.SystemStatistics statistics, int tenantId)
           
static void setConfigurationContextService(org.wso2.carbon.utils.ConfigurationContextService configurationContextService)
          method to setConfigurationContextService
static String updateServerName(int tenantId)
          method to update server name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PublisherUtils

public PublisherUtils()
Method Detail

updateServerName

public static String updateServerName(int tenantId)
                               throws UsageException
method to update server name

Parameters:
tenantId - tenant id
Returns:
server name
Throws:
UsageException

getServerUrl

public static String getServerUrl(int tenantId)

defineUsageEventStream

public static void defineUsageEventStream()
                                   throws Exception
Throws:
Exception

createDataPublisher

public static void createDataPublisher()

createAsynDataPublisher

public static void createAsynDataPublisher()
Creates an async data publisher using the existing data publisher object


publish

public static void publish(BandwidthUsage usage)
                    throws UsageException
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

public static void publish(APIManagerRequestStats statistics,
                           int tenantId)
                    throws Exception
Parameters:
statistics - APIManagerRequestStats which contains usage data
tenantId - 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 -


Copyright © 2015 WSO2. All rights reserved.