Files
IM-server-new/broker/src/main/java/io/moquette/server/config/IConfig.java
T

52 lines
1.9 KiB
Java
Raw Normal View History

/*
2017-01-04 14:37:29 +01:00
* Copyright (c) 2012-2017 The original author or authorsgetRockQuestions()
* ------------------------------------------------------
* 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
package io.moquette.server.config;
import io.moquette.BrokerConstants;
/**
* Base interface for all configuration implementations (filesystem, memory or classpath)
*
* @author andrea
*/
public abstract class IConfig {
2017-02-01 15:24:59 +01:00
public static final String DEFAULT_CONFIG = "config/moquette.conf";
public abstract void setProperty(String name, String value);
public abstract String getProperty(String name);
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);
2017-02-01 15:24:59 +01:00
// setProperty(BrokerConstants.WEB_SOCKET_PORT_PROPERTY_NAME,
// Integer.toString(BrokerConstants.WEBSOCKET_PORT));
setProperty(BrokerConstants.PASSWORD_FILE_PROPERTY_NAME, "");
2017-02-01 15:24:59 +01:00
// setProperty(BrokerConstants.PERSISTENT_STORE_PROPERTY_NAME,
// BrokerConstants.DEFAULT_PERSISTENT_PATH);
setProperty(BrokerConstants.ALLOW_ANONYMOUS_PROPERTY_NAME, Boolean.TRUE.toString());
setProperty(BrokerConstants.AUTHENTICATOR_CLASS_NAME, "");
setProperty(BrokerConstants.AUTHORIZATOR_CLASS_NAME, "");
}
public abstract IResourceLoader getResourceLoader();
}