@Override
    public void leftCluster(byte[] nodeID) {
        // Another node left the cluster.
        //
        // If the cluster node leaves in an orderly fashion, it might have broadcasted
        // the necessary events itself. This cannot be depended on, as the cluster node
        // might have disconnected unexpectedly (as a result of a crash or network issue).
        //
        // Determine what data was available only on that node, and remove that.
        //
        // All remaining cluster nodes will be in a race to clean up the
        // same data. The implementation below accounts for that, by only having the
        // senior cluster node to perform the cleanup.
        if (ClusterManager.isSeniorClusterMember()) {
            NodeID leftNode = NodeID.getInstance(nodeID);
            for (Map.Entry<String, ClusteredServerItem> entry : serverItems.entrySet()) {
                String jid = entry.getKey();
                Lock lock = serverItems.getLock(jid);
                lock.lock();
                try {
                    ClusteredServerItem item = entry.getValue();
                    if (item.nodes.remove(leftNode)) {
                        // Update the cache with latest info
                        if (item.nodes.isEmpty()) {
                            serverItems.remove(jid);
                        }
                        else {
                            serverItems.put(jid, item);
                        }
                    }
                }
                finally {
                    lock.unlock();
                }
            }
        }
    }
Removes a disco item for a component that has been removed from the server.

@param jid the jid of the component being removed.
xmppserver/src/main/java/org/jivesoftware/openfire/disco/IQDiscoItemsHandler.java