@Override
                        public void receivedAnswer(final IQ packet) {
                            final JID from = packet.getFrom();
                            // Assume that the user is not a registered user
                            Boolean isRegistered = Boolean.FALSE;
                            // Analyze the disco result packet
                            if (IQ.Type.result == packet.getType()) {
                                final Element child = packet.getChildElement();
                                if (child != null) {
                                    for (final Iterator<Element> it = child.elementIterator("identity"); it.hasNext();) {
                                        final Element identity = it.next();
                                        final String accountType = identity.attributeValue("type");
                                        if ("registered".equals(accountType) || "admin".equals(accountType)) {
                                            isRegistered = Boolean.TRUE;
                                            break;
                                        }
                                    }
                                }
                            }
                            // Update cache of remote registered users
                            remoteUsersCache.put(from.toBareJID(), isRegistered);
                            completionSemaphore.release();
                        }
Returns true if the specified JID belongs to a local or remote registered user. If allowed by the 'checkRemoteDomains',
argument, for remote users (i.e. domain does not match local domain) a disco#info request is going to be sent to
the bare JID of the user. If 'checkRemoteDomains' is false, this method will return 'false' for all JIDs of which the
domain-part does not match the local domain.

<p>WARNING: If the supplied JID could be a remote user and the disco#info result packet comes back on the same
thread as the one the calls this method then it will not be processed, and this method will block for 60 seconds
by default. To change the timeout, update the system property <code>usermanager.remote-disco-info-timeout-seconds</code>

@param user to JID of the user to check it it's a registered user.
@param checkRemoteDomains false the lookup is allowed to include calls to remote XMPP domains.
@return true if the specified JID belongs to a registered user.
xmppserver/src/main/java/org/jivesoftware/openfire/user/UserManager.java