String nodeId = globalThree.getDatabaseNodeStr();
// MethodName: "publish", "subscribe"
// String relatingType = entry.getEmbeddedType();
// "connection_clientsubscriber1"
String queueName = entry.getStorageId().getOldPostfix();
StorageId oldStorageId = StorageId.valueOf(globalOne, queueName);
// "connection"
String relating = oldStorageId.getXBStore().getType();
// reset nodeId to ""
// nodeId = oldStorageId.getXBStore().getNode();
StorageId storageId = null;
// sn is most time null
SessionName sender = entry.getSender();// entry.getMsgUnit().getQosData().getSender();
SessionName receiver = entry.getReceiver();
SessionName guessed = SessionName.guessSessionName(globalOne, null, queueName,
limitPositivePubToOneDigit);
if (receiver != null && receiver.isNodeIdExplicitlyGiven())
nodeId = receiver.getNodeIdStr();
else if (guessed != null && guessed.isNodeIdExplicitlyGiven())
nodeId = guessed.getNodeIdStr();
// else if (sn != null)
// nodeId = sn.getNodeIdStr();
// if (sn != null) {
// storageId = new StorageId(globalThree, nodeId, relating,
// sn);
// } else {
// xb_entries.queueName="connection_clientpublisherToHeron2"
// --->
// xbstore.xbpostfix="client/publisherToHeron/2"
SessionName sn = SessionName.guessSessionName(globalOne, nodeId, queueName,
limitPositivePubToOneDigit);
storageId = new StorageId(globalThree, nodeId, relating, sn);
// }
logToFile("storageId=" + storageId.getXBStore().toString() + " from: nodeId=" + nodeId + "sender="
+ (sender == null ? null : sender.getAbsoluteName()) + " receiver="
+ (receiver == null ? null : receiver.getAbsoluteName()) + " guessed="
+ (guessed == null ? null : guessed.getAbsoluteName()));
XBStore xbStore = getXBStore(dbAccessorClientThree, globalThree, storageId);
entry.getStorageId().getXBStore().setPostfix(storageId.getXBStore().getPostfix());
dbAccessorClientThree.addEntry(xbStore, entry);
processed++;
if ((processed % 1000) == 0)
logToFile(queueNamePattern + " [processed=" + processed + "] processing ...");
totalProcessed++;