org.aselect.server.application
Class ApplicationManager

java.lang.Object
  extended by org.aselect.server.application.ApplicationManager

public class ApplicationManager
extends java.lang.Object

The application manager for the A-Select Server.

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

Concurrency issues:
The class is a singleton, so the same class is used in all the classes of the A-Select Server.

Author:
Alfa & Ariss

Constructor Summary
ApplicationManager()
           
 
Method Summary
 java.lang.String getAttributePolicy(java.lang.String sAppId)
          Returns the attribute policy for an application.
 java.lang.String getFriendlyName(java.lang.String sAppId)
          Returns the Friendly Name for an application.
static ApplicationManager getHandle()
          Must be used to get an ApplicationManager instance.
 java.lang.String getMaintainerEmail(java.lang.String sAppId)
          Returns the maintainer email address for an application.
 java.lang.Integer getMaxLevel(java.lang.String sAppId)
          Returns the maximum level for an application.
 java.lang.String getOptionalParam(java.lang.String sAppId, java.lang.String sName)
          Returns the requested optional parameter for an application.
 java.lang.String getParam(java.lang.String sAppId, java.lang.String sName)
          Returns the requested parameter for an application.
 java.lang.Integer getRequiredLevel(java.lang.String sAppId)
          Returns the required level for an application.
 java.security.PublicKey getSigningKey(java.lang.String sAppId)
          Retrieve a signing key.
 java.util.Vector getSSOGroups(java.lang.String sAppId)
          Returns a all configured single sign-on groups for the supplied sAppID.
 boolean hasApplicationsConfigured()
           
 void init()
          Initialization of the ApplicationManager singleton

Description:
Must be successfully run once, before it can be used.
 boolean isApplication(java.lang.String sAppId)
           
 boolean isForcedAuthenticateEnabled(java.lang.String sAppId)
           
 boolean isShowUrl(java.lang.String sAppId)
          Returns if the app url must be shown or not

Description:
Returns true if app url must be shown and false if not.
 boolean isSigningRequired()
           
 boolean isUseOpaqueUid(java.lang.String sAppId)
          Returns if an opaque uid must be used for an application.
 boolean isValidSSOGroup(java.util.Vector vValidSSOGroups, java.util.Vector vOldSSOGroups)
          Verifies if one of the supplied single sign-on groups contains in the existing TGT

Description:
Verifies if one sso_group that exists in the vValidSSOGroups correspond with one sso_group in the vOldSSOGroups

Concurrency issues:
-

Preconditions:
vValidSSOGroups may not be null vOldSSOGroups may not be null

Postconditions:
-
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationManager

public ApplicationManager()
Method Detail

getHandle

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

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

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

Preconditions:
-

Postconditions:
-

Returns:
A static handle to the ApplicationManager.

init

public void init()
          throws ASelectException
Initialization of the ApplicationManager singleton

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

Concurrency issues:
-

Preconditions:
- Singleton ASelectConfigManager should be initialized.
- At least one application should be configured.

Postconditions:
-

Throws:
ASelectException

hasApplicationsConfigured

public boolean hasApplicationsConfigured()
Returns:
true if there are applications configured.

isApplication

public boolean isApplication(java.lang.String sAppId)
Parameters:
sAppId - the Id of the application
Returns:
true if the application exists.

isSigningRequired

public boolean isSigningRequired()
Returns:
true if signing is required, otherwise false.

getRequiredLevel

public java.lang.Integer getRequiredLevel(java.lang.String sAppId)
                                   throws ASelectException
Returns the required level for an application.

Description:
Returns the configured required level for the application.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Parameters:
sAppId - String containing an application id.
Returns:
String containing the level. null if no level was found.
Throws:
ASelectException

getMaxLevel

public java.lang.Integer getMaxLevel(java.lang.String sAppId)
                              throws ASelectException
Returns the maximum level for an application.

Description:
Returns the configured maximum level for the application.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Parameters:
sAppId - String containing an application id.
Returns:
String containing the level. null if no level was found.
Throws:
ASelectException

getSigningKey

public java.security.PublicKey getSigningKey(java.lang.String sAppId)
                                      throws ASelectException
Retrieve a signing key.

Parameters:
sAppId - The application ID.
Returns:
The signing key of the given application ID.
Throws:
ASelectException - If retrieving fails.

isForcedAuthenticateEnabled

public boolean isForcedAuthenticateEnabled(java.lang.String sAppId)
                                    throws ASelectException
