Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.tibco.bpm.web.client.model.pagebus.hub
Class ManagedHub

    java.lang.Object
      com.tibco.bpm.web.client.model.pagebus.hub.ManagedHub

All Implemented Interfaces:
  Hub

    public class ManagedHub

extends java.lang.Object
implements Hub

The ManagedHub class provides a GWT JSNI interface to the TIBCO PageBus(TM) version 2.0.0 manager-side APIs to the Managed Hub.

The ManagedHub allows an application to control communication between both trusted and untrusted components using Inline and Iframe containers and Hub clients configured to run in these containers.

©2011 TIBCO Software Inc.

Since:
  1.2.0
See Also:
  `ManagedHubFrame`, `IframeContainer`, `IframeHubClient`, `InlineContainer`, `InlineHubClient`

Constructor Summary
`ManagedHub()` Creates a ManagedHub with no HubPolicy and a default noop callback is used for optional callbacks.
`ManagedHub(HubPolicy hubPolicy)` Creates a ManagedHub with the provided HubPolicy and a default noop callback is used for all optional callbacks.
`ManagedHub(HubPolicy hubPolicy, OnPublishCallback onPublishCallback, OnSubscribeCallback onSubscribeCallback, OnUnsubscribeCallback onUnsubscribeCallback, OnLogCallback onLogCallback)` Creates a ManagedHub with the provided HubPolicy and the given optional callbacks.

Method Summary
`void` | `disconnect()` Destroy this ManagedHub 1.
`java.lang.Object` | `getContainer(java.lang.String containerId)` Get a container belonging to this ManagedHub by its clientID, or null if this ManagedHub has no such container This function can be called even if the ManagedHub is not in a CONNECTED state.
`com.google.gwt.core.client.JavaScriptObject` | `getManagedHub()`
`java.lang.Object` | `getParameters()`
`java.lang.Object` | `getScope()`
`SubscriberData` | `getSubscriberData(Subscription subscription)`
`java.lang.Object` | `getSubscriberScope()`
`boolean` | `isConnected()`
`java.lang.Object` | `listContainers()` Returns an array listing all containers belonging to this ManagedHub.
`void` | `publish(PageBusMessage message)`
`void` | `publish(java.lang.String topic, PageBusMessage message)`
`protected void` | `publishNative(java.lang.String topic, com.google.gwt.core.client.JavaScriptObject message)`
`PageBusMessage[]` | `query(java.lang.String topic)`
`void` | `removeContainer(Container container)` Remove a container from this ManagedHub immediately.
`void` | `store(java.lang.String topic, PageBusMessage message)`
`Subscription` | `subscribe(java.lang.String topic, OnDataCallback onDataCallback, OnSubscribeCompleteCallback onSubscribeCompleteCallback, SubscriberData subscriberData)`
`protected Subscription` | `subscribeNative(java.lang.String topic, com.google.gwt.core.client.JavaScriptObject subscriberCallback, com.google.gwt.core.client.JavaScriptObject onCompleteCallback, com.google.gwt.core.client.JavaScriptObject subscriberData)`
`void` | `unsubscribe(Subscription subscription, OnSubscribeCompleteCallback onSubscribeCompleteCallback)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ManagedHub

    public ManagedHub()

  Creates a ManagedHub with no HubPolicy and a default noop callback is used for optional callbacks.

  Throws:
    `BadParametersException`

### ManagedHub

    public ManagedHub(HubPolicy hubPolicy)

  Creates a ManagedHub with the provided HubPolicy and a default noop callback is used for all optional callbacks. If null is passed for hubPolicy then no HubPolicy is used.

  Parameters:
    `hubPolicy` - The HubPolicy instance used for security control of this ManagedHub.
  Throws:
    `BadParametersException`

### ManagedHub

    public ManagedHub(HubPolicy hubPolicy,
                      OnPublishCallback onPublishCallback,
                      OnSubscribeCallback onSubscribeCallback,
                      OnUnsubscribeCallback onUnsubscribeCallback,
                      OnLogCallback onLogCallback)

  Creates a ManagedHub with the provided HubPolicy and the given optional callbacks. 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 ManagedHub.
    `onPublishCallback` - Callback function that is invoked whenever a data value published by a Container is about to be delivered to some (possibly the same) Container. This callback function implements a security policy; it returns true if the delivery of the data is permitted and false if permission is denied.
    `onSubscribeCallback` - Called whenever a Container tries to subscribe on behalf of its client. This callback function implements a security policy; it returns true if the subscription is permitted and false if permission is denied.
    `onUnsubscribeCallback` - Called whenever a Container unsubscribes on behalf of its client. Unlike the other callbacks, onUnsubscribe is intended only for informative purposes, and is not used to implement a security policy.
    `onLogCallback` - Receives build-in logging from the PageBus.
  Throws:
    `BadParametersException`

Method Detail

### getManagedHub

    public com.google.gwt.core.client.JavaScriptObject getManagedHub()

### subscribe

    public Subscription subscribe(java.lang.String topic,
                                  OnDataCallback onDataCallback,
                                  OnSubscribeCompleteCallback onSubscribeCompleteCallback,
                                  SubscriberData subscriberData)

  Specified by:
    `subscribe` in interface `Hub`

### subscribeNative

    protected Subscription subscribeNative(java.lang.String topic,
                                           com.google.gwt.core.client.JavaScriptObject subscriberCallback,
                                           com.google.gwt.core.client.JavaScriptObject onCompleteCallback,
                                           com.google.gwt.core.client.JavaScriptObject subscriberData)

### 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`

### publishNative

    protected void publishNative(java.lang.String topic,
                                 com.google.gwt.core.client.JavaScriptObject message)

### 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)`

### disconnect

    public void disconnect()

  Destroy this ManagedHub

  1. Sets state to DISCONNECTED. All subsequent attempts to add containers, publish or subscribe will throw the Disconnected error. We will continue to allow "cleanup" operations such as removeContainer and unsubscribe, as well as read-only operations such as isConnected

  2. Remove all Containers associated with this ManagedHub

### getContainer

    public java.lang.Object getContainer(java.lang.String containerId)

  Get a container belonging to this ManagedHub by its clientID, or null if this ManagedHub has no such container

  This function can be called even if the ManagedHub is not in a CONNECTED state.

  Parameters:
    `containerId` - The ID associated with the container

### listContainers

    public java.lang.Object listContainers()

  Returns an array listing all containers belonging to this ManagedHub. The order of the Containers in this array is arbitrary.

  This function can be called even if the ManagedHub is not in a CONNECTED state.

### removeContainer

    public void removeContainer(Container container)

  Remove a container from this ManagedHub immediately.

  This function can be called even if the ManagedHub is not in a CONNECTED state.

  Parameters:
    `container` - A Container (wraps the native type: {OpenAjax.hub.Container}) to be removed from this ManagedHub.
  Throws:
    `NoContainerException` - if no such container is found

### 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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2015 TIBCO Software Inc. All Rights Reserved.