com.sun.multicast.reliable.transport.um
Class UMTransportProfile

java.lang.Object
  |
  +--com.sun.multicast.reliable.transport.um.UMTransportProfile
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, TransportProfile

public class UMTransportProfile
extends java.lang.Object
implements TransportProfile, java.lang.Cloneable, java.io.Serializable

A TransportProfile for the Unreliable Multicast transport.

The only transport-specific public methods that are added by this class are getDataRate and setDataRate, which allow a maximum data rate to be set to throttle outgoing data. This avoids overrunning network elements.

See Also:
TransportProfile, Serialized Form

Fields inherited from interface com.sun.multicast.reliable.transport.TransportProfile
RECEIVER, REPAIR_NODE, SEND_RECEIVE, SENDER
 
Constructor Summary
UMTransportProfile(java.net.InetAddress address, int port)
          Creates a new Unreliable Multicast TransportProfile.
 
Method Summary
 java.lang.Object clone()
          Create a new UMTransportProfile object and return it to the caller.
 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()
          enable the use of authentication.
 java.net.InetAddress getAddress()
          Returns the multicast address for this TransportProfile.
 java.lang.String getAuthenticationSpecFileName()
          gets the name of the authenticationSpec filename to use for initialization.
 java.lang.String getAuthenticationSpecPassword()
          Gets the password for the authenticationSpec
 long getDataRate()
          Returns the maximum send rate for this TransportProfile (in bytes per second).
 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()
          Returns the value of the ordered flag.
 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 authenticationSpec filename to use for initialization.
 void setAuthenticationSpecPassword(java.lang.String password)
          Sets the password for the authenticationSpec
 void setDataRate(long dataRate)
          Sets the maximum send rate for this TransportProfile (in bytes per second).
 void setMultiSender(boolean multiSender)
          Sets the value of the multisender flag.
 void setOrdered(boolean ordered)
          Sets the value of the ordered flag.
 void setPort(int port)
          Sets the multicast port number for this TransportProfile.
 void setTTL(byte ttl)
          Sets the value for the Time-to-live.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UMTransportProfile

public UMTransportProfile(java.net.InetAddress address,
                          int port)
                   throws InvalidMulticastAddressException
Creates a new Unreliable Multicast TransportProfile. The multicast address and port must be specified for this constructor.
Parameters:
address - a multicast address for this TransportProfile.
port - the port number for this TransportProfile.
Throws:
InvalidMulticastAddressException - if the address specified is not a multicast address.
Method Detail

createRMStreamSocket

public RMStreamSocket createRMStreamSocket(int sendReceive)
                                    throws UnsupportedException
Creates an RMStreamSocket using this TransportProfile as input. Unreliable multicast cannot support a stream interface, since it does not include support for repairing lost data. Therefore, this method always throws UnsupportedException in this class.
Specified by:
createRMStreamSocket in interface TransportProfile
Parameters:
sendReceive - UMTransportProfile doesn't care about this parameter.
Returns:
a new RMStreamSocket (but nothing is ever returned here).
Throws:
UnsupportedException - always, since this transport does not support a stream interface.

createRMPacketSocket

public RMPacketSocket createRMPacketSocket(int sendReceive)
                                    throws UnsupportedException,
                                           InvalidTransportProfileException,
                                           java.io.IOException
Creates an RMPacketSocket using this TransportProfile as input.
Specified by:
createRMPacketSocket in interface TransportProfile
Parameters:
sendReceive - UMTransportProfile doesn't care about this parameter.
Returns:
the new RMPacketSocket
Throws:
UnsupportedException - if the transport does not support a packet interface.
InvalidTransportProfileException - if the TransportProfile is not valid
java.io.IOException - if an I/O 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.
Specified by:
getName in interface TransportProfile
Returns:
the name of the transport

getAddress

public java.net.InetAddress getAddress()
Returns the multicast address for this TransportProfile.
Specified by:
getAddress in interface TransportProfile
Returns:
the multicast address for this TransportProfile

getPort

public int getPort()
Returns the multicast port number for this TransportProfile.
Specified by:
getPort in interface 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.
Specified by:
getTTL in interface TransportProfile
Returns:
the time-to-live value for this TransportProfile.

getDataRate

public long getDataRate()
Returns the maximum send rate for this TransportProfile (in bytes per second).
Returns:
the current data rate.

getAuthenticationSpecFileName

public java.lang.String getAuthenticationSpecFileName()
gets the name of the authenticationSpec filename to use for initialization.
Specified by:
getAuthenticationSpecFileName in interface TransportProfile
Following copied from interface: com.sun.multicast.reliable.transport.TransportProfile
Returns:
the name of the authenticationSpec filename to use for initialization.

isMultiSender

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

isOrdered

public boolean isOrdered()
Returns the value of the ordered flag. 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.
Specified by:
isOrdered in interface TransportProfile
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.
Specified by:
isUsingAuthentication in interface TransportProfile
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
Sets the multicast address for this TransportProfile.
Specified by:
setAddress in interface TransportProfile
Parameters:
address - the multicast address for this TransportProfile.
Throws:
InvalidMulticastAddressException - if an the address specified is not a multicast address.

setPort

public void setPort(int port)
Sets the multicast port number for this TransportProfile.
Specified by:
setPort in interface TransportProfile
Parameters:
port - the new multicast port number.

setOrdered

public void setOrdered(boolean ordered)
Sets the value of the ordered flag. 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.
Specified by:
setOrdered in interface TransportProfile
Parameters:
ordered - the value of the ordered flag.

setTTL

public void setTTL(byte ttl)
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).
Specified by:
setTTL in interface TransportProfile
Parameters:
ttl - the value of the time-to-live parameter.

setMultiSender

public void setMultiSender(boolean multiSender)
                    throws UnsupportedException
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.
Specified by:
setMultiSender in interface TransportProfile
Parameters:
multisender - true if the application wishes to support multiple senders; false otherwise
Throws:
UnsupportedException - if the transport does not support multiple senders.

setDataRate

public void setDataRate(long dataRate)
Sets the maximum send rate for this TransportProfile (in bytes per second).
Parameters:
dataRate - the new data rate.

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).
Specified by:
isValid in interface TransportProfile
Returns:
true if the TransportProfile is valid; false otherwise

clone

public java.lang.Object clone()
Create a new UMTransportProfile object and return it to the caller.
Specified by:
clone in interface TransportProfile
Overrides:
clone in class java.lang.Object
Returns:
a copy of this UMTransportProfile object.

enableAuthentication

public void enableAuthentication()
enable the use of authentication.
Specified by:
enableAuthentication in interface TransportProfile

disableAuthentication

public void disableAuthentication()
disables the use of Authentication
Specified by:
disableAuthentication in interface TransportProfile

setAuthenticationSpecFileName

public void setAuthenticationSpecFileName(java.lang.String specFileName)
sets the name of the authenticationSpec filename to use for initialization.
Specified by:
setAuthenticationSpecFileName in interface TransportProfile
Following copied from interface: com.sun.multicast.reliable.transport.TransportProfile
Parameters:
specFileName - Authentication Spec file name.

getAuthenticationSpecPassword

public java.lang.String getAuthenticationSpecPassword()
Gets the password for the authenticationSpec
Specified by:
getAuthenticationSpecPassword in interface TransportProfile
Returns:
authenticationSpecPassword currently specified.

setAuthenticationSpecPassword

public void setAuthenticationSpecPassword(java.lang.String password)
Sets the password for the authenticationSpec
Specified by:
setAuthenticationSpecPassword in interface TransportProfile
Parameters:
password - the password for the authenticationSpec.


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