Commit 6cbada6b authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Added checking that newly registerd component is not overriding an already taken domain. JM-612

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3644 b35dd754-fafc-0310-a699-88a17e54d16e
parent 8804cfd4
...@@ -77,6 +77,12 @@ public class InternalComponentManager implements ComponentManager, RoutableChann ...@@ -77,6 +77,12 @@ public class InternalComponentManager implements ComponentManager, RoutableChann
} }
public void addComponent(String subdomain, Component component) throws ComponentException { public void addComponent(String subdomain, Component component) throws ComponentException {
// Check that the requested subdoman is not taken by another component
Component existingComponent = components.get(subdomain);
if (existingComponent != null && existingComponent != component) {
throw new ComponentException("Domain already taken by another component");
}
// Register that the domain is now taken by the component
components.put(subdomain, component); components.put(subdomain, component);
JID componentJID = new JID(subdomain + "." + serverDomain); JID componentJID = new JID(subdomain + "." + serverDomain);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment