private boolean canSendEvents() {
        // Check if the subscription is active
        if (!isActive()) {
            Log.trace("Cannot send any events: subscription is not active.");
            return false;
        }
        // Check if delivery of notifications is disabled
        if (!shouldDeliverNotifications()) {
            Log.trace("Cannot send any events: delivery of notifications is disabled.");
            return false;
        }
        // Check if delivery is subject to presence-based policy
        if (!getPresenceStates().isEmpty()) {
            Collection<String> shows = node.getService().getShowPresences(jid);
            if (shows.isEmpty() || Collections.disjoint(getPresenceStates(), shows)) {
                Log.trace("Cannot send any events: delivery is subject to presence-based policy that currently does not apply.");
                return false;
            }
        }
        // Check if node is only sending events when user is online
        if (node.isPresenceBasedDelivery()) {
            // Check that user is online
            if (node.getService().getShowPresences(jid).isEmpty())
            {
                Log.trace("Cannot send any events: node is only sending events when user is online (and they're not).");
                return false;
            }
        }

        Log.trace("Can send generic node events.");
        return true;
    }
Returns true if events in general can be sent. This method checks basic
conditions common to all type of event notifications (e.g. item was published,
node configuration has changed, new child node was added to collection node, etc.).

@return true if events in general can be sent.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/NodeSubscription.java