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 ClientMinPrincipalType

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

All Implemented Interfaces:
  InvocationConstraint, Serializable

public final class ClientMinPrincipalType
extends Object
implements InvocationConstraint, Serializable

Represents a constraint on the client, such that if the client authenticates itself, then it must authenticate itself such that, for each specified class, at least one authenticated principal is an instance of that class. 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 of different types, the client might wish to ensure that it authenticates as one type, the other type, 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
See Also:
  `ClientAuthentication`, `ClientMaxPrincipal`, `ClientMaxPrincipalType`, `ClientMinPrincipal`, `AuthenticationPermission`, Serialized Form

Constructor Summary
`ClientMinPrincipalType(Class clazz)` Creates a constraint containing the specified class.
`ClientMinPrincipalType(Class[] classes)` Creates a constraint containing the specified classes, with redundant classes removed.
`ClientMinPrincipalType(Collection c)` Creates a constraint containing the specified classes, with redundant classes removed.

Method Summary
`Set` | `elements()` Returns an immutable set of all of the classes.
`boolean` | `equals(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.
`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

### ClientMinPrincipalType

    public ClientMinPrincipalType(Class clazz)

  Creates a constraint containing the specified class. This constructor is equivalent to calling a constructor with a single-element array containing the specified class.

Parameters:
  `clazz` - the class
Throws:
  `NullPointerException` - if the argument is `null`
  `IllegalArgumentException` - if the argument is a primitive type, an array type, or a `final` class that does not have `Principal` as a superinterface

### ClientMinPrincipalType

    public ClientMinPrincipalType(Class[] classes)

  Creates a constraint containing the specified classes, with redundant classes removed. Redundant classes are removed as follows: for any two specified classes `c1` and `c2`, if `c1.isAssignableFrom(c2)` is `true`, then `c1` is removed. That is, duplicates and supertypes are 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:
  `classes` - the classes
Throws:
  `IllegalArgumentException` - if the argument is empty, or if any element is a primitive type, an array type, or a `final` class that does not have `Principal` as a superinterface
  `NullPointerException` - if the argument is `null` or any element is `null`

### ClientMinPrincipalType

    public ClientMinPrincipalType(Collection c)

  Creates a constraint containing the specified classes, with redundant classes removed. Redundant classes are removed as follows: for any two specified classes `c1` and `c2`, if `c1.isAssignableFrom(c2)` is `true`, then `c1` is removed. That is, duplicates and supertypes are 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 classes
Throws:
  `IllegalArgumentException` - if the argument is empty, or if any element is not a `Class`, or is a primitive type, an array type, or a `final` class that does not have `Principal` as a superinterface
  `NullPointerException` - if the argument is `null` or any element is `null`

Method Detail

### elements

    public Set elements()

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

  Returns:
    an immutable set of all of the classes

### 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 classes (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