com.sun.multicast.allocation
Interface Lease


public interface Lease

A multicast address lease. This object represents a lease that allows a set of multicast addresses to be used for a period of time.


Method Summary
 AddressSet getAddresses()
          Gets the multicast addresses associated with this lease.
 int getDuration()
          Gets the duration of this lease.
 boolean getReleased()
          Returns true if the lease has been released.
 Scope getScope()
          Gets the Scope associated with this lease.
 java.util.Date getStartTime()
          Gets the start time of this lease.
 void release()
          Releases this lease.
 void setDuration(int requestedDuration, int requiredDuration)
          Requests a change in the duration of this lease.
 void setStartTime(java.util.Date requestedStartTime, java.util.Date requiredStartTime)
          Requests a change in the start time of this lease.
 

Method Detail

getAddresses

public AddressSet getAddresses()
                        throws AddressAllocationException
Gets the multicast addresses associated with this lease.
Returns:
an AddressSet representing the multicast addresses associated with this lease (null if unknown)
Throws:
AddressAllocationException - if an error occurs

getStartTime

public java.util.Date getStartTime()
                            throws AddressAllocationException
Gets the start time of this lease.
Returns:
the start time of this lease (null if unknown)
Throws:
AddressAllocationException - if an error occurs

getDuration

public int getDuration()
                throws AddressAllocationException
Gets the duration of this lease.
Returns:
the duration of this lease in seconds (-1 if indefinite, -2 for unknown)
Throws:
AddressAllocationException - if an error occurs

getScope

public Scope getScope()
               throws AddressAllocationException
Gets the Scope associated with this lease.
Returns:
the Scope associated with this lease (null if unknown)
Throws:
AddressAllocationException - if an error occurs

setStartTime

public void setStartTime(java.util.Date requestedStartTime,
                         java.util.Date requiredStartTime)
                  throws AddressAllocationException
Requests a change in the start time of this lease.
Parameters:
requestedStartTime - the requested start time (null if now)
requiredStartTime - the latest acceptable start time (null if now)
Throws:
AddressAllocationException - if the request could not be satisfied

setDuration

public void setDuration(int requestedDuration,
                        int requiredDuration)
                 throws AddressAllocationException
Requests a change in the duration of this lease.
Parameters:
requestedDuration - the requested duration in seconds (-1 if indefinite)
requiredDuration - the required duration in seconds (-1 if indefinite)
Throws:
AddressAllocationException - if the request could not be satisfied

getReleased

public boolean getReleased()
                    throws AddressAllocationException
Returns true if the lease has been released.
Returns:
true if the lease has been released, false otherwise
Throws:
AddressAllocationException - if an error occurs

release

public void release()
             throws AddressAllocationException
Releases this lease. If this method succeeds, the address allocation represented by this lease will no longer be valid. The addresses may be used for other leases, so they should no longer be used in relation to this lease. The getReleased method will return true. Other methods may throw exceptions.
Throws:
AddressAllocationException - if the request could not be satisfied


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