com.tibco.bpm.web.client.model.pagebus.hub
Class InlineHubClient

java.lang.Object
  extended by com.tibco.bpm.web.client.model.pagebus.hub.ManagedObject
      extended by com.tibco.bpm.web.client.model.pagebus.hub.InlineHubClient
All Implemented Interfaces:
Hub, HubClient

public class InlineHubClient
extends ManagedObject
implements Hub, HubClient

Wraps the TIBCO PageBus JavaScript InlineHubClient providing a JSNI interface enabling the use of Managed Hub events.

©2011 Cloud Software Group, Inc.

Since:
1.2.0

Constructor Summary
InlineHubClient(InlineContainer inlineContainer)
          Creates an InlineHubClient with defaults values for optional parameters.
InlineHubClient(InlineContainer inlineContainer, HubPolicy hubPolicy, OnSecurityAlertCallback onSecurityAlertCallback, OnLogCallback onLogCallback)
          Creates an InlineHubClient with the given optional parameters.
 
Method Summary
 void connect(OnCompleteCallback onCompleteCallback)
          Requests a connection to the ManagedHub, via the Container associated with this HubClient.
 void disconnect(OnCompleteCallback onCompleteCallback)
          Disconnect from the ManagedHub

Disconnect immediately:

1.

 java.lang.String getClientId()
          Returns the client ID of this HubClient
 java.lang.Object getParameters()
           
 java.lang.String getPartnerOrigin()
          If DISCONNECTED: Returns null

If CONNECTED: Returns the origin associated with the window containing the Container associated with this HubClient instance.

 java.lang.Object getScope()
           
 SubscriberData getSubscriberData(Subscription subscription)
           
 java.lang.Object getSubscriberScope()
           
 boolean isConnected()
           
 void publish(PageBusMessage message)
           
 void publish(java.lang.String topic, PageBusMessage message)
           
 PageBusMessage[] query(java.lang.String topic)
           
 void store(java.lang.String topic, PageBusMessage message)
           
 Subscription subscribe(java.lang.String topic, OnDataCallback onDataCallback, OnSubscribeCompleteCallback onSubscribeCompleteCallback, SubscriberData subscriberData)
           
 void unsubscribe(Subscription subscription, OnSubscribeCompleteCallback onSubscribeCompleteCallback)
           
 
Methods inherited from class com.tibco.bpm.web.client.model.pagebus.hub.ManagedObject
addObject, getManagedObjectForNative
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InlineHubClient

public InlineHubClient(InlineContainer inlineContainer)
Creates an InlineHubClient with defaults values for optional parameters. A default noop callback is used for optional callbacks.

Throws:
BadParametersException

InlineHubClient

public InlineHubClient(InlineContainer inlineContainer,
                       HubPolicy hubPolicy,
                       OnSecurityAlertCallback onSecurityAlertCallback,
                       OnLogCallback onLogCallback)
Creates an InlineHubClient with the given optional parameters. All of these parameters are optional and null may be passed. If null is passed for hubPolicy then no HubPolicy is used. If null is passed for any callback then a default noop callback is used.

Parameters:
hubPolicy - The HubPolicy instance used for security control of this InlineHubClient.
onSecurityAlertCallback - Invoked when a security alert is raised.
onLogCallback - Receives build-in logging from the PageBus.
Throws:
BadParametersException
Method Detail

connect

public void connect(OnCompleteCallback onCompleteCallback)
Description copied from interface: HubClient
Requests a connection to the ManagedHub, via the Container associated with this HubClient.

If the Container accepts the connection request, the HubClient's state is set to CONNECTED and the HubClient invokes the onComplete callback function.

If the Container refuses the connection request, the HubClient invokes the onComplete callback function with an error code. The error code might, for example, indicate that the Container is being destroyed.

In most implementations, this function operates asynchronously, so the onComplete callback function is the only reliable way to determine when this function completes and whether it has succeeded or failed.

A component within a Container application may call HubClient.disconnect and then call HubClient.connect.

Specified by:
connect in interface HubClient
Parameters:
onCompleteCallback - Callback function to call when this operation completes.

getPartnerOrigin

public java.lang.String getPartnerOrigin()
Description copied from interface: HubClient
If DISCONNECTED: Returns null

If CONNECTED: Returns the origin associated with the window containing the Container associated with this HubClient instance. The origin has the format

[protocol]://[host]

where:

[protocol] is "http" or "https"
[host] is the hostname of the partner page.

Specified by:
getPartnerOrigin in interface HubClient

getClientId

public java.lang.String getClientId()
Description copied from interface: HubClient
Returns the client ID of this HubClient

Specified by:
getClientId in interface HubClient

publish

public void publish(PageBusMessage message)
Specified by:
publish in interface Hub

publish

public void publish(java.lang.String topic,
                    PageBusMessage message)
Specified by:
publish in interface Hub

subscribe

public Subscription subscribe(java.lang.String topic,
                              OnDataCallback onDataCallback,
                              OnSubscribeCompleteCallback onSubscribeCompleteCallback,
                              SubscriberData subscriberData)
Specified by:
subscribe in interface Hub

disconnect

public void disconnect(OnCompleteCallback onCompleteCallback)
Description copied from interface: HubClient
Disconnect from the ManagedHub

Disconnect immediately:

This function operates asynchronously, so the onComplete callback function is the only reliable way to determine when this function completes and whether it has succeeded or failed.

A client application is allowed to call HubClient.disconnect and then call HubClient.connect.

Specified by:
disconnect in interface HubClient
Parameters:
onCompleteCallback - Callback function to call when this operation completes.

unsubscribe

public void unsubscribe(Subscription subscription,
                        OnSubscribeCompleteCallback onSubscribeCompleteCallback)
Specified by:
unsubscribe in interface Hub

isConnected

public boolean isConnected()
Specified by:
isConnected in interface Hub

getScope

public java.lang.Object getScope()
Specified by:
getScope in interface Hub

getSubscriberData

public SubscriberData getSubscriberData(Subscription subscription)
Specified by:
getSubscriberData in interface Hub

getSubscriberScope

public java.lang.Object getSubscriberScope()
Specified by:
getSubscriberScope in interface Hub

getParameters

public java.lang.Object getParameters()
Specified by:
getParameters in interface Hub

query

public PageBusMessage[] query(java.lang.String topic)
See Also:
EventCache.query(JavaScriptObject, String)

store

public void store(java.lang.String topic,
                  PageBusMessage message)
See Also:
EventCache.store(JavaScriptObject, String, PageBusMessage)


Copyright © 2015 Cloud Software Group, Inc. All Rights Reserved.