AgentConfiguration agentConfiguration = new AgentConfiguration();
//System.setProperty("javax.net.ssl.trustStore", "/home/isuru/wso2/S2/apache/stratos/alpha/wso2bam-2.4.0/repository/resources/security/client-truststore.jks");
//System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon");
Agent agent = new Agent(agentConfiguration);
dataPublisher = new AsyncDataPublisher(dataPublisherConfig.getMonitoringServerUrl(), dataPublisherConfig.getAdminUsername(),
dataPublisherConfig.getAdminPassword(), agent);
if (!dataPublisher.isStreamDefinitionAdded(streamDefinition.getName(), streamDefinition.getVersion())) {
dataPublisher.addStreamDefinition(streamDefinition);
}