public class CarbonEventBroker extends Object implements EventBroker
| Constructor and Description |
|---|
CarbonEventBroker() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp()
Cleans up the delivery broker
|
List<Subscription> |
getAllSubscriptions(String filter)
Get all subscriptions
|
Subscription |
getSubscription(String id)
Get subscription from subscription ID
|
TopicManagerService |
getTopicManagerService()
Gets the topic manager
|
void |
init()
Initializes the carbon event broker.
|
void |
initializeTenant()
This method is called when a tenant initialize.
|
void |
publish(Message message,
String topicName)
Publish an event to the given topic asynchronously.
|
void |
publish(Message message,
String topicName,
int deliveryMode)
Publish an event to the given topic asynchronously.
|
void |
publishRobust(Message message,
String topicName)
Publish an event to the given topic synchronously.
|
void |
publishRobust(Message message,
String topicName,
int deliveryMode)
Publish an event to the given topic synchronously.
|
void |
registerEventDispatcher(String eventDispatcherName,
EventDispatcher eventDispatcher)
Register an event dispatcher in the case of using subscriptions with eventBrokerName
|
void |
renewSubscription(Subscription subscription)
Renews a subscription.
|
void |
setDeliveryManager(DeliveryManager deliveryManager)
Sets the delivery manager
|
void |
setExecutor(ExecutorService executor)
Sets the executor service
|
void |
setSubscriptionManager(SubscriptionManager subscriptionManager)
Sets new subscription manager
|
void |
setTopicManagerService(TopicManagerService topicManagerService)
Sets new topic manager
|
String |
subscribe(Subscription subscription)
Subscribe using the given subscription details.
|
void |
unsubscribe(String id)
Unsubscribes a subscription
|
public void init()
throws EventBrokerConfigurationException
public void initializeTenant()
throws EventBrokerException,
org.wso2.carbon.user.api.UserStoreException
initializeTenant in interface EventBrokerEventBrokerExceptionorg.wso2.carbon.user.api.UserStoreExceptionpublic String subscribe(Subscription subscription) throws EventBrokerException
subscribe in interface EventBrokersubscription - the subscriptionEventBrokerExceptionpublic void unsubscribe(String id) throws EventBrokerException
unsubscribe in interface EventBrokerid - subscription IDEventBrokerExceptionpublic Subscription getSubscription(String id) throws EventBrokerException
getSubscription in interface EventBrokerid - subscription IDEventBrokerExceptionpublic void renewSubscription(Subscription subscription) throws EventBrokerException
renewSubscription in interface EventBrokersubscription - the subscription to renewEventBrokerExceptionpublic List<Subscription> getAllSubscriptions(String filter) throws EventBrokerException
getAllSubscriptions in interface EventBrokerfilter - filter value. use * for allEventBrokerExceptionpublic void publish(Message message, String topicName) throws EventBrokerException
publish in interface EventBrokermessage - - message to publish. this contains the OMElement of the message and any
properties.topicName - topic nameEventBrokerExceptionpublic void publish(Message message, String topicName, int deliveryMode) throws EventBrokerException
publish in interface EventBrokermessage - - message to publish. this contains the OMElement of the message and any
properties.topicName - topic namedeliveryMode - - persist or notEventBrokerExceptionpublic void publishRobust(Message message, String topicName) throws EventBrokerException
publishRobust in interface EventBrokermessage - message to publish. this contains the OMElement of the message and any
properties.topicName - topic nameEventBrokerExceptionpublic void publishRobust(Message message, String topicName, int deliveryMode) throws EventBrokerException
publishRobust in interface EventBrokermessage - - message to publish. this contains the OMElement of the message and any
properties.topicName - topic namedeliveryMode - - persist or notEventBrokerExceptionpublic void registerEventDispatcher(String eventDispatcherName, EventDispatcher eventDispatcher)
registerEventDispatcher in interface EventBrokereventDispatcherName - event dispatcher nameeventDispatcher - event dispatcherpublic void setSubscriptionManager(SubscriptionManager subscriptionManager)
subscriptionManager - new subscription managerpublic TopicManagerService getTopicManagerService()
getTopicManagerService in interface EventBrokerpublic void setTopicManagerService(TopicManagerService topicManagerService)
topicManagerService - new topic managerpublic void setDeliveryManager(DeliveryManager deliveryManager)
deliveryManager - new delivery managerpublic void setExecutor(ExecutorService executor)
executor - new executor servicepublic void cleanUp()
throws EventBrokerException
EventBrokerExceptionCopyright © 2017 WSO2. All rights reserved.