public final class ServerMinPrincipal extends Object implements InvocationConstraint, Serializable
The use of an instance of this class does not imply directly a
ServerAuthentication.YES
constraint; that must be specified
separately to ensure that the server actually authenticates itself.
Because this constraint is conditional on server authentication, it does
not conflict with ServerAuthentication.NO
.
It is important to understand that specifying
ServerAuthentication.YES
as a requirement does not
ensure that a server is to be trusted; it does ensure that the
server authenticates itself as someone, but it does not ensure that the
server authenticates itself as anyone in particular. Without knowing who
the server authenticated itself as, there is no basis for actually
trusting the server. The client generally needs to specify a
ServerMinPrincipal
requirement in addition, or else verify
that the server has specified a satisfactory
ServerMinPrincipal
requirement for each of the methods that
the client cares about.
ServerAuthentication
,
AuthenticationPermission
,
Serialized FormModifier and Type | Field and Description |
---|---|
private Principal[] |
principals
The principals.
|
private static ObjectStreamField[] |
serialPersistentFields |
private static long |
serialVersionUID |
Constructor and Description |
---|
ServerMinPrincipal(Collection c)
Creates a constraint containing the specified principals, with
duplicates removed.
|
ServerMinPrincipal(Principal p)
Creates a constraint containing the specified principal.
|
ServerMinPrincipal(Principal[] principals)
Creates a constraint containing the specified principals, with
duplicates removed.
|
Modifier and Type | Method and Description |
---|---|
Set |
elements()
Returns an immutable set of all of the principals.
|
boolean |
equals(Object obj)
Two instances of this class are equal if they have the same principals
(ignoring order).
|
(package private) Principal[] |
getPrincipals()
Returns the principals, without copying.
|
int |
hashCode()
Returns a hash code value for this object.
|
private void |
readObject(ObjectInputStream s)
Verifies that there is at least one principal, that none of the
principals is
null , and that there are no duplicates. |
String |
toString()
Returns a string representation of this object.
|
private static final long serialVersionUID
private static final ObjectStreamField[] serialPersistentFields
private final Principal[] principals
public ServerMinPrincipal(Principal p)
p
- the principalNullPointerException
- if the argument is null
public ServerMinPrincipal(Principal[] principals)
principals
- the principalsNullPointerException
- if the argument is null
or
any element is null
IllegalArgumentException
- if the argument is emptypublic ServerMinPrincipal(Collection c)
c
- the principalsNullPointerException
- if the argument is null
or
any element is null
IllegalArgumentException
- if the argument is empty or the
elements do not all implement the Principal
interfacepublic Set elements()
UnsupportedOperationException
being
thrown.Principal[] getPrincipals()
public int hashCode()
public boolean equals(Object obj)
public String toString()
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException
null
, and that there are no duplicates.InvalidObjectException
- if there are no principals,
or any principal is null
, or if there are duplicate
principalsIOException
ClassNotFoundException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.