public class ServerProperties extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ADMIN_USER_NAME
Name of property used to store the admin username.
|
static String |
ADMIN_USER_NAME_ENV
The environment variable for storing the admin's name.
|
static String |
ADMIN_USER_PASSWORD
Name of property used to store the admin password.
|
static String |
ADMIN_USER_PASSWORD_ENV
The environment variable for storing the admin's password.
|
static String |
CHECK_SESSIONS
Check the Session opens vs close.
|
static String |
CONTEXT_ROOT_KEY
The context root key.
|
static String |
DATABASE_URL
The database url.
|
static String |
DB_CONNECTION_DRIVER
The database connection driver class.
|
static String |
DB_CONNECTION_URL
The database connection driver url.
|
static String |
DB_CONNECTION_URL_ENV
The database connection driver url environment variable.
|
static String |
DB_PASSWORD
The database password.
|
static String |
DB_SHOW_SQL
The database show sql.
|
static String |
DB_TABLE_UPDATE
The database drop&create tables.
|
static String |
DB_USER_NAME
The database username.
|
static String |
ENABLE_LOGGING_KEY
Enable logging in the server.
|
static String |
FALSE
String for false.
|
static String |
HEROKU_DATABASE_URL_KEY
The heroku database URL.
|
static String |
HEROKU_HOSTNAME_KEY
The hostname for Heroku.
|
static String |
HOSTNAME_KEY
The hostname key.
|
static String |
LOGGING_LEVEL_KEY
The logging level key.
|
static String |
PORT_KEY
The wattdepot server port key.
|
static String |
SERVER_HOME_DIR
The full path to the server's home directory.
|
static String |
SERVER_TIMING_KEY
Enable timing of Server operations.
|
static String |
SSL
The option to enable SSL.
|
static String |
SSL_KEYSTORE_KEY_PASSWORD
The password for the key.
|
static String |
SSL_KEYSTORE_PASSWORD
The password for the keystore.
|
static String |
SSL_KEYSTORE_PATH
The path to the keystore holding the certificate.
|
static String |
SSL_KEYSTORE_TYPE
The type of keystore.
|
static String |
TEST_HEROKU_KEY
Heroku test key.
|
static String |
TEST_PORT_KEY
The wattdepot server port key during testing.
|
static String |
TEST_WATT_DEPOT_IMPL_KEY
The WattDepot implementation class during testing.
|
static String |
TRUE
String for true.
|
static String |
USE_HEROKU_KEY
Heroku key.
|
static String |
WATT_DEPOT_IMPL_KEY
The WattDepot implementation class.
|
static String |
WATTDEPOT_EXTENSION
String for the beginning of the WattDepotServer extension definitions.
|
static String |
WATTDEPOT_EXTENSIONS
Property key that holds all the WattDepotServer extensions defined in the properties file.
|
static String |
WATTDEPOT_SALT_ENV
The environment variable name that holds the salt used for encrypting
passwords in WattDepot.
|
Constructor and Description |
---|
ServerProperties()
Creates a new ServerProperties instance using the default filename.
|
ServerProperties(String serverSubdir)
Creates a new ServerProperties instance loaded from the given filename.
|
Modifier and Type | Method and Description |
---|---|
String |
echoProperties()
Returns a string containing all current properties in alphabetical order.
|
String |
get(String key)
Returns the value of the Server Property specified by the key.
|
String |
getFullHost()
Returns the fully qualified host name, such as
"http://localhost:9876/wattdepot/".
|
Object |
getPropertyInstance(Object key)
Returns the instance.
|
void |
set(String key,
String value)
Sets the given property.
|
void |
setTestProperties()
Sets the properties to their "test" equivalents and updates the system
properties.
|
void |
trimProperties()
Ensures that the there is no leading or trailing whitespace in the property
values.
|
public static final String SERVER_HOME_DIR
public static final String HOSTNAME_KEY
public static final String ADMIN_USER_NAME
public static final String ADMIN_USER_NAME_ENV
public static final String ADMIN_USER_PASSWORD
public static final String ADMIN_USER_PASSWORD_ENV
public static final String WATTDEPOT_SALT_ENV
public static final String WATT_DEPOT_IMPL_KEY
public static final String PORT_KEY
public static final String CONTEXT_ROOT_KEY
public static final String SSL
public static final String SSL_KEYSTORE_PATH
public static final String SSL_KEYSTORE_PASSWORD
public static final String SSL_KEYSTORE_KEY_PASSWORD
public static final String SSL_KEYSTORE_TYPE
public static final String DB_CONNECTION_DRIVER
public static final String DB_CONNECTION_URL
public static final String DB_CONNECTION_URL_ENV
public static final String DATABASE_URL
public static final String DB_USER_NAME
public static final String DB_PASSWORD
public static final String DB_SHOW_SQL
public static final String DB_TABLE_UPDATE
public static final String ENABLE_LOGGING_KEY
public static final String CHECK_SESSIONS
public static final String LOGGING_LEVEL_KEY
public static final String SERVER_TIMING_KEY
public static final String TEST_WATT_DEPOT_IMPL_KEY
public static final String TEST_PORT_KEY
public static final String USE_HEROKU_KEY
public static final String TEST_HEROKU_KEY
public static final String HEROKU_HOSTNAME_KEY
public static final String HEROKU_DATABASE_URL_KEY
public static final String FALSE
public static final String TRUE
public static final String WATTDEPOT_EXTENSION
public static final String WATTDEPOT_EXTENSIONS
public ServerProperties() throws Exception
Exception
- if errors occur.public ServerProperties(String serverSubdir) throws Exception
serverSubdir
- The name of the subdirectory used to store all files
for this server.Exception
- if errors occur.public void setTestProperties()
public String echoProperties()
public String get(String key)
key
- Should be one of the public static final strings in this class.public Object getPropertyInstance(Object key)
key
- The key.public void set(String key, String value)
key
- the key.value
- the valuepublic void trimProperties()
public String getFullHost()
Copyright © 2015 Collaborative Software Development Laboratory. All rights reserved.