com.sun.multicast.reliable.channel
Interface ChannelManager

All Superinterfaces:
java.rmi.Remote
All Known Subinterfaces:
PrimaryChannelManager

public interface ChannelManager
extends java.rmi.Remote

A reliable multicast channel manager. Several different implementations of the ChannelManager interface are provided, depending on whether it's local or remote. This interface includes methods that are shared by both secondary and primary channel managers. It is extended by the PrimaryChannelManager interface, which adds methods unique to primary channel managers. To get a ChannelManager object, use LocalPCM.getLocalPCM().

See Also:
PrimaryChannelManager, LocalPCM

Method Summary
 void addChannelListChangeListener(com.sun.multicast.reliable.channel.ChannelListChangeListener listener)
          Add a ChannelListChangeListener to the listener list.
 boolean authenticate(java.lang.String identity, java.lang.String key)
          Authenticate with the ChannelManager.
 Channel getChannel(long channelID)
          Get the Channel that goes with a given channel ID.
 int getChannelCount()
          Get the number of channels accessible to this principal on this channel manager.
 long[] getChannelList(java.lang.String channelName, java.lang.String applicationName)
          Get an array of channel IDs for all the channels accessible to this principal on this channel manager that match the channel and application names given.
 int getRegisteredReceiverCount()
          Get the number of registered receivers for the ChannelManager.
 java.lang.String[] getRegisteredReceiverList()
          Get an array of principal names for all the registered receivers on this channel manager.
 int getRegistrationFailureCount()
          Get the number of registration failures for the ChannelManager.
 boolean isEnabled()
          Tests whether the channel manager is enabled.
 void removeChannelListChangeListener(com.sun.multicast.reliable.channel.ChannelListChangeListener listener)
          Remove a ChannelListChangeListener from the listener list.
 void setEnabled(boolean b)
          Sets whether the channel manager is enabled.
 

Method Detail

authenticate

public boolean authenticate(java.lang.String identity,
                            java.lang.String key)
                     throws RMException,
                            java.rmi.RemoteException
Authenticate with the ChannelManager.
Parameters:
identity - the identity to be established
key - the authorization key to be used
Returns:
true if authentication succeeded; false otherwise
Throws:
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

getChannelCount

public int getChannelCount()
                    throws RMException,
                           java.rmi.RemoteException
Get the number of channels accessible to this principal on this channel manager.
Returns:
the number of channels accessible to this principal on this channel manager
Throws:
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

getChannelList

public long[] getChannelList(java.lang.String channelName,
                             java.lang.String applicationName)
                      throws RMException,
                             java.rmi.RemoteException
Get an array of channel IDs for all the channels accessible to this principal on this channel manager that match the channel and application names given.
Parameters:
channelName - channel name to match (null to match any)
applicationName - application name to match (null to match any)
Returns:
an array of channel IDs
Throws:
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

getChannel

public Channel getChannel(long channelID)
                   throws RMException,
                          ChannelNotFoundException,
                          java.rmi.RemoteException
Get the Channel that goes with a given channel ID.
Parameters:
channelID - channel ID whose Channel is requested
Returns:
the Channel that was requested
Throws:
RMException - if a reliable-multicast-related exception occurs
ChannelNotFoundException - if there is no Channel with the given ID
java.rmi.RemoteException - if an RMI-related exception occurs

getRegisteredReceiverCount

public int getRegisteredReceiverCount()
                               throws RMException,
                                      java.rmi.RemoteException
Get the number of registered receivers for the ChannelManager.
Returns:
the number of registered receivers for this ChannelManager
Throws:
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

getRegisteredReceiverList

public java.lang.String[] getRegisteredReceiverList()
                                             throws RMException,
                                                    java.rmi.RemoteException
Get an array of principal names for all the registered receivers on this channel manager.
Returns:
an array of principal names
Throws:
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

getRegistrationFailureCount

public int getRegistrationFailureCount()
                                throws RMException,
                                       java.rmi.RemoteException
Get the number of registration failures for the ChannelManager.
Returns:
the number of registration failures for the ChannelManager
Throws:
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

setEnabled

public void setEnabled(boolean b)
                throws RMException,
                       java.rmi.RemoteException
Sets whether the channel manager is enabled. Disabled channel managers are not accessible to anyone without administrator access.
Parameters:
b - if true, enable the channel manager; otherwise, disable it
Throws:
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

isEnabled

public boolean isEnabled()
                  throws RMException,
                         java.rmi.RemoteException
Tests whether the channel manager is enabled. Disabled channel managers are not accessible to anyone without administrator access.
Throws:
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

addChannelListChangeListener

public void addChannelListChangeListener(com.sun.multicast.reliable.channel.ChannelListChangeListener listener)
                                  throws RMException,
                                         java.rmi.RemoteException
Add a ChannelListChangeListener to the listener list.
Parameters:
listener - the listener to be added
Throws:
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

removeChannelListChangeListener

public void removeChannelListChangeListener(com.sun.multicast.reliable.channel.ChannelListChangeListener listener)
                                     throws RMException,
                                            java.rmi.RemoteException
Remove a ChannelListChangeListener from the listener list.
Parameters:
listener - the listener to be removed
Throws:
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs


JavaTM Reliable MulticastTM Service version 1.1
Copyright (c) 2001, Sun Microsystems Laboratories, All rights reserved.