com.tibco.bpm.web.client.model.pagebus.hub
Interface HubClient
- All Known Implementing Classes:
- IframeHubClient, InlineHubClient
public interface HubClient
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.String |
getPartnerOrigin()
If DISCONNECTED: Returns null
If CONNECTED: Returns the origin associated with the window
containing the Container associated with this
HubClient instance. |
connect
void connect(OnCompleteCallback onCompleteCallback)
- 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.
- Parameters:
onCompleteCallback
- Callback function to call when this operation completes.
- Throws:
DuplicateException
- if the HubClient is already connected.
disconnect
void disconnect(OnCompleteCallback onCompleteCallback)
- Disconnect from the ManagedHub
Disconnect immediately:
- 1. Sets the HubClient's state to DISCONNECTED.
- 2. Causes the HubClient to send a Disconnect request to the
associated Container.
- 3. Ensures that the client application will receive no more
onData or onComplete callbacks associated with this
connection, except for the disconnect function's own
onComplete callback.
- 4. Automatically destroys all of the HubClient's subscriptions.
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.
- Parameters:
onCompleteCallback
- Callback function to call when this operation completes.
- Throws:
DisconnectedException
- if the HubClient is already disconnected
getPartnerOrigin
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. The origin has the format
[protocol]://[host]
where:
[protocol] is "http" or "https"
[host] is the hostname of the partner page.
getClientId
java.lang.String getClientId()
- Returns the client ID of this HubClient
Copyright © 2015 Cloud Software Group, Inc. All Rights Reserved.