public void configure(IQ originalIQ, DataForm options) {
        boolean wasUnconfigured = isConfigurationPending();
        // Change the subscription configuration based on the completed form
        configure(options);
        if (originalIQ != null) {
            // Return success response
            node.getService().send(IQ.createResultIQ(originalIQ));
        }

        if (wasUnconfigured) {
            // If subscription is pending then send notification to node owners
            // asking to approve the now configured subscription
            if (isAuthorizationPending()) {
                sendAuthorizationRequest();
            }

            // Send last published item (if node is leaf node and subscription status is ok)
            if (node.isSendItemSubscribe() && isActive()) {
                PublishedItem lastItem = node.getLastPublishedItem();
                if (lastItem != null) {
                    sendLastPublishedItem(lastItem);
                }
            }
        }
    }
Configures the subscription based on the sent {@link DataForm} included in the IQ
packet sent by the subscriber. If the subscription was pending of configuration
then the last published item is going to be sent to the subscriber.

The originalIQ parameter may be {@code null} when using this API internally. When no
IQ packet was sent then no IQ result will be sent to the sender. The rest of the
functionality is the same.

@param originalIQ the IQ packet sent by the subscriber to configure his subscription or
       null when using this API internally.
@param options the data form containing the new subscription configuration.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/NodeSubscription.java