org.wso2.carbon.databridge.agent.thrift.lb
Class LoadBalancingDataPublisher

java.lang.Object
  extended by org.wso2.carbon.databridge.agent.thrift.lb.LoadBalancingDataPublisher

public class LoadBalancingDataPublisher
extends Object

Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


Constructor Summary
LoadBalancingDataPublisher(ArrayList<ReceiverGroup> receiverGroups)
           
LoadBalancingDataPublisher(ArrayList<ReceiverGroup> receiverGroups, Agent agent)
           
LoadBalancingDataPublisher(ArrayList<ReceiverGroup> receiverGroups, Agent agent, boolean shareStreamDefinitionCache)
           
 
Method Summary
 void addReceiverGroup(ReceiverGroup aReceiverGroup)
           
 void addStreamDefinition(org.wso2.carbon.databridge.commons.StreamDefinition definition)
           
 void addStreamDefinition(String streamDefn, String streamName, String version)
           
 boolean isStreamDefinitionAdded(org.wso2.carbon.databridge.commons.StreamDefinition streamDefinition)
          Returns a boolean whether the stream definition is already added to cache in async data publisher
 boolean isStreamDefinitionAdded(String streamName, String version)
          Returns a boolean whether the stream definition is already added to cache in async data publisher
 void publish(org.wso2.carbon.databridge.commons.Event event)
          Publish the event asynchronously.
 void publish(String streamName, String streamVersion, org.wso2.carbon.databridge.commons.Event event)
          Publish the event asynchronously.
 void publish(String streamName, String streamVersion, long timeStamp, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray)
          Publish the event asynchronously.
 void publish(String streamName, String streamVersion, long timeStamp, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray, Map<String,String> arbitraryDataMap)
          Publish the event asynchronously.
 void publish(String streamName, String streamVersion, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray)
          Publish the event asynchronously.
 void publish(String streamName, String streamVersion, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray, Map<String,String> arbitraryDataMap)
          Publish the event asynchronously.
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoadBalancingDataPublisher

public LoadBalancingDataPublisher(ArrayList<ReceiverGroup> receiverGroups)

LoadBalancingDataPublisher

public LoadBalancingDataPublisher(ArrayList<ReceiverGroup> receiverGroups,
                                  Agent agent)

LoadBalancingDataPublisher

public LoadBalancingDataPublisher(ArrayList<ReceiverGroup> receiverGroups,
                                  Agent agent,
                                  boolean shareStreamDefinitionCache)
Method Detail

addReceiverGroup

public void addReceiverGroup(ReceiverGroup aReceiverGroup)

publish

public void publish(String streamName,
                    String streamVersion,
                    long timeStamp,
                    Object[] metaDataArray,
                    Object[] correlationDataArray,
                    Object[] payloadDataArray,
                    Map<String,String> arbitraryDataMap)
             throws AgentException
Publish the event asynchronously.

If the data publisher hasn't been initialized properly, the events will be pushed in the queue If the stream id is not in the cache the event will be pushed in the queue else the stream id from the cache will be used to publish the event

Parameters:
streamName - Name of the stream which the events is for
streamVersion - Version of the stream which the events is for
streamName - Name of the stream which the events is for
streamVersion - Version of the stream which the events is for
timeStamp - Timestamp of the event
metaDataArray - metadata array of the event
correlationDataArray - correlation array of the event
payloadDataArray - payload array of the event
arbitraryDataMap - arbitrary mata (as meta.),correlation (as correlation.) & payload (as ) data as key-value pairs
Throws:
AgentException

publish

public void publish(String streamName,
                    String streamVersion,
                    long timeStamp,
                    Object[] metaDataArray,
                    Object[] correlationDataArray,
                    Object[] payloadDataArray)
             throws AgentException
Publish the event asynchronously.

If the data publisher hasn't been initialized properly, the events will be pushed in the queue If the stream id is not in the cache the event will be pushed in the queue else the stream id from the cache will be used to publish the event

