public class SpincastConfigPropsFileBased extends SpincastConfig implements ISpincastConfig
| Modifier and Type | Field and Description |
|---|---|
static String |
APP_PROPERTIES_FILE_NAME |
static String |
APP_PROPERTIES_KEY_ENVIRONMENT_IS_DEBUG |
static String |
APP_PROPERTIES_KEY_ENVIRONMENT_NAME |
static String |
APP_PROPERTIES_KEY_HTTP_SERVER_PORT |
static String |
APP_PROPERTIES_KEY_HTTPS_SERVER_KEYSTORE_KEYPASS |
static String |
APP_PROPERTIES_KEY_HTTPS_SERVER_KEYSTORE_PATH |
static String |
APP_PROPERTIES_KEY_HTTPS_SERVER_KEYSTORE_STOREPASS |
static String |
APP_PROPERTIES_KEY_HTTPS_SERVER_KEYSTORE_TYPE |
static String |
APP_PROPERTIES_KEY_HTTPS_SERVER_PORT |
static String |
APP_PROPERTIES_KEY_SERVER_HOST |
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
SpincastConfigPropsFileBased(ISpincastUtils spincastUtils,
String[] mainArgs)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected Properties |
getAppProperties()
Here is the algorithm used to find the configuration file :
1) If getSpecificAppPropertiesFilePath() is not
null,
we use it as the path. |
protected String |
getConfig(String key)
Gets a String configuration and throws an exception if the
specified key is not found.
|
protected Object |
getConfig(String key,
Object defaultValue,
boolean useDefaultValue)
Gets a configuration.
|
protected String |
getConfig(String key,
String defaultValue)
Gets a String configuration and uses the specified default value if the
key is not found.
|
protected Boolean |
getConfigBoolean(String key)
Gets a boolean configuration and throws an exception if the
specified key is not found.
|
protected Boolean |
getConfigBoolean(String key,
Boolean defaultValue)
Gets a boolean configuration and uses the specified default value if the
key is not found.
|
protected String |
getConfigFileName() |
protected Integer |
getConfigInteger(String key)
Gets a integer configuration and throws an exception if the
specified key is not found.
|
protected Integer |
getConfigInteger(String key,
Integer defaultValue)
Gets a integer configuration and uses the specified default value if the
key is not found.
|
protected String |
getConfigKeyEnvironmentIsDebug() |
protected String |
getConfigKeyEnvironmentName() |
protected String |
getConfigKeyHttpServerPort() |
protected String |
getConfigKeyHttpsServerKeystoreKeyPass() |
protected String |
getConfigKeyHttpsServerKeystorePath() |
protected String |
getConfigKeyHttpsServerKeystoreStorePass() |
protected String |
getConfigKeyHttpsServerKeystoreType() |
protected String |
getConfigKeyHttpsServerPort() |
protected String |
getConfigKeyServerHost() |
String |
getEnvironmentName() |
protected String |
getFoundPropertiesFilePath()
The path to the acutally found .properties file.
|
int |
getHttpServerPort() |
String |
getHttpsKeyStoreKeypass() |
String |
getHttpsKeyStorePath() |
String |
getHttpsKeyStoreStorePass() |
String |
getHttpsKeyStoreType() |
int |
getHttpsServerPort() |
String |
getServerHost() |
protected String |
getSpecificAppPropertiesFilePath() |
protected ISpincastUtils |
getSpincastUtils() |
boolean |
isDebugEnabled() |
protected String |
lookForPropsFileSpecificPath(String[] mainArgs)
If the properties file is not at the default location where
this plugin will search for it, it is possible to simply
reuturn the path here.
|
getContentTypesToSkipGziping, getDefaultLocale, getRouteForwardingMaxNumber, getServerMaxRequestBodyBytes, getSpincastWritableDir, isRoutesCaseSensitiveclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetContentTypesToSkipGziping, getDefaultLocale, getRouteForwardingMaxNumber, getServerMaxRequestBodyBytes, getSpincastWritableDir, isRoutesCaseSensitiveprotected final org.slf4j.Logger logger
public static final String APP_PROPERTIES_FILE_NAME
public static final String APP_PROPERTIES_KEY_ENVIRONMENT_NAME
public static final String APP_PROPERTIES_KEY_ENVIRONMENT_IS_DEBUG
public static final String APP_PROPERTIES_KEY_SERVER_HOST
public static final String APP_PROPERTIES_KEY_HTTP_SERVER_PORT
public static final String APP_PROPERTIES_KEY_HTTPS_SERVER_PORT
public static final String APP_PROPERTIES_KEY_HTTPS_SERVER_KEYSTORE_PATH
public static final String APP_PROPERTIES_KEY_HTTPS_SERVER_KEYSTORE_TYPE
public static final String APP_PROPERTIES_KEY_HTTPS_SERVER_KEYSTORE_STOREPASS
public static final String APP_PROPERTIES_KEY_HTTPS_SERVER_KEYSTORE_KEYPASS
@Inject public SpincastConfigPropsFileBased(ISpincastUtils spincastUtils, @Nullable String[] mainArgs)
protected String lookForPropsFileSpecificPath(String[] mainArgs)
protected ISpincastUtils getSpincastUtils()
protected String getSpecificAppPropertiesFilePath()
protected String getFoundPropertiesFilePath()
null if
none was found.protected String getConfigFileName()
protected String getConfigKeyEnvironmentName()
protected String getConfigKeyEnvironmentIsDebug()
protected String getConfigKeyServerHost()
protected String getConfigKeyHttpServerPort()
protected String getConfigKeyHttpsServerPort()
protected String getConfigKeyHttpsServerKeystorePath()
protected String getConfigKeyHttpsServerKeystoreType()
protected String getConfigKeyHttpsServerKeystoreStorePass()
protected String getConfigKeyHttpsServerKeystoreKeyPass()
protected Properties getAppProperties()
null,
we use it as the path.
2) Otherwise, we try to find the configuration file next to the ".jar"
itself.
3) It we didn't found the configuration file next to the ".jar" file,
or if there is no .jar file (the code is running from an IDE, for example),
then we fallback to the default configurations which are defined in the
SpincastConfig base class.protected String getConfig(String key)
protected String getConfig(String key, String defaultValue)
protected Boolean getConfigBoolean(String key)
protected Boolean getConfigBoolean(String key, Boolean defaultValue)
protected Integer getConfigInteger(String key)
protected Integer getConfigInteger(String key, Integer defaultValue)
protected Object getConfig(String key, Object defaultValue, boolean useDefaultValue)
public String getEnvironmentName()
getEnvironmentName in interface ISpincastConfiggetEnvironmentName in class SpincastConfigpublic boolean isDebugEnabled()
isDebugEnabled in interface ISpincastConfigisDebugEnabled in class SpincastConfigpublic String getServerHost()
getServerHost in interface ISpincastConfiggetServerHost in class SpincastConfigpublic int getHttpServerPort()
getHttpServerPort in interface ISpincastConfiggetHttpServerPort in class SpincastConfigpublic int getHttpsServerPort()
getHttpsServerPort in interface ISpincastConfiggetHttpsServerPort in class SpincastConfigpublic String getHttpsKeyStorePath()
getHttpsKeyStorePath in interface ISpincastConfiggetHttpsKeyStorePath in class SpincastConfigpublic String getHttpsKeyStoreType()
getHttpsKeyStoreType in interface ISpincastConfiggetHttpsKeyStoreType in class SpincastConfigpublic String getHttpsKeyStoreStorePass()
getHttpsKeyStoreStorePass in interface ISpincastConfiggetHttpsKeyStoreStorePass in class SpincastConfigpublic String getHttpsKeyStoreKeypass()
getHttpsKeyStoreKeypass in interface ISpincastConfiggetHttpsKeyStoreKeypass in class SpincastConfigCopyright © 2016. All rights reserved.