public class DataPublisher extends Object
| Constructor and Description |
|---|
DataPublisher(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.
|
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.
|
public DataPublisher(String receiverURLSet, String authURLSet, String username, String password) throws 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.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.DataEndpointException - 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 void shutdown()
throws DataEndpointException
DataEndpointException - Exception to be thrown when communicating with DataEndpoint.Copyright © 2021 WSO2. All rights reserved.