Parameters:
streamName - Name of the stream which the events is for
streamVersion - Version of the stream which the events is for
streamName - Name of the stream which the events is for
streamVersion - Version of the stream which the events is for
timeStamp - Timestamp of the event
metaDataArray - metadata array of the event
correlationDataArray - correlation array of the event
payloadDataArray - payload array of the event
Throws:
AgentException

publish

public void publish(String streamName,
                    String streamVersion,
                    Object[] metaDataArray,
                    Object[] correlationDataArray,
                    Object[] payloadDataArray,
                    Map<String,String> arbitraryDataMap)
             throws AgentException
Publish the event asynchronously.

If the data publisher hasn't been initialized properly, the events will be pushed in the queue If the stream id is not in the cache the event will be pushed in the queue else the stream id from the cache will be used to publish the event

Parameters:
streamName - Name of the stream which the events is for
streamVersion - Version of the stream which the events is for
streamName - Name of the stream which the events is for
streamVersion - Version of the stream which the events is for
metaDataArray - metadata array of the event
correlationDataArray - correlation array of the event
payloadDataArray - payload array of the event
arbitraryDataMap - arbitrary mata (as meta.),correlation (as correlation.) & payload (as ) data as key-value pairs
Throws:
AgentException

publish

public void publish(String streamName,
                    String streamVersion,
                    Object[] metaDataArray,
                    Object[] correlationDataArray,
                    Object[] payloadDataArray)
             throws AgentException
Publish the event asynchronously.

If the data publisher hasn't been initialized properly, the events will be pushed in the queue If the stream id is not in the cache the event will be pushed in the queue else the stream id from the cache will be used to publish the event

Parameters:
streamName - Name of the stream which the events is for
streamVersion - Version of the stream which the events is for
streamName - Name of the stream which the events is for
streamVersion - Version of the stream which the events is for
metaDataArray - metadata array of the event
correlationDataArray - correlation array of the event
payloadDataArray - payload array of the event
Throws:
AgentException

publish

public void publish(String streamName,
                    String streamVersion,
                    org.wso2.carbon.databridge.commons.Event event)
             throws AgentException
Publish the event asynchronously.

If the data publisher hasn't been initialized properly, the events will be pushed in the queue If the stream id is not in the cache the event will be pushed in the queue else the stream id from the cache will be used to publish the event

Parameters:
streamName - Name of the stream which the events is for
streamVersion - Version of the stream which the events is for
streamName - Name of the stream which the events is for
streamVersion - Version of the stream which the events is for
event - Event which should be published
Throws:
AgentException

publish

public void publish(org.wso2.carbon.databridge.commons.Event event)
             throws AgentException
Publish the event asynchronously.

If the data publisher hasn't been initialized properly, the events will be pushed in the queue If the stream id is not in the cache the event will be pushed in the queue else the stream id from the cache will be used to publish the event

Parameters:
event - Event which should be published
Throws:
AgentException

addStreamDefinition

public void addStreamDefinition(String streamDefn,
                                String streamName,
                                String version)

addStreamDefinition

public void addStreamDefinition(org.wso2.carbon.databridge.commons.StreamDefinition definition)

isStreamDefinitionAdded

public boolean isStreamDefinitionAdded(String streamName,
                                       String version)
Returns a boolean whether the stream definition is already added to cache in async data publisher

Parameters:
streamName - Name of the stream needed to check
version - version of the stream needed to check
Returns:
whether the stream definition is exists or not

isStreamDefinitionAdded

public boolean isStreamDefinitionAdded(org.wso2.carbon.databridge.commons.StreamDefinition streamDefinition)
Returns a boolean whether the stream definition is already added to cache in async data publisher

Parameters:
streamDefinition - Object of the stream definition needed to check in the cache
Returns:
whether the stream definition is exists or not

stop

public void stop()


Copyright © 2015 WSO2. All rights reserved.