Remove unused imports, raw types and some deprecated method calls..
This commit is contained in:
@@ -9,7 +9,8 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public class HazelcastMsg implements Serializable {
|
public class HazelcastMsg implements Serializable {
|
||||||
|
|
||||||
private final String clientId;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private final String clientId;
|
||||||
private final byte qos;
|
private final byte qos;
|
||||||
private final byte[] payload;
|
private final byte[] payload;
|
||||||
private final String topic;
|
private final String topic;
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ public interface IResourceLoader {
|
|||||||
String getName();
|
String getName();
|
||||||
|
|
||||||
class ResourceIsDirectoryException extends RuntimeException {
|
class ResourceIsDirectoryException extends RuntimeException {
|
||||||
public ResourceIsDirectoryException(String message) {
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public ResourceIsDirectoryException(String message) {
|
||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ package io.moquette.server.netty;
|
|||||||
|
|
||||||
import io.netty.channel.ChannelDuplexHandler;
|
import io.netty.channel.ChannelDuplexHandler;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.handler.timeout.IdleStateEvent;
|
|
||||||
import io.netty.util.concurrent.EventExecutor;
|
import io.netty.util.concurrent.EventExecutor;
|
||||||
|
|
||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ import io.netty.handler.codec.http.HttpRequestDecoder;
|
|||||||
import io.netty.handler.codec.http.HttpResponseEncoder;
|
import io.netty.handler.codec.http.HttpResponseEncoder;
|
||||||
import io.netty.handler.codec.http.HttpServerCodec;
|
import io.netty.handler.codec.http.HttpServerCodec;
|
||||||
import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame;
|
import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame;
|
||||||
import io.netty.handler.codec.http.websocketx.Utf8FrameValidator;
|
|
||||||
import io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler;
|
import io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler;
|
||||||
import io.netty.handler.ssl.SslHandler;
|
import io.netty.handler.ssl.SslHandler;
|
||||||
import io.netty.handler.timeout.IdleStateHandler;
|
import io.netty.handler.timeout.IdleStateHandler;
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
package io.moquette.server.netty;
|
package io.moquette.server.netty;
|
||||||
|
|
||||||
import io.moquette.server.Constants;
|
import io.moquette.server.Constants;
|
||||||
import io.moquette.spi.impl.ProtocolProcessor;
|
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.util.Attribute;
|
import io.netty.util.Attribute;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class BytesMetricsHandler extends ChannelDuplexHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
||||||
Attribute<BytesMetrics> attr = ctx.attr(ATTR_KEY_METRICS);
|
Attribute<BytesMetrics> attr = ctx.channel().attr(ATTR_KEY_METRICS);
|
||||||
attr.set(new BytesMetrics());
|
attr.set(new BytesMetrics());
|
||||||
|
|
||||||
super.channelActive(ctx);
|
super.channelActive(ctx);
|
||||||
@@ -42,14 +42,14 @@ public class BytesMetricsHandler extends ChannelDuplexHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
||||||
BytesMetrics metrics = ctx.attr(ATTR_KEY_METRICS).get();
|
BytesMetrics metrics = ctx.channel().attr(ATTR_KEY_METRICS).get();
|
||||||
metrics.incrementRead(((ByteBuf)msg).readableBytes());
|
metrics.incrementRead(((ByteBuf)msg).readableBytes());
|
||||||
ctx.fireChannelRead(msg);
|
ctx.fireChannelRead(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
|
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
|
||||||
BytesMetrics metrics = ctx.attr(ATTR_KEY_METRICS).get();
|
BytesMetrics metrics = ctx.channel().attr(ATTR_KEY_METRICS).get();
|
||||||
metrics.incrementWrote(((ByteBuf)msg).writableBytes());
|
metrics.incrementWrote(((ByteBuf)msg).writableBytes());
|
||||||
ctx.write(msg, promise);
|
ctx.write(msg, promise);
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ public class BytesMetricsHandler extends ChannelDuplexHandler {
|
|||||||
@Override
|
@Override
|
||||||
public void close(ChannelHandlerContext ctx,
|
public void close(ChannelHandlerContext ctx,
|
||||||
ChannelPromise promise) throws Exception {
|
ChannelPromise promise) throws Exception {
|
||||||
BytesMetrics metrics = ctx.attr(ATTR_KEY_METRICS).get();
|
BytesMetrics metrics = ctx.channel().attr(ATTR_KEY_METRICS).get();
|
||||||
m_collector.sumReadBytes(metrics.readBytes());
|
m_collector.sumReadBytes(metrics.readBytes());
|
||||||
m_collector.sumWroteBytes(metrics.wroteBytes());
|
m_collector.sumWroteBytes(metrics.wroteBytes());
|
||||||
super.close(ctx, promise);
|
super.close(ctx, promise);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class MessageMetricsHandler extends ChannelDuplexHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
||||||
Attribute<MessageMetrics> attr = ctx.attr(ATTR_KEY_METRICS);
|
Attribute<MessageMetrics> attr = ctx.channel().attr(ATTR_KEY_METRICS);
|
||||||
attr.set(new MessageMetrics());
|
attr.set(new MessageMetrics());
|
||||||
|
|
||||||
super.channelActive(ctx);
|
super.channelActive(ctx);
|
||||||
@@ -41,14 +41,14 @@ public class MessageMetricsHandler extends ChannelDuplexHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
||||||
MessageMetrics metrics = ctx.attr(ATTR_KEY_METRICS).get();
|
MessageMetrics metrics = ctx.channel().attr(ATTR_KEY_METRICS).get();
|
||||||
metrics.incrementRead(1);
|
metrics.incrementRead(1);
|
||||||
ctx.fireChannelRead(msg);
|
ctx.fireChannelRead(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
|
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
|
||||||
MessageMetrics metrics = ctx.attr(ATTR_KEY_METRICS).get();
|
MessageMetrics metrics = ctx.channel().attr(ATTR_KEY_METRICS).get();
|
||||||
metrics.incrementWrote(1);
|
metrics.incrementWrote(1);
|
||||||
ctx.write(msg, promise);
|
ctx.write(msg, promise);
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,7 @@ public class MessageMetricsHandler extends ChannelDuplexHandler {
|
|||||||
@Override
|
@Override
|
||||||
public void close(ChannelHandlerContext ctx,
|
public void close(ChannelHandlerContext ctx,
|
||||||
ChannelPromise promise) throws Exception {
|
ChannelPromise promise) throws Exception {
|
||||||
MessageMetrics metrics = ctx.attr(ATTR_KEY_METRICS).get();
|
MessageMetrics metrics = ctx.channel().attr(ATTR_KEY_METRICS).get();
|
||||||
m_collector.sumReadMessages(metrics.messagesRead());
|
m_collector.sumReadMessages(metrics.messagesRead());
|
||||||
m_collector.sumWroteMessages(metrics.messagesWrote());
|
m_collector.sumWroteMessages(metrics.messagesWrote());
|
||||||
super.close(ctx, promise);
|
super.close(ctx, promise);
|
||||||
|
|||||||
@@ -20,8 +20,6 @@ import java.nio.ByteBuffer;
|
|||||||
import io.moquette.parser.proto.messages.AbstractMessage;
|
import io.moquette.parser.proto.messages.AbstractMessage;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the SPI to be implemented by a StorageService that handle persistence of messages
|
* Defines the SPI to be implemented by a StorageService that handle persistence of messages
|
||||||
@@ -29,7 +27,8 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
public interface IMessagesStore {
|
public interface IMessagesStore {
|
||||||
|
|
||||||
class StoredMessage implements Serializable {
|
class StoredMessage implements Serializable {
|
||||||
final AbstractMessage.QOSType m_qos;
|
private static final long serialVersionUID = 1L;
|
||||||
|
final AbstractMessage.QOSType m_qos;
|
||||||
final byte[] m_payload;
|
final byte[] m_payload;
|
||||||
final String m_topic;
|
final String m_topic;
|
||||||
private boolean m_retained;
|
private boolean m_retained;
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ import java.io.Serializable;
|
|||||||
* Value object for GUIDs of messages.
|
* Value object for GUIDs of messages.
|
||||||
* */
|
* */
|
||||||
public class MessageGUID implements Serializable {
|
public class MessageGUID implements Serializable {
|
||||||
private final String guid;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private final String guid;
|
||||||
|
|
||||||
public MessageGUID(String guid) {
|
public MessageGUID(String guid) {
|
||||||
this.guid = guid;
|
this.guid = guid;
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import java.nio.ByteBuffer;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Queue;
|
|
||||||
import java.util.concurrent.BlockingQueue;
|
import java.util.concurrent.BlockingQueue;
|
||||||
|
|
||||||
class InternalRepublisher {
|
class InternalRepublisher {
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ public class ProtocolProcessorBootstrapper {
|
|||||||
|
|
||||||
subscriptions.init(m_sessionsStore);
|
subscriptions.init(m_sessionsStore);
|
||||||
|
|
||||||
String configPath = System.getProperty("moquette.path", null);
|
|
||||||
String authenticatorClassName = props.getProperty(BrokerConstants.AUTHENTICATOR_CLASS_NAME, "");
|
String authenticatorClassName = props.getProperty(BrokerConstants.AUTHENTICATOR_CLASS_NAME, "");
|
||||||
|
|
||||||
if (!authenticatorClassName.isEmpty()) {
|
if (!authenticatorClassName.isEmpty()) {
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ public class DBAuthenticator implements IAuthenticator {
|
|||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(DBAuthenticator.class);
|
private static final Logger LOG = LoggerFactory.getLogger(DBAuthenticator.class);
|
||||||
|
|
||||||
private final String sqlQuery;
|
|
||||||
private final MessageDigest messageDigest;
|
private final MessageDigest messageDigest;
|
||||||
private final PreparedStatement preparedStatement;
|
private final PreparedStatement preparedStatement;
|
||||||
|
|
||||||
@@ -44,7 +43,6 @@ public class DBAuthenticator implements IAuthenticator {
|
|||||||
*/
|
*/
|
||||||
public DBAuthenticator(String driver, String jdbcUrl, String sqlQuery, String digestMethod){
|
public DBAuthenticator(String driver, String jdbcUrl, String sqlQuery, String digestMethod){
|
||||||
|
|
||||||
this.sqlQuery = sqlQuery;
|
|
||||||
try {
|
try {
|
||||||
Class.forName(driver);
|
Class.forName(driver);
|
||||||
final Connection connection = DriverManager.getConnection(jdbcUrl);
|
final Connection connection = DriverManager.getConnection(jdbcUrl);
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ package io.moquette.spi.impl.security;
|
|||||||
|
|
||||||
import io.moquette.server.config.IResourceLoader;
|
import io.moquette.server.config.IResourceLoader;
|
||||||
import io.moquette.spi.security.IAuthenticator;
|
import io.moquette.spi.security.IAuthenticator;
|
||||||
import org.apache.commons.codec.binary.Hex;
|
|
||||||
import org.apache.commons.codec.digest.DigestUtils;
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ import io.moquette.spi.ISessionsStore.ClientTopicCouple;
|
|||||||
*/
|
*/
|
||||||
public final class Subscription implements Serializable {
|
public final class Subscription implements Serializable {
|
||||||
|
|
||||||
final QOSType requestedQos; //max QoS acceptable
|
private static final long serialVersionUID = 1L;
|
||||||
|
final QOSType requestedQos; //max QoS acceptable
|
||||||
final String clientId;
|
final String clientId;
|
||||||
final String topicFilter;
|
final String topicFilter;
|
||||||
final boolean active;
|
final boolean active;
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ public class MapDBPersistentStore {
|
|||||||
* a session.
|
* a session.
|
||||||
* */
|
* */
|
||||||
public static class PersistentSession implements Serializable {
|
public static class PersistentSession implements Serializable {
|
||||||
public final boolean cleanSession;
|
private static final long serialVersionUID = 1L;
|
||||||
|
public final boolean cleanSession;
|
||||||
|
|
||||||
public PersistentSession(boolean cleanSession) {
|
public PersistentSession(boolean cleanSession) {
|
||||||
this.cleanSession = cleanSession;
|
this.cleanSession = cleanSession;
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
package io.moquette.spi.persistence;
|
package io.moquette.spi.persistence;
|
||||||
|
|
||||||
import io.moquette.spi.ClientSession;
|
import io.moquette.spi.ClientSession;
|
||||||
import io.moquette.spi.IMessagesStore;
|
|
||||||
import io.moquette.spi.IMessagesStore.StoredMessage;
|
import io.moquette.spi.IMessagesStore.StoredMessage;
|
||||||
import io.moquette.spi.ISessionsStore;
|
import io.moquette.spi.ISessionsStore;
|
||||||
import io.moquette.spi.MessageGUID;
|
import io.moquette.spi.MessageGUID;
|
||||||
|
|||||||
Reference in New Issue
Block a user