|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher
public class AsyncDataPublisher
AsyncDataPublisher creates the connection to with receiver asynchronously and will queue all the events
| Constructor Summary | |
|---|---|
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 |
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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 - password
public AsyncDataPublisher(String receiverURL,
String username,
String password)
receiverURL - the event receiver url
use username - user namepassword - password
public AsyncDataPublisher(String receiverURL,
String username,
String password,
Agent agent)
receiverURL - the event receiver url
use username - user namepassword - passwordagent - the underlining agent
public 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 agent
public 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 events| Method Detail |
|---|
public 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 agent
AgentException
org.wso2.carbon.databridge.commons.exception.AuthenticationException
org.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 event
AgentException
public 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.AgentException
public 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 event
AgentException
public 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 event
AgentException
public 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 published
AgentException
public void publish(org.wso2.carbon.databridge.commons.Event event)
throws AgentException
event - Event which should be published
AgentExceptionpublic 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 added
public boolean isStreamDefinitionAdded(String streamName,
String version)
streamName - Name of the stream needed to checkversion - version of the stream needed to check
public 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 stream
AgentException
org.wso2.carbon.databridge.commons.exception.StreamDefinitionException
org.wso2.carbon.databridge.commons.exception.NoStreamDefinitionExistException
public String findStreamId(String name,
String version)
throws AgentException
name - Name of the event streamversion - Version of the stream
AgentExceptionpublic void stop()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||