com.flexive.shared.interfaces
Interface GlobalConfigurationEngine

All Superinterfaces:
GenericConfigurationEngine
All Known Subinterfaces:
GlobalConfigurationEngineLocal

public interface GlobalConfigurationEngine
extends GenericConfigurationEngine

Global configuration interface. Stores parameters valid for all divisions and the division configuration itself.

Author:
Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)

Method Summary
 void clearDivisionCache()
          Clear the division cache.
 void create()
          JMX management method.
 DivisionData createDivisionData(int divisionId, java.lang.String dataSource, java.lang.String domainRegEx)
          Tests the database connection for the given dataSource JNDI name and returns a DivisionData object with the current database vendor and version values.
 void destroy()
          JMX management method.
 DivisionData getDivisionData(int division)
          Returns the configuration data for a given division ID.
 int getDivisionId(java.lang.String serverName)
          Returns the first matching division for the given server name, or -1 if no division was found.
 int[] getDivisionIds()
          Return all configured division IDs.
 DivisionData[] getDivisions()
          Return the division data for all configured divisions.
 java.lang.String getRootLogin()
          Return the root user name.
 java.lang.String getRootPassword()
          Get the SHA1-hashed root password.
 boolean isMatchingRootPassword(java.lang.String userPassword)
          Return true if the given plain-text password matches the stored (and hashed) password.
 void registerCacheMBean(javax.management.ObjectName name)
           
 void saveDivisions(java.util.List<? extends DivisionData> divisions)
          Replaces the existing division configuration.
 void setRootLogin(java.lang.String value)
          Set the root user name.
 void setRootPassword(java.lang.String value)
          Set the root password.
 
Methods inherited from interface com.flexive.shared.interfaces.GenericConfigurationEngine
get, get, get, getAll, getKeys, put, put, remove, remove, removeAll
 

Method Detail

create

void create()
            throws java.lang.Exception
JMX management method.

Throws:
java.lang.Exception - if an error occured

destroy

void destroy()
             throws java.lang.Exception
JMX management method.

Throws:
java.lang.Exception - if an error occured

getRootLogin

java.lang.String getRootLogin()
                              throws FxApplicationException
Return the root user name.

Returns:
the root login name.
Throws:
FxApplicationException - TODO
FxLoadException - if a database error occured
FxNotFoundException - if the root login is not set in the configuration

setRootLogin

void setRootLogin(java.lang.String value)
                  throws FxApplicationException
Set the root user name.

Parameters:
value - the new root user name
Throws:
FxApplicationException - TODO
FxUpdateException - if the user name could not be updated
FxNoAccessException - if the calling user is not permitted to change to root long

getRootPassword

java.lang.String getRootPassword()
                                 throws FxApplicationException
Get the SHA1-hashed root password.

Returns:
the SHA1-hashed root password.
Throws:
FxApplicationException - TODO
FxLoadException - if the parameter could not be loaded successfully
FxNotFoundException - if the root login is not set

isMatchingRootPassword

boolean isMatchingRootPassword(java.lang.String userPassword)
                               throws FxApplicationException
Return true if the given plain-text password matches the stored (and hashed) password.

Parameters:
userPassword - the password to be checked
Returns:
true if the given plain-text password matches the stored (and hashed) password.
Throws:
FxApplicationException - TODO
FxLoadException - if the root password could not be loaded
FxNotFoundException - if the root password is not set in the global configuration

setRootPassword

void setRootPassword(java.lang.String value)
                     throws FxApplicationException
Set the root password.

Parameters:
value - the root password in plain-text.
Throws:
FxApplicationException - TODO
FxUpdateException - if the password could not be updated
FxNoAccessException - if the calling user is not permitted to change the password

getDivisionData

DivisionData getDivisionData(int division)
                             throws FxApplicationException
Returns the configuration data for a given division ID.

Parameters:
division - the division ID.
Returns:
the configuration data for a given division ID.
Throws:
FxApplicationException - TODO
FxLoadException - if an error occured reading the division configuration
FxNotFoundException - if the division was not found

getDivisionId

int getDivisionId(java.lang.String serverName)
                  throws FxApplicationException
Returns the first matching division for the given server name, or -1 if no division was found.

Parameters:
serverName - the server name to be matched
Returns:
the ID of the first division that matches
Throws:
FxApplicationException - TODO
FxLoadException - if an error occured reading the division configuration

getDivisionIds

int[] getDivisionIds()
                     throws FxApplicationException
Return all configured division IDs.

Returns:
all configured division IDs
Throws:
FxApplicationException - TODO
FxLoadException - if an error occured reading the division configuration

getDivisions

DivisionData[] getDivisions()
                            throws FxApplicationException
Return the division data for all configured divisions.

Returns:
division data for all configured divisions.
Throws:
FxApplicationException - TODO
FxLoadException - if an error occured reading the division configuration

clearDivisionCache

void clearDivisionCache()
Clear the division cache.


registerCacheMBean

void registerCacheMBean(javax.management.ObjectName name)
                        throws javax.management.MBeanRegistrationException,
                               javax.management.NotCompliantMBeanException,
                               javax.management.InstanceAlreadyExistsException
Throws:
javax.management.MBeanRegistrationException
javax.management.NotCompliantMBeanException
javax.management.InstanceAlreadyExistsException

createDivisionData

DivisionData createDivisionData(int divisionId,
                                java.lang.String dataSource,
                                java.lang.String domainRegEx)
Tests the database connection for the given dataSource JNDI name and returns a DivisionData object with the current database vendor and version values.

Parameters:
divisionId - the division ID
dataSource - the datasource JNDI path
domainRegEx - the regular expression used for matching domains
Returns:
the DivisionData object with database information

saveDivisions

void saveDivisions(java.util.List<? extends DivisionData> divisions)
                   throws FxApplicationException
Replaces the existing division configuration.

Parameters:
divisions - the new division data
Throws:
FxApplicationException - if the divisions could not be updated.