com.sun.multicast.reliable.transport
Interface TransportProfile

All Superinterfaces:
java.lang.Cloneable, java.io.Serializable
All Known Implementing Classes:
UMTransportProfile, TRAMTransportProfile, LRMPTransportProfile

public interface TransportProfile
extends java.lang.Cloneable, java.io.Serializable

A TransportProfile is an object that contains the parameters required to initialize and establish a multicast transport session. Each transport must define at least one class that implements the TransportProfile interface. This class may have additional transport specific methods, but must support the minimal methods defined in this interface.

One common way to use a TransportProfile is for a sender to create a transport-specific object that implements TransportProfile and send it to a set of receivers via object serialization. The receivers may then use the methods of the TransportProfile interface to join the multicast transport session and receive data. Of course, there are many other ways to use a TransportProfile.


Field Summary
static int RECEIVER
          A constant passed to createRM*Socket to indicate that the socket will only be used for receiving data.
static int REPAIR_NODE
          A constant passed to createRM*Socket to indicate that the socket will be used to start a multicast data repair node.
static int SEND_RECEIVE
          A constant passed to createRM*Socket to indicate that the socket will be used for sending and receiving data.
static int SENDER
          A constant passed to createRM*Socket to indicate that the socket will only be used for sending data.
 
Method Summary
 java.lang.Object clone()
          Creates a new transport profile with all the attributes of the current TransportProfile.
 RMPacketSocket createRMPacketSocket(int sendReceive)
          Creates an RMPacketSocket using this TransportProfile as input.
 RMStreamSocket createRMStreamSocket(int sendReceive)
          Creates an RMStreamSocket using this TransportProfile as input.
 void disableAuthentication()
          Disables the use of Authentication.
 void enableAuthentication()
          Enables the use of authentication.
 java.net.InetAddress getAddress()
          Returns the multicast address for this TransportProfile.
 java.lang.String getAuthenticationSpecFileName()
          Returns the name of the authenticationSpec filename to use for initialization.
 java.lang.String getAuthenticationSpecPassword()
          Returns the password for the authenticationSpec.
 java.lang.String getName()
          Returns the name of this transport.
 int getPort()
          Returns the multicast port number for this TransportProfile.
 byte getTTL()
          Returns the time-to-live for this TransportProfile.
 boolean isMultiSender()
          Determines if multiple senders are supported with this TransportProfile.
 boolean isOrdered()
          Method to test if Packet Ordering option is enabled.If the application requires that the data is returned to the application in the order which it was sent, the ordered flag needs to be set.
 boolean isUsingAuthentication()
          Returns the value of the authentication flag.
 boolean isValid()
          Tests whether this TransportProfile is valid.
 void setAddress(java.net.InetAddress address)
          Sets the multicast address for this TransportProfile.
 void setAuthenticationSpecFileName(java.lang.String specFileName)
          Sets the name of the authentication Spec filename to use for initialization.
 void setAuthenticationSpecPassword(java.lang.String password)
          Sets the password for the authentication Spec.
 void setMultiSender(boolean multisender)
          Sets the value of the multisender flag.
 void setOrdered(boolean ordered)
          Sets the Packet Ordering preference in the transport profile.
 void setPort(int port)
          Sets the multicast port number for this TransportProfile.
 void setTTL(byte ttl)
          Sets the value for the Time-to-live.
 

Field Detail

SENDER

public static final int SENDER
A constant passed to createRM*Socket to indicate that the socket will only be used for sending data.

RECEIVER

public static final int RECEIVER
A constant passed to createRM*Socket to indicate that the socket will only be used for receiving data.

SEND_RECEIVE

public static final int SEND_RECEIVE
A constant passed to createRM*Socket to indicate that the socket will be used for sending and receiving data.

REPAIR_NODE

public static final int REPAIR_NODE
A constant passed to createRM*Socket to indicate that the socket will be used to start a multicast data repair node. For such a socket, the receive() function does not return data, but only exceptions when the session ends or aborts.
Method Detail

createRMStreamSocket

public RMStreamSocket createRMStreamSocket(int sendReceive)
                                    throws UnsupportedException,
                                           InvalidTransportProfileException,
                                           java.io.IOException,
                                           RMException
Creates an RMStreamSocket using this TransportProfile as input.
Parameters:
sendReceive - indicates whether the socket created is for sending data, receiving data, or both. Valid values are SENDER, RECEIVER, and SEND_RECEIVE. Some transports may not support SEND_RECEIVE.
Returns:
a new RMStreamSocket
Throws:
UnsupportedException - if the transport does not support a stream interface or does not support the specified sendReceive value.
InvalidTransportProfileException - if the TransportProfile is not valid
java.io.IOException - if an I/O exception occurs
RMException - if a reliable-multicast-related exception occurs

createRMPacketSocket

public RMPacketSocket createRMPacketSocket(int sendReceive)
                                    throws UnsupportedException,
                                           InvalidTransportProfileException,
                                           java.io.IOException,
                                           RMException
