org.eclipse.jetty.util.security

## Class Constraint

- java.lang.Object
- - org.eclipse.jetty.util.security.Constraint

- All Implemented Interfaces:
    Serializable, Cloneable

      public class Constraint
      extends Object
      implements Cloneable, Serializable

  Describe an auth and/or data constraint.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `__BASIC_AUTH`
    `static String` | `__CERT_AUTH`
    `static String` | `__CERT_AUTH2`
    `static String` | `__DIGEST_AUTH`
    `static String` | `__FORM_AUTH`
    `static String` | `__NEGOTIATE_AUTH`
    `static String` | `__SPNEGO_AUTH`
    `static String` | `ANY_ROLE`
    `static int` | `DC_CONFIDENTIAL`
    `static int` | `DC_FORBIDDEN`
    `static int` | `DC_INTEGRAL`
    `static int` | `DC_NONE`
    `static int` | `DC_UNSET`
    `static String` | `NONE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Constraint()` Constructor.
    `Constraint(String name, String role)` Conveniance Constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `clone()`
    `boolean` | `getAuthenticate()`
    `int` | `getDataConstraint()`
    `String[]` | `getRoles()`
    `boolean` | `hasDataConstraint()`
    `boolean` | `hasRole(String role)`
    `boolean` | `isAnyRole()`
    `boolean` | `isForbidden()`
    `void` | `setAuthenticate(boolean authenticate)`
    `void` | `setDataConstraint(int c)`
    `void` | `setName(String name)`
    `void` | `setRoles(String[] roles)`
    `String` | `toString()`
    `static boolean` | `validateMethod(String method)`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### __BASIC_AUTH

          public static final String __BASIC_AUTH

      See Also:
        Constant Field Values

    - #### __FORM_AUTH

          public static final String __FORM_AUTH

      See Also:
        Constant Field Values

    - #### __DIGEST_AUTH

          public static final String __DIGEST_AUTH

      See Also:
        Constant Field Values

    - #### __CERT_AUTH

          public static final String __CERT_AUTH

      See Also:
        Constant Field Values

    - #### __CERT_AUTH2

          public static final String __CERT_AUTH2

      See Also:
        Constant Field Values

    - #### __SPNEGO_AUTH

          public static final String __SPNEGO_AUTH

      See Also:
        Constant Field Values

    - #### __NEGOTIATE_AUTH

          public static final String __NEGOTIATE_AUTH

      See Also:
        Constant Field Values

    - #### DC_UNSET

          public static final int DC_UNSET

      See Also:
        Constant Field Values

    - #### DC_NONE

          public static final int DC_NONE

      See Also:
        Constant Field Values

    - #### DC_INTEGRAL

          public static final int DC_INTEGRAL

      See Also:
        Constant Field Values

    - #### DC_CONFIDENTIAL

          public static final int DC_CONFIDENTIAL

      See Also:
        Constant Field Values

    - #### DC_FORBIDDEN

          public static final int DC_FORBIDDEN

      See Also:
        Constant Field Values

    - #### NONE

          public static final String NONE

      See Also:
        Constant Field Values

    - #### ANY_ROLE

          public static final String ANY_ROLE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Constraint

          public Constraint()

      Constructor.

    - #### Constraint

          public Constraint(String name,
                    String role)

      Conveniance Constructor.
      Parameters:
        `name` -
        `role` -

  - ### Method Detail

    - #### validateMethod

          public static boolean validateMethod(String method)

    - #### clone

          public Object clone()
                       throws CloneNotSupportedException

      Overrides:
        `clone` in class `Object`
      Throws:
        `CloneNotSupportedException`

    - #### setName

          public void setName(String name)

      Parameters:
        `name` -

    - #### setRoles

          public void setRoles(String[] roles)

    - #### isAnyRole

          public boolean isAnyRole()

      Returns:
        True if any user role is permitted.

    - #### getRoles

          public String[] getRoles()

      Returns:
        List of roles for this constraint.

    - #### hasRole

          public boolean hasRole(String role)

      Parameters:
        `role` -
      Returns:
        True if the constraint contains the role.

    - #### setAuthenticate

          public void setAuthenticate(boolean authenticate)

      Parameters:
        `authenticate` - True if users must be authenticated

    - #### getAuthenticate

          public boolean getAuthenticate()

      Returns:
        True if the constraint requires request authentication

    - #### isForbidden

          public boolean isForbidden()

      Returns:
        True if authentication required but no roles set

    - #### setDataConstraint

          public void setDataConstraint(int c)

      Parameters:
        `c` - Data constrain indicator: 0=DC+NONE, 1=DC_INTEGRAL & 2=DC_CONFIDENTIAL

    - #### getDataConstraint

          public int getDataConstraint()

      Returns:
        Data constrain indicator: 0=DC+NONE, 1=DC_INTEGRAL & 2=DC_CONFIDENTIAL

    - #### hasDataConstraint

          public boolean hasDataConstraint()

      Returns:
        True if a data constraint has been set.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.