public class DataPublisher extends Object
| Constructor and Description |
|---|
DataPublisher(String receiverURLSet,
String username,
String password)
Creates the DataPublisher instance for a specific user, and the it creates
connection asynchronously to receiver endpoint.
|
DataPublisher(String type,
String receiverURLSet,
String authURLSet,
String username,
String password)
Creates the DataPublisher instance for a specific user, and the it creates
connection asynchronously to receiver endpoint.
|
| Modifier and Type | Method and Description |
|---|---|
void |
publish(org.wso2.carbon.databridge.commons.Event event)
Publish an event based on the event properties that are passed
for all receiver groups which has been specified in the DataPublisher.
|
void |
publish(String streamId,
long timeStamp,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray)
Publish an event based on the event properties that are passed
for all receiver groups which has been specified in the DataPublisher.
|
void |
publish(String streamId,
long timeStamp,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray,
Map<String,String> arbitraryDataMap)
Publish an event based on the event properties that are passed
for all receiver groups which has been specified in the DataPublisher.
|
void |
publish(String streamId,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray)
Publish an event based on the event properties that are passed
for all receiver groups which has been specified in the DataPublisher.
|
void |
publish(String streamId,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray,
Map<String,String> arbitraryDataMap)
Publish an event based on the event properties that are passed
for all receiver groups which has been specified in the DataPublisher.
|
void |
shutdown()
Graceful shutdown of all the operations of the data publisher.
|
void |
shutdownWithAgent()
Graceful shutdown of all the operations of the data publisher, and also
if there is no other data publishers registered with the associated then
it will shutdown the agent as well.
|
boolean |
tryPublish(org.wso2.carbon.databridge.commons.Event event)
Publish an event based on the event properties that are passed
for all receiver groups which has been specified in the DataPublisher.
|
boolean |
tryPublish(org.wso2.carbon.databridge.commons.Event event,
long timeoutMS)
Publish an event based on the event properties that are passed
for all receiver groups which has been specified in the DataPublisher.
|
boolean |
tryPublish(String streamId,
long timeStamp,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray)
* Publish an event based on the event properties that are passed
for all receiver groups which has been specified in the DataPublisher.
|
boolean |
tryPublish(String streamId,
long timeStamp,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray,
long timeoutMS)
Publish an event based on the event properties that are passed
for all receiver groups which has been specified in the DataPublisher.
|
boolean |
tryPublish(String streamId,
long timeStamp,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray,
Map<String,String> arbitraryDataMap)
* Publish an event based on the event properties that are passed
for all receiver groups which has been specified in the DataPublisher.
|
boolean |
tryPublish(String streamId,
long timeStamp,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray,
Map<String,String> arbitraryDataMap,
long timeoutMS)
Publish an event based on the event properties that are passed
for all receiver groups which has been specified in the DataPublisher.
|
boolean |
tryPublish(String streamId,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray)
* Publish an event based on the event properties that are passed
for all receiver groups which has been specified in the DataPublisher.
|
boolean |
tryPublish(String streamId,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray,
long timeoutMS)
Publish an event based on the event properties that are passed
for all receiver groups which has been specified in the DataPublisher.
|
boolean |
tryPublish(String streamId,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray,
Map<String,String> arbitraryDataMap)
* Publish an event based on the event properties that are passed
for all receiver groups which has been specified in the DataPublisher.
|
boolean |
tryPublish(String streamId,
Object[] metaDataArray,
Object[] correlationDataArray,
Object[] payloadDataArray,
Map<String,String> arbitraryDataMap,
long timeoutMS)
Publish an event based on the event properties that are passed
for all receiver groups which has been specified in the DataPublisher.
|
public DataPublisher(String receiverURLSet, String username, String password) throws DataEndpointAgentConfigurationException, DataEndpointException, DataEndpointConfigurationException, DataEndpointAuthenticationException, org.wso2.carbon.databridge.commons.exception.TransportException
receiverURLSet - The receiving endpoint URL Set. This can be either load balancing URL set,
or Failover URL set.username - Authorized username at receiver.password - The password of the username provided.DataEndpointAgentConfigurationException - Exception to be thrown for DataEndpointAgentConfiguration
which was specified in the data.agent.config.yamlDataEndpointException - Exception to be thrown when communicating with DataEndpoint.DataEndpointConfigurationException - Exception to be thrown When parsing the Data Endpoint
configurations when initializing data publisherDataEndpointAuthenticationException - Exception to be thrown when connecting the Data Endpointorg.wso2.carbon.databridge.commons.exception.TransportException - Transport level exceptionpublic DataPublisher(String type, String receiverURLSet, String authURLSet, String username, String password) throws DataEndpointAgentConfigurationException, DataEndpointException, DataEndpointConfigurationException, DataEndpointAuthenticationException, org.wso2.carbon.databridge.commons.exception.TransportException
type - The Agent name from which the DataPublisher that needs to be created. By default Thrift,
and Binary is supported. The type should match with the parameter name.
element in the data.agent.config.yaml, if null is passed one of the default type will be pickedreceiverURLSet - The receiving endpoint URL Set. This can be either load balancing URL set,
or Failover URL set.authURLSet - The authenticating URL Set for the endpoints given in receiverURLSet parameter.
This should be in the same format as receiverURL set parameter. If null is passed
the authURLs will be offsetted by value of 100.username - Authorized username at receiver.password - The password of the username provided.DataEndpointAgentConfigurationException - Exception to be thrown for DataEndpointAgentConfiguration which
was specified in the data.agent.config.yamlDataEndpointException - Exception to be thrown when communicating with DataEndpoint.DataEndpointConfigurationException - Exception to be thrown When parsing the Data Endpoint configurations
when initializing data publisherDataEndpointAuthenticationException - Exception to be thrown when connecting the Data Endpointorg.wso2.carbon.databridge.commons.exception.TransportException - Transport level exceptionpublic void publish(org.wso2.carbon.databridge.commons.Event event)
event - The Event that needs to sent for the receiver groupspublic void publish(String streamId, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray)
streamId - StreamId for which the event belongs to.metaDataArray - Meta data element of the event.correlationDataArray - Correlation data element of the event.payloadDataArray - Payload data element of the event.public void publish(String streamId, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray, Map<String,String> arbitraryDataMap)
streamId - StreamId for which the event belongs to.metaDataArray - Meta data element of the event.correlationDataArray - Correlation data element of the event.payloadDataArray - Payload data element of the event.arbitraryDataMap - Arbitrary data element of the event, which was not included in the stream
definition of the event, and intermittent data.public void publish(String streamId, long timeStamp, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray)
streamId - StreamId for which the event belongs to.metaDataArray - Meta data element of the event.correlationDataArray - Correlation data element of the event.payloadDataArray - Payload data element of the event.timeStamp - Timestamp of the event.public void publish(String streamId, long timeStamp, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray, Map<String,String> arbitraryDataMap)
streamId - StreamId for which the event belongs to.metaDataArray - Meta data element of the event.correlationDataArray - Correlation data element of the event.payloadDataArray - Payload data element of the event.timeStamp - Timestamp of the event.arbitraryDataMap - Arbitrary data element of the event, which was not included in the stream
definition of the event, and intermittent data.public boolean tryPublish(org.wso2.carbon.databridge.commons.Event event)
event - The event which needs to be published to the receiver groupspublic boolean tryPublish(org.wso2.carbon.databridge.commons.Event event,
long timeoutMS)
event - The event which needs to be published to the receiver groupstimeoutMS - The timeout value to insert publish the eventpublic boolean tryPublish(String streamId, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray, long timeoutMS)
streamId - StreamId for which the event belongs to.metaDataArray - Meta data element of the event.correlationDataArray - Correlation data element of the event.payloadDataArray - Payload data element of the event.timeoutMS - The timeout value to insert publish the eventpublic boolean tryPublish(String streamId, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray, Map<String,String> arbitraryDataMap, long timeoutMS)
streamId - StreamId for which the event belongs to.metaDataArray - Meta data element of the event.correlationDataArray - Correlation data element of the event.payloadDataArray - Payload data element of the event.arbitraryDataMap - Arbitrary data element of the event, which was not included in the stream
definition of the event, and intermittent data.timeoutMS - The timeout value to insert publish the eventpublic boolean tryPublish(String streamId, long timeStamp, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray, long timeoutMS)
streamId - StreamId for which the event belongs to.metaDataArray - Meta data element of the event.correlationDataArray - Correlation data element of the event.payloadDataArray - Payload data element of the event.timeStamp - Time stamp of the event.timeoutMS - The timeout value to insert publish the eventpublic boolean tryPublish(String streamId, long timeStamp, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray, Map<String,String> arbitraryDataMap, long timeoutMS)
streamId - StreamId for which the event belongs to.metaDataArray - Meta data element of the event.correlationDataArray - Correlation data element of the event.payloadDataArray - Payload data element of the event.arbitraryDataMap - Arbitrary data element of the event, which was not included in the stream
definition of the event, and intermittent data.timeStamp - Time stamp of the event.timeoutMS - The timeout value to insert publish the eventpublic boolean tryPublish(String streamId, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray)
streamId - StreamId for which the event belongs to.metaDataArray - Meta data element of the event.correlationDataArray - Correlation data element of the event.payloadDataArray - Payload data element of the event.public boolean tryPublish(String streamId, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray, Map<String,String> arbitraryDataMap)
streamId - StreamId for which the event belongs to.metaDataArray - Meta data element of the event.correlationDataArray - Correlation data element of the event.payloadDataArray - Payload data element of the event.arbitraryDataMap - Arbitrary data element of the event, which was not included in the stream
definition of the event, and intermittent data.public boolean tryPublish(String streamId, long timeStamp, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray)
streamId - StreamId for which the event belongs to.metaDataArray - Meta data element of the event.correlationDataArray - Correlation data element of the event.payloadDataArray - Payload data element of the event.timeStamp - TimeStamp of the event.public boolean tryPublish(String streamId, long timeStamp, Object[] metaDataArray, Object[] correlationDataArray, Object[] payloadDataArray, Map<String,String> arbitraryDataMap)
streamId - StreamId for which the event belongs to.metaDataArray - Meta data element of the event.correlationDataArray - Correlation data element of the event.payloadDataArray - Payload data element of the event.arbitraryDataMap - Arbitrary data element of the event, which was not included in the stream
definition of the event, and intermittent data.timeStamp - Timestamp of the event.public void shutdown()
throws DataEndpointException
DataEndpointException - Exception to be thrown when communicating with DataEndpoint.public void shutdownWithAgent()
throws DataEndpointException
DataEndpointException - Exception to be thrown when communicating with DataEndpoint.Copyright © 2017 WSO2. All rights reserved.