fr.cnes.sitools.common
Class SitoolsSettings

java.lang.Object
  extended by fr.cnes.sitools.common.SitoolsSettings

public final class SitoolsSettings
extends java.lang.Object

Class for managing global settings

Author:
jp.boignard (AKKA Technologies)

Field Summary
static java.lang.String DEFAULT_BUNDLE
          Default bundle name
static java.lang.String DEFAULT_HOST_NAME
          Default host name for HTTP server
static java.lang.String DEFAULT_HOST_PORT
          Default host port for HTTP server
 
Method Summary
 java.lang.String getAdminMail()
          Gets the admin mail.
 AppRegistryApplication getAppRegistry()
          Gets the appRegistry value
 java.lang.String getAuthenticationAGENT()
          Gets the authenticationAGENT value
 java.lang.String getAuthenticationALGORITHM()
          Gets the authenticationALGORITHM value
 java.lang.String getAuthenticationCOOKIE()
          Gets the authenticationCOOKIE value
 java.lang.String getAuthenticationDOMAIN()
          Gets the authenticationDOMAIN value
 SitoolsRealm getAuthenticationRealm()
          Gets the authenticationRealm value
 java.lang.String getAuthenticationSCHEME()
          Gets the authenticationSCHEME value
 java.util.ResourceBundle getBundle()
          Gets the bundle value
 SitoolsComponent getComponent()
          Gets the component value
 java.lang.String getFormattedString(java.lang.String format)
          To replace "${ROOT_DIRECTORY}" in String
static SitoolsSettings getInstance()
          Gets default bundle settings
static SitoolsSettings getInstance(java.lang.String bundle)
          Gets bundle settings
static SitoolsSettings getInstance(java.lang.String bundle, java.lang.ClassLoader classloader, java.util.Locale locale, boolean defaultBundle)
          Settings constructors
 int getInt(java.lang.String key)
          gets the property value
 java.util.List<java.lang.String> getIntranetAddresses()
          Gets the intranetAddresses value
 java.util.List<Category> getIntranetCategories()
          Gets the intranetCategories value
 java.lang.Long getLong(java.lang.String key)
          gets the property value
 java.lang.String getMaxConnectionsPerHost()
          Gets the maxConnectionsPerHost value
 java.lang.String getMaxTotalConnections()
          Gets the maxTotalConnections value
 NotificationManager getNotificationManager()
          Gets the notificationManager value
 java.lang.String getPublicHostDomain()
          Gets the publicHostDomain value
 java.lang.String getRootDirectory()
          Gets the rootDirectory value
 java.lang.String getSecretKey()
          Gets the secretKey value
 java.util.Map<java.lang.String,java.lang.Object> getSettings(java.lang.String baseName)
          Gets settings starting with baseName
 java.util.Map<java.lang.String,java.lang.Object> getSettings(java.lang.String baseName, java.lang.String replacement)
          Gets settings starting with baseName and replaces baseName with replacement.
 java.lang.String getStoreDIR()
          Gets the storeDIR value
 java.lang.String getStoreDIR(java.lang.String storeID)
          Gets Store Directory for a specific ID
 java.util.Map<java.lang.String,java.lang.Object> getStores()
          Gets the stores value
 java.lang.String getString(java.lang.String key)
          gets the property value
 java.lang.String getString(java.lang.String key, java.lang.String defaultValue)
          gets the property value
 java.lang.String getTmpFolderUrl()
          Gets the tmpFolderUrl value
 java.lang.String getUserStorageDir(java.lang.String username)
          Get the userstorage directory for a particular username
 int getUserStorageRefreshDelay()
          Gets the userStorageRefreshDelay value
 java.lang.String getVariableStoreDIR(java.lang.String storeID)
          Gets Store Directory for a specific ID keeping ${ROOT_DIRECTORY}
 void initIntranetCategories()
          Init the intranet categories
 boolean isCheckStores()
          Gets the checkStores value
 boolean isSecured()
          Gets the secured value
 boolean isStartWithMigration()
          Gets the startWithMigration value
 void setAppRegistry(AppRegistryApplication appRegistry)
          Sets the value of appRegistry
 void setAuthenticationAGENT(java.lang.String authenticationAGENT)
          Sets the value of authenticationAGENT
 void setAuthenticationALGORITHM(java.lang.String authenticationALGORITHM)
          Sets the value of authenticationALGORITHM
 void setAuthenticationCOOKIE(java.lang.String authenticationCOOKIE)
          Sets the value of authenticationCOOKIE
 void setAuthenticationDOMAIN(java.lang.String authenticationDOMAIN)
          Sets the value of authenticationDOMAIN
 void setAuthenticationRealm(SitoolsRealm authenticationRealmParameter)
          Sets the value of authenticationRealm
 void setAuthenticationSCHEME(java.lang.String authenticationSCHEME)
          Sets the value of authenticationSCHEME
 void setCheckStores(boolean checkStores)
          Sets the value of checkStores
 void setComponent(SitoolsComponent component)
          Sets the value of component
 void setIntranetAddresses(java.util.List<java.lang.String> intranetAddresses)
          Sets the value of intranetAddresses
 void setIntranetCategories(java.util.List<Category> intranetCategories)
          Sets the value of intranetCategories
 void setMaxConnectionsPerHost(java.lang.String maxConnectionsPerHost)
          Sets the value of maxConnectionsPerHost
 void setMaxTotalConnections(java.lang.String maxTotalConnections)
          Sets the value of maxTotalConnections
 void setNotificationManager(NotificationManager notificationManager)
          Sets the value of notificationManager
 void setPublicHostDomain(java.lang.String publicHostDomainParameter)
          Sets the value of publicHostDomain
 void setRootDirectory(java.lang.String rootDirectory)
          Sets the value of rootDirectory
 void setSecretKey(java.lang.String secretKey)
          Sets the value of secretKey
 void setSecured(boolean secured)
          Sets the value of secured
 void setStartWithMigration(boolean startWithMigration)
          Sets the value of startWithMigration
 void setStoreDIR(java.lang.String storeDIRParameter)
          Sets the value of storeDIR
 void setStores(java.util.Map<java.lang.String,java.lang.Object> stores)
          Sets the value of stores
 void setTmpFolderUrl(java.lang.String tmpFolderUrl)
          Sets the value of tmpFolderUrl
 void setUserStorageRefreshDelay(int userStorageRefreshDelay)
          Sets the value of userStorageRefreshDelay
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_HOST_PORT

