org.apache.lenya.ac
Interface Policy

All Known Subinterfaces:
ModifiablePolicy

public interface Policy

A policy assigns roles to accreditables using credentials. Additionally, SSL protection is defined.

Version:
$Id: Policy.java 479620 2006-11-27 14:02:13Z andreas $

Field Summary
static int RESULT_DENIED
          The role is denied for the identity.
static int RESULT_GRANTED
          The role is granted for the identity.
static int RESULT_NOT_MATCHED
          The identity was not matched in this policy.
 
Method Summary
 int check(Identity identity, Role role)
          Checks if a certain role is granted for a certain policy.
 Credential[] getCredentials()
           
 Credential[] getCredentials(Identity identity)
           
 boolean isEmpty()
          Returns if the policy is empty.
 boolean isSSLProtected()
          Returns if this policy requires SSL protection.
 

Field Detail

RESULT_NOT_MATCHED

static final int RESULT_NOT_MATCHED
The identity was not matched in this policy.

See Also:
Constant Field Values

RESULT_DENIED

static final int RESULT_DENIED
The role is denied for the identity.

See Also:
Constant Field Values

RESULT_GRANTED

static final int RESULT_GRANTED
The role is granted for the identity.

See Also:
Constant Field Values
Method Detail

check

int check(Identity identity,
          Role role)
          throws AccessControlException
Checks if a certain role is granted for a certain policy.

Parameters:
identity - The identity.
role - The role to check.
Returns:
A result code.
Throws:
AccessControlException - when something went wrong.

isSSLProtected

boolean isSSLProtected()
                       throws AccessControlException
Returns if this policy requires SSL protection.

Returns:
A boolean value.
Throws:
AccessControlException - when something went wrong.

isEmpty

boolean isEmpty()
                throws AccessControlException
Returns if the policy is empty. A policy is empty if it does not contain any credentials.

Returns:
A boolean value.
Throws:
AccessControlException - when something went wrong.

getCredentials

Credential[] getCredentials(Identity identity)
                            throws AccessControlException
Parameters:
identity - The identity.
Returns:
All credentials defined by this policy for this identity.
Throws:
AccessControlException - if an error occurs.

getCredentials

Credential[] getCredentials()
                            throws AccessControlException
Returns:
All credentials defined by this policy.
Throws:
AccessControlException - if an error occurs.


Copyright 1999-2006 Apache Software Foundation. All Rights Reserved.