|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.util.AppiusConfig
public final class BraqueConfig
This static class is the singleton responsible for configuration, factories, etc.
Field Summary | |
---|---|
private static Properties |
config
The internal configuration database is really a Java Properties object. |
private static Connection |
dbh
This is the data source for SQL queries. |
Constructor Summary | |
---|---|
BraqueConfig()
|
Method Summary | |
---|---|
static com.whirlycott.cache.Cache |
getCache()
|
static String |
getChatFilterName()
|
static String |
getConfig(String key)
This fetches up a configuration property in general. |
static boolean |
getConfigBool(String string)
|
static boolean |
getConfigBoolOrFalse(String string)
The same as getConfigBool(String) but returns a "false"
if the key is not found |
static String |
getConfigOrDefault(String key,
String defaultValue)
|
static String |
getConfigOrNull(String string)
This calls @see(#getConfig), but doesn't throw any exceptions, it just returns a null if the string isn't found in the configuration. |
static Connection |
getDatabaseConnection()
This routine currently returns a single, shared object. |
static String |
getDNS_JNDI()
This returns the DNS URL to be used in JNDI queries for DNS lookups. |
static int |
getInt(String string)
|
static int |
getIntOrZero(String string)
|
static Logger |
getLogger()
|
static String |
getLoginFilterName()
|
static javax.mail.Address |
getMailSender()
Get a Java mail Address object for sending automated eMails. |
static String |
getServerName()
|
static String |
getSFSName()
|
static int |
getSFSPort()
|
static String |
getSMTPHost()
|
static void |
init()
Initialize the configuration system from the Properties system and any other relevant sources. |
static void |
setConfig(String key,
String value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static Properties config
private static volatile Connection dbh
Constructor Detail |
---|
public BraqueConfig()
Method Detail |
---|
public static com.whirlycott.cache.Cache getCache()
public static String getChatFilterName()
public static String getConfig(String key) throws NotFoundException
key
- The identifier of the configuration value to be
queried
NotFoundException
- If the configuration string is not
foundpublic static boolean getConfigBool(String string) throws NotFoundException
string
- the configuration identifier string
NotFoundException
- if the value can't be found or isn't a
boolean (literal "true" or "false" only)public static boolean getConfigBoolOrFalse(String string)
getConfigBool(String)
but returns a "false"
if the key is not found
string
- the config identifier string
public static String getConfigOrDefault(String key, String defaultValue)
key
- configuration keydefaultValue
- default value
public static String getConfigOrNull(String string)
string
- The identifier of the configuration being queries
public static Connection getDatabaseConnection() throws SQLException
This routine currently returns a single, shared object. In the future, we might move to a pool of available connection objects or similar.
FIXME: http://onjava.com/pub/a/onjava/2006/04/19/database-connection -pooling-with-tomcat.html?page=2
SQLException
- (bubbled up from underlying layers)public static String getDNS_JNDI()
public static int getInt(String string) throws NumberFormatException, NotFoundException
string
- the configuration key
NotFoundException
- if the key isn't found in the
configuration
NumberFormatException
- if the key can't be parsed as an
integerpublic static int getIntOrZero(String string)
string
- the configuration key
public static Logger getLogger()
public static String getLoginFilterName()
public static javax.mail.Address getMailSender()
public static String getServerName()
public static String getSFSName()
public static int getSFSPort()
public static String getSMTPHost()
public static void init()
public static void setConfig(String key, String value)
key
- The configuration value to be setvalue
- The new value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |