completeRequest(ack.messageId(), UNSUBSCRIBE.TYPE, null); break;
public void onUnSubscribe(UNSUBSCRIBE command) throws MQTTProtocolException { checkConnected(); if (command.qos() != QoS.AT_LEAST_ONCE && (version != V3_1 || publishDollarTopics != true)) { throw new MQTTProtocolException("Failed to process unsubscribe request", true, new Exception("UNSUBSCRIBE frame not properly formatted, QoS")); } UTF8Buffer[] topics = command.topics(); if (topics != null) { for (UTF8Buffer topic : topics) { MQTTProtocolSupport.validate(topic.toString()); try { findSubscriptionStrategy().onUnSubscribe(topic.toString()); } catch (IOException e) { throw new MQTTProtocolException("Failed to process unsubscribe request", true, e); } } UNSUBACK ack = new UNSUBACK(); ack.messageId(command.messageId()); sendToMQTT(ack.encode()); } else { LOG.warn("No topics defined for Subscription " + command); throw new MQTTProtocolException("UNSUBSCRIBE command received with no topic filter"); } }
public void onUnSubscribe(UNSUBSCRIBE command) throws MQTTProtocolException { checkConnected(); if (command.qos() != QoS.AT_LEAST_ONCE && (version != V3_1 || publishDollarTopics != true)) { throw new MQTTProtocolException("Failed to process unsubscribe request", true, new Exception("UNSUBSCRIBE frame not properly formatted, QoS")); } UTF8Buffer[] topics = command.topics(); if (topics != null) { for (UTF8Buffer topic : topics) { MQTTProtocolSupport.validate(topic.toString()); try { findSubscriptionStrategy().onUnSubscribe(topic.toString()); } catch (IOException e) { throw new MQTTProtocolException("Failed to process unsubscribe request", true, e); } } UNSUBACK ack = new UNSUBACK(); ack.messageId(command.messageId()); sendToMQTT(ack.encode()); } else { LOG.warn("No topics defined for Subscription " + command); throw new MQTTProtocolException("UNSUBSCRIBE command received with no topic filter"); } }
public void onUnSubscribe(UNSUBSCRIBE command) throws MQTTProtocolException { checkConnected(); if (command.qos() != QoS.AT_LEAST_ONCE && (version != V3_1 || publishDollarTopics != true)) { throw new MQTTProtocolException("Failed to process unsubscribe request", true, new Exception("UNSUBSCRIBE frame not properly formatted, QoS")); } UTF8Buffer[] topics = command.topics(); if (topics != null) { for (UTF8Buffer topic : topics) { MQTTProtocolSupport.validate(topic.toString()); try { findSubscriptionStrategy().onUnSubscribe(topic.toString()); } catch (IOException e) { throw new MQTTProtocolException("Failed to process unsubscribe request", true, e); } } UNSUBACK ack = new UNSUBACK(); ack.messageId(command.messageId()); sendToMQTT(ack.encode()); } else { LOG.warn("No topics defined for Subscription " + command); throw new MQTTProtocolException("UNSUBSCRIBE command received with no topic filter"); } }
public void onUnSubscribe(UNSUBSCRIBE command) throws MQTTProtocolException { checkConnected(); UTF8Buffer[] topics = command.topics(); if (topics != null) { for (UTF8Buffer topic : topics) { try { onUnSubscribe(topic.toString()); } catch (IOException e) { throw new MQTTProtocolException("Failed to process unsubscribe request", true, e); } } } UNSUBACK ack = new UNSUBACK(); ack.messageId(command.messageId()); sendToMQTT(ack.encode()); }
public void onUnSubscribe(UNSUBSCRIBE command) throws MQTTProtocolException { checkConnected(); UTF8Buffer[] topics = command.topics(); if (topics != null) { for (UTF8Buffer topic : topics) { try { onUnSubscribe(topic.toString()); } catch (IOException e) { throw new MQTTProtocolException("Failed to process unsubscribe request", true, e); } } } UNSUBACK ack = new UNSUBACK(); ack.messageId(command.messageId()); sendToMQTT(ack.encode()); }
completeRequest(ack.messageId(), UNSUBSCRIBE.TYPE, null); break;