Class Constraint

java.lang.Object
org.eclipse.jetty.util.security.Constraint
All Implemented Interfaces:
Serializable, Cloneable

public class Constraint extends Object implements Cloneable, Serializable
Constraint Describe an auth and/or data constraint.
See Also:
  • Field Details Link icon

  • Constructor Details Link icon

    • Constraint Link icon

      public Constraint()
      Constructor.
    • Constraint Link icon

      public Constraint(String name, String role)
      Convenience Constructor.
      Parameters:
      name - the name
      role - the role
  • Method Details Link icon

    • validateMethod Link icon

      public static boolean validateMethod(String method)
    • clone Link icon

      public Object clone() throws CloneNotSupportedException
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • setName Link icon

      public void setName(String name)
      Parameters:
      name - the name
    • getName Link icon

      public String getName()
    • setRoles Link icon

      public void setRoles(String[] roles)
    • isAnyRole Link icon

      public boolean isAnyRole()
      Returns:
      True if any user role is permitted.
    • isAnyAuth Link icon

      public boolean isAnyAuth()
      Servlet Spec 3.1, pg 140
      Returns:
      True if any authenticated user is permitted (ie a role "**" was specified in the constraint).
    • getRoles Link icon

      public String[] getRoles()
      Returns:
      String array of roles for this constraint.
    • hasRole Link icon

      public boolean hasRole(String role)
      Parameters:
      role - the role
      Returns:
      True if the constraint contains the role.
    • setAuthenticate Link icon

      public void setAuthenticate(boolean authenticate)
      Parameters:
      authenticate - True if users must be authenticated
    • getAuthenticate Link icon

      public boolean getAuthenticate()
      Returns:
      True if the constraint requires request authentication
    • isForbidden Link icon

      public boolean isForbidden()
      Returns:
      True if authentication required but no roles set
    • setDataConstraint Link icon

      public void setDataConstraint(int c)
      Parameters:
      c - Data constrain indicator: 0=DC+NONE, 1=DC_INTEGRAL & 2=DC_CONFIDENTIAL
    • getDataConstraint Link icon

      public int getDataConstraint()
      Returns:
      Data constrain indicator: 0=DC+NONE, 1=DC_INTEGRAL & 2=DC_CONFIDENTIAL
    • hasDataConstraint Link icon

      public boolean hasDataConstraint()
      Returns:
      True if a data constraint has been set.
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object