|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.constraint.ClientMaxPrincipalType
Represents a constraint on the client, such that if the client authenticates itself, then it may only authenticate itself as principals that are instances of one or more of the specified classes. A client can use this to limit how much of its identity is exposed in remote calls.
The use of an instance of this constraint does not directly imply a
ClientAuthentication.YES
constraint; that
must be specified separately to ensure that the client actually
authenticates itself.
AuthenticationPermission
, Serialized FormConstructor Summary | |
ClientMaxPrincipalType(java.lang.Class clazz)
Creates a constraint containing the specified class. |
|
ClientMaxPrincipalType(java.lang.Class[] classes)
Creates a constraint containing the specified classes, with redundant classes removed. |
|
ClientMaxPrincipalType(java.util.Collection c)
Creates a constraint containing the specified classes, with redundant classes removed. |
Method Summary | |
java.util.Set |
elements()
Returns an immutable set of all of the classes. |
boolean |
equals(java.lang.Object obj)
Two instances of this class are equal if they have the same classes (ignoring order). |
int |
hashCode()
Returns a hash code value for this object. |
SecurityConstraint |
reduceBy(SecurityConstraint c)
Returns the smallest representable subset of this constraint that contains the intersection of this constraint with the specified constraint, or null if there is no intersection. |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ClientMaxPrincipalType(java.lang.Class clazz)
clazz
- the classjava.lang.IllegalArgumentException
- if the parameter is not a trusted
principal class or a supertype, or the parameter is class
java.security.Principal
, Object
or
java.io.Serializable
NullPointerException
- if the parameter is null
public ClientMaxPrincipalType(java.lang.Class[] classes)
c1
and c2
, if
c1.isAssignableFrom(c2)
is true
, then
c2
is removed. That is, duplicates and subtypes are
removed. The parameter passed to the constructor is neither modified
nor retained; subsequent changes to that parameter have no effect on
the instance created.classes
- the classesjava.lang.IllegalArgumentException
- if the parameter is empty, or the
elements are not all trusted principal classes or supertypes, or any
element is class java.security.Principal
,
Object
or java.io.Serializable
NullPointerException
- if the parameter is null
or
any element is null
public ClientMaxPrincipalType(java.util.Collection c)
c1
and c2
, if
c1.isAssignableFrom(c2)
is true
, then
c2
is removed. That is, duplicates and subtypes are
removed. The parameter passed to the constructor is neither modified
nor retained; subsequent changes to that parameter have no effect on
the instance created.classes
- the classesjava.lang.IllegalArgumentException
- if the parameter is empty, or the
elements are not all trusted principal classes or supertypes, or any
element is class java.security.Principal
,
Object
or java.io.Serializable
NullPointerException
- if the parameter is null
or
any element is null
Method Detail |
public java.util.Set elements()
UnsupportedOperationException
being thrown.public SecurityConstraint reduceBy(SecurityConstraint c)
null
if there is no intersection.
For any instances c1
and c2
of this class, a
reduced set of classes is computed as follows. For each class
t1
in c1
, if there exists a class
t2
in c2
such that
t2.isAssignableFrom(t1)
is true
, then
t1
is included in the reduced set. For each class
t2
in c2
, if there exists a class
t1
in c1
such that
t1.isAssignableFrom(t2)
is true
and
t1
is not equal to t2
, then
t2
is included in the reduced set. If the reduced set is
empty, then the result of c1.reduceBy(c2)
is
null
, otherwise the result is a
ClientMaxPrincipalType
constructed from the reduced set.
For any instance c1
of this class and any
ClientMaxPrincipal
instance c2
,
c1.reduceBy(c2)
returns a ClientMaxPrincipal
constructed from the principals of c2
that are instances
of at least one of the classes in c1
, or null
if there are no such principals.
For any instance c1
of this class and any
ClientMinPrincipal
instance c2
,
c1.reduceBy(c2)
returns null
if there
exists a principal in c2
that is not an instance of
any class in c1
, and returns c1
otherwise.
For any instance c1
of this class and any
ClientMinPrincipalType
instance c2
,
c1.reduceBy(c2)
returns null
if there exists
a class t2
in c2
such that for every
class t1
in c1
, both
t1.isAssignableFrom(t2)
and
t2.isAssignableFrom(t1)
are false
, and
returns c1
otherwise.
For any instance c
of this class,
c.reduceBy(ClientAuthentication.NO)
returns
ClientAuthentication.NO
.
For any instance c1
of this class and any
ConstraintAlternatives
instance c2
containing ClientMaxPrincipal
or
ClientMaxPrincipalType
instances,
c1.reduceBy(c2)
returns the result of calling
ConstraintAlternatives.create
with all of the
non-null
values returned by c1.reduceBy(c)
for each element c
of c2
, or null
if there are no non-null
values.
For any instance c1
of this class and any
ConstraintAlternatives
instance c2
containing ClientMinPrincipal
or
ClientMinPrincipalType
instances,
c1.reduceBy(c2)
returns null
if
c1.reduceBy(c)
returns null
for
every element c
of c2
, and returns
c1
otherwise.
For any instance c1
of this class and any other constraint
instance c2
not previously mentioned,
c1.reduceBy(c2)
returns c1
.
reduceBy
in interface SecurityConstraint
java.rmi.constraint.SecurityConstraint
c
- a constraintnull
if
there is no intersectionpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |