private void renewSubscription()

in modules/core/src/main/java/org/apache/savan/eventing/client/EventingClient.java [88:119]


    private void renewSubscription(String expirationString, String subscriptionID)
            throws Exception {
        SubscriptionResponseData data =
                (SubscriptionResponseData)subscriptionDataMap.get(subscriptionID);
        EndpointReference managerEPR = data.getSubscriptionManager();
        if (managerEPR == null)
            throw new Exception("Manager EPR is not set");

        Options options = serviceClient.getOptions();
        if (options == null) {
            options = new Options();
            serviceClient.setOptions(options);
        }

        String SOAPVersion = options.getSoapVersionURI();
        if (SOAPVersion == null)
            SOAPVersion = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;

        SOAPEnvelope envelope = createRenewSubscriptionEnvelope(expirationString, SOAPVersion);

        String oldAction = options.getAction();
        String action = EventingConstants.Actions.Renew;
        options.setAction(action);

        EndpointReference oldTo = serviceClient.getOptions().getTo();
        options.setTo(managerEPR);

        OMElement renewResponse = serviceClient.sendReceive(envelope.getBody().getFirstElement());

        options.setAction(oldAction);
        options.setTo(oldTo);
    }