public static final java.lang.String DEFAULT_HOST_PORT
Default host port for HTTP server

See Also:
Constant Field Values

DEFAULT_HOST_NAME

public static final java.lang.String DEFAULT_HOST_NAME
Default host name for HTTP server

See Also:
Constant Field Values

DEFAULT_BUNDLE

public static final java.lang.String DEFAULT_BUNDLE
Default bundle name

See Also:
Constant Field Values
Method Detail

getInstance

public static SitoolsSettings getInstance(java.lang.String bundle,
                                          java.lang.ClassLoader classloader,
                                          java.util.Locale locale,
                                          boolean defaultBundle)
Settings constructors

Parameters:
bundle - String name of resource bundle
classloader - ClassLoader of the bundle (useful in osgi environment)
locale - Locale
defaultBundle - true if this settings must be stored as default settings.
Returns:
SitoolsSettings

getInstance

public static SitoolsSettings getInstance(java.lang.String bundle)
Gets bundle settings

Parameters:
bundle - String bundle name
Returns:
SitoolsSettings

getInstance

public static SitoolsSettings getInstance()
Gets default bundle settings

Returns:
SitoolsSettings

setAuthenticationDOMAIN

public void setAuthenticationDOMAIN(java.lang.String authenticationDOMAIN)
Sets the value of authenticationDOMAIN

Parameters:
authenticationDOMAIN - the authenticationDOMAIN to set

getAuthenticationDOMAIN

public java.lang.String getAuthenticationDOMAIN()
Gets the authenticationDOMAIN value

Returns:
the authenticationDOMAIN

getSecretKey

public java.lang.String getSecretKey()
Gets the secretKey value

Returns:
the secretrKey

setSecretKey

public void setSecretKey(java.lang.String secretKey)
Sets the value of secretKey

Parameters:
secretKey - the secretKey to set

getAuthenticationSCHEME

public java.lang.String getAuthenticationSCHEME()
Gets the authenticationSCHEME value

Returns:
the authenticationSCHEME

setAuthenticationSCHEME

public void setAuthenticationSCHEME(java.lang.String authenticationSCHEME)
Sets the value of authenticationSCHEME

Parameters:
authenticationSCHEME - the authenticationSCHEME to set

