Moved inner class StoredMessage from SimpleMsessaging to HawtDBStorageService
This commit is contained in:
@@ -4,7 +4,7 @@ import org.dna.mqtt.moquette.messaging.spi.impl.SimpleMessaging;
|
||||
import org.dna.mqtt.moquette.messaging.spi.impl.Subscription;
|
||||
import org.dna.mqtt.moquette.messaging.spi.impl.events.PublishEvent;
|
||||
import org.dna.mqtt.moquette.proto.messages.AbstractMessage;
|
||||
import static org.dna.mqtt.moquette.messaging.spi.impl.SimpleMessaging.StoredMessage;
|
||||
import static org.dna.mqtt.moquette.messaging.spi.impl.HawtDBStorageService.StoredMessage;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
+20
-2
@@ -13,16 +13,34 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
import static org.dna.mqtt.moquette.messaging.spi.impl.SimpleMessaging.StoredMessage;
|
||||
|
||||
|
||||
/**
|
||||
* Implementation of IStorageService backed by HawtDB
|
||||
*/
|
||||
public class HawtDBStorageService implements IStorageService {
|
||||
|
||||
public static class StoredMessage implements Serializable {
|
||||
AbstractMessage.QOSType m_qos;
|
||||
byte[] m_payload;
|
||||
|
||||
StoredMessage(byte[] message, AbstractMessage.QOSType qos) {
|
||||
m_qos = qos;
|
||||
m_payload = message;
|
||||
}
|
||||
|
||||
AbstractMessage.QOSType getQos() {
|
||||
return m_qos;
|
||||
}
|
||||
|
||||
byte[] getPayload() {
|
||||
return m_payload;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(HawtDBStorageService.class);
|
||||
|
||||
private MultiIndexFactory m_multiIndexFactory;
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.dna.mqtt.moquette.server.Constants;
|
||||
import org.dna.mqtt.moquette.server.IAuthenticator;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.dna.mqtt.moquette.messaging.spi.impl.HawtDBStorageService.StoredMessage;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -37,25 +38,6 @@ import org.slf4j.LoggerFactory;
|
||||
*/
|
||||
public class SimpleMessaging implements IMessaging, EventHandler<ValueEvent> {
|
||||
|
||||
//TODO probably move this
|
||||
public static class StoredMessage implements Serializable {
|
||||
QOSType m_qos;
|
||||
byte[] m_payload;
|
||||
|
||||
StoredMessage(byte[] message, QOSType qos) {
|
||||
m_qos = qos;
|
||||
m_payload = message;
|
||||
}
|
||||
|
||||
QOSType getQos() {
|
||||
return m_qos;
|
||||
}
|
||||
|
||||
byte[] getPayload() {
|
||||
return m_payload;
|
||||
}
|
||||
}
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SimpleMessaging.class);
|
||||
|
||||
private SubscriptionsStore subscriptions = new SubscriptionsStore();
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ public class DummyStorageService implements IStorageService {
|
||||
//To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
public Collection<SimpleMessaging.StoredMessage> searchMatching(IMatchingCondition condition) {
|
||||
public Collection<HawtDBStorageService.StoredMessage> searchMatching(IMatchingCondition condition) {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user