Parameters:
sAppId - The application id that will be checked for enabled forced authentication
Returns:
true if forced_authenticate="true", otherwise false.
Throws:
ASelectException

getAttributePolicy

public java.lang.String getAttributePolicy(java.lang.String sAppId)
                                    throws ASelectException
Returns the attribute policy for an application.

Description:
Returns the configured attribute policy for the application.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Parameters:
sAppId - String containing an application id.
Returns:
String containing the level. null if no level was found.
Throws:
ASelectException

getFriendlyName

public java.lang.String getFriendlyName(java.lang.String sAppId)
                                 throws ASelectException
Returns the Friendly Name for an application.

Description:
Returns the configured Friendly Name for the application.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Parameters:
sAppId - String containing an application id.
Returns:
String containing the friendly name. null if no friendly name was found.
Throws:
ASelectException

getMaintainerEmail

public java.lang.String getMaintainerEmail(java.lang.String sAppId)
                                    throws ASelectException
Returns the maintainer email address for an application.

Description:
Returns the configured maintainer email address for the application.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Parameters:
sAppId - String containing an application id.
Returns:
String containing the maintainer email address. null if no level was found.
Throws:
ASelectException

isUseOpaqueUid

public boolean isUseOpaqueUid(java.lang.String sAppId)
                       throws ASelectException
Returns if an opaque uid must be used for an application.

Description:
Returns true if an opaque uid must be used for an application and false if the 'normal' A-Select uid must be used.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Parameters:
sAppId - String containing an application id.
Returns:
true or false.
Throws:
ASelectException

isShowUrl

public boolean isShowUrl(java.lang.String sAppId)
                  throws ASelectException
Returns if the app url must be shown or not

Description:
Returns true if app url must be shown and false if not.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Parameters:
sAppId - String containing an application id.
Returns:
true or false.
Throws:
ASelectException

getSSOGroups

public java.util.Vector getSSOGroups(java.lang.String sAppId)
Returns a all configured single sign-on groups for the supplied sAppID.

Description:
Returns a Vector containing all configured single sign-on groups for the supplied app_id. If now groups is configured the default group "0" is returned.

Concurrency issues:
  • sAppID may not be null
  • _htSSOGroupedApplications may not be null


  • Preconditions:
    -

    Postconditions:
    -

    Parameters:
    sAppId - The single sign-on groups in which this app id is contained
    Returns:
    null if the supplied app id isn't configured in a single sign-on group

    isValidSSOGroup

    public boolean isValidSSOGroup(java.util.Vector vValidSSOGroups,
                                   java.util.Vector vOldSSOGroups)
    Verifies if one of the supplied single sign-on groups contains in the existing TGT

    Description:
    Verifies if one sso_group that exists in the vValidSSOGroups correspond with one sso_group in the vOldSSOGroups

    Concurrency issues:
    -

    Preconditions:
  • vValidSSOGroups may not be null
  • vOldSSOGroups may not be null


  • Postconditions:
    -

    Parameters:
    vValidSSOGroups - Vector containing the sso_group id's of the current application
    vOldSSOGroups - Vector containing the sso_group id's that are known in the TGT
    Returns:
    TRUE if one sso_group from vValidSSOGroups contains in the vOldSSOGroups

    getParam

    public java.lang.String getParam(java.lang.String sAppId,
                                     java.lang.String sName)
    Returns the requested parameter for an application.

    Description:
    Returns the configured value of the parameter asked for.

    Concurrency issues:
    -

    Preconditions:
    -

    Postconditions:
    -

    Parameters:
    sAppId - String containing an application id.
    sName - String containing the parameter name asked for.
    Returns:
    String containing the paramtere value asked for, or null if the attribute was not found.

    getOptionalParam

    public java.lang.String getOptionalParam(java.lang.String sAppId,
                                             java.lang.String sName)
                                      throws ASelectException
    Returns the requested optional parameter for an application.

    Description:
    Returns the configured value of the parameter asked for, or null if the attribute is not present. Unlike the getParam(String, String) method, this method does not complain about missing parameters in the system log.

    Concurrency issues:
    -

    Preconditions:
    -

    Postconditions:
    -

    Parameters:
    sAppId - String containing an application id.
    sName - String containing the parameter name asked for.
    Returns:
    String containing the parameter value asked for, or null if the attribute was not found.
    Throws:
    ASelectException


    Copyright © 2008 SURFnet BV. All Rights Reserved.