com.sun.multicast.reliable.channel
Interface PrimaryChannelManager

All Superinterfaces:
ChannelManager, java.rmi.Remote

public interface PrimaryChannelManager
extends ChannelManager

A primary channel manager. Several different implementations of the PrimaryChannelManager interface may be provided (local, remote, etc.). This interface includes methods unique to primary channel managers. It extends the ChannelManager interface, which includes methods that are shared by both secondary and primary channel managers. To get a PrimaryChannelManager object, use LocalPCM.getLocalPCM().

See Also:
ChannelManager, LocalPCM

Method Summary
 void addSCM(java.lang.String principal)
          Adds a principal to the list of secondary channel managers (SCMs) authorized to communicate with this channel manager.
 Channel createChannel()
          Create a new Channel.
 void fileChannel(Channel channel, java.lang.String fileName)
          Serialize and store a channel in a file.
 int getChannelLimit()
          Gets the maximum number of channels that this PCM can own.
 int getOwnedChannelCount()
          Gets the number of channels owned by this channel manager.
 long[] getOwnedChannelList()
          Gets a list of channel IDs for channels owned by this channel manager.
 int getSCMCount()
          Gets the number of secondary channel managers (SCMs) authorized to communicate with this channel manager.
 java.lang.String[] getSCMList()
          Gets a copy of the list of secondary channel managers (SCMs) authorized to communicate with this channel manager.
 Channel readChannel(java.lang.String fileName)
          Read a serialized channel from a file.
 void removeSCM(java.lang.String principal)
          Removes a principal from the list of secondary channel managers (SCMs) authorized to communicate with this channel manager.
 void setChannelLimit(int limit)
          Set the maximum number of channels that this PCM can own.
 
Methods inherited from interface com.sun.multicast.reliable.channel.ChannelManager
addChannelListChangeListener, authenticate, getChannel, getChannelCount, getChannelList, getRegisteredReceiverCount, getRegisteredReceiverList, getRegistrationFailureCount, isEnabled, removeChannelListChangeListener, setEnabled
 

Method Detail

createChannel

public Channel createChannel()
                      throws LimitExceededException,
                             RMException,
                             java.rmi.RemoteException
Create a new Channel. The channel is initially disabled, with all fields set to null, 0, or false (except the channel ID, which is initialized to a random value; and the creation time, which is set to the current time).
Returns:
the new Channel
Throws:
LimitExceededException - if the PCM's channel limit has been reached
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

setChannelLimit

public void setChannelLimit(int limit)
                     throws LimitExceededException,
                            RMException,
                            java.rmi.RemoteException
Set the maximum number of channels that this PCM can own.
Parameters:
limit - the new channel limit
Throws:
LimitExceededException - if the PCM already has more channels than the new limit
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

getChannelLimit

public int getChannelLimit()
                    throws RMException,
                           java.rmi.RemoteException
Gets the maximum number of channels that this PCM can own.
Throws:
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

addSCM

public void addSCM(java.lang.String principal)
            throws RMException,
                   java.rmi.RemoteException
Adds a principal to the list of secondary channel managers (SCMs) authorized to communicate with this channel manager.
Parameters:
principal - the principal name to be added
Throws:
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

removeSCM

public void removeSCM(java.lang.String principal)
               throws RMException,
                      java.rmi.RemoteException
Removes a principal from the list of secondary channel managers (SCMs) authorized to communicate with this channel manager.
Parameters:
principal - the principal name to be removed
Throws:
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

getSCMCount

public int getSCMCount()
                throws RMException,
                       java.rmi.RemoteException
Gets the number of secondary channel managers (SCMs) authorized to communicate with this channel manager.
Returns:
the number of secondary channel managers (SCMs) authorized to communicate with this channel manager.
Throws:
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

getSCMList

public java.lang.String[] getSCMList()
                              throws RMException,
                                     java.rmi.RemoteException
Gets a copy of the list of secondary channel managers (SCMs) authorized to communicate with this channel manager. This list is a snapshot, so it will not be updated if authorizations change.
Returns:
the list of secondary channel managers (SCMs) authorized to communicate with this channel manager.
Throws:
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

getOwnedChannelCount

public int getOwnedChannelCount()
                         throws RMException,
                                java.rmi.RemoteException
Gets the number of channels owned by this channel manager.
Returns:
the number of channels owned by this channel manager.
Throws:
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

getOwnedChannelList

public long[] getOwnedChannelList()
                           throws RMException,
                                  java.rmi.RemoteException
Gets a list of channel IDs for channels owned by this channel manager. This list is a snapshot, so it will not be updated if the channel list changes.
Returns:
the list of channel ID for channels owned by this channel manager
Throws:
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

readChannel

public Channel readChannel(java.lang.String fileName)
                    throws java.io.IOException,
                           java.lang.ClassNotFoundException
Read a serialized channel from a file.
Parameters:
fileName - the name of the file to store the channel
Returns:
channel read from file
Throws:
java.io.IOException - is raised if failure to read from file

fileChannel

public void fileChannel(Channel channel,
                        java.lang.String fileName)
                 throws java.io.IOException
Serialize and store a channel in a file.
Parameters:
channel - the channel to be stored in a file
fileName - the name of the file to store the channel
Throws:
java.io.IOException - is raised if failure to write to file


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