org.apache.geronimo.security.util
Class ConfigurationUtil

java.lang.Object
  extended by org.apache.geronimo.security.util.ConfigurationUtil

public class ConfigurationUtil
extends Object

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

See Also:
PolicyConfiguration, "JSR 115" Java Authorization Contract for Containers

Constructor Summary
ConfigurationUtil()
           
 
Method Summary
static Subject generateDefaultSubject(DefaultPrincipal defaultPrincipal, ClassLoader classLoader)
          Generate the default principal from the security config.
static DomainPrincipal generateDomainPrincipal(String loginDomain, PrincipalInfo principalInfo, ClassLoader classLoader)
          Create a DomainPrincipal from a deployment description.
static DomainPrincipal generateDomainPrincipal(String loginDomain, String className, String principalName, ClassLoader classLoader)
           
static PrimaryDomainPrincipal generatePrimaryDomainPrincipal(String domain, PrincipalInfo principalInfo, ClassLoader classLoader)
          Create a DomainPrincipal from a deployment description.
static PrimaryDomainPrincipal generatePrimaryDomainPrincipal(String domain, String className, String principalName, ClassLoader classLoader)
           
static PrimaryPrincipal generatePrimaryPrincipal(PrincipalInfo principalInfo, ClassLoader classLoader)
          Create a Principal from a deployment description.
static PrimaryPrincipal generatePrimaryPrincipal(String className, String principalName, ClassLoader classLoader)
           
static PrimaryRealmPrincipal generatePrimaryRealmPrincipal(String realm, String domain, PrincipalInfo principalInfo, ClassLoader classLoader)
          Create a RealmPrincipal from a deployment description.
static PrimaryRealmPrincipal generatePrimaryRealmPrincipal(String realm, String domain, String className, String principalName, ClassLoader classLoader)
           
static Principal generatePrincipal(PrincipalInfo principalInfo, ClassLoader classLoader)
          Create a Principal from a deployment description.
static Principal generatePrincipal(String className, String principalName, ClassLoader classLoader)
           
static RealmPrincipal generateRealmPrincipal(String realm, String loginDomain, PrincipalInfo principalInfo, ClassLoader classLoader)
          Create a RealmPrincipal from a deployment description.
static RealmPrincipal generateRealmPrincipal(String realm, String loginDomain, String className, String principalName, ClassLoader classLoader)
           
static X500Principal generateX500Principal(String name)
          Create an X500Principal from a deployment description.
static void registerPolicyContextHandler(PolicyContextHandler handler, boolean replace)
          A simple helper method to register PolicyContextHandlers
 
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

generateX500Principal

public static X500Principal generateX500Principal(String name)
Create an X500Principal from a deployment description.

Parameters:
name - the distinguished name of the principal
Returns:
an X500Principal from a deployment description

generatePrincipal

public static Principal generatePrincipal(PrincipalInfo principalInfo,
                                          ClassLoader classLoader)
Create a Principal from a deployment description.

Parameters:
principalInfo - the deployment description of the principal to be created.
classLoader -
Returns:
a RealmPrincipal from a deployment description

generatePrincipal

public static Principal generatePrincipal(String className,
                                          String principalName,
                                          ClassLoader classLoader)

generateRealmPrincipal

public static RealmPrincipal generateRealmPrincipal(String realm,
                                                    String loginDomain,
                                                    PrincipalInfo principalInfo,
                                                    ClassLoader classLoader)
Create a RealmPrincipal from a deployment description.

Parameters:
principalInfo - the deployment description of the principal to be created.
classLoader -
Returns:
a RealmPrincipal from a deployment description

generateRealmPrincipal

public static RealmPrincipal generateRealmPrincipal(String realm,
                                                    String loginDomain,
                                                    String className,
                                                    String principalName,
                                                    ClassLoader classLoader)

generateDomainPrincipal

public static DomainPrincipal generateDomainPrincipal(String loginDomain,
                                                      PrincipalInfo principalInfo,
                                                      ClassLoader classLoader)
Create a DomainPrincipal from a deployment description.

Parameters:
principalInfo - the deployment description of the principal to be created.
classLoader -
Returns:
a RealmPrincipal from a deployment description

generateDomainPrincipal

public static DomainPrincipal generateDomainPrincipal(String loginDomain,
                                                      String className,
                                                      String principalName,
                                                      ClassLoader classLoader)

generatePrimaryRealmPrincipal

public static PrimaryRealmPrincipal generatePrimaryRealmPrincipal(String realm,
                                                                  String domain,
                                                                  PrincipalInfo principalInfo,
                                                                  ClassLoader classLoader)
                                                           throws org.apache.geronimo.common.DeploymentException
Create a RealmPrincipal from a deployment description.

Parameters:
principalInfo - the deployment description of the principal to be created.
classLoader -
Returns:
a PrimaryRealmPrincipal from a deployment description
Throws:
org.apache.geronimo.common.DeploymentException

generatePrimaryRealmPrincipal

public static PrimaryRealmPrincipal generatePrimaryRealmPrincipal(String realm,
                                                                  String domain,
                                                                  String className,
                                                                  String principalName,
                                                                  ClassLoader classLoader)
                                                           throws org.apache.geronimo.common.DeploymentException
Throws:
org.apache.geronimo.common.DeploymentException

generatePrimaryDomainPrincipal

public static PrimaryDomainPrincipal generatePrimaryDomainPrincipal(String domain,
                                                                    PrincipalInfo principalInfo,
                                                                    ClassLoader classLoader)
                                                             throws org.apache.geronimo.common.DeploymentException
Create a DomainPrincipal from a deployment description.

Parameters:
principalInfo - the deployment description of the principal to be created.
classLoader -
Returns:
a PrimaryDomainPrincipal from a deployment description
Throws:
org.apache.geronimo.common.DeploymentException

generatePrimaryDomainPrincipal

public static PrimaryDomainPrincipal generatePrimaryDomainPrincipal(String domain,
                                                                    String className,
                                                                    String principalName,
                                                                    ClassLoader classLoader)
                                                             throws org.apache.geronimo.common.DeploymentException
Throws:
org.apache.geronimo.common.DeploymentException

generatePrimaryPrincipal

public static PrimaryPrincipal generatePrimaryPrincipal(PrincipalInfo principalInfo,
                                                        ClassLoader classLoader)
                                                 throws org.apache.geronimo.common.DeploymentException
Create a Principal from a deployment description.

Parameters:
principalInfo - the deployment description of the principal to be created.
classLoader -
Returns:
a Principal from a deployment description
Throws:
org.apache.geronimo.common.DeploymentException

generatePrimaryPrincipal

public static PrimaryPrincipal generatePrimaryPrincipal(String className,
                                                        String principalName,
                                                        ClassLoader classLoader)
                                                 throws org.apache.geronimo.common.DeploymentException
Throws:
org.apache.geronimo.common.DeploymentException

generateDefaultSubject

public static Subject generateDefaultSubject(DefaultPrincipal defaultPrincipal,
                                             ClassLoader classLoader)
                                      throws org.apache.geronimo.common.DeploymentException
Generate the default principal from the security config.

Parameters:
defaultPrincipal -
classLoader -
Returns:
the default principal
Throws:
org.apache.geronimo.common.DeploymentException

registerPolicyContextHandler

public static void registerPolicyContextHandler(PolicyContextHandler handler,
                                                boolean replace)
                                         throws 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:
PolicyContextException


Copyright © 2006 Apache Software Foundation. All Rights Reserved.