|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.sun.jini.discovery.DiscoveryConstraints
Class for processing constraints which apply to the discovery protocol:
DiscoveryProtocolVersion, MulticastMaxPacketSize,
MulticastTimeToLive, and UnicastSocketTimeout.
| Field Summary | |
static Method |
multicastAnnouncementMethod
Method object for the multicastAnnouncement method of this class. |
static Method |
multicastRequestMethod
Method object for the multicastRequest method of this class. |
static Method |
unicastDiscoveryMethod
Method object for the unicastDiscovery method of this class. |
| Method Summary | |
void |
checkProtocolVersion(int version)
Checks the protocol version of an incoming multicast request, announcement, or unicast discovery attempt, throwing an UnsupportedConstraintException if handling of the given protocol does
not satisfy the constraints of this instance. |
int |
chooseProtocolVersion()
Returns the protocol version to use for sending multicast requests or announcements, or initiating unicast discovery. |
int |
getMulticastMaxPacketSize(int defaultValue)
Returns the maximum multicast packet size to allow, or the specified default value if not constrained. |
int |
getMulticastTimeToLive(int defaultValue)
Returns the multicast time to live value to use, or the specified default value if not constrained. |
InvocationConstraints |
getUnfulfilledConstraints()
Returns the constraints for this instance which are not, or do not contain as alternatives, instances of the "fulfillable" (by this layer) constraint types DiscoveryProtocolVersion,
MulticastMaxPacketSize, MulticastTimeToLive,
and UnicastSocketTimeout. |
int |
getUnicastSocketTimeout(int defaultValue)
Returns socket timeout to use for unicast discovery, or the specified default value if not constrained. |
static void |
multicastAnnouncement()
Empty method which serves as a MethodConstraints key for looking
up InvocationConstraints that apply to multicast announcements. |
static void |
multicastRequest()
Empty method which serves as a MethodConstraints key for looking
up InvocationConstraints that apply to multicast requests. |
static DiscoveryConstraints |
process(InvocationConstraints constraints)
Processes the discovery-related constraints in the given set of constraints, returning a DiscoveryConstraints instance from
which the constraint results can be queried. |
static void |
unicastDiscovery()
Empty method which serves as a MethodConstraints key for looking
up InvocationConstraints that apply to unicast discovery. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final Method multicastRequestMethod
public static final Method multicastAnnouncementMethod
public static final Method unicastDiscoveryMethod
| Method Detail |
public static void multicastRequest()
MethodConstraints key for looking
up InvocationConstraints that apply to multicast requests.
public static void multicastAnnouncement()
MethodConstraints key for looking
up InvocationConstraints that apply to multicast announcements.
public static void unicastDiscovery()
MethodConstraints key for looking
up InvocationConstraints that apply to unicast discovery.
public static DiscoveryConstraints process(InvocationConstraints constraints)
throws UnsupportedConstraintException
DiscoveryConstraints instance from
which the constraint results can be queried.
constraints - the constraints to process
UnsupportedConstraintException - if the discovery-related
constraints contain conflicts, or otherwise cannot be processed
NullPointerException - if constraints is
nullpublic int chooseProtocolVersion()
public void checkProtocolVersion(int version)
throws UnsupportedConstraintException
UnsupportedConstraintException if handling of the given protocol does
not satisfy the constraints of this instance.
version - protocol version to check
UnsupportedConstraintException - if handling of the given protocol
does not satisfy the constraints of this instancepublic int getMulticastMaxPacketSize(int defaultValue)
defaultValue - the value to return if the multicast packet size is
unconstrained
public int getMulticastTimeToLive(int defaultValue)
defaultValue - the value to return if the multicast time to live
value is unconstrained
public int getUnicastSocketTimeout(int defaultValue)
defaultValue - the value to return if the socket timeout is
unconstrained
public InvocationConstraints getUnfulfilledConstraints()
DiscoveryProtocolVersion,
MulticastMaxPacketSize, MulticastTimeToLive,
and UnicastSocketTimeout. Constraint alternatives
containing both fulfillable and unfulfillable constraints are treated
optimistically--it is assumed that the one of the fulfillable
alternatives will be satisfied, so the unfulfillable alternatives are
not included in the returned constraints.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||