Minor change, removed commented code added a comment
This commit is contained in:
@@ -21,12 +21,6 @@ public interface IMessaging {
|
|||||||
|
|
||||||
void stop();
|
void stop();
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the clientID from topic subscription, if not previously subscribed,
|
|
||||||
* doesn't reply any error
|
|
||||||
*/
|
|
||||||
//void unsubscribe(String topic, String clientID);
|
|
||||||
|
|
||||||
void disconnect(IoSession session);
|
void disconnect(IoSession session);
|
||||||
|
|
||||||
void republishStored(String clientID);
|
void republishStored(String clientID);
|
||||||
|
|||||||
@@ -114,14 +114,6 @@ public class SimpleMessaging implements IMessaging, EventHandler<ValueEvent> {
|
|||||||
m_ringBuffer.publish(sequence);
|
m_ringBuffer.publish(sequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
public void publish(String topic, byte[] message, QOSType qos, boolean retain, String clientID, IoSession session) {
|
|
||||||
disruptorPublish(new PublishEvent(topic, qos, message, retain, clientID, session));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void publish(String topic, byte[] message, QOSType qos, boolean retain, String clientID, int messageID, IoSession session) {
|
|
||||||
disruptorPublish(new PublishEvent(topic, qos, message, retain, clientID, messageID, session));
|
|
||||||
} */
|
|
||||||
|
|
||||||
public void subscribe(String clientId, String topic, QOSType qos, boolean cleanSession, int messageID) {
|
public void subscribe(String clientId, String topic, QOSType qos, boolean cleanSession, int messageID) {
|
||||||
Subscription newSubscription = new Subscription(clientId, topic, qos, cleanSession);
|
Subscription newSubscription = new Subscription(clientId, topic, qos, cleanSession);
|
||||||
@@ -129,12 +121,7 @@ public class SimpleMessaging implements IMessaging, EventHandler<ValueEvent> {
|
|||||||
disruptorPublish(new SubscribeEvent(newSubscription, messageID));
|
disruptorPublish(new SubscribeEvent(newSubscription, messageID));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*public void unsubscribe(String topic, String clientID) {
|
|
||||||
disruptorPublish(new UnsubscribeEvent(topic, clientID));
|
|
||||||
} */
|
|
||||||
|
|
||||||
|
|
||||||
public void disconnect(IoSession session) {
|
public void disconnect(IoSession session) {
|
||||||
disruptorPublish(new DisconnectEvent(session));
|
disruptorPublish(new DisconnectEvent(session));
|
||||||
}
|
}
|
||||||
@@ -422,7 +409,11 @@ public class SimpleMessaging implements IMessaging, EventHandler<ValueEvent> {
|
|||||||
// IoSession session = m_clientIDs.get(evt.getSubscription().clientId).getSession();
|
// IoSession session = m_clientIDs.get(evt.getSubscription().clientId).getSession();
|
||||||
// session.write(ackMessage).awaitUninterruptibly();
|
// session.write(ackMessage).awaitUninterruptibly();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the clientID from topic subscription, if not previously subscribed,
|
||||||
|
* doesn't reply any error
|
||||||
|
*/
|
||||||
protected void processUnsubscribe(IoSession session, String clientID, List<String> topics, int messageID) {
|
protected void processUnsubscribe(IoSession session, String clientID, List<String> topics, int messageID) {
|
||||||
LOG.debug("processSubscribe invoked");
|
LOG.debug("processSubscribe invoked");
|
||||||
|
|
||||||
|
|||||||
@@ -88,17 +88,6 @@ public class MQTTHandler extends IoHandlerAdapter {
|
|||||||
private void handleUnsubscribe(IoSession session, UnsubscribeMessage msg) {
|
private void handleUnsubscribe(IoSession session, UnsubscribeMessage msg) {
|
||||||
LOG.info("unregistering the subscriptions");
|
LOG.info("unregistering the subscriptions");
|
||||||
m_messaging.handleProtocolMessage(session, msg);
|
m_messaging.handleProtocolMessage(session, msg);
|
||||||
|
|
||||||
|
|
||||||
/*for (String topic : msg.topics()) {
|
|
||||||
m_messaging.unsubscribe(topic, (String) session.getAttribute(Constants.ATTR_CLIENTID));
|
|
||||||
}
|
|
||||||
//ack the client
|
|
||||||
UnsubAckMessage ackMessage = new UnsubAckMessage();
|
|
||||||
ackMessage.setMessageID(msg.getMessageID());
|
|
||||||
|
|
||||||
LOG.info("replying with UnsubAck to MSG ID {0}", msg.getMessageID());
|
|
||||||
session.write(ackMessage); */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void handlePublish(IoSession session, PublishMessage message) {
|
protected void handlePublish(IoSession session, PublishMessage message) {
|
||||||
|
|||||||
Reference in New Issue
Block a user