public static void blockAccess(String subdomain) throws ModificationNotAllowedException {
        // Alert listeners about this event
        for (ExternalComponentManagerListener listener : listeners) {
            try {
                listener.componentBlocked(subdomain);
            } catch (Exception e) {
                Log.warn("An exception occurred while dispatching a 'componentBlocked' event!", e);
            }
        }
        // Remove any previous configuration for this external component
        deleteConfigurationFromDB(getConfiguration(subdomain, false));
        // Update the database with the new revoked permission
        ExternalComponentConfiguration config = new ExternalComponentConfiguration(subdomain, false, Permission.blocked, null);
        addConfiguration(config);
        // Check if the component was connected and proceed to close the connection
        String domain = subdomain + "." + XMPPServer.getInstance().getServerInfo().getXMPPDomain();
        Session session = SessionManager.getInstance().getComponentSession(domain);
        if (session != null) {
            Log.debug( "Closing session for external component '{}' as the domain is being blocked. Affected session: {}", domain, session );
            session.close();
        }
    }
Blocks an external component from connecting to the local server. If the component was
connected when the permission was revoked then the connection of the entity will be closed.

@param subdomain the subdomain of the external component that is not allowed to connect.
@throws ModificationNotAllowedException if the operation was denied.
xmppserver/src/main/java/org/jivesoftware/openfire/component/ExternalComponentManager.java