Update to allow for persistent store to be specified in the config

Update to allow for persistent store to be specified in the config
This commit is contained in:
swarwick
2015-03-14 16:37:09 +01:00
committed by andrea
parent 4195b0d62c
commit 8943445efa
4 changed files with 10 additions and 8 deletions
@@ -46,6 +46,7 @@ class ConfigurationParser {
m_properties.put("host", Constants.HOST);
m_properties.put("websocket_port", Integer.toString(Constants.WEBSOCKET_PORT));
m_properties.put("password_file", "");
m_properties.put("persistent_store", System.getProperty("user.home") + File.separator + "moquette_store.mapdb");
}
/**
@@ -31,9 +31,6 @@ public class Server {
private static final Logger LOG = LoggerFactory.getLogger(Server.class);
public static final String STORAGE_FILE_PATH = System.getProperty("user.home") +
File.separator + "moquette_store.mapdb";
private ServerAcceptor m_acceptor;
SimpleMessaging messaging;
@@ -64,7 +61,6 @@ public class Server {
*/
public void startServer(File configFile) throws IOException {
LOG.info("Using config file: " + configFile.getAbsolutePath());
LOG.info("Persistent store file: " + STORAGE_FILE_PATH);
ConfigurationParser confParser = new ConfigurationParser();
try {
@@ -86,6 +82,7 @@ public class Server {
* </ul>
*/
public void startServer(Properties configProps) throws IOException {
LOG.info("Persistent store file: " + configProps.get("persistent_store"));
messaging = SimpleMessaging.getInstance();
messaging.init(configProps);