com.sun.multicast.advertising
Class Advertiser

java.lang.Object
  |
  +--com.sun.multicast.advertising.Advertiser
All Implemented Interfaces:
java.lang.Runnable

public class Advertiser
extends java.lang.Object
implements java.lang.Runnable

Controls advertising of Advertisement objects.

See Also:
Advertisement

Method Summary
static Advertiser getAdvertiser()
          Returns a reference to the Advertiser.
 void run()
          Overrides Thread's run method.
 void startAdvertising(Advertisement advertisement)
          Starts advertising an Advertisement on the default advertising address.
 void startAdvertising(java.net.InetAddress advertisingAddress, Advertisement advertisement)
          Starts advertising an Advertisement on the specified advertising address.
 void startAdvertising(java.net.InetAddress advertisingAddress, java.net.InetAddress address, int ttl, java.util.Date startTime, java.util.Date endTime)
          Starts advertising an address on the specified address.
 void startAdvertising(java.net.InetAddress address, int ttl, java.util.Date startTime, java.util.Date endTime)
          Starts advertising an address on the default advertising address.
 boolean stopAdvertising(Advertisement advertisement)
          Stops advertising an Advertisement.
 boolean stopAdvertising(java.net.InetAddress address)
          Stops advertising an address.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAdvertiser

public static Advertiser getAdvertiser()
                                throws java.net.UnknownHostException
Returns a reference to the Advertiser.
Returns:
reference to the Advertiser object

startAdvertising

public void startAdvertising(java.net.InetAddress advertisingAddress,
                             java.net.InetAddress address,
                             int ttl,
                             java.util.Date startTime,
                             java.util.Date endTime)
                      throws java.io.IOException
Starts advertising an address on the specified address.
Parameters:
advertisingAddress - the address on which to send the advertisement
address - the address to be advertised
ttl - the time-to-live to use in the advertisement
startTime - the time to start advertising
endTime - the time to stop advertising

startAdvertising

public void startAdvertising(java.net.InetAddress advertisingAddress,
                             Advertisement advertisement)
                      throws java.io.IOException
Starts advertising an Advertisement on the specified advertising address.
Parameters:
advertisingAddress - the address on which to send the Advertisement
advertisement - the Advertisement to be advertised

startAdvertising

public void startAdvertising(java.net.InetAddress address,
                             int ttl,
                             java.util.Date startTime,
                             java.util.Date endTime)
                      throws java.io.IOException
Starts advertising an address on the default advertising address.
Parameters:
address - the address to be advertised
ttl - the time-to-live to use in the advertisement
startTime - the time to start advertising
endTime - the time to stop advertising

startAdvertising

public void startAdvertising(Advertisement advertisement)
                      throws java.io.IOException
Starts advertising an Advertisement on the default advertising address.
Parameters:
advertisement - the Advertisement to be advertised

stopAdvertising

public boolean stopAdvertising(java.net.InetAddress address)
Stops advertising an address.
Parameters:
address - the address to stop advertising
Returns:
true if the Advertisement was found; false otherwise

stopAdvertising

public boolean stopAdvertising(Advertisement advertisement)
Stops advertising an Advertisement. advertisement the Advertisement to stop advertising
Returns:
true if the Advertisement was found; false otherwise

run

public void run()
Overrides Thread's run method.
Specified by:
run in interface java.lang.Runnable


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