Class ServerMinPrincipal

java.lang.Object
net.jini.core.constraint.ServerMinPrincipal
All Implemented Interfaces:
Serializable, InvocationConstraint

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
Author:
Sun Microsystems, Inc.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a constraint containing the specified principal.
    Creates a constraint containing the specified principals, with duplicates removed.
    Creates a constraint containing the specified principals, with duplicates removed.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an immutable set of all of the principals.
    boolean
    Two instances of this class are equal if they have the same principals (ignoring order).
    int
    Returns a hash code value for this object.
    Returns a string representation of this object.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • 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 Details

    • 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.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Two instances of this class are equal if they have the same principals (ignoring order).
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Returns a string representation of this object.
      Overrides:
      toString in class Object