com.sun.jini.discovery
Class MulticastTimeToLive

java.lang.Object
  extended by com.sun.jini.discovery.MulticastTimeToLive
All Implemented Interfaces:
Serializable, InvocationConstraint

public final class MulticastTimeToLive
extends Object
implements InvocationConstraint, Serializable

Represents a constraint on the time to live (TTL) value set on outgoing multicast request and multicast announcement packets. Lookup services and discovery clients can use this constraint to specify the range of multicast transmissions used in discovery.

Since:
2.0
Author:
Sun Microsystems, Inc.
See Also:
Serialized Form

Field Summary
static int MAX_TIME_TO_LIVE
          The maximum permissible time to live value.
private static long serialVersionUID
           
private  int ttl
          The time to live value.
 
Constructor Summary
MulticastTimeToLive(int ttl)
          Creates a MulticastTimeToLive constraint for the given time to live value.
 
Method Summary
 boolean equals(Object obj)
           
 int getTimeToLive()
          Returns the time to live value.
 int hashCode()
           
private  void readObject(ObjectInputStream in)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

MAX_TIME_TO_LIVE

public static final int MAX_TIME_TO_LIVE
The maximum permissible time to live value.

See Also:
Constant Field Values

ttl

private final int ttl
The time to live value.

Constructor Detail

MulticastTimeToLive

public MulticastTimeToLive(int ttl)
Creates a MulticastTimeToLive constraint for the given time to live value.

Parameters:
ttl - the time to live value
Throws:
IllegalArgumentException - if the given value is negative or greater than MAX_TIME_TO_LIVE.
Method Detail

getTimeToLive

public int getTimeToLive()
Returns the time to live value.

Returns:
the time to live value

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

readObject

private void readObject(ObjectInputStream in)
                 throws IOException,
                        ClassNotFoundException
Throws:
IOException
ClassNotFoundException


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.