Creates an RMPacketSocket using this TransportProfile as input.
Parameters:
sendReceive - indicates whether the socket created is for sending data, receiving data, or both. Valid values are SENDER, RECEIVER, and SEND_RECEIVE. Some transports may not support SEND_RECEIVE.
Returns:
a new RMPacketSocket
Throws:
UnsupportedException - if the transport does not support a packet interface or does not support the specified sendReceive value.
InvalidTransportProfileException - if the TransportProfile is not valid
java.io.IOException - if an I/O exception occurs
RMException - if a reliable-multicast-related exception occurs

getName

public java.lang.String getName()
Returns the name of this transport. The transport sets the name field. Applications cannot modify this field.
Returns:
the name of the transport

getAddress

public java.net.InetAddress getAddress()
Returns the multicast address for this TransportProfile.
Returns:
the multicast address for this TransportProfile (may be null)

getPort

public int getPort()
Returns the multicast port number for this TransportProfile.
Returns:
the multicast port number for this transport.

getTTL

public byte getTTL()
Returns the time-to-live for this TransportProfile. The time-to-live value indicates the range of multicast messages.
Returns:
the time-to-live value for this TransportProfile.

getAuthenticationSpecFileName

public java.lang.String getAuthenticationSpecFileName()
Returns the name of the authenticationSpec filename to use for initialization.
Returns:
the name of the authenticationSpec filename to use for initialization.

getAuthenticationSpecPassword

public java.lang.String getAuthenticationSpecPassword()
Returns the password for the authenticationSpec.
Returns:
the password for the authenticationSpec.

isMultiSender

public boolean isMultiSender()
Determines if multiple senders are supported with this TransportProfile.
Returns:
true if multiple senders are supported with this TransportProfile; false otherwise.

isOrdered

public boolean isOrdered()
Method to test if Packet Ordering option is enabled.If the application requires that the data is returned to the application in the order which it was sent, the ordered flag needs to be set. If the application doesn't care which order the data arrives in, this flag can be set to false. This flag is only valid for RMPacketSockets and most transports can only support ordering for a single sender. Check with the particular transport if global ordering is required.
Returns:
the value of the ordered flag.

isUsingAuthentication

public boolean isUsingAuthentication()
Returns the value of the authentication flag. If the flag is set(true), it indicates that the data packets are authenticated.
Returns:
true indicates that the data packets are authenticated false indicates that the data packets are not authenticated/signed.

setAddress

public void setAddress(java.net.InetAddress address)
                throws InvalidMulticastAddressException,
                       RMException
Sets the multicast address for this TransportProfile.
Parameters:
address - the new multicast address.
Throws:
InvalidMulticastAddressException - if an the address specified is not a multicast address.
RMException - if a reliable-multicast-related exception occurs

setPort

public void setPort(int port)
             throws RMException
Sets the multicast port number for this TransportProfile.
Parameters:
port - the new multicast port number.
Throws:
RMException - if a reliable-multicast-related exception occurs

setOrdered

public void setOrdered(boolean ordered)
                throws RMException
Sets the Packet Ordering preference in the transport profile. Setting this flag to true indicates that all data is to be forwarded to the application in the order it was sent. Setting this flag to false indicates that the application will get the data in the order that it was received, which may not be the order that it was sent.
Parameters:
ordered - the new value of the ordered flag.
Throws:
RMException - if a reliable-multicast-related exception occurs

setTTL

public void setTTL(byte ttl)
            throws RMException
Sets the value for the Time-to-live. The ttl indicates the range of the multicast messages sent on the multicast address/port. The default value is 1 (local area).
Parameters:
ttl - the value of the time-to-live parameter.
Throws:
RMException - if a reliable-multicast-related exception occurs

setMultiSender

public void setMultiSender(boolean multisender)
                    throws UnsupportedException,
                           RMException
Sets the value of the multisender flag. If the application wishes to support multiple senders with this TransportProfile, this flag must be set to true.
Parameters:
multisender - true if the application wishes to support multiple senders; false otherwise
Throws:
UnsupportedException - if the transport does not support multiple senders.
RMException - if a reliable-multicast-related exception occurs

isValid

public boolean isValid()
Tests whether this TransportProfile is valid. A TransportProfile is valid if, as far as can be determined, it could be used to send or receive data. Possible causes for invalid TransportProfiles include not setting the multicast address, port, and TTL (or other transport-specific problems).
Returns:
true if the TransportProfile is valid; false otherwise

clone

public java.lang.Object clone()
Creates a new transport profile with all the attributes of the current TransportProfile.
Overrides:
clone in class java.lang.Object
Returns:
a new TransportProfile object.

enableAuthentication

public void enableAuthentication()
Enables the use of authentication.

disableAuthentication

public void disableAuthentication()
Disables the use of Authentication.

setAuthenticationSpecFileName

public void setAuthenticationSpecFileName(java.lang.String specFileName)
Sets the name of the authentication Spec filename to use for initialization.
Parameters:
specFileName - Authentication Spec file name.

setAuthenticationSpecPassword

public void setAuthenticationSpecPassword(java.lang.String password)
Sets the password for the authentication Spec.
Parameters:
password - Authentication Spec password.


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