Package net.jini.core.constraint
Class ClientMinPrincipal
java.lang.Object
net.jini.core.constraint.ClientMinPrincipal
- All Implemented Interfaces:
Serializable,InvocationConstraint
Represents a constraint on the client, such that if the client authenticates itself, then it must
authenticate itself as at least all of the specified principals. The mechanisms and credentials
used to authenticate the client as those principals are not specified by this constraint. This
constraint is intended for use by clients to control how much of their identity is exposed in
remote calls; it is not intended for use by servers as an authorization mechanism. For example,
if the client's subject contains sufficient information to authenticate as two distinct
principals, the client might wish to ensure that it authenticates as one, the other, or both,
depending on what the client believes is necessary for authorization at the server.
The use
of an instance of this class does not directly imply a ClientAuthentication.YES
constraint; that must be specified separately to ensure that the client actually authenticates
itself. Because this constraint is conditional on client authentication, it does not conflict
with ClientAuthentication.NO.
- Since:
- 2.0
- Author:
- Sun Microsystems, Inc.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a constraint containing the specified principal.ClientMinPrincipal(Principal[] principals) Creates a constraint containing the specified principals, with duplicates removed.Creates a constraint containing the specified principals, with duplicates removed. -
Method Summary
Modifier and TypeMethodDescriptionelements()Returns an immutable set of all of the principals.booleanTwo instances of this class are equal if they have the same principals (ignoring order).inthashCode()Returns a hash code value for this object.toString()Returns a string representation of this object.
-
Constructor Details
-
ClientMinPrincipal
Creates a constraint containing the specified principal. This constructor is equivalent to calling a constructor with a single-element array containing the specified principal.- Parameters:
p- the principal- Throws:
NullPointerException- if the argument isnull
-
ClientMinPrincipal
Creates a constraint containing the specified principals, with duplicates removed. The argument passed to the constructor is neither modified nor retained; subsequent changes to that argument have no effect on the instance created.- Parameters:
principals- the principals- Throws:
NullPointerException- if the argument isnullor any element isnullIllegalArgumentException- if the argument is empty
-
ClientMinPrincipal
Creates a constraint containing the specified principals, with duplicates removed. The argument passed to the constructor is neither modified nor retained; subsequent changes to that argument have no effect on the instance created.- Parameters:
c- the principals- Throws:
NullPointerException- if the argument isnullor any element isnullIllegalArgumentException- if the argument is empty or the elements do not all implement thePrincipalinterface
-
-
Method Details
-
elements
Returns an immutable set of all of the principals. Any attempt to modify the set results in anUnsupportedOperationExceptionbeing thrown.- Returns:
- an immutable set of all of the principals
-
hashCode
public int hashCode()Returns a hash code value for this object. -
equals
Two instances of this class are equal if they have the same principals (ignoring order). -
toString
Returns a string representation of this object.
-