org.apache.geronimo.security.util
Class ConfigurationUtil

java.lang.Object
  extended byorg.apache.geronimo.security.util.ConfigurationUtil

public class ConfigurationUtil
extends Object

A collection of utility functions that assist with the configuration of PolicyConfigurations.

Version:
$Revision: 1.6 $ $Date: 2004/07/27 01:58:22 $
See Also:
PolicyConfiguration, "JSR 115" Java Authorization Contract for Containers

Constructor Summary
ConfigurationUtil()
           
 
Method Summary
static void configure(javax.security.jacc.PolicyConfiguration configuration, org.apache.geronimo.xbeans.j2ee.EjbJarType ejbJar)
           
static void configure(javax.security.jacc.PolicyConfiguration configuration, org.apache.geronimo.xbeans.j2ee.WebAppType webApp)
          Translate the web deployment descriptors into equivalent security permissions.
static PrimaryRealmPrincipal generatePrimaryRealmPrincipal(Principal principal, String realmName)
          Create a RealmPrincipal from a deployment description.
static RealmPrincipal generateRealmPrincipal(Principal principal, String realmName)
          Create a RealmPrincipal from a deployment description.
static void registerPolicyContextHandler(javax.security.jacc.PolicyContextHandler handler, boolean replace)
          A simple helper method to register PolicyContextHandlers
static String[] toStringArray(org.apache.geronimo.xbeans.j2ee.JavaTypeType[] methodParamArray)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationUtil

public ConfigurationUtil()
Method Detail

generateRealmPrincipal

public static RealmPrincipal generateRealmPrincipal(Principal principal,
                                                    String realmName)
Create a RealmPrincipal from a deployment description.

Parameters:
principal - the deployment description of the principal to be created.
realmName - the security realm that the principal belongs go
Returns:
a RealmPrincipal from a deployment description

generatePrimaryRealmPrincipal

public static PrimaryRealmPrincipal generatePrimaryRealmPrincipal(Principal principal,
                                                                  String realmName)
Create a RealmPrincipal from a deployment description.

Parameters:
principal - the deployment description of the principal to be created.
realmName - the security realm that the principal belongs go
Returns:
a RealmPrincipal from a deployment description

registerPolicyContextHandler

public static void registerPolicyContextHandler(javax.security.jacc.PolicyContextHandler handler,
                                                boolean replace)
                                         throws javax.security.jacc.PolicyContextException
A simple helper method to register PolicyContextHandlers

Parameters:
handler - an object that implements the PolicyContextHandler interface. The value of this parameter must not be null.
replace - this boolean value defines the behavior of this method if, when it is called, a PolicyContextHandler has already been registered to handle the same key. In that case, and if the value of this argument is true, the existing handler is replaced with the argument handler. If the value of this parameter is false the existing registration is preserved and an exception is thrown.
Throws:
javax.security.jacc.PolicyContextException

configure

public static void configure(javax.security.jacc.PolicyConfiguration configuration,
                             org.apache.geronimo.xbeans.j2ee.WebAppType webApp)
                      throws GeronimoSecurityException
Translate the web deployment descriptors into equivalent security permissions. These permissions are placed into the appropriate PolicyConfiguration object as defined in the JAAC spec.

Parameters:
webApp - the deployment descriptor from which to obtain the security constraints that are to be translated.
Throws:
GeronimoSecurityException - if there is any violation of the semantics of the security descriptor or the state of the module configuration.
See Also:
PolicyConfiguration, "Java Authorization Contract for Containers", section 3.1.3

configure

public static void configure(javax.security.jacc.PolicyConfiguration configuration,
                             org.apache.geronimo.xbeans.j2ee.EjbJarType ejbJar)
                      throws GeronimoSecurityException
Throws:
GeronimoSecurityException

toStringArray

public static String[] toStringArray(org.apache.geronimo.xbeans.j2ee.JavaTypeType[] methodParamArray)


Copyright © 2003-2005 Apache Software Foundation. All Rights Reserved.