org.aselect.server.config
Class ASelectConfigManager

java.lang.Object
  extended by org.aselect.system.configmanager.ConfigManager
      extended by org.aselect.server.config.ASelectConfigManager

public class ASelectConfigManager
extends ConfigManager

The configuration manager for the A-Select Server.

Description:
A singleton configuration manager, containing the A-Select Server configuration. It loads several settings in memory during initialization.

Concurrency issues:
-

Author:
Alfa & Ariss

Field Summary
static java.lang.String MODULE
          The name of this module, that is used in the system logging.
static java.lang.String TAG_COUNTRY
          optional template tag
static java.lang.String TAG_FRIENLDY_NAME
          optional template tag
static java.lang.String TAG_LANGUAGE
          optional template tag
static java.lang.String TAG_MAINTAINER_EMAIL
          optional template tag
static java.lang.String TAG_SHOW_URL
          optional template tag
 
Method Summary
 java.util.Hashtable getAuthspSettings()
          Get all AuthSP settings.
 java.lang.String getCookieDomain()
          Returns the cookie domain, if specificaly set in the configuration.
 java.lang.String getCookieDomainPath()
          Returns the cookie path, if specificaly set in the configuration.
 int getCookiesVersion()
          Returns the cookie version, which can be forced in configuration.
 java.lang.String getDefaultCertId()
          Returns the default certificate ID.
 java.security.cert.X509Certificate getDefaultCertificate()
          Returns the certificate of this A-Select Server.
 java.security.PrivateKey getDefaultPrivateKey()
          Returns the default private key of this A-Select Server.
 java.lang.String getErrorMessage(java.lang.String sErrorCode)
          Get the error message that matches the error code that is supplied.
 java.lang.String getForm(java.lang.String sForm)
          Get a template of an A-Select Server form.
static ASelectConfigManager getHandle()
          Must be used to get an ASelectConfigManager instance.
 java.security.PublicKey getPrivilegedPublicKey(java.lang.String sAlias)
          Returns the public signing key of the privileged application with the given alias.
 java.lang.String getRedirectURL()
          Returns the A-Select Server redirect URL.
 java.lang.String getUIDCookieDomain()
          Returns the configured cookie domain for the aselect_uid cookie.
 java.lang.String getUIDCookieDomainPath()
          Returns the configured cookie path for the aselect_uid cookie.
 java.lang.String getWorkingdir()
          Returns the A-Select Server working dir.
 void init(java.lang.String sWorkingDir, java.lang.String sSQLDriver, java.lang.String sSQLUser, java.lang.String sSQLPassword, java.lang.String sSQLURL, java.lang.String sSQLTable, java.lang.String sConfigIDName)
          Initialization of the ASelectConfigManager singleton.
 boolean isCrossFallBackEnabled()
          Returns if cross fallback is enabled or not.
 boolean isSingleSignOn()
          Returns TRUE if single sign-on for this A-Select Server is enabled.
 boolean isUDBEnabled()
          Returns TRUE if a UDB for this A-Select Server is enabled.
 java.lang.String updateTemplate(java.lang.String sTemplate, java.util.Hashtable htSessionContext)
          Updates the supplied template with optional requestor information.
 
Methods inherited from class org.aselect.system.configmanager.ConfigManager
getNextSection, getParam, getSection, getSection, importConfig, init, init, removeSection, removeSection, saveConfig, setParam, setSection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODULE

public static final java.lang.String MODULE
The name of this module, that is used in the system logging.

See Also:
Constant Field Values

TAG_FRIENLDY_NAME

public static final java.lang.String TAG_FRIENLDY_NAME
optional template tag

See Also:
Constant Field Values

TAG_MAINTAINER_EMAIL

public static final java.lang.String TAG_MAINTAINER_EMAIL
optional template tag

See Also:
Constant Field Values

TAG_SHOW_URL

public static final java.lang.String TAG_SHOW_URL
optional template tag

See Also:
Constant Field Values

TAG_LANGUAGE

public static final java.lang.String TAG_LANGUAGE
optional template tag

See Also:
Constant Field Values

TAG_COUNTRY

public static final java.lang.String TAG_COUNTRY
optional template tag

See Also:
Constant Field Values
Method Detail

getHandle

public static ASelectConfigManager getHandle()
Must be used to get an ASelectConfigManager instance.

Description:
Creates a new ASelectConfigManager instance if it's still null.

Concurrency issues:
Always the same instance of the config manager is returned, because it's singleton.

Preconditions:
-

Postconditions:
-

Returns:
handle to the ASelectConfigManager

init

public void init(java.lang.String sWorkingDir,
                 java.lang.String sSQLDriver,
                 java.lang.String sSQLUser,
                 java.lang.String sSQLPassword,
                 java.lang.String sSQLURL,
                 java.lang.String sSQLTable,
                 java.lang.String sConfigIDName)
          throws ASelectException
Initialization of the ASelectConfigManager singleton.

Description:
Must be successfully run once, before it can be used.

Concurrency issues:
-

Preconditions:
Postconditions:
The A-Select configuration is read and components are initialized.

Parameters:
sWorkingDir - The workingdir containing the configuration and keystores of the A-Select Server.
sSQLDriver - The JDBC driver name, used when configuration is stored in a database.
sSQLUser - The JDBC user name, used when configuration is stored in a database.
sSQLPassword - The JDBC password for the given user name, used when configuration is stored in a database.
sSQLURL - The JDBC URL, used when configuration is stored in a database.
sSQLTable - The JDBC table name in which the configuration is located; used when configuration is stored in a database.
sConfigIDName - The JDBC configuration id to locate the configuration in the config table, used when configuration is stored in a database.
Throws:
ASelectException - If initialisation fails.

