Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.jini.core.constraint
Class ServerMinPrincipal

    java.lang.Object
      net.jini.core.constraint.ServerMinPrincipal

All Implemented Interfaces:
  InvocationConstraint, Serializable

public final class ServerMinPrincipal
extends Object
implements InvocationConstraint, Serializable

Represents a constraint on the server, such that if the server authenticates itself, then it must authenticate itself as at least all of the specified principals. The mechanisms and credentials used to authenticate the server as those principals are not specified by this constraint.

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.

Since:
  2.0
See Also:
  `ServerAuthentication`, `AuthenticationPermission`, Serialized Form

Constructor Summary
`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.

Method Summary
`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).
`int` | `hashCode()` Returns a hash code value for this object.
`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

### ServerMinPrincipal

    public ServerMinPrincipal(Principal p)

  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 is `null`

### ServerMinPrincipal

    public ServerMinPrincipal(Principal[] principals)

  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 is `null` or any element is `null`
  `IllegalArgumentException` - if the argument is empty

### ServerMinPrincipal

    public ServerMinPrincipal(Collection c)

  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 is `null` or any element is `null`
  `IllegalArgumentException` - if the argument is empty or the elements do not all implement the `Principal` interface

Method Detail

### elements

    public Set elements()

  Returns an immutable set of all of the principals. Any attempt to modify the set results in an `UnsupportedOperationException` being thrown.

  Returns:
    an immutable set of all of the principals

### hashCode

    public int hashCode()

  Returns a hash code value for this object.

### equals

    public boolean equals(Object obj)

  Two instances of this class are equal if they have the same principals (ignoring order).

### toString

    public String toString()

  Returns a string representation of this object.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Sun Microsystems, Inc. All rights reserved