Oracle Fusion Middleware
Oracle WebLogic Server API Reference
11g Release 1 (10.3.6)

Part Number E13941-06

com.bea.httppubsub
Interface Channel


public interface Channel

Channel represents a pub/sub channel. A channel can have sub channels beneath it like a hierarchical structure.

Since:
10.3.0.0

Nested Class Summary
static class Channel.ChannelPattern
          This enum provides constants of the three channel patterns that are described in section 2.2.1 Channel Globbing of Bayeux Protocol -- Bayeux 1.0draft1 .
 
Method Summary
 void addSubChannel(Channel child)
          Add one immediate child channel to this channel.
 void destroy(Client client)
          Destroy this channel and all subchannels beneath it
 List<Channel> getAllSubChannels()
          Return the list of all child channels for the current channel.
 List<Client> getClients(Channel.ChannelPattern pattern)
          Return list of clients subscribed this channel or its children, depending on pattern parameter passed in.
 String getName()
          Return channel name defined in Bayeux protcol:
 Channel getParentChannel()
          Return current channel's parent or null if current channel is root.
 List<Channel> getSubChannels()
          Return the list of immediate child channels for the current channel.
 void publish(Client client, BayeuxMessage message, Channel.ChannelPattern pattern)
          Publish to this channel or its child channels with specified pattern.
 void removeSubChannel(Channel child)
          Remove sub channel from this channel.
 void subscribe(Client client)
          Subscribe to this channel.
 void subscribe(Client client, Channel.ChannelPattern pattern)
          Subscribe to this channel or its child channels with specified pattern.
 void unsubscribe(Client client)
          Unsubscribe from all of this channel.
 void unsubscribe(Client client, Channel.ChannelPattern pattern)
          Unsubscribe from this channel.
 

Method Detail

getName

String getName()
Return channel name defined in Bayeux protcol:
  
   channel_name     = "/"  channel_segments
   channel_segments = channel_segment *( "/" channel_segment )
   channel_segment  = token 
 

Returns:
channel name.

getParentChannel

Channel getParentChannel()
Return current channel's parent or null if current channel is root.

Returns:
parent channel

getSubChannels

List<Channel> getSubChannels()
Return the list of immediate child channels for the current channel.

Returns:
the list of immediate child channels

getAllSubChannels

List<Channel> getAllSubChannels()
Return the list of all child channels for the current channel.

Returns:
the list of all child channels

addSubChannel

void addSubChannel(Channel child)
Add one immediate child channel to this channel.

Parameters:
child - child channel.

removeSubChannel

void removeSubChannel(Channel child)
Remove sub channel from this channel.

Parameters:
child - child channel.

destroy

void destroy(Client client)
Destroy this channel and all subchannels beneath it

Parameters:
client - Client object.

getClients

List<Client> getClients(Channel.ChannelPattern pattern)
Return list of clients subscribed this channel or its children, depending on pattern parameter passed in.

Parameters:
pattern - subscribe pattern, valid values are ITSELF, IMMEDIATE_SUBCHANNELS, ALL_SUBCHANNELS
Returns:
a list of client subscribing to this channel, or this channel's immediate child channels, or this channel's child channels.

subscribe

void subscribe(Client client)
               throws PubSubSecurityException
Subscribe to this channel.
 This method is equivalent to:
     subscribe(client, ChannelPattern.ITSELF);
 

Parameters:
client - client object.
Throws:
PubSubSecurityException - when any security error occurs.

subscribe

void subscribe(Client client,
               Channel.ChannelPattern pattern)
               throws PubSubSecurityException
Subscribe to this channel or its child channels with specified pattern.

Parameters:
client - client to subscribe this channel
pattern - pattern deciding which channels beneath the current channel should be subscribed.
Throws:
PubSubSecurityException - If security permission checking failure.

unsubscribe

void unsubscribe(Client client)
Unsubscribe from all of this channel.
 This method is equivalent to:
     unsubscribe(client, ChannelPattern.ITSELF);
     unsubscribe(client, ChannelPattern.IMMEDIATE_SUBCHANNELS);
     unsubscribe(client, ChannelPattern.ALL_SUBCHANNELS);
 

Parameters:
client - client object.

unsubscribe

void unsubscribe(Client client,
                 Channel.ChannelPattern pattern)
Unsubscribe from this channel.

Parameters:
client - client to unsubscribe this channel
pattern - pattern deciding which channels beneath the current channel should be unsubscribed.

publish

void publish(Client client,
             BayeuxMessage message,
             Channel.ChannelPattern pattern)
             throws PubSubSecurityException
Publish to this channel or its child channels with specified pattern.

Parameters:
client - Client to publish to this channel
message - BayeuxMessage to publish
pattern - channel pattern to decide where to publish
Throws:
PubSubSecurityException - If no permission to publish

Copyright 1996, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Oracle Fusion Middleware
Oracle WebLogic Server API Reference
11g Release 1 (10.3.6)

Part Number E13941-06