getRootDirectory

public java.lang.String getRootDirectory()
Gets the rootDirectory value

Returns:
the rootDirectory

setRootDirectory

public void setRootDirectory(java.lang.String rootDirectory)
Sets the value of rootDirectory

Parameters:
rootDirectory - the rootDirectory to set

setAuthenticationRealm

public void setAuthenticationRealm(SitoolsRealm authenticationRealmParameter)
Sets the value of authenticationRealm

Parameters:
authenticationRealmParameter - the authenticationRealm to set

getAuthenticationRealm

public SitoolsRealm getAuthenticationRealm()
Gets the authenticationRealm value

Returns:
the authenticationRealm

getMaxTotalConnections

public java.lang.String getMaxTotalConnections()
Gets the maxTotalConnections value

Returns:
the maxTotalConnections

setMaxTotalConnections

public void setMaxTotalConnections(java.lang.String maxTotalConnections)
Sets the value of maxTotalConnections

Parameters:
maxTotalConnections - the maxTotalConnections to set

getMaxConnectionsPerHost

public java.lang.String getMaxConnectionsPerHost()
Gets the maxConnectionsPerHost value

Returns:
the maxConnectionsPerHost

setMaxConnectionsPerHost

public void setMaxConnectionsPerHost(java.lang.String maxConnectionsPerHost)
Sets the value of maxConnectionsPerHost

Parameters:
maxConnectionsPerHost - the maxConnectionsPerHost to set

setPublicHostDomain

public void setPublicHostDomain(java.lang.String publicHostDomainParameter)
Sets the value of publicHostDomain

Parameters:
publicHostDomainParameter - the publicHostDomain to set

getPublicHostDomain

public java.lang.String getPublicHostDomain()
Gets the publicHostDomain value

Returns:
the publicHostDomain

getStoreDIR

public java.lang.String getStoreDIR()
Gets the storeDIR value

Returns:
the storeDIR

setStoreDIR

public void setStoreDIR(java.lang.String storeDIRParameter)
Sets the value of storeDIR

Parameters:
storeDIRParameter - the storeDIR to set

getStoreDIR

public java.lang.String getStoreDIR(java.lang.String storeID)
Gets Store Directory for a specific ID

Parameters:
storeID - property key
Returns:
String

getVariableStoreDIR

public java.lang.String getVariableStoreDIR(java.lang.String storeID)
Gets Store Directory for a specific ID keeping ${ROOT_DIRECTORY}

Parameters:
storeID - the store identifier
Returns:
the store directory

setTmpFolderUrl

public void setTmpFolderUrl(java.lang.String tmpFolderUrl)
Sets the value of tmpFolderUrl

Parameters:
tmpFolderUrl - the tmpFolderUrl to set

getTmpFolderUrl

public java.lang.String getTmpFolderUrl()
Gets the tmpFolderUrl value

Returns:
the tmpFolderUrl

getFormattedString

public java.lang.String getFormattedString(java.lang.String format)
To replace "${ROOT_DIRECTORY}" in String

Parameters:
format - the string to format
Returns:
The formated string

getString

public java.lang.String getString(java.lang.String key)
gets the property value

Parameters:
key - property
Returns:
String value

getString

public java.lang.String getString(java.lang.String key,
                                  java.lang.String defaultValue)
gets the property value

Parameters:
key - property
defaultValue - returned value if key not found
Returns:
String value

getInt

public int getInt(java.lang.String key)
gets the property value

Parameters:
key - property
Returns:
int value

getLong

public java.lang.Long getLong(java.lang.String key)
gets the property value

Parameters:
key - property
Returns:
int value

getSettings

public java.util.Map<java.lang.String,java.lang.Object> getSettings(java.lang.String baseName)
Gets settings starting with baseName

Parameters:
baseName - String
Returns:
Map

getSettings

public java.util.Map<java.lang.String,java.lang.Object> getSettings(java.lang.String baseName,
                                                                    java.lang.String replacement)
Gets settings starting with baseName and replaces baseName with replacement.

Parameters:
baseName - String
replacement - String
Returns:
Map

initIntranetCategories

public void initIntranetCategories()
Init the intranet categories


getAppRegistry

public AppRegistryApplication getAppRegistry()
Gets the appRegistry value

Returns:
the appRegistry

setAppRegistry

