Minor added slf4j-api deps to re-enable logging
This commit is contained in:
@@ -26,6 +26,8 @@ dependencies {
|
|||||||
// compile group: 'org.hdrhistogram', name: 'HdrHistogram', version:'2.1.4'
|
// compile group: 'org.hdrhistogram', name: 'HdrHistogram', version:'2.1.4'
|
||||||
compile group: 'com.hazelcast', name: 'hazelcast', version:'3.5.4'
|
compile group: 'com.hazelcast', name: 'hazelcast', version:'3.5.4'
|
||||||
|
|
||||||
|
compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.5'
|
||||||
|
|
||||||
testCompile group: 'org.fusesource.mqtt-client', name: 'mqtt-client', version:'1.12'
|
testCompile group: 'org.fusesource.mqtt-client', name: 'mqtt-client', version:'1.12'
|
||||||
testCompile group: 'org.eclipse.paho', name: 'org.eclipse.paho.client.mqttv3', version:'1.0.2'
|
testCompile group: 'org.eclipse.paho', name: 'org.eclipse.paho.client.mqttv3', version:'1.0.2'
|
||||||
testCompile group: 'org.eclipse.jetty.websocket', name: 'websocket-client', version:'9.2.0.M1'
|
testCompile group: 'org.eclipse.jetty.websocket', name: 'websocket-client', version:'9.2.0.M1'
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import io.moquette.spi.security.ISslContextCreator;
|
|||||||
import io.netty.handler.codec.mqtt.MqttPublishMessage;
|
import io.netty.handler.codec.mqtt.MqttPublishMessage;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -82,8 +83,7 @@ public class Server {
|
|||||||
/**
|
/**
|
||||||
* Starts Moquette bringing the configuration from the file located at m_config/moquette.conf
|
* Starts Moquette bringing the configuration from the file located at m_config/moquette.conf
|
||||||
*
|
*
|
||||||
* @throws IOException
|
* @throws IOException in case of any IO error.
|
||||||
* in case of any IO error.
|
|
||||||
*/
|
*/
|
||||||
public void startServer() throws IOException {
|
public void startServer() throws IOException {
|
||||||
File defaultConfigurationFile = defaultConfigFile();
|
File defaultConfigurationFile = defaultConfigFile();
|
||||||
@@ -101,10 +101,8 @@ public class Server {
|
|||||||
/**
|
/**
|
||||||
* Starts Moquette bringing the configuration from the given file
|
* Starts Moquette bringing the configuration from the given file
|
||||||
*
|
*
|
||||||
* @param configFile
|
* @param configFile text file that contains the configuration.
|
||||||
* text file that contains the configuration.
|
* @throws IOException in case of any IO Error.
|
||||||
* @throws IOException
|
|
||||||
* in case of any IO Error.
|
|
||||||
*/
|
*/
|
||||||
public void startServer(File configFile) throws IOException {
|
public void startServer(File configFile) throws IOException {
|
||||||
LOG.info("Starting Moquette server. Configuration file path={}", configFile.getAbsolutePath());
|
LOG.info("Starting Moquette server. Configuration file path={}", configFile.getAbsolutePath());
|
||||||
@@ -115,17 +113,15 @@ public class Server {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts the server with the given properties.
|
* Starts the server with the given properties.
|
||||||
*
|
* <p>
|
||||||
* Its suggested to at least have the following properties:
|
* Its suggested to at least have the following properties:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>port</li>
|
* <li>port</li>
|
||||||
* <li>password_file</li>
|
* <li>password_file</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @param configProps
|
* @param configProps the properties map to use as configuration.
|
||||||
* the properties map to use as configuration.
|
* @throws IOException in case of any IO Error.
|
||||||
* @throws IOException
|
|
||||||
* in case of any IO Error.
|
|
||||||
*/
|
*/
|
||||||
public void startServer(Properties configProps) throws IOException {
|
public void startServer(Properties configProps) throws IOException {
|
||||||
LOG.info("Starting Moquette server using properties object");
|
LOG.info("Starting Moquette server using properties object");
|
||||||
@@ -136,10 +132,8 @@ public class Server {
|
|||||||
/**
|
/**
|
||||||
* Starts Moquette bringing the configuration files from the given Config implementation.
|
* Starts Moquette bringing the configuration files from the given Config implementation.
|
||||||
*
|
*
|
||||||
* @param config
|
* @param config the configuration to use to start the broker.
|
||||||
* the configuration to use to start the broker.
|
* @throws IOException in case of any IO Error.
|
||||||
* @throws IOException
|
|
||||||
* in case of any IO Error.
|
|
||||||
*/
|
*/
|
||||||
public void startServer(IConfig config) throws IOException {
|
public void startServer(IConfig config) throws IOException {
|
||||||
LOG.info("Starting Moquette server using IConfig instance...");
|
LOG.info("Starting Moquette server using IConfig instance...");
|
||||||
@@ -150,12 +144,9 @@ public class Server {
|
|||||||
* Starts Moquette with config provided by an implementation of IConfig class and with the set
|
* Starts Moquette with config provided by an implementation of IConfig class and with the set
|
||||||
* of InterceptHandler.
|
* of InterceptHandler.
|
||||||
*
|
*
|
||||||
* @param config
|
* @param config the configuration to use to start the broker.
|
||||||
* the configuration to use to start the broker.
|
* @param handlers the handlers to install in the broker.
|
||||||
* @param handlers
|
* @throws IOException in case of any IO Error.
|
||||||
* the handlers to install in the broker.
|
|
||||||
* @throws IOException
|
|
||||||
* in case of any IO Error.
|
|
||||||
*/
|
*/
|
||||||
public void startServer(IConfig config, List<? extends InterceptHandler> handlers) throws IOException {
|
public void startServer(IConfig config, List<? extends InterceptHandler> handlers) throws IOException {
|
||||||
LOG.info("Starting moquette server using IConfig instance and intercept handlers");
|
LOG.info("Starting moquette server using IConfig instance and intercept handlers");
|
||||||
@@ -163,7 +154,7 @@ public class Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void startServer(IConfig config, List<? extends InterceptHandler> handlers, ISslContextCreator sslCtxCreator,
|
public void startServer(IConfig config, List<? extends InterceptHandler> handlers, ISslContextCreator sslCtxCreator,
|
||||||
IAuthenticator authenticator, IAuthorizator authorizator) throws IOException {
|
IAuthenticator authenticator, IAuthorizator authorizator) throws IOException {
|
||||||
if (handlers == null) {
|
if (handlers == null) {
|
||||||
handlers = Collections.emptyList();
|
handlers = Collections.emptyList();
|
||||||
}
|
}
|
||||||
@@ -207,8 +198,8 @@ public class Server {
|
|||||||
if (hzConfigPath != null) {
|
if (hzConfigPath != null) {
|
||||||
boolean isHzConfigOnClasspath = this.getClass().getClassLoader().getResource(hzConfigPath) != null;
|
boolean isHzConfigOnClasspath = this.getClass().getClassLoader().getResource(hzConfigPath) != null;
|
||||||
Config hzconfig = isHzConfigOnClasspath
|
Config hzconfig = isHzConfigOnClasspath
|
||||||
? new ClasspathXmlConfig(hzConfigPath)
|
? new ClasspathXmlConfig(hzConfigPath)
|
||||||
: new FileSystemXmlConfig(hzConfigPath);
|
: new FileSystemXmlConfig(hzConfigPath);
|
||||||
LOG.info("Starting Hazelcast instance. ConfigurationFile={}", hzconfig);
|
LOG.info("Starting Hazelcast instance. ConfigurationFile={}", hzconfig);
|
||||||
hazelcastInstance = Hazelcast.newHazelcastInstance(hzconfig);
|
hazelcastInstance = Hazelcast.newHazelcastInstance(hzconfig);
|
||||||
} else {
|
} else {
|
||||||
@@ -233,12 +224,9 @@ public class Server {
|
|||||||
* Use the broker to publish a message. It's intended for embedding applications. It can be used
|
* Use the broker to publish a message. It's intended for embedding applications. It can be used
|
||||||
* only after the server is correctly started with startServer.
|
* only after the server is correctly started with startServer.
|
||||||
*
|
*
|
||||||
* @param msg
|
* @param msg the message to forward.
|
||||||
* the message to forward.
|
* @param clientId the id of the sending server.
|
||||||
* @param clientId
|
* @throws IllegalStateException if the server is not yet started
|
||||||
* the id of the sending server.
|
|
||||||
* @throws IllegalStateException
|
|
||||||
* if the server is not yet started
|
|
||||||
*/
|
*/
|
||||||
public void internalPublish(MqttPublishMessage msg, final String clientId) {
|
public void internalPublish(MqttPublishMessage msg, final String clientId) {
|
||||||
final int messageID = msg.variableHeader().messageId();
|
final int messageID = msg.variableHeader().messageId();
|
||||||
@@ -287,8 +275,7 @@ public class Server {
|
|||||||
/**
|
/**
|
||||||
* SPI method used by Broker embedded applications to add intercept handlers.
|
* SPI method used by Broker embedded applications to add intercept handlers.
|
||||||
*
|
*
|
||||||
* @param interceptHandler
|
* @param interceptHandler the handler to add.
|
||||||
* the handler to add.
|
|
||||||
*/
|
*/
|
||||||
public void addInterceptHandler(InterceptHandler interceptHandler) {
|
public void addInterceptHandler(InterceptHandler interceptHandler) {
|
||||||
if (!m_initialized) {
|
if (!m_initialized) {
|
||||||
@@ -303,8 +290,7 @@ public class Server {
|
|||||||
/**
|
/**
|
||||||
* SPI method used by Broker embedded applications to remove intercept handlers.
|
* SPI method used by Broker embedded applications to remove intercept handlers.
|
||||||
*
|
*
|
||||||
* @param interceptHandler
|
* @param interceptHandler the handler to remove.
|
||||||
* the handler to remove.
|
|
||||||
*/
|
*/
|
||||||
public void removeInterceptHandler(InterceptHandler interceptHandler) {
|
public void removeInterceptHandler(InterceptHandler interceptHandler) {
|
||||||
if (!m_initialized) {
|
if (!m_initialized) {
|
||||||
|
|||||||
Reference in New Issue
Block a user