@Override
            public Iterator<Element> getIdentities(String name, String node, JID senderJID) {
                if (node != null && serverNodeProviders.get(node) != null) {
                    // Redirect the request to the disco info provider of the specified node
                    return serverNodeProviders.get(node).getIdentities(name, node, senderJID);
                }
                if (name == null || name.equals(XMPPServer.getInstance().getServerInfo().getXMPPDomain())) {
                    // Answer identity of the server itself.
                    final ArrayList<Element> identities = new ArrayList<>();
                    final Element identity = DocumentHelper.createElement("identity");
                    identity.addAttribute("category", "server");
                    identity.addAttribute("name", JiveGlobals.getProperty("xmpp.server.name", "Openfire Server"));
                    identity.addAttribute("type", "im");
                    identities.add(identity);

                    // Include identities from modules that implement ServerIdentitiesProvider
                    for (ServerIdentitiesProvider provider : serverIdentityProviders )
                    {
                        final Iterator<Element> iterator = provider.getIdentities();
                        while ( iterator.hasNext() )
                        {
                            identities.add( iterator.next() );
                        }
                    }
                    return identities.iterator();
                }
                else if (node != null) {
                    return XMPPServer.getInstance().getIQPEPHandler().getIdentities(name, node, senderJID);
                }
                else {
                    // Answer with identities of users of the server.
                    final Collection<UserIdentitiesProvider> providers;
                    if (SessionManager.getInstance().isAnonymousClientSession(name))
                    {
                        // Answer identity of an anonymous user.
                        providers = anonymousUserIdentityProviders;
                    }
                    else
                    {
                        // Answer identity of a registered user.
                        // Note: We know that this user exists because #hasInfo returned true
                        providers = registeredUserIdentityProviders;
                    }

                    final Set<Element> result = new HashSet<>();
                    for ( final UserIdentitiesProvider provider : providers )
                    {
                        final Iterator<Element> identities = provider.getIdentities();
                        while ( identities.hasNext() )
                        {
                            result.add( identities.next() );
                        }
                    }
                    return result.iterator();
                }
            }
Returns the DiscoInfoProvider responsible for providing information at the server level. This
means that this DiscoInfoProvider will provide information whenever a disco request whose
recipient JID is the server (e.g. localhost) is made.

@return the DiscoInfoProvider responsible for providing information at the server level.
xmppserver/src/main/java/org/jivesoftware/openfire/disco/IQDiscoInfoHandler.java