org.mortbay.http
Class SecurityConstraint

java.lang.Object
  |
  +--org.mortbay.http.SecurityConstraint
All Implemented Interfaces:
java.lang.Cloneable

public class SecurityConstraint
extends java.lang.Object
implements java.lang.Cloneable

Describe an auth and/or data constraint.

Version:
$Revision: 1.2 $
Author:
Greg Wilkins (gregw)

Field Summary
static int DC_CONFIDENTIAL
           
static int DC_INTEGRAL
           
static int DC_NONE
           
static java.lang.String NONE
           
 
Constructor Summary
SecurityConstraint()
          Constructor.
SecurityConstraint(java.lang.String name, java.lang.String role)
          Conveniance Constructor.
 
Method Summary
 void addMethod(java.lang.String method)
           
 void addRole(java.lang.String role)
           
 java.lang.Object clone()
           
 boolean forMethod(java.lang.String method)
           
 int getDataConstraint()
           
 java.util.List getMethods()
           
 java.util.List getRoles()
           
 boolean hasDataConstraint()
           
 boolean hasRole(java.lang.String role)
           
 boolean isAuthenticated()
           
 java.util.Iterator roles()
           
 void setDataConstraint(int c)
           
 void setName(java.lang.String name)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DC_NONE

public static final int DC_NONE

DC_INTEGRAL

public static final int DC_INTEGRAL

DC_CONFIDENTIAL

public static final int DC_CONFIDENTIAL

NONE

public static final java.lang.String NONE
Constructor Detail

SecurityConstraint

public SecurityConstraint()
Constructor.

SecurityConstraint

public SecurityConstraint(java.lang.String name,
                          java.lang.String role)
Conveniance Constructor.
Parameters:
name -  
role -  
Method Detail

setName

public void setName(java.lang.String name)
Parameters:
name -  

addMethod

public void addMethod(java.lang.String method)
Parameters:
method -  

getMethods

public java.util.List getMethods()

forMethod

public boolean forMethod(java.lang.String method)
Parameters:
method -  
Returns:
True if this constraint applies to the method.

addRole

public void addRole(java.lang.String role)
Parameters:
role -  

roles

public java.util.Iterator roles()
Returns:
Iterator of role names

getRoles

public java.util.List getRoles()
Returns:
 

hasRole

public boolean hasRole(java.lang.String role)
Parameters:
role -  
Returns:
True if the constraint contains the role.

isAuthenticated

public boolean isAuthenticated()
Returns:
True if the constraint requires request authentication

setDataConstraint

public void setDataConstraint(int c)
Parameters:
c -  

getDataConstraint

public int getDataConstraint()
Returns:
 

hasDataConstraint

public boolean hasDataConstraint()
Returns:
True if there is a data constraint.

clone

public java.lang.Object clone()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
 


Copyright © 2000 Mortbay Consulting Pty. Ltd. All Rights Reserved.