Minor change added logging

This commit is contained in:
andrea
2013-12-26 12:48:35 +01:00
parent d259d7c5e7
commit 7695c14598
3 changed files with 9 additions and 2 deletions
@@ -216,14 +216,18 @@ public class HawtDBStorageService implements IStorageService {
}
public void addNewSubscription(Subscription newSubscription, String clientID) {
LOG.debug("addNewSubscription invoked with subscription {} for client {}", newSubscription, clientID);
if (!m_persistentSubscriptions.containsKey(clientID)) {
LOG.debug("clientID {} is a newcome, creating it's subscriptions set", clientID);
m_persistentSubscriptions.put(clientID, new HashSet<Subscription>());
}
Set<Subscription> subs = m_persistentSubscriptions.get(clientID);
if (!subs.contains(newSubscription)) {
LOG.debug("updating clientID {} subscriptions set with new subscription", clientID);
subs.add(newSubscription);
m_persistentSubscriptions.put(clientID, subs);
LOG.debug("clientID {} subscriptions set now is {}", clientID, subs);
}
}
@@ -236,10 +240,12 @@ public class HawtDBStorageService implements IStorageService {
for (Map.Entry<String, Set<Subscription>> entry : m_persistentSubscriptions) {
allSubscriptions.addAll(entry.getValue());
}
LOG.debug("retrieveAllSubscriptions returning subs {}", allSubscriptions);
return allSubscriptions;
}
public void close() {
LOG.debug("closing disk storage");
try {
pageFactory.close();
} catch (IOException ex) {
@@ -236,7 +236,8 @@ class ProtocolProcessor implements EventHandler<ValueEvent> {
* Flood the subscribers with the message to notify. MessageID is optional and should only used for QoS 1 and 2
* */
private void publish2Subscribers(String topic, AbstractMessage.QOSType qos, ByteBuffer message, boolean retain, Integer messageID) {
LOG.debug("publish2Subscribers republishing to existing subscribers that matches the topic {}", topic);
LOG.debug("publish2Subscribers republishing to existing subscribers that matches the topic {}, content", topic);
LOG.debug("content <{}>", new String(message.array()));
if (LOG.isDebugEnabled()) {
LOG.debug("subscription tree {}", subscriptions.dumpTree());
}
@@ -281,6 +282,7 @@ class ProtocolProcessor implements EventHandler<ValueEvent> {
pubMessage.setPayload(message);
LOG.info("send publish message to <{}> on topic <{}>", clientId, topic);
LOG.debug("content <{}>", new String(message.array()));
if (pubMessage.getQos() != AbstractMessage.QOSType.MOST_ONE) {
pubMessage.setMessageID(messageID);
}
@@ -122,7 +122,6 @@ public class SubscriptionsStore {
//log the subscription
String clientID = newSubscription.getClientId();
m_storageService.addNewSubscription(newSubscription, clientID);
// pageFile.flush();
}