isSingleSignOn

public boolean isSingleSignOn()
Returns TRUE if single sign-on for this A-Select Server is enabled.

Returns:
FALSE if single sign-on is disabled in the configuration

isUDBEnabled

public boolean isUDBEnabled()
Returns TRUE if a UDB for this A-Select Server is enabled.

Returns:
FALSE if only cross A-Select is supported

getCookieDomain

public java.lang.String getCookieDomain()
Returns the cookie domain, if specificaly set in the configuration.

Returns:
null if no domain is set or a String containing the cookie domain that is configured including the '.' as prefix.

getCookieDomainPath

public java.lang.String getCookieDomainPath()
Returns the cookie path, if specificaly set in the configuration.

Returns:
null if no path is configured.

getUIDCookieDomain

public java.lang.String getUIDCookieDomain()
Returns the configured cookie domain for the aselect_uid cookie.

Returns:
null if no or an empty domain is configured.

getUIDCookieDomainPath

public java.lang.String getUIDCookieDomainPath()
Returns the configured cookie path for the aselect_uid cookie.

Returns:
null if no path is configured.

getCookiesVersion

public int getCookiesVersion()
Returns the cookie version, which can be forced in configuration.

Description:
Workaround for Tomcat bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=44679

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Returns:
int representing the cookie version

getWorkingdir

public java.lang.String getWorkingdir()
Returns the A-Select Server working dir.

Description:
Returns the A-Select Server working_dir init parameter in the web.xml.

Concurrency issues:
-

Preconditions:
-

Postconditions:

Returns:
String containing the A-Select Server working dir.

getRedirectURL

public java.lang.String getRedirectURL()
Returns the A-Select Server redirect URL.

Description:
Returns the external URL of the A-Select Server which is used in redirects.
The optional 'redirect_url' config item is configured in the A-Select configuration (aselect.xml).

Concurrency issues:
-

Preconditions:
-

Postconditions:

Returns:
String containing the A-Select Server redirect URL dir.

getAuthspSettings

public java.util.Hashtable getAuthspSettings()
Get all AuthSP settings.

Description:
Returns all AuthSP settings that are loaded during startup.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Returns:
A Hashtable containing all AuthSP settings.

getPrivilegedPublicKey

public java.security.PublicKey getPrivilegedPublicKey(java.lang.String sAlias)
Returns the public signing key of the privileged application with the given alias.

Description:
Returns the PublicKey of the privileged application that has the supplied alias name.

Concurrency issues:
-

Preconditions:
-

Postconditions:
- Returns null if no public key was found for that alias.

Parameters:
sAlias - The id of the public key.
Returns:
The public key of a privieleged application indicated by it's alias.

getDefaultPrivateKey

public java.security.PrivateKey getDefaultPrivateKey()
Returns the default private key of this A-Select Server.

Description:
Returns the PrivateKey that is stored in the aselect.keystore keystore.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Returns:
The private key of this A-Select Server.

getDefaultCertificate

public java.security.cert.X509Certificate getDefaultCertificate()
Returns the certificate of this A-Select Server.

Description:
Returns the X509 certificate that is stored in the aselect.keystore keystore.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Returns:
The certificate of this A-Select Server.

getDefaultCertId

public java.lang.String getDefaultCertId()
Returns the default certificate ID.

Description:
Returns the certificate ID of the A-Select Server private key.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Returns:
a String representation of the certificate ID

getErrorMessage

public java.lang.String getErrorMessage(java.lang.String sErrorCode)
Get the error message that matches the error code that is supplied.

Description:
Returns the error message that is configured in the errors.conf file in the A-Select Server configuration.

Concurrency issues:
-

Preconditions:
sErrorCode != null

Postconditions:
-

Parameters:
sErrorCode - An error code as configured in the errors.conf file
Returns:
A String representation of the error message

getForm

public java.lang.String getForm(java.lang.String sForm)
Get a template of an A-Select Server form.

Description:
Returns a A-Select Server form that is located in the A-Select Server configuration (aselectserver/conf/html/*) and can be used as a template.

Concurrency issues:
-

Preconditions:
sForm != null

Postconditions:
-

Parameters:
sForm - The id of the form that must be returned.
Returns:
A String representation of the requested form.

updateTemplate

public java.lang.String updateTemplate(java.lang.String sTemplate,
                                       java.util.Hashtable htSessionContext)
                                throws ASelectException
Updates the supplied template with optional requestor information.

Description:
Updates the supplied template with the tags:
[requestor_url]
[requestor_friendly_name]
[requestor_maintainer_email]


Concurrency issues:
-

Preconditions:
- sTemplate != null

Postconditions:
-

Parameters:
sTemplate - the template that must be updated
htSessionContext - containing the session information
Returns:
String containing the updated template
Throws:
ASelectException - if template could not be updated

isCrossFallBackEnabled

public boolean isCrossFallBackEnabled()
Returns if cross fallback is enabled or not.

Description:
Returns true if cross fallback is enabled and false if not. If a user not exists in the local UDB and cross fallback is enabled A-Select will try to do an cross authentication

Concurrency issues:
-

Preconditions:
cross_aselect must be enabled with remote servers.

Postconditions:
-

Returns:
true if cross fallback is enabled and false if not.


Copyright © 2008 SURFnet BV. All Rights Reserved.