public void setAppRegistry(AppRegistryApplication appRegistry)
Sets the value of appRegistry

Parameters:
appRegistry - the appRegistry to set

getNotificationManager

public NotificationManager getNotificationManager()
Gets the notificationManager value

Returns:
the notificationManager

setNotificationManager

public void setNotificationManager(NotificationManager notificationManager)
Sets the value of notificationManager

Parameters:
notificationManager - the notificationManager to set

getBundle

public java.util.ResourceBundle getBundle()
Gets the bundle value

Returns:
the bundle

getStores

public java.util.Map<java.lang.String,java.lang.Object> getStores()
Gets the stores value

Returns:
the stores

setStores

public void setStores(java.util.Map<java.lang.String,java.lang.Object> stores)
Sets the value of stores

Parameters:
stores - the stores to set

getAuthenticationALGORITHM

public java.lang.String getAuthenticationALGORITHM()
Gets the authenticationALGORITHM value

Returns:
the authenticationALGORITHM

setAuthenticationALGORITHM

public void setAuthenticationALGORITHM(java.lang.String authenticationALGORITHM)
Sets the value of authenticationALGORITHM

Parameters:
authenticationALGORITHM - the authenticationALGORITHM to set

getAuthenticationCOOKIE

public java.lang.String getAuthenticationCOOKIE()
Gets the authenticationCOOKIE value

Returns:
the authenticationCOOKIE

setAuthenticationCOOKIE

public void setAuthenticationCOOKIE(java.lang.String authenticationCOOKIE)
Sets the value of authenticationCOOKIE

Parameters:
authenticationCOOKIE - the authenticationCOOKIE to set

getAuthenticationAGENT

public java.lang.String getAuthenticationAGENT()
Gets the authenticationAGENT value

Returns:
the authenticationAGENT

setAuthenticationAGENT

public void setAuthenticationAGENT(java.lang.String authenticationAGENT)
Sets the value of authenticationAGENT

Parameters:
authenticationAGENT - the authenticationAGENT to set

getIntranetCategories

public java.util.List<Category> getIntranetCategories()
Gets the intranetCategories value

Returns:
the intranetCategories

setIntranetCategories

public void setIntranetCategories(java.util.List<Category> intranetCategories)
Sets the value of intranetCategories

Parameters:
intranetCategories - the intranetCategories to set

setIntranetAddresses

public void setIntranetAddresses(java.util.List<java.lang.String> intranetAddresses)
Sets the value of intranetAddresses

Parameters:
intranetAddresses - the intranetAddresses to set

getIntranetAddresses

public java.util.List<java.lang.String> getIntranetAddresses()
Gets the intranetAddresses value

Returns:
the intranetAddresses

setComponent

public void setComponent(SitoolsComponent component)
Sets the value of component

Parameters:
component - the component to set

getComponent

public SitoolsComponent getComponent()
Gets the component value

Returns:
the component

isSecured

public boolean isSecured()
Gets the secured value

Returns:
the secured

setSecured

public void setSecured(boolean secured)
Sets the value of secured

Parameters:
secured - the secured to set

getUserStorageRefreshDelay

public int getUserStorageRefreshDelay()
Gets the userStorageRefreshDelay value

Returns:
the userStorageRefreshDelay

setUserStorageRefreshDelay

public void setUserStorageRefreshDelay(int userStorageRefreshDelay)
Sets the value of userStorageRefreshDelay

Parameters:
userStorageRefreshDelay - the userStorageRefreshDelay to set

isStartWithMigration

public boolean isStartWithMigration()
Gets the startWithMigration value

Returns:
the startWithMigration

setStartWithMigration

public void setStartWithMigration(boolean startWithMigration)
Sets the value of startWithMigration

Parameters:
startWithMigration - the startWithMigration to set

getUserStorageDir

public java.lang.String getUserStorageDir(java.lang.String username)
Get the userstorage directory for a particular username

Parameters:
username - the username
Returns:
userstorage directory for a particular username

isCheckStores

public boolean isCheckStores()
Gets the checkStores value

Returns:
the checkStores

setCheckStores

public void setCheckStores(boolean checkStores)
Sets the value of checkStores

Parameters:
checkStores - the checkStores to set

getAdminMail

public java.lang.String getAdminMail()
Gets the admin mail.

Returns:
the admin mail


Copyright © 2010-2013 CNES. All Rights Reserved.