|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.tibco.bpm.web.client.model.pagebus.hub.ManagedEventService com.tibco.bpm.web.client.model.pagebus.hub.ManagedEventClient
public abstract class ManagedEventClient
Encapsulates the details of creating an IframeHubClient and adding subscribers, events, and handlers.
©2012 Cloud Software Group, Inc.
Field Summary |
---|
Fields inherited from class com.tibco.bpm.web.client.model.pagebus.hub.ManagedEventService |
---|
onSubscribeCompleteCallback, subscriptions |
Constructor Summary | |
---|---|
protected |
ManagedEventClient()
Creates a ManagedEventClient using a default serviceId set to: "ManagedEventClient" |
protected |
ManagedEventClient(java.lang.String serviceId)
Creates a ManagedEventFrame. |
Method Summary | |
---|---|
Subscription |
addSubscriber(java.lang.String topic,
OnDataCallback onDataCallback,
OnSubscribeCompleteCallback onSubscribeCompleteCallback,
SubscriberData subscriberData)
Creates a subscription to a topic name. |
Subscription |
addSubscriberNative(java.lang.String topic,
com.google.gwt.core.client.JavaScriptObject onDataCallback,
com.google.gwt.core.client.JavaScriptObject onSubscribeCompleteCallback,
com.google.gwt.core.client.JavaScriptObject subscriberData)
Creates a subscription to a topic name using native JSO arguments. |
void |
disconnect()
Disconnects the IframeHubClient. |
boolean |
isConnected()
Returns true if the IframeHubClient is connected. |
protected void |
onConnectComplete(java.lang.Object item,
boolean success,
java.lang.String error)
Extending class can override this as needed to perform specific tasks after a connect completes. |
protected void |
onCreateSecurityAlert(java.lang.Object source,
java.lang.String alertType)
Extending class can override this as needed to perform specific tasks when a SecurityAlert is encountered. |
protected void |
onDisconnectComplete(java.lang.Object item,
boolean success,
java.lang.String error)
Extending class can override this as needed to perform specific tasks after a disconnect completes. |
protected void |
onManagedEventBusError(ManagedEventBusError managedEventBusError)
Extending class can override this as needed to perform specific tasks when a ManagedEventBusError is encountered. |
protected void |
onReconnectComplete(java.lang.Object item,
boolean success,
java.lang.String error)
Extending class can override this as needed to perform specific tasks after a reconnect completes. |
void |
publish(PageBusMessage message)
Publishes the given message. |
void |
publish(java.lang.String topic,
PageBusMessage message)
Publishes the given message using the given topic. |
void |
reconnect()
Reconnects the IframeHubClient. |
void |
removeSubscriber(Subscription subscription)
Removes the given subscription. |
void |
removeSubscribers()
Removes subscriptions previously added and clears the subscriptions set. |
Methods inherited from class com.tibco.bpm.web.client.model.pagebus.hub.ManagedEventService |
---|
addEvent, addEvents, addHandler, addHandlers, addSubscribers, alertMessage, getServiceId, log, onRemoveSubscriberComplete, removeEvents, removeHandlers, setServiceId |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ManagedEventClient()
protected ManagedEventClient(java.lang.String serviceId)
serviceId
- May be used in alert messages or logs to identify the service instance.Method Detail |
---|
public void removeSubscribers()
ManagedEventService.onRemoveSubscriberComplete(Subscription, boolean, String)
method is called for each callback when the unsubscribe action is
complete.
removeSubscribers
in class ManagedEventService
ManagedEventService.addSubscribers()
,
ManagedEventService.onRemoveSubscriberComplete(Subscription, boolean, String)
public void removeSubscriber(Subscription subscription)
ManagedEventService
ManagedEventService.onRemoveSubscriberComplete(Subscription, boolean, String)
method is called for each callback when the unsubscribe action is
complete.
removeSubscriber
in class ManagedEventService
public void publish(PageBusMessage message)
ManagedEventService
publish
in class ManagedEventService
message
- Message to be published on the given topic.public void publish(java.lang.String topic, PageBusMessage message)
ManagedEventService
publish
in class ManagedEventService
topic
- Topic name on which to publish the message. This must NOT
be a wildcard topic.message
- Message to be published on the given topic.public boolean isConnected()
public void disconnect()
onDisconnectComplete(Object, boolean, String)
method is called when the asynchronous callback is made after the
disconnect completes.
public void reconnect()
onReconnectComplete(Object, boolean, String)
method is
called when the asynchronous callback is made after the reconnect
completes.
public Subscription addSubscriber(java.lang.String topic, OnDataCallback onDataCallback, OnSubscribeCompleteCallback onSubscribeCompleteCallback, SubscriberData subscriberData)
ManagedEventService
ManagedEventService.removeSubscribers()
is called.
If the subscription's topic name contains wildcards, then the subscriber
will be notified via its onDataCallback if the wildcard topic associated
with the subscription matches the topic of the published event, even if
the two topics are not identical. For example, if a subscriber
subscribes to "a.b.*", then it will be notified when someone publishes on
the topic "a.b.c" or the topic "a.b.x".
The value of the subscriberData parameter determines whether the
subscriber is cache-enabled.
addSubscriber
in class ManagedEventService
topic
- Topic name on which to subscribe. This MAY be a wildcard
topic.onDataCallback
- Callback function for ManagedEventService to invoke
when a message is published on the subscribed
subject.
This parameter must NOT be null.onSubscribeCompleteCallback
- Callback function for ManagedEventService
to invoke after the subscription has been added.
Optional, null value is permitted.subscriberData
- User-defined. Null value is permitted. This is
useful when the subscriber needs to access or
update any data members when the callback function
is invoked. The value of the subscriberData
parameter determines whether the subscriber is
cache-enabled.
ManagedEventService.removeSubscriber(Subscription)
public Subscription addSubscriberNative(java.lang.String topic, com.google.gwt.core.client.JavaScriptObject onDataCallback, com.google.gwt.core.client.JavaScriptObject onSubscribeCompleteCallback, com.google.gwt.core.client.JavaScriptObject subscriberData)
ManagedEventService
addSubscriberNative
in class ManagedEventService
ManagedEventService.addSubscriber(String, OnDataCallback, OnSubscribeCompleteCallback, SubscriberData)
protected void onDisconnectComplete(java.lang.Object item, boolean success, java.lang.String error)
item
- success
- error
- protected void onReconnectComplete(java.lang.Object item, boolean success, java.lang.String error)
item
- success
- error
- protected void onConnectComplete(java.lang.Object item, boolean success, java.lang.String error)
item
- success
- error
- protected void onManagedEventBusError(ManagedEventBusError managedEventBusError)
managedEventBusError
- protected void onCreateSecurityAlert(java.lang.Object source, java.lang.String alertType)
source
- alertType
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |