When I try to register a component with relative domain name “rsearch.realms”, the component gets the disco#info message and sends a reply advertising its functionality, still that reply gets discarded because the ComponentManager cannot map the fully qualified domain name to the relative domain name used in InternalComponentManager.
A possible fix for this problem would be to store the components keyed by fully qualified domain name. This would require changes in addComponent() and removeComponent() to append the XMPP base domain name. And getComponent() would be simplified to this:
public Component getComponent(JID componentJID) {
Component c = components.get(jid.toString());
if (c==null) return components.get(jid.toString() + “.” + serverDomain);
}
/code
If we want to keep the mapping keys as relative domain names, I suggest we change the getComponent() to:
public Component getComponent(JID componentJID) {
String jid = componentJID.toBareJID();
if (components.containsKey(jid)) {
return components.get(jid);
}
else {
if (!jid.contains(serverDomain)) {
// Ignore JIDs that doesn’'t belong to this server
return null;
}
String serverName = new JID(jid).getDomain();
int index = serverName.indexOf("." + serverDomain); // MODIFIED: added serverDomain
if (index != -1) {
jid = serverName.substring(0, index);
}
}
return components.get(jid);
}
/code
(org.jivesoftware.wildfire.component.InternalComponentManager, line 226, version #3229)