public class DataPublisher extends Object
| Constructor and Description |
|---|
DataPublisher(String receiverUrl,
String userName,
String password)
To create the Data Publisher and the respective agent to publish events
For TCP protocol
For secure data transfer the Authenticator URL will be the same as the Receiver URL and
for normal data transfer the Authenticator ip will be the same as receiver ip but its port will be 100+
|
DataPublisher(String receiverUrl,
String userName,
String password,
Agent agent)
To create the Data Publisher to publish events
For TCP protocol
For secure data transfer the Authenticator URL will be the same as the Receiver URL and
for normal data transfer the Authenticator ip will be the same as receiver ip but its port will be 100+
|
DataPublisher(String authenticationUrl,
String receiverUrl,
String userName,
String password)
To create the Data Publisher and the respective agent to publish events
|
DataPublisher(String authenticationUrl,
String receiverUrl,
String userName,
String password,
Agent agent)
To create the Data Publisher and the respective agent to publish events
|
| Modifier and Type | Method and Description |
|---|---|
String |
defineStream(org.wso2.carbon.databridge.commons.StreamDefinition streamDefinition)
Defining stream on which events will be published by this DataPublisher
|
String |
defineStream(String streamDefinition)
Defining stream on which events will be published by this DataPublisher
|
boolean |
deleteStream(String streamId)
Defining stream on which events will be published by this DataPublisher
|
boolean |
deleteStream(String streamName,
String streamVersion)
Defining stream on which events will be published by this DataPublisher
|
String |
findStream(String name,
String version)
Deprecated.
|
String |
findStreamId(String name,
String version)
Finding already existing stream's Id to publish data
|
Agent |
getAgent()
to get the underlining agent
|
void |
publish(org.wso2.carbon.databridge.commons.Event event)
Publishing the events to the server
|
void |
publish(String streamId,
long timeStamp,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray)
Publishing events to the server
|
void |
publish(String streamId,
long timeStamp,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray,
Map<String,String> arbitraryDataMap)
Publishing events to the server
|
void |
publish(String streamId,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray)
Publishing events to the server
|
void |
publish(String streamId,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray,
Map<String,String> arbitraryDataMap)
Publishing events to the server
|
void |
registerReceiverStateObserver(ReceiverStateObserver stateObserver) |
void |
setAgent(Agent agent)
to set the underlining agent
which could be sheared by many data publishers
|
void |
stop()
Disconnecting from the server
|
void |
stopNow()
Disconnecting from the server
|
boolean |
tryPublish(org.wso2.carbon.databridge.commons.Event event) |
boolean |
tryPublish(String streamId,
long timestamp,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray,
Map<String,String> arbitraryDataMap) |
boolean |
tryPublish(String streamId,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray,
Map<String,String> arbitraryDataMap) |
public DataPublisher(String receiverUrl, String userName, String password) throws MalformedURLException, AgentException, org.wso2.carbon.databridge.commons.exception.AuthenticationException, org.wso2.carbon.databridge.commons.exception.TransportException
receiverUrl - the event receiver url
use userName - user namepassword - passwordMalformedURLExceptionAgentExceptionorg.wso2.carbon.databridge.commons.exception.AuthenticationExceptionorg.wso2.carbon.databridge.commons.exception.TransportExceptionpublic DataPublisher(String authenticationUrl, String receiverUrl, String userName, String password) throws MalformedURLException, AgentException, org.wso2.carbon.databridge.commons.exception.AuthenticationException, org.wso2.carbon.databridge.commons.exception.TransportException
authenticationUrl - the secure authentication url, use receiverUrl - the event receiver url
use userName - user namepassword - passwordMalformedURLExceptionAgentExceptionorg.wso2.carbon.databridge.commons.exception.AuthenticationExceptionorg.wso2.carbon.databridge.commons.exception.TransportExceptionpublic DataPublisher(String receiverUrl, String userName, String password, Agent agent) throws MalformedURLException, AgentException, org.wso2.carbon.databridge.commons.exception.AuthenticationException, org.wso2.carbon.databridge.commons.exception.TransportException
receiverUrl - the event receiver url
use userName - user namepassword - passwordagent - the underlining agentMalformedURLExceptionAgentExceptionorg.wso2.carbon.databridge.commons.exception.AuthenticationExceptionorg.wso2.carbon.databridge.commons.exception.TransportExceptionpublic DataPublisher(String authenticationUrl, String receiverUrl, String userName, String password, Agent agent) throws MalformedURLException, AgentException, org.wso2.carbon.databridge.commons.exception.AuthenticationException, org.wso2.carbon.databridge.commons.exception.TransportException
authenticationUrl - the secure authentication url, use receiverUrl - the event receiver url
use userName - user namepassword - passwordagent - the underlining agentMalformedURLExceptionAgentExceptionorg.wso2.carbon.databridge.commons.exception.AuthenticationExceptionorg.wso2.carbon.databridge.commons.exception.TransportExceptionpublic 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 registerReceiverStateObserver(ReceiverStateObserver stateObserver)
public String defineStream(String streamDefinition) throws AgentException, org.wso2.carbon.databridge.commons.exception.MalformedStreamDefinitionException, org.wso2.carbon.databridge.commons.exception.StreamDefinitionException, org.wso2.carbon.databridge.commons.exception.DifferentStreamDefinitionAlreadyDefinedException
streamDefinition - on json formatAgentExceptionorg.wso2.carbon.databridge.commons.exception.DifferentStreamDefinitionAlreadyDefinedExceptionorg.wso2.carbon.databridge.commons.exception.MalformedStreamDefinitionExceptionorg.wso2.carbon.databridge.commons.exception.StreamDefinitionExceptionpublic String defineStream(org.wso2.carbon.databridge.commons.StreamDefinition streamDefinition) throws AgentException, org.wso2.carbon.databridge.commons.exception.MalformedStreamDefinitionException, org.wso2.carbon.databridge.commons.exception.StreamDefinitionException, org.wso2.carbon.databridge.commons.exception.DifferentStreamDefinitionAlreadyDefinedException
streamDefinition - on json formatAgentExceptionorg.wso2.carbon.databridge.commons.exception.DifferentStreamDefinitionAlreadyDefinedExceptionorg.wso2.carbon.databridge.commons.exception.MalformedStreamDefinitionExceptionorg.wso2.carbon.databridge.commons.exception.StreamDefinitionException@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 - the stream nameversion - the version of the streamAgentException - if client cannot publish the type definitionorg.wso2.carbon.databridge.commons.exception.StreamDefinitionExceptionorg.wso2.carbon.databridge.commons.exception.NoStreamDefinitionExistExceptionpublic String findStreamId(String name, String version) throws AgentException
name - the stream nameversion - the version of the streamAgentException - if client cannot publish the type definitionpublic boolean deleteStream(String streamId) throws AgentException
streamId - of the StreamAgentExceptionorg.wso2.carbon.databridge.commons.exception.DifferentStreamDefinitionAlreadyDefinedExceptionorg.wso2.carbon.databridge.commons.exception.MalformedStreamDefinitionExceptionorg.wso2.carbon.databridge.commons.exception.StreamDefinitionExceptionpublic boolean deleteStream(String streamName, String streamVersion) throws AgentException
streamName - of the StreamstreamVersion - of the StreamAgentExceptionorg.wso2.carbon.databridge.commons.exception.DifferentStreamDefinitionAlreadyDefinedExceptionorg.wso2.carbon.databridge.commons.exception.MalformedStreamDefinitionExceptionorg.wso2.carbon.databridge.commons.exception.StreamDefinitionExceptionpublic void publish(org.wso2.carbon.databridge.commons.Event event)
throws AgentException
event - the event to be publishedAgentException - if client cannot publish the eventpublic boolean tryPublish(org.wso2.carbon.databridge.commons.Event event)
throws AgentException
AgentExceptionpublic void publish(String streamId, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray) throws AgentException
streamId - of the stream on which the events are publishedmetaDataArray - metadata array of the eventcorrelationDataArray - correlation data array of the eventpayloadDataArray - payload data array of the eventAgentExceptionpublic boolean tryPublish(String streamId, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray, Map<String,String> arbitraryDataMap) throws AgentException
AgentExceptionpublic boolean tryPublish(String streamId, long timestamp, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray, Map<String,String> arbitraryDataMap) throws AgentException
AgentExceptionpublic void publish(String streamId, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray, Map<String,String> arbitraryDataMap) throws AgentException
streamId - of the stream on which the events are publishedmetaDataArray - metadata array of the eventcorrelationDataArray - correlation data array of the eventpayloadDataArray - payload data array of the eventarbitraryDataMap - arbitrary mata (as meta.AgentExceptionpublic void publish(String streamId, long timeStamp, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray) throws AgentException
streamId - of the stream on which the events are publishedtimeStamp - time stamp of the eventmetaDataArray - metadata array of the eventcorrelationDataArray - correlation data array of the eventpayloadDataArray - payload data array of the eventAgentExceptionpublic void publish(String streamId, long timeStamp, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray, Map<String,String> arbitraryDataMap) throws AgentException
streamId - of the stream on which the events are publishedtimeStamp - time stamp of the eventmetaDataArray - metadata array of the eventcorrelationDataArray - correlation data array of the eventpayloadDataArray - payload data array of the eventarbitraryDataMap - arbitrary mata (as meta.AgentExceptionpublic void stop()
public void stopNow()
Copyright © 2015 WSO2. All rights reserved.