*/
public void subscriptionRemove(SubscriptionEvent subscriptionEvent) throws XmlBlasterException {
if (this.topicSet == null && this.clientSet == null) return;
SubscriptionInfo subscriptionInfo = subscriptionEvent.getSubscriptionInfo();
SessionInfo sessionInfo = subscriptionInfo.getSessionInfo();
SessionName sessionName = sessionInfo.getSessionName();
String oid = subscriptionInfo.getKeyOid(); // is null for XPATH
String url = subscriptionInfo.getKeyData().getUrl();
// EXACT subscription recursion detection
if (this.publishDestinationHelper != null && oid != null && oid.equals(this.publishDestinationHelper.getKeyOid())) {
log.info("Ignoring unSubscribe event on topic '" + oid + "' from '" + sessionName.getRelativeName() + "' to avoid recursion");
return;
}
// "/event/unSubscribe"
String event = ContextNode.SEP + "event" + ContextNode.SEP + "unSubscribe";
// "topic/hello/event/unSubscribe"
String foundEvent = ContextNode.TOPIC_MARKER_TAG + ContextNode.SEP + oid + event;
boolean found = true;
if (this.topicSet != null) {
if (!this.topicSet.contains(foundEvent)) {
// "topic/*/event/unSubscribe"
foundEvent = ContextNode.TOPIC_MARKER_TAG + ContextNode.SEP + "*" + event;
if (!this.topicSet.contains(foundEvent)) {
found = false;
}
}
}
if (!found) {
if (this.clientSet == null) return;
if (!this.clientSet.contains(foundEvent)) {
// "client/joe/session/*/event/unSubscribe"
foundEvent = ContextNode.SUBJECT_MARKER_TAG + ContextNode.SEP + sessionName.getLoginName() + ContextNode.SEP + ContextNode.SESSION_MARKER_TAG + ContextNode.SEP + "*" + event;
if (!this.clientSet.contains(foundEvent)) {
// "client/*/session/*/event/unSubscribe"
foundEvent = ContextNode.SUBJECT_MARKER_TAG + ContextNode.SEP + "*" + ContextNode.SEP + ContextNode.SESSION_MARKER_TAG + ContextNode.SEP + "*" + event;
if (!this.clientSet.contains(foundEvent)) {
return;
}
}
}
}
try {
String summary = "unSubscribe of client "
+ sessionInfo.getSessionName().getAbsoluteName()
+ " on topic " + url;
String description = subscriptionInfo.toXml();
String eventType = foundEvent;
String errorCode = null;