@Override
    public void run()
    {
        // Note: this implementation should apply changes in-memory state only. It explicitly needs not update
        // persisted data storage, as this can be expected to be done by the cluster node that issued this task.
        // Applying such changes in this task would, at best, needlessly require resources.
        log.debug("[TASK] Modify subscription : {}", toString());

        final Optional<Node> optNode = getNodeIfLoaded();

        // This will only occur if a PEP service is not loaded on this particular cluster node. We can safely do nothing
        // in this case since any changes that might have been applied here will also have been applied to the database
        // by the cluster node where this task originated, meaning that those changes get loaded from the database when
        // the pubsub node is retrieved from the database in the future (OF-2077)
        if (optNode.isEmpty()) {
            return;
        }

        final Node node = optNode.get();

        // Forcefully (re)load the subscription from the database, which resets any in-memory representation.
        // TODO OF-2140 Remove database interaction. Instead of reloading, modify the existing in-memory representation with data from this task.
        XMPPServer.getInstance().getPubSubModule().getPersistenceProvider().loadSubscription(node, getSubscriptionId());
    }
Constructs a new task that modifies a subscription to a pubsub node.

@param subscription The to-be-modified subscription
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/cluster/ModifySubscriptionTask.java