public void process(PubSubService service, Presence presence) {
        if (presence.isAvailable()) {
            JID subscriber = presence.getFrom();
            Map<JID, String> fullPresences = service.getSubscriberPresences().get(subscriber.asBareJID());
            if (fullPresences == null) {
                synchronized (userMutex.intern(subscriber.asBareJID())) {
                    fullPresences = service.getSubscriberPresences().get(subscriber.asBareJID());
                    if (fullPresences == null) {
                        fullPresences = new ConcurrentHashMap<>();
                        service.getSubscriberPresences().put(subscriber.asBareJID(), fullPresences);
                    }
                }
            }
            Presence.Show show = presence.getShow();
            fullPresences.put(subscriber, show == null ? "online" : show.name());
        }
        else if (presence.getType() == Presence.Type.unavailable) {
            JID subscriber = presence.getFrom();
            Map<JID, String> fullPresences = service.getSubscriberPresences().get(subscriber.asBareJID());
            if (fullPresences != null) {
                fullPresences.remove(subscriber);
                if (fullPresences.isEmpty()) {
                    service.getSubscriberPresences().remove(subscriber.asBareJID());
                }
            }
        }
    }
Handles Presence packets sent to the pubsub service. Only process available and not
available presences.

@param service the PubSub service this action is to be performed for.
@param presence the Presence packet sent to the pubsub service.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/PubSubEngine.java