2015-08-22 15:35:11 +02:00
|
|
|
/*
|
2019-03-16 17:04:23 +08:00
|
|
|
* Copyright (c) 2012-2017 The original author or authors
|
2015-08-22 15:35:11 +02:00
|
|
|
* ------------------------------------------------------
|
|
|
|
|
* All rights reserved. This program and the accompanying materials
|
|
|
|
|
* are made available under the terms of the Eclipse Public License v1.0
|
|
|
|
|
* and Apache License v2.0 which accompanies this distribution.
|
|
|
|
|
*
|
|
|
|
|
* The Eclipse Public License is available at
|
|
|
|
|
* http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
|
*
|
|
|
|
|
* The Apache License v2.0 is available at
|
|
|
|
|
* http://www.opensource.org/licenses/apache2.0.php
|
|
|
|
|
*
|
|
|
|
|
* You may elect to redistribute this code under either of these licenses.
|
|
|
|
|
*/
|
2017-02-01 15:24:59 +01:00
|
|
|
|
2019-03-16 17:04:23 +08:00
|
|
|
package io.moquette.server.config;
|
2015-08-22 15:35:11 +02:00
|
|
|
|
2016-04-25 11:51:57 +02:00
|
|
|
import io.moquette.BrokerConstants;
|
|
|
|
|
|
2015-08-22 15:35:11 +02:00
|
|
|
/**
|
|
|
|
|
* Base interface for all configuration implementations (filesystem, memory or classpath)
|
|
|
|
|
*/
|
2016-04-25 11:51:57 +02:00
|
|
|
public abstract class IConfig {
|
2017-02-01 15:24:59 +01:00
|
|
|
|
2019-03-16 17:04:23 +08:00
|
|
|
public static final String DEFAULT_CONFIG = "config/wildfirechat.conf";
|
|
|
|
|
public static final String LICENSE_PATH = "config/wildfirechat.license";
|
2016-12-26 15:59:19 +02:00
|
|
|
|
2016-04-25 11:51:57 +02:00
|
|
|
public abstract void setProperty(String name, String value);
|
2015-08-22 15:35:11 +02:00
|
|
|
|
2016-04-25 11:51:57 +02:00
|
|
|
public abstract String getProperty(String name);
|
2015-08-22 15:35:11 +02:00
|
|
|
|
2016-04-25 11:51:57 +02:00
|
|
|
public abstract String getProperty(String name, String defaultValue);
|
|
|
|
|
|
|
|
|
|
void assignDefaults() {
|
|
|
|
|
setProperty(BrokerConstants.PORT_PROPERTY_NAME, Integer.toString(BrokerConstants.PORT));
|
|
|
|
|
setProperty(BrokerConstants.HOST_PROPERTY_NAME, BrokerConstants.HOST);
|
|
|
|
|
setProperty(BrokerConstants.AUTHORIZATOR_CLASS_NAME, "");
|
|
|
|
|
}
|
2016-12-26 15:59:19 +02:00
|
|
|
|
|
|
|
|
public abstract IResourceLoader getResourceLoader();
|
|
|
|
|
|
2015-08-22 15:35:11 +02:00
|
|
|
}
|