broker/IMessagesStore: code formatter used
This commit is contained in:
@@ -13,12 +13,12 @@
|
|||||||
*
|
*
|
||||||
* 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;
|
package io.moquette.spi;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
import io.netty.handler.codec.mqtt.MqttQoS;
|
import io.netty.handler.codec.mqtt.MqttQoS;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -29,13 +29,14 @@ import java.util.Collection;
|
|||||||
public interface IMessagesStore {
|
public interface IMessagesStore {
|
||||||
|
|
||||||
class StoredMessage implements Serializable {
|
class StoredMessage implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1755296138639817304L;
|
private static final long serialVersionUID = 1755296138639817304L;
|
||||||
final MqttQoS m_qos;
|
final MqttQoS 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;
|
||||||
private String m_clientID;
|
private String m_clientID;
|
||||||
//Optional attribute, available only fo QoS 1 and 2
|
// Optional attribute, available only fo QoS 1 and 2
|
||||||
private Integer m_msgID;
|
private Integer m_msgID;
|
||||||
private MessageGUID m_guid;
|
private MessageGUID m_guid;
|
||||||
|
|
||||||
@@ -95,41 +96,42 @@ public interface IMessagesStore {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "PublishEvent{" +
|
return "PublishEvent{" + "m_msgID=" + m_msgID + ", clientID='" + m_clientID + '\'' + ", m_retain="
|
||||||
"m_msgID=" + m_msgID +
|
+ m_retained + ", m_qos=" + m_qos + ", m_topic='" + m_topic + '\'' + '}';
|
||||||
", clientID='" + m_clientID + '\'' +
|
|
||||||
", m_retain=" + m_retained +
|
|
||||||
", m_qos=" + m_qos +
|
|
||||||
", m_topic='" + m_topic + '\'' +
|
|
||||||
'}';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to initialize all persistent store structures
|
* Used to initialize all persistent store structures
|
||||||
* */
|
*/
|
||||||
void initStore();
|
void initStore();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Persist the message.
|
* Persist the message. If the message is empty then the topic is cleaned, else it's stored.
|
||||||
* If the message is empty then the topic is cleaned, else it's stored.
|
*
|
||||||
* @param topic for the retained.
|
* @param topic
|
||||||
* @param guid of the message to mark as retained.
|
* for the retained.
|
||||||
|
* @param guid
|
||||||
|
* of the message to mark as retained.
|
||||||
*/
|
*/
|
||||||
void storeRetained(String topic, MessageGUID guid);
|
void storeRetained(String topic, MessageGUID guid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a list of retained messages that satisfy the condition.
|
* Return a list of retained messages that satisfy the condition.
|
||||||
* @param condition the condition to match during the search.
|
*
|
||||||
|
* @param condition
|
||||||
|
* the condition to match during the search.
|
||||||
* @return the collection of matching messages.
|
* @return the collection of matching messages.
|
||||||
*/
|
*/
|
||||||
Collection<StoredMessage> searchMatching(IMatchingCondition condition);
|
Collection<StoredMessage> searchMatching(IMatchingCondition condition);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Persist the message.
|
* Persist the message.
|
||||||
* @param storedMessage the message to store for future usage.
|
*
|
||||||
|
* @param storedMessage
|
||||||
|
* the message to store for future usage.
|
||||||
* @return the unique id in the storage (guid).
|
* @return the unique id in the storage (guid).
|
||||||
* */
|
*/
|
||||||
MessageGUID storePublishForFuture(StoredMessage storedMessage);
|
MessageGUID storePublishForFuture(StoredMessage storedMessage);
|
||||||
|
|
||||||
void dropMessagesInSession(String clientID);
|
void dropMessagesInSession(String clientID);
|
||||||
|
|||||||
Reference in New Issue
Block a user