Package no.polaric.core
Class ConfigBase
java.lang.Object
no.polaric.core.ConfigBase
- All Implemented Interfaces:
ServerConfig
Base class, implementing common methods of ServerConfig.
This may be subclassed by application (e.g. by Main class)
-
Nested Class Summary
Nested classes/interfaces inherited from interface no.polaric.core.ServerConfig
ServerConfig.Notification, ServerConfig.PubSub, ServerConfig.SimpleCb, ServerConfig.UserDb, ServerConfig.Web
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconfig()
Get configuration properties.boolean
getBoolProperty
(String pname, boolean dvalue) Get boolean propertyint
getIntProperty
(String pname, int dvalue) Get integer propertydouble[]
getPosProperty
(String pname) Get position property (lat, long)getProperty
(String pname, String dvalue) Get a configuration propertylog()
Get logfileGet plugin properties.protected void
setConfig
(Properties prop) protected void
void
setProperty
(String pname, String dvalue) Set a configuration propertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface no.polaric.core.ServerConfig
addShutdownHandler, getWebserver
-
Constructor Details
-
ConfigBase
public ConfigBase()
-
-
Method Details
-
log
Get logfile- Specified by:
log
in interfaceServerConfig
-
setLogger
-
config
Get configuration properties.- Specified by:
config
in interfaceServerConfig
- Returns:
- Properties object.
-
setConfig
-
setProperty
Set a configuration property- Specified by:
setProperty
in interfaceServerConfig
- Parameters:
pname
- property name.dvalue
- default value.
-
getProperty
Get a configuration property- Specified by:
getProperty
in interfaceServerConfig
- Parameters:
pname
- property name.dvalue
- default value.- Returns:
- The value of the property (or dval if not registered)
-
getBoolProperty
Get boolean property- Specified by:
getBoolProperty
in interfaceServerConfig
- Parameters:
pname
- property name.dvalue
- default value.- Returns:
- The value of the property (or dval if not registered)
-
getIntProperty
Get integer property- Specified by:
getIntProperty
in interfaceServerConfig
- Parameters:
pname
- property name.dvalue
- default value.- Returns:
- The value of the property (or dval if not registered)
-
getPosProperty
Get position property (lat, long)- Specified by:
getPosProperty
in interfaceServerConfig
- Parameters:
pname
- property name.- Returns:
- [lat, long] coordinate
-
properties
Get plugin properties.- Specified by:
properties
in interfaceServerConfig
- Returns:
- A map of properties (name,value) to be used by plugins.
-