public void addValidatedDomain(String domain) {
        if (validatedDomains.add(domain)) {
            // Set the first validated domain as the address of the session
            if (validatedDomains.size() < 2) {
                setAddress(new JID(null, domain, null));
            }
            setStatus(Status.AUTHENTICATED);
            // Register the new validated domain for this server session in SessionManager
            SessionManager.getInstance().registerIncomingServerSession(domain, this);
        }
    }
Adds a new validated domain, subdomain or virtual host to the list of
validated domains for the remote server.

@param domain the new validated domain, subdomain or virtual host to add.
xmppserver/src/main/java/org/jivesoftware/openfire/session/LocalIncomingServerSession.java