info.aduna.app
Class AppConfiguration

java.lang.Object
  extended by info.aduna.app.AppConfiguration
All Implemented Interfaces:
Configuration

public class AppConfiguration
extends Object
implements Configuration

Author:
Herko ter Horst

Field Summary
 
Fields inherited from interface info.aduna.app.config.Configuration
CONFIG_DIR
 
Constructor Summary
AppConfiguration()
          Create a new, uninitialized application configuration.
AppConfiguration(String applicationId)
          Create the application configuration.
AppConfiguration(String applicationId, AppVersion version)
          Create the application configuration.
AppConfiguration(String applicationId, String longName, AppVersion version)
          Create the application configuration.
 
Method Summary
 void destroy()
          Clean up configuration resources.
 String getApplicationId()
          Get the name of the application (e.g.
 String[] getCommandLineArgs()
          Get the command line arguments of the application.
 File getDataDir()
           
 String getFullName()
          Get the full name of the application, which consists of the long name and the version number (e.g.
 LogConfiguration getLogConfiguration()
           
 String getLongName()
          Get the long name of the application (e.g.
 ProxySettings getProxySettings()
           
 AppVersion getVersion()
          Get the version of the application.
 void init()
          Initialize the configuration settings.
 void load()
          Load the configuration settings.
 void save()
          Store configuration settings.
 void setApplicationId(String applicationId)
           
 void setCommandLineArgs(String[] args)
          Set the command line arguments specified to the application.
 void setDataDirName(String dataDirName)
           
 void setLongName(String longName)
          Set the long name of the application.
 void setProxySettings(ProxySettings proxySettings)
           
 void setVersion(AppVersion version)
          Set the version of the application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppConfiguration

public AppConfiguration()
Create a new, uninitialized application configuration.


AppConfiguration

public AppConfiguration(String applicationId)
Create the application configuration.

Parameters:
applicationId - the ID of the application

AppConfiguration

public AppConfiguration(String applicationId,
                        AppVersion version)
Create the application configuration.

Parameters:
applicationId - the ID of the application
version - the application's version

AppConfiguration

public AppConfiguration(String applicationId,
                        String longName,
                        AppVersion version)
Create the application configuration.

Parameters:
applicationId - the ID of the application
longName - the long name of the application
version - the application's version
Method Detail

load

public void load()
          throws IOException
Description copied from interface: Configuration
Load the configuration settings. Settings will be loaded from a user and application specific location first. If no such settings exists, an attempt will be made to retrieve settings from a resource on the classpath. If no such settings exist either, settings will be loaded from a default resource on the classpath.

Specified by:
load in interface Configuration
Throws:
IOException - if the configuration settings could not be loaded due to an I/O problem.

save

public void save()
          throws IOException
Description copied from interface: Configuration
Store configuration settings. Settings will be stored in a user and application specific location.

Specified by:
save in interface Configuration
Throws:
IOException - if the configuration settings could not be saved due to an I/O problem.

init

public void init()
          throws IOException
Description copied from interface: Configuration
Initialize the configuration settings.

Specified by:
init in interface Configuration
Throws:
IOException - if the configuration settings could not be initialized because of an I/O problem.

destroy

public void destroy()
             throws IOException
Description copied from interface: Configuration
Clean up configuration resources.

Specified by:
destroy in interface Configuration
Throws:
IOException - if one or more resources could not be cleaned up. Implementations should attempt to clean up as many resources as possible before returning or throwing an exception.

getApplicationId

public String getApplicationId()
Get the name of the application (e.g. "AutoFocus" or "Metadata Server").

Returns:
the name of the application

setApplicationId

public void setApplicationId(String applicationId)

setDataDirName

public void setDataDirName(String dataDirName)

getLongName

public String getLongName()
Get the long name of the application (e.g. "Aduna AutoFocus" or "OpenRDF Sesame Server").

Returns:
the long name of the application

setLongName

public void setLongName(String longName)
Set the long name of the application.

Parameters:
longName - the new name

getFullName

public String getFullName()
Get the full name of the application, which consists of the long name and the version number (e.g. "Aduna AutoFocus 4.0-beta1" or "OpenRDF Sesame Webclient 2.0")

Returns:
the full name of the application

getVersion

public AppVersion getVersion()
Get the version of the application.

Returns:
the version of the application

setVersion

public void setVersion(AppVersion version)
Set the version of the application.

Parameters:
version - the new version

getCommandLineArgs

public String[] getCommandLineArgs()
Get the command line arguments of the application.

Returns:
A String array, as (typically) specified to the main method.

setCommandLineArgs

public void setCommandLineArgs(String[] args)
Set the command line arguments specified to the application.

Parameters:
args - A String array containing the arguments as specified to the main method.

getDataDir

public File getDataDir()

getLogConfiguration

public LogConfiguration getLogConfiguration()

getProxySettings

public ProxySettings getProxySettings()

setProxySettings

public void setProxySettings(ProxySettings proxySettings)


Copyright © 1997-2008 Aduna. All Rights Reserved.