public class AsyncDataPublisher extends Object
| Constructor and Description |
|---|
AsyncDataPublisher(DataPublisher dataPublisher)
To create the Data Publisher and creates the connection asynchronously
|
AsyncDataPublisher(String receiverURL,
String username,
String password)
To create the Data Publisher and creates the connection asynchronously
|
AsyncDataPublisher(String receiverURL,
String username,
String password,
Agent agent)
To create the Data Publisher and creates the connection asynchronously
|
AsyncDataPublisher(String authenticationURL,
String receiverURL,
String username,
String password)
To create the Data Publisher and creates the connection asynchronously
|
AsyncDataPublisher(String authenticationUrl,
String receiverUrl,
String userName,
String password,
Agent agent)
To create the Data Publisher and creates the connection asynchronously
|
AsyncDataPublisher(String authenticationUrl,
String receiverUrl,
String userName,
String password,
Agent agent,
ConcurrentHashMap<String,String> streamDefnCache)
To create the Data Publisher and creates the connection asynchronously
|
| Modifier and Type | Method and Description |
|---|---|
void |
addStreamDefinition(org.wso2.carbon.databridge.commons.StreamDefinition definition)
add the stream definition which can be published by
the AsyncDataPublisher
|
void |
addStreamDefinition(String streamDefn,
String streamName,
String version)
add the stream definition which can be published by
the AsyncDataPublisher
|
boolean |
canPublish()
Evaluates the publisher is ready and established the connection to publish the events
|
String |
findStream(String name,
String version)
Deprecated.
|
String |
findStreamId(String name,
String version)
Returns the streamId if the already stream name and version is defined in the receiver
|
Agent |
getAgent()
to get the underlining agent
|
LinkedBlockingQueue<PublishData> |
getQueuedEventsAndReset()
resets the publishDataQueue and returns all elements
|
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 |
reconnect()
Establish the connection of data publisher to receiver again
|
void |
registerReceiverObserver(ReceiverStateObserver observer) |
void |
setAgent(Agent agent)
to set the underlining agent
which could be sheared by many data publishers
|
void |
stop()
Disconnecting from the server
|
public AsyncDataPublisher(String authenticationURL, String receiverURL, String username, String password)
authenticationURL - the secure authentication url, use receiverURL - the event receiver url
use username - user namepassword - passwordpublic AsyncDataPublisher(String receiverURL, String username, String password)
receiverURL - the event receiver url
use username - user namepassword - passwordpublic AsyncDataPublisher(String receiverURL, String username, String password, Agent agent)
receiverURL - the event receiver url
use username - user namepassword - passwordagent - the underlining agentpublic AsyncDataPublisher(String authenticationUrl, String receiverUrl, String userName, String password, Agent agent)
authenticationUrl - the secure authentication url, use receiverUrl - the event receiver url
use userName - user namepassword - passwordagent - the underlining agentpublic AsyncDataPublisher(String authenticationUrl, String receiverUrl, String userName, String password, Agent agent, ConcurrentHashMap<String,String> streamDefnCache)
authenticationUrl - the secure authentication url, use receiverUrl - the event receiver url
use userName - user namepassword - passwordagent - the underlining agentstreamDefnCache - the common Stream Definition cache used by AsyncDataPublisherspublic AsyncDataPublisher(DataPublisher dataPublisher)
dataPublisher - DataPublisher used by the Asynchronous client to publish the eventspublic void reconnect()
public boolean canPublish()
public void setAgent(Agent agent) throws AgentException, org.wso2.carbon.databridge.commons.exception.AuthenticationException, org.wso2.carbon.databridge.commons.exception.TransportException
agent - the underlining agentAgentExceptionorg.wso2.carbon.databridge.commons.exception.AuthenticationExceptionorg.wso2.carbon.databridge.commons.exception.TransportExceptionpublic Agent getAgent()
public void registerReceiverObserver(ReceiverStateObserver observer)
public void publish(String streamName, String streamVersion, long timeStamp, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray) throws AgentException
streamName - Name of the stream which the events is forstreamVersion - Version of the stream which the events is fortimeStamp - Timestamp of the eventmetaDataArray - metadata array of the eventcorrelationDataArray - correlation array of the eventpayloadDataArray - payload array of the eventAgentExceptionpublic void publish(String streamName, String streamVersion, long timeStamp, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray, Map<String,String> arbitraryDataMap) throws AgentException
streamName - Name of the stream which the events is forstreamVersion - Version of the stream which the events is fortimeStamp - Timestamp of the eventmetaDataArray - metadata array of the eventcorrelationDataArray - correlation array of the eventpayloadDataArray - payload array of the eventarbitraryDataMap - arbitrary mata (as meta.AgentExceptionpublic void publish(String streamName, String streamVersion, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray) throws AgentException
streamName - Name of the stream which the events is forstreamVersion - Version of the stream which the events is formetaDataArray - metadata array of the eventcorrelationDataArray - correlation array of the eventpayloadDataArray - payload array of the eventAgentExceptionpublic void publish(String streamName, String streamVersion, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray, Map<String,String> arbitraryDataMap) throws AgentException
streamName - Name of the stream which the events is forstreamVersion - Version of the stream which the events is formetaDataArray - metadata array of the eventcorrelationDataArray - correlation array of the eventpayloadDataArray - payload array of the eventAgentExceptionpublic void publish(String streamName, String streamVersion, org.wso2.carbon.databridge.commons.Event event) throws AgentException
streamName - Name of the stream which the events is forstreamVersion - Version of the stream which the events is forevent - Event which should be publishedAgentExceptionpublic void publish(org.wso2.carbon.databridge.commons.Event event)
throws AgentException
event - Event which should be publishedAgentExceptionpublic LinkedBlockingQueue<PublishData> getQueuedEventsAndReset()
public void addStreamDefinition(String streamDefn, String streamName, String version)
streamDefn - json string format of the stream definitionstreamName - Name of stream which should be addedversion - Version of stream which should be addedpublic void addStreamDefinition(org.wso2.carbon.databridge.commons.StreamDefinition definition)
definition - Stream definition object which should be addedpublic boolean isStreamDefinitionAdded(String streamName, String version)
streamName - Name of the stream needed to checkversion - version of the stream needed to checkpublic boolean isStreamDefinitionAdded(org.wso2.carbon.databridge.commons.StreamDefinition streamDefinition)
streamDefinition - Object of the stream definition needed to check in the cache@Deprecated public String findStream(String name, String version) throws AgentException, org.wso2.carbon.databridge.commons.exception.StreamDefinitionException, org.wso2.carbon.databridge.commons.exception.NoStreamDefinitionExistException
name - Name of the event streamversion - Version of the streamAgentExceptionorg.wso2.carbon.databridge.commons.exception.StreamDefinitionExceptionorg.wso2.carbon.databridge.commons.exception.NoStreamDefinitionExistExceptionpublic String findStreamId(String name, String version) throws AgentException
name - Name of the event streamversion - Version of the streamAgentExceptionpublic void stop()
Copyright © 2015 WSO2. All rights reserved.