jxl.enclosure.security
Class PolicyData

java.lang.Object
  extended by jxl.enclosure.security.PolicyData

public final class PolicyData
extends java.lang.Object

This class hides the details of mapping and recovering permission policy data from persistent store.

Author:
Alex Lynch

Method Summary
 void clearTestingPolicies()
           
 void deny(java.security.CodeSigner signer, java.security.Permission p)
          Deny p to signer
static PolicyData getInstance()
          Get a singleton instance of PolicyData.
 java.util.Map<java.security.CodeSigner,java.util.Map<java.security.Permission,PermissionState>> getPolicies()
          Get an unmodifiable view of the security policy data
 PermissionState getState(java.security.CodeSigner signer, java.security.Permission p)
          Get state of permissoin p for signer
 void grant(java.security.CodeSigner signer, java.security.Permission p)
          Grant p to signer
 boolean isDenied(java.security.CodeSigner signer, java.security.Permission p)
          Is p denied to signer
 boolean isGranted(java.security.CodeSigner signer, java.security.Permission p)
          Is p granted to signer
 void setState(java.security.CodeSigner signer, java.security.Permission p, PermissionState state)
          Set the state of permissoin p for signer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static PolicyData getInstance()
                              throws java.lang.SecurityException
Get a singleton instance of PolicyData.

Throws:
java.lang.SecurityException - if the caller does not pass jxl.enclosure.security.DynSecurityPolicy.checkEnclosure().

clearTestingPolicies

public void clearTestingPolicies()

grant

public void grant(java.security.CodeSigner signer,
                  java.security.Permission p)
Grant p to signer


deny

public void deny(java.security.CodeSigner signer,
                 java.security.Permission p)
Deny p to signer


isGranted

public boolean isGranted(java.security.CodeSigner signer,
                         java.security.Permission p)
Is p granted to signer


isDenied

public boolean isDenied(java.security.CodeSigner signer,
                        java.security.Permission p)
Is p denied to signer


getState

public PermissionState getState(java.security.CodeSigner signer,
                                java.security.Permission p)
Get state of permissoin p for signer


getPolicies

public java.util.Map<java.security.CodeSigner,java.util.Map<java.security.Permission,PermissionState>> getPolicies()
Get an unmodifiable view of the security policy data


setState

public void setState(java.security.CodeSigner signer,
                     java.security.Permission p,
                     PermissionState state)
Set the state of permissoin p for signer