}
// The following checks run for each MsgUnit key (not the immutable TopicHandler key)
// Now check if we are master
XmlKey xmlKey = new XmlKey(glob, msgUnit.getKeyData());
for (int ii=0; ii<keyMappings.length; ii++) {
QueryKeyData keyMapping = keyMappings[ii];
/*
if (ii==0) {
// Try to find the DOM parsed XmlKey object:
TopicHandler topicHandler = this.glob.getTopicAccessor().access(msgUnit.getKeyOid());
try {
if (topicHandler != null && topicHandler.hasXmlKey()) {
xmlKey = topicHandler.getXmlKey();
}
else {
xmlKey = new XmlKey(glob, msgUnit.getKeyData());
}
}
finally {
if (topicHandler != null) this.glob.getTopicAccessor().release(topicHandler);
}
}
*/
if (keyMapping.isDomain() && !msgUnit.hasDomain()) {
if (nodeMasterInfo.getClusterNode().isLocalNode()) {
if (nodeMasterInfo.isAcceptDefault()==true) {
// if no domain is specified and the local node accepts default messages -> local node is master
if (log.isLoggable(Level.FINE)) log.fine("Message oid='" + msgUnit.getKeyOid() + "' domain='" + xmlKey.getDomain() + "' is handled by local node");
AccessFilterQos[] filterQos = keyMapping.getAccessFilterArr();
if (filterQos != null && filterQos.length > 0) {
log.warning("<filter> additional check is not implemented: " + keyMapping.toXml());
}
return nodeMasterInfo; // Found the master nodeMasterInfo.getClusterNode();
}
}
else {
if (nodeMasterInfo.isAcceptOtherDefault()==true) {
log.info("Found master='" + nodeMasterInfo.getNodeId().getId() + "' for message oid='" + msgUnit.getKeyOid() + "' which accepts other default domains");
AccessFilterQos[] filterQos = keyMapping.getAccessFilterArr();
if (filterQos != null && filterQos.length > 0) {
log.warning("<filter> additional check is not implemented: " + keyMapping.toXml());
}
return nodeMasterInfo; // Found the master nodeMasterInfo.getClusterNode();
}
}
}
// TODO: If filter has a prepared query cache switched on,
// we should go over the TopicHandlerAccessor to force single threaded match() access
if (xmlKey.match(keyMapping)) {
if (log.isLoggable(Level.FINE)) log.fine("Found master='" + nodeMasterInfo.getNodeId().getId() +
"' stratum=" + nodeMasterInfo.getStratum() + " for message '" + msgUnit.getLogId() +
"' domain='" + xmlKey.getDomain() + "'.");
AccessFilterQos[] filterQos = keyMapping.getAccessFilterArr();
if (filterQos != null && filterQos.length > 0) {
if (log.isLoggable(Level.FINE)) log.fine("Found " + filterQos.length + " key specific filter rules in XmlKey ...");
for (int jj=0; jj<filterQos.length; jj++) {
I_AccessFilter filter = glob.getRequestBroker().getAccessPluginManager().getAccessFilter(