String str = msgUnit.getContentStr().trim();
// clear sessionName="" prefix=""
String[] cmdArr = ReplaceVariable.toArray(str, " ");
String command = (cmdArr.length > 0) ? cmdArr[0] : "";
boolean isForOtherClusterNode = false;
SessionName otherSessionName = publishQos.getFirstDestination();
// __sessionName is deprecated, pls use PtP destination to name the session for remoteProperty changes
String __sessionNameStr = publishQos.getData().getClientProperty("__sessionName", (String)null);
if (__sessionNameStr != null) {
otherSessionName = new SessionName(glob, __sessionNameStr);
}
if (glob.useCluster() && otherSessionName != null && otherSessionName.getNodeId() != null && !glob.getNodeId().equals(otherSessionName.getNodeId())) {
isForOtherClusterNode = true; // TODO: Create a PtP destination which routes to node
}
if (!isForOtherClusterNode) {
SessionInfo otherSessionInfo = (otherSessionName == null) ? sessionInfo : getAuthenticate().getSessionInfo(otherSessionName);
if (otherSessionInfo == null) {
if ("clearLastError".equals(command) || "clearLastWarning".equals(command)) {
otherSessionInfo = sessionInfo; // global action, just use the login sessionInf
}
else {
log.warning(msgKeyData.getOid() + " failed, sessionName not known: " + (otherSessionName == null ? "" : otherSessionName.getAbsoluteName()));
return Constants.RET_WARN;
}
}
if (__sessionNameStr != null) publishQos.getData().getClientProperties().remove("__sessionName");
String prefix = publishQos.getData().getClientProperty("__prefix", (String)null);