Just renames
This commit is contained in:
+4
-4
@@ -16,17 +16,17 @@ import java.util.concurrent.ConcurrentMap;
|
|||||||
|
|
||||||
import static io.moquette.spi.impl.ProtocolProcessor.lowerQosToTheSubscriptionDesired;
|
import static io.moquette.spi.impl.ProtocolProcessor.lowerQosToTheSubscriptionDesired;
|
||||||
|
|
||||||
class MetaPublisher {
|
class MessagesPublisher {
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(MetaPublisher.class);
|
private static final Logger LOG = LoggerFactory.getLogger(MessagesPublisher.class);
|
||||||
private final ConcurrentMap<String, ConnectionDescriptor> connectionDescriptors;
|
private final ConcurrentMap<String, ConnectionDescriptor> connectionDescriptors;
|
||||||
private final ISessionsStore m_sessionsStore;
|
private final ISessionsStore m_sessionsStore;
|
||||||
private final IMessagesStore m_messagesStore;
|
private final IMessagesStore m_messagesStore;
|
||||||
private final BestEffortMessageSender bestEffortSender;
|
private final BestEffortMessageSender bestEffortSender;
|
||||||
private final PersistentQueueMessageSender persistentSender;
|
private final PersistentQueueMessageSender persistentSender;
|
||||||
|
|
||||||
public MetaPublisher(ConcurrentMap<String, ConnectionDescriptor> connectionDescriptors, ISessionsStore sessionsStore,
|
public MessagesPublisher(ConcurrentMap<String, ConnectionDescriptor> connectionDescriptors, ISessionsStore sessionsStore,
|
||||||
IMessagesStore messagesStore) {
|
IMessagesStore messagesStore) {
|
||||||
this.connectionDescriptors = connectionDescriptors;
|
this.connectionDescriptors = connectionDescriptors;
|
||||||
this.m_sessionsStore = sessionsStore;
|
this.m_sessionsStore = sessionsStore;
|
||||||
this.m_messagesStore = messagesStore;
|
this.m_messagesStore = messagesStore;
|
||||||
@@ -136,7 +136,7 @@ public class ProtocolProcessor {
|
|||||||
private Qos0PublishHandler qos0PublishHandler;
|
private Qos0PublishHandler qos0PublishHandler;
|
||||||
private Qos1PublishHandler qos1PublishHandler;
|
private Qos1PublishHandler qos1PublishHandler;
|
||||||
private Qos2PublishHandler qos2PublishHandler;
|
private Qos2PublishHandler qos2PublishHandler;
|
||||||
private MetaPublisher metaPublisher;
|
private MessagesPublisher messagesPublisher;
|
||||||
private InternalRepublisher internalRepublisher;
|
private InternalRepublisher internalRepublisher;
|
||||||
|
|
||||||
//maps clientID to Will testament, if specified on CONNECT
|
//maps clientID to Will testament, if specified on CONNECT
|
||||||
@@ -194,7 +194,7 @@ public class ProtocolProcessor {
|
|||||||
this.qos1PublishHandler = new Qos1PublishHandler(m_authorizator, subscriptions, m_messagesStore,
|
this.qos1PublishHandler = new Qos1PublishHandler(m_authorizator, subscriptions, m_messagesStore,
|
||||||
m_interceptor, this.connectionDescriptors, m_sessionsStore, m_server_port);
|
m_interceptor, this.connectionDescriptors, m_sessionsStore, m_server_port);
|
||||||
|
|
||||||
this.metaPublisher = new MetaPublisher(connectionDescriptors, sessionsStore, m_messagesStore);
|
this.messagesPublisher = new MessagesPublisher(connectionDescriptors, sessionsStore, m_messagesStore);
|
||||||
this.qos2PublishHandler = new Qos2PublishHandler(m_authorizator, subscriptions, m_messagesStore,
|
this.qos2PublishHandler = new Qos2PublishHandler(m_authorizator, subscriptions, m_messagesStore,
|
||||||
m_interceptor, this.connectionDescriptors, m_sessionsStore, m_server_port/*, this.qos2Publisher*/);
|
m_interceptor, this.connectionDescriptors, m_sessionsStore, m_server_port/*, this.qos2Publisher*/);
|
||||||
|
|
||||||
@@ -488,7 +488,7 @@ public class ProtocolProcessor {
|
|||||||
guid = m_messagesStore.storePublishForFuture(toStoreMsg);
|
guid = m_messagesStore.storePublishForFuture(toStoreMsg);
|
||||||
}
|
}
|
||||||
List<Subscription> topicMatchingSubscriptions = subscriptions.matches(topic);
|
List<Subscription> topicMatchingSubscriptions = subscriptions.matches(topic);
|
||||||
this.metaPublisher.publish2Subscribers(toStoreMsg, topicMatchingSubscriptions);
|
this.messagesPublisher.publish2Subscribers(toStoreMsg, topicMatchingSubscriptions);
|
||||||
|
|
||||||
if (!msg.isRetainFlag()) {
|
if (!msg.isRetainFlag()) {
|
||||||
return;
|
return;
|
||||||
@@ -522,7 +522,7 @@ public class ProtocolProcessor {
|
|||||||
String topic = tobeStored.getTopic();
|
String topic = tobeStored.getTopic();
|
||||||
List<Subscription> topicMatchingSubscriptions = subscriptions.matches(topic);
|
List<Subscription> topicMatchingSubscriptions = subscriptions.matches(topic);
|
||||||
|
|
||||||
this.metaPublisher.publish2Subscribers(tobeStored, topicMatchingSubscriptions);
|
this.messagesPublisher.publish2Subscribers(tobeStored, topicMatchingSubscriptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QOSType lowerQosToTheSubscriptionDesired(Subscription sub, QOSType qos) {
|
static QOSType lowerQosToTheSubscriptionDesired(Subscription sub, QOSType qos) {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class Qos0PublishHandler {
|
|||||||
private final SubscriptionsStore subscriptions;
|
private final SubscriptionsStore subscriptions;
|
||||||
private final IMessagesStore m_messagesStore;
|
private final IMessagesStore m_messagesStore;
|
||||||
private final BrokerInterceptor m_interceptor;
|
private final BrokerInterceptor m_interceptor;
|
||||||
private final MetaPublisher metaPublisher;
|
private final MessagesPublisher metaPublisher;
|
||||||
|
|
||||||
public Qos0PublishHandler(IAuthorizator authorizator, SubscriptionsStore subscriptions,
|
public Qos0PublishHandler(IAuthorizator authorizator, SubscriptionsStore subscriptions,
|
||||||
IMessagesStore messagesStore, BrokerInterceptor interceptor, ConcurrentMap<String,
|
IMessagesStore messagesStore, BrokerInterceptor interceptor, ConcurrentMap<String,
|
||||||
@@ -34,7 +34,7 @@ class Qos0PublishHandler {
|
|||||||
this.subscriptions = subscriptions;
|
this.subscriptions = subscriptions;
|
||||||
this.m_messagesStore = messagesStore;
|
this.m_messagesStore = messagesStore;
|
||||||
this.m_interceptor = interceptor;
|
this.m_interceptor = interceptor;
|
||||||
this.metaPublisher = new MetaPublisher(connectionDescriptors, sessionsStore, messagesStore);
|
this.metaPublisher = new MessagesPublisher(connectionDescriptors, sessionsStore, messagesStore);
|
||||||
}
|
}
|
||||||
|
|
||||||
void receivedPublishQos0(Channel channel, PublishMessage msg) {
|
void receivedPublishQos0(Channel channel, PublishMessage msg) {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class Qos1PublishHandler {
|
|||||||
private final BrokerInterceptor m_interceptor;
|
private final BrokerInterceptor m_interceptor;
|
||||||
private final ConcurrentMap<String, ConnectionDescriptor> connectionDescriptors;
|
private final ConcurrentMap<String, ConnectionDescriptor> connectionDescriptors;
|
||||||
private final String brokerPort;
|
private final String brokerPort;
|
||||||
private final MetaPublisher metaPublisher;
|
private final MessagesPublisher metaPublisher;
|
||||||
|
|
||||||
public Qos1PublishHandler(IAuthorizator authorizator, SubscriptionsStore subscriptions,
|
public Qos1PublishHandler(IAuthorizator authorizator, SubscriptionsStore subscriptions,
|
||||||
IMessagesStore messagesStore, BrokerInterceptor interceptor, ConcurrentMap<String,
|
IMessagesStore messagesStore, BrokerInterceptor interceptor, ConcurrentMap<String,
|
||||||
@@ -39,7 +39,7 @@ class Qos1PublishHandler {
|
|||||||
this.m_interceptor = interceptor;
|
this.m_interceptor = interceptor;
|
||||||
this.connectionDescriptors = connectionDescriptors;
|
this.connectionDescriptors = connectionDescriptors;
|
||||||
this.brokerPort = brokerPort;
|
this.brokerPort = brokerPort;
|
||||||
this.metaPublisher = new MetaPublisher(connectionDescriptors, sessionsStore, messagesStore);
|
this.metaPublisher = new MessagesPublisher(connectionDescriptors, sessionsStore, messagesStore);
|
||||||
}
|
}
|
||||||
|
|
||||||
void receivedPublishQos1(Channel channel, PublishMessage msg) {
|
void receivedPublishQos1(Channel channel, PublishMessage msg) {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class Qos2PublishHandler {
|
|||||||
private final ConcurrentMap<String, ConnectionDescriptor> connectionDescriptors;
|
private final ConcurrentMap<String, ConnectionDescriptor> connectionDescriptors;
|
||||||
private final ISessionsStore m_sessionsStore;
|
private final ISessionsStore m_sessionsStore;
|
||||||
private final String brokerPort;
|
private final String brokerPort;
|
||||||
private final MetaPublisher metaPublisher;
|
private final MessagesPublisher metaPublisher;
|
||||||
|
|
||||||
public Qos2PublishHandler(IAuthorizator authorizator, SubscriptionsStore subscriptions,
|
public Qos2PublishHandler(IAuthorizator authorizator, SubscriptionsStore subscriptions,
|
||||||
IMessagesStore messagesStore, BrokerInterceptor interceptor, ConcurrentMap<String,
|
IMessagesStore messagesStore, BrokerInterceptor interceptor, ConcurrentMap<String,
|
||||||
@@ -43,7 +43,7 @@ class Qos2PublishHandler {
|
|||||||
this.connectionDescriptors = connectionDescriptors;
|
this.connectionDescriptors = connectionDescriptors;
|
||||||
this.m_sessionsStore = sessionsStore;
|
this.m_sessionsStore = sessionsStore;
|
||||||
this.brokerPort = brokerPort;
|
this.brokerPort = brokerPort;
|
||||||
this.metaPublisher = new MetaPublisher(connectionDescriptors, sessionsStore, messagesStore);
|
this.metaPublisher = new MessagesPublisher(connectionDescriptors, sessionsStore, messagesStore);
|
||||||
}
|
}
|
||||||
|
|
||||||
void receivedPublishQos2(Channel channel, PublishMessage msg) {
|
void receivedPublishQos2(Channel channel, PublishMessage msg) {
|
||||||
|
|||||||
Reference in New Issue
Block a user