org.figure8.join.core.setup
Class ApplicationConfig

java.lang.Object
  extended by org.figure8.join.core.setup.ApplicationConfig

public class ApplicationConfig
extends java.lang.Object

This ia an object that manages Join application configuration and associated operations (such as loading or savind configuration). It uses backed ConfigProperty Java Beans for storing config informations.

Version:
$Revision: 1.3 $
Author:
Laurent Broudoux

Field Summary
static java.lang.String CONFIG_FILE
          Configuration file into Join Home directory.
static java.lang.String CUSTOM_TYPE
          Custom setup type property value
static java.lang.String DISSOCIATED
          Property used for telling that synch/asynch services are dissociated
protected static org.apache.commons.logging.Log log
          Get a commons logger.
static java.lang.String OTHER_SIDE_URL
          Property used for representing the url of this other side of application (if app is dissociated)
static java.lang.String SETUP_COMPLETE
          Property used for identifying the setup process has completed
static java.lang.String SETUP_TYPE
          Application properties determining setup type
static java.lang.String STANDARD_TYPE
          Standard setup type property value
static java.lang.String SYNCH_SIDE
          Property used for telling if this side of app is the synch side
 
Constructor Summary
ApplicationConfig()
          Creates a new instance of ApplicationConfig
 
Method Summary
 void addConfigProperty(ConfigProperty property)
          Add a ConfigProperty obtained from configuration file
 boolean configurationFileExists()
          Tells if configuration file is an existing file
 java.lang.String getApplicationHome()
           
static java.lang.String getConfigurationFileName()
          Get the configuration file name into application home directory
 java.util.Properties getProperties()
           
 java.lang.String getProperty(java.lang.String key)
          Get a specific application config property
 boolean isAsynchronousSide()
           
 boolean isCustomSetup()
           
 boolean isDissociatedSetup()
           
 boolean isSetupComplete()
           
 boolean isStandardSetup()
           
 boolean isSynchronousSide()
           
 void load()
          Load the application configuration from config file
 void save()
          Save the application configuration to config file
 void setApplicationHome(java.lang.String home)
           
 void setProperties(java.util.Properties props)
          Set some application config properties.
 void setProperty(java.lang.String key, java.lang.Object value)
          Set an application config property.
 void setSetupComplete(boolean complete)
          Set the flag telling if setup has been completed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
Get a commons logger.


CONFIG_FILE

public static final java.lang.String CONFIG_FILE
Configuration file into Join Home directory.

See Also:
Constant Field Values

SETUP_TYPE

public static final java.lang.String SETUP_TYPE
Application properties determining setup type

See Also:
Constant Field Values

CUSTOM_TYPE

public static final java.lang.String CUSTOM_TYPE
Custom setup type property value

See Also:
Constant Field Values

STANDARD_TYPE

public static final java.lang.String STANDARD_TYPE
Standard setup type property value

See Also:
Constant Field Values

SYNCH_SIDE

public static final java.lang.String SYNCH_SIDE
Property used for telling if this side of app is the synch side

See Also:
Constant Field Values

DISSOCIATED

public static final java.lang.String DISSOCIATED
Property used for telling that synch/asynch services are dissociated

See Also:
Constant Field Values

OTHER_SIDE_URL

public static final java.lang.String OTHER_SIDE_URL
Property used for representing the url of this other side of application (if app is dissociated)

See Also:
Constant Field Values

SETUP_COMPLETE

public static final java.lang.String SETUP_COMPLETE
Property used for identifying the setup process has completed

See Also:
Constant Field Values
Constructor Detail

ApplicationConfig

public ApplicationConfig()
Creates a new instance of ApplicationConfig

Method Detail

setApplicationHome

public void setApplicationHome(java.lang.String home)
Parameters:
home - Set the application home directory

getApplicationHome

public java.lang.String getApplicationHome()
Returns:
Get the application home directory

setProperties

public void setProperties(java.util.Properties props)
Set some application config properties.

Parameters:
props - Properties to add to application props.

getProperties

public java.util.Properties getProperties()
Returns:
The set of configured application properties

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object value)
Set an application config property. If value is not null, its string representation (toString() result) will be inserted.

Parameters:
key - Unique id of the application property
value - Value associated to key

getProperty

public java.lang.String getProperty(java.lang.String key)
Get a specific application config property

Parameters:
key - Unique id of the property to retrieve
Returns:
The string property corresponding to key or null if it doesn't exist

isSetupComplete

public boolean isSetupComplete()
Returns:
true if setup has been completed, false otherwise

setSetupComplete

public void setSetupComplete(boolean complete)
Set the flag telling if setup has been completed

Parameters:
complete - Setup completion status

isCustomSetup

public boolean isCustomSetup()
Returns:
true if setup is a custom setup whether it is completed or not, false otherwise

isStandardSetup

public boolean isStandardSetup()
Returns:
true if setup is not a custom setup whether it is completed or not, false otherwise

isSynchronousSide

public boolean isSynchronousSide()
Returns:
true if this side of application is synchronous

isAsynchronousSide

public boolean isAsynchronousSide()
Returns:
true if this side of application is asynchronous

isDissociatedSetup

public boolean isDissociatedSetup()
Returns:
true if setup is custom with dissociation of synch/.asynch services

configurationFileExists

public boolean configurationFileExists()
Tells if configuration file is an existing file

Returns:
true if config file exists, false otherwise

addConfigProperty

public void addConfigProperty(ConfigProperty property)
Add a ConfigProperty obtained from configuration file

Parameters:
property - Property wrapper to add

load

public void load()
          throws BootstrapException
Load the application configuration from config file

Throws:
BootstrapException - if something wrong happens during file loading

save

public void save()
          throws java.io.IOException
Save the application configuration to config file

Throws:
java.io.IOException - if something wrong occurs during file writing

getConfigurationFileName

public static java.lang.String getConfigurationFileName()
Get the configuration file name into application home directory

Returns:
The configuration file name


Copyright © 2005-2008 Join. All Rights Reserved.