broker/Subscription: code formatter used
This commit is contained in:
@@ -13,28 +13,27 @@
|
|||||||
*
|
*
|
||||||
* You may elect to redistribute this code under either of these licenses.
|
* You may elect to redistribute this code under either of these licenses.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.moquette.spi.impl.subscriptions;
|
package io.moquette.spi.impl.subscriptions;
|
||||||
|
|
||||||
import io.moquette.spi.ISessionsStore.ClientTopicCouple;
|
import io.moquette.spi.ISessionsStore.ClientTopicCouple;
|
||||||
import io.netty.handler.codec.mqtt.MqttQoS;
|
import io.netty.handler.codec.mqtt.MqttQoS;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maintain the information about which Topic a certain ClientID is subscribed
|
* Maintain the information about which Topic a certain ClientID is subscribed and at which QoS
|
||||||
* and at which QoS
|
*
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @author andrea
|
* @author andrea
|
||||||
*/
|
*/
|
||||||
public final class Subscription implements Serializable {
|
public final class Subscription implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -3383457629635732794L;
|
private static final long serialVersionUID = -3383457629635732794L;
|
||||||
final MqttQoS requestedQos; //max QoS acceptable
|
final MqttQoS requestedQos; // max QoS acceptable
|
||||||
final String clientId;
|
final String clientId;
|
||||||
final String topicFilter;
|
final String topicFilter;
|
||||||
final boolean active;
|
final boolean active;
|
||||||
|
|
||||||
public Subscription(String clientId, String topicFilter, MqttQoS requestedQos) {
|
public Subscription(String clientId, String topicFilter, MqttQoS requestedQos) {
|
||||||
this.requestedQos = requestedQos;
|
this.requestedQos = requestedQos;
|
||||||
this.clientId = clientId;
|
this.clientId = clientId;
|
||||||
@@ -67,12 +66,15 @@ public final class Subscription implements Serializable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o)
|
||||||
if (o == null || getClass() != o.getClass()) return false;
|
return true;
|
||||||
|
if (o == null || getClass() != o.getClass())
|
||||||
|
return false;
|
||||||
|
|
||||||
Subscription that = (Subscription) o;
|
Subscription that = (Subscription) o;
|
||||||
|
|
||||||
if (clientId != null ? !clientId.equals(that.clientId) : that.clientId != null) return false;
|
if (clientId != null ? !clientId.equals(that.clientId) : that.clientId != null)
|
||||||
|
return false;
|
||||||
return !(topicFilter != null ? !topicFilter.equals(that.topicFilter) : that.topicFilter != null);
|
return !(topicFilter != null ? !topicFilter.equals(that.topicFilter) : that.topicFilter != null);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -86,8 +88,12 @@ public final class Subscription implements Serializable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return String.format("[filter:%s, cliID: %s, qos: %s, active: %s]", this.topicFilter, this.clientId,
|
return String.format(
|
||||||
this.requestedQos, this.active);
|
"[filter:%s, cliID: %s, qos: %s, active: %s]",
|
||||||
|
this.topicFilter,
|
||||||
|
this.clientId,
|
||||||
|
this.requestedQos,
|
||||||
|
this.active);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user