com.sun.jini.discovery.internal
Class X500Constraints

java.lang.Object
  extended by com.sun.jini.discovery.internal.X500Constraints

 class X500Constraints
extends Object

Processes constraints specified to net.jini.discovery.x500.* discovery format providers.


Field Summary
private  InvocationConstraints distilled
           
private static Set principalConstraints
           
private static Object SUPPORTED
           
private static Set supportedAnnouncementConstraints
           
private static Set supportedRequestConstraints
           
private static Object UNSUPPORTED
           
 
Constructor Summary
private X500Constraints(InvocationConstraints distilled)
           
 
Method Summary
(package private)  int checkClientPrincipal(X500Principal principal)
          Checks the given client principal against the constraints represented by this instance, returning the number of preferences satisfied, or -1 if the constraint requirements are not satisfied by the principal.
(package private)  int checkServerPrincipal(X500Principal principal)
          Checks the given server principal against the constraints represented by this instance, returning the number of preferences satisfied, or -1 if the constraint requirements are not satisfied by the principal.
private static boolean clientPrincipalSatisfies(X500Principal principal, InvocationConstraint constraint)
          Returns true if the specified client principal satisfies the given constraint; returns false otherwise.
private static Object distill(InvocationConstraint constraint, boolean request)
          Returns distilled (principal-dependent) constraint, or SUPPORTED/UNSUPPORTED if the constraint is unconditionally supported or not supported.
private static Collection distill(Set constraints, boolean request, boolean required)
          Returns principal-dependent constraints distilled from the given set of overall constraints.
(package private) static X500Constraints process(InvocationConstraints constraints, boolean request)
          Returns X500Constraints instance representing the processed constraints.
private static boolean serverPrincipalSatisfies(X500Principal principal, InvocationConstraint constraint)
          Returns true if the specified server principal satisfies the given constraint; returns false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUPPORTED

private static final Object SUPPORTED

UNSUPPORTED

private static final Object UNSUPPORTED

supportedRequestConstraints

private static final Set supportedRequestConstraints

supportedAnnouncementConstraints

private static final Set supportedAnnouncementConstraints

principalConstraints

private static final Set principalConstraints

distilled

private final InvocationConstraints distilled
Constructor Detail

X500Constraints

private X500Constraints(InvocationConstraints distilled)
Method Detail

process

static X500Constraints process(InvocationConstraints constraints,
                               boolean request)
                        throws UnsupportedConstraintException
Returns X500Constraints instance representing the processed constraints. If request is true, the constraints apply to multicast requests; otherwise, they apply to a multicast announcements. Throws an UnsupportedConstraintException if the constraints are unfulfillable (note that a successful return does not imply that the constraints are necessarily fulfillable).

Throws:
UnsupportedConstraintException

checkClientPrincipal

int checkClientPrincipal(X500Principal principal)
Checks the given client principal against the constraints represented by this instance, returning the number of preferences satisfied, or -1 if the constraint requirements are not satisfied by the principal.


checkServerPrincipal

int checkServerPrincipal(X500Principal principal)
Checks the given server principal against the constraints represented by this instance, returning the number of preferences satisfied, or -1 if the constraint requirements are not satisfied by the principal.


distill

private static Collection distill(Set constraints,
                                  boolean request,
                                  boolean required)
                           throws UnsupportedConstraintException
Returns principal-dependent constraints distilled from the given set of overall constraints. If request is true, the given constraints apply to multicast requests; otherwise, they apply to multicast announcements. If required is true, then an UnsupportedConstraintException is thrown if an unsupported constraint is encountered; otherwise, unsupported constraints are ignored.

Throws:
UnsupportedConstraintException

distill

private static Object distill(InvocationConstraint constraint,
                              boolean request)
Returns distilled (principal-dependent) constraint, or SUPPORTED/UNSUPPORTED if the constraint is unconditionally supported or not supported. If request is true, the given constraint applies to multicast requests; otherwise, it applies to multicast announcements.


clientPrincipalSatisfies

private static boolean clientPrincipalSatisfies(X500Principal principal,
                                                InvocationConstraint constraint)
Returns true if the specified client principal satisfies the given constraint; returns false otherwise.


serverPrincipalSatisfies

private static boolean serverPrincipalSatisfies(X500Principal principal,
                                                InvocationConstraint constraint)
Returns true if the specified server principal satisfies the given constraint; returns false otherwise.



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