org.jboss.security.auth.login
Class XMLLoginConfigImpl

java.lang.Object
  extended by javax.security.auth.login.Configuration
      extended by org.jboss.security.auth.login.XMLLoginConfigImpl
All Implemented Interfaces:
Serializable, ApplicationPolicyRegistration

public class XMLLoginConfigImpl
extends Configuration
implements Serializable, ApplicationPolicyRegistration

An concrete implementation of the javax.security.auth.login.Configuration class that parses an xml configuration of the form: starksm

Version:
$Revision: 57482 $
Author:
Scott.Stark@jboss.org, Anil.Saldhana@jboss.org
See Also:
Configuration, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.security.auth.login.Configuration
Configuration.Parameters
 
Field Summary
protected  URL loginConfigURL
          The URL to the XML or Sun login configuration
protected  Configuration parentConfig
          The inherited configuration we delegate to
 
Method Summary
 void addAppConfig(String appName, AppConfigurationEntry[] entries)
          Add an application configuration
 void addApplicationPolicy(String appName, ApplicationPolicy aPolicy)
          Register an application policy
 void clear()
           
 void copy(PolicyConfig policyConfig)
           
 AppConfigurationEntry[] getAppConfigurationEntry(String appName)
           
 ApplicationPolicy getApplicationPolicy(String domainName)
          Get the Application Policy given the security domain name
 BaseAuthenticationInfo getAuthenticationInfo(String domainName)
          Method that returns the parsed AuthenticationInfo needed by the JASPI framework until a seperate Configuration mechanism for JASPI is established
 URL getConfigURL()
          Set the URL of the XML login configuration file that should be loaded by this mbean on startup.
static XMLLoginConfigImpl getInstance()
           Obtains a reference to the singleton.
 boolean getValidateDTD()
          Get whether the login config xml document is validated againsts its DTD
 void loadConfig()
          Called to try to load the config from the java.security.auth.login.config property value when there is no loginConfigURL.
protected  String[] loadConfig(URL config)
           
 void refresh()
           
 void removeAppConfig(String appName)
          Deprecated.  
 boolean removeApplicationPolicy(String appName)
          Unregister an Application Policy for a security domain
 void setConfigResource(String resourceName)
           
 void setConfigURL(URL loginConfigURL)
          Set the URL of the XML login configuration file that should be loaded by this mbean on startup.
 void setParentConfig(Configuration parentConfig)
           
 void setValidateDTD(boolean flag)
          Set whether the login config xml document is validated againsts its DTD
 
Methods inherited from class javax.security.auth.login.Configuration
getConfiguration, getInstance, getInstance, getInstance, getParameters, getProvider, getType, setConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loginConfigURL

protected URL loginConfigURL
The URL to the XML or Sun login configuration


parentConfig

protected Configuration parentConfig
The inherited configuration we delegate to

Method Detail

getInstance

public static XMLLoginConfigImpl getInstance()

Obtains a reference to the singleton.

Returns:
a reference to the singleton XMLLoginConfigImpl instance.

refresh

public void refresh()
Overrides:
refresh in class Configuration

getAppConfigurationEntry

public AppConfigurationEntry[] getAppConfigurationEntry(String appName)
Specified by:
getAppConfigurationEntry in class Configuration

getConfigURL

public URL getConfigURL()
Set the URL of the XML login configuration file that should be loaded by this mbean on startup.


setConfigURL

public void setConfigURL(URL loginConfigURL)
Set the URL of the XML login configuration file that should be loaded by this mbean on startup.


setConfigResource

public void setConfigResource(String resourceName)
                       throws IOException
Throws:
IOException

setParentConfig

public void setParentConfig(Configuration parentConfig)

getValidateDTD

public boolean getValidateDTD()
Get whether the login config xml document is validated againsts its DTD


setValidateDTD

public void setValidateDTD(boolean flag)
Set whether the login config xml document is validated againsts its DTD


addApplicationPolicy

public void addApplicationPolicy(String appName,
                                 ApplicationPolicy aPolicy)
Description copied from interface: ApplicationPolicyRegistration
Register an application policy

Specified by:
addApplicationPolicy in interface ApplicationPolicyRegistration
Parameters:
appName - Security Domain Name
aPolicy - Application Policy to register
See Also:
ApplicationPolicyRegistration.addApplicationPolicy(String, ApplicationPolicy)

addAppConfig

public void addAppConfig(String appName,
                         AppConfigurationEntry[] entries)
Add an application configuration


copy

public void copy(PolicyConfig policyConfig)

removeAppConfig

@Deprecated
public void removeAppConfig(String appName)
Deprecated. 

Parameters:
appName -
See Also:
removeApplicationPolicy(String)

getApplicationPolicy

public ApplicationPolicy getApplicationPolicy(String domainName)
Description copied from interface: ApplicationPolicyRegistration
Get the Application Policy given the security domain name

Specified by:
getApplicationPolicy in interface ApplicationPolicyRegistration
Parameters:
domainName - security domain name
Returns:
registered Application Policy
See Also:
ApplicationPolicyRegistration.getApplicationPolicy(String)

removeApplicationPolicy

public boolean removeApplicationPolicy(String appName)
Description copied from interface: ApplicationPolicyRegistration
Unregister an Application Policy for a security domain

Specified by:
removeApplicationPolicy in interface ApplicationPolicyRegistration
Returns:
whether unregistration was successful
See Also:
ApplicationPolicyRegistration.removeApplicationPolicy(String)

getAuthenticationInfo

public BaseAuthenticationInfo getAuthenticationInfo(String domainName)
Method that returns the parsed AuthenticationInfo needed by the JASPI framework until a seperate Configuration mechanism for JASPI is established

Returns:
the parsed AuthenticationInfo object

clear

public void clear()

loadConfig

public void loadConfig()
Called to try to load the config from the java.security.auth.login.config property value when there is no loginConfigURL.


loadConfig

protected String[] loadConfig(URL config)
                       throws Exception
Throws:
Exception


Copyright © 2009 JBoss Inc.. All Rights Reserved.