Package com.volantis.xml.pipeline.sax.drivers.web

Examples of com.volantis.xml.pipeline.sax.drivers.web.HTTPRequestOperationProcess


    // Javadoc inherited.
    protected XMLProcess createProcess(
            DynamicProcess dynamicProcess, ExpandedName elementName,
            Attributes attributes) throws SAXException {

        HTTPRequestOperationProcess operation =
                new HTTPRequestOperationProcess();

        operation.setRequestType(requestType);

        // The fully specified URL of the web server including protocol
        // and ports e.g. http://www.volantis.com:8080/index.html.
        // This value is required.
        String url = attributes.getValue("url");
        if (url != null) {

            operation.setUrlString(url);

            String value;

            // The version of the HTTP protocol to use when making the request.
            // If not specified then HTTP 1.1 is assumed.
            if ((value = attributes.getValue("version")) != null) {
                operation.setHTTPVersion(HTTPVersion.httpVersion(value));
            }
            // This attribute is used to identify the particular instance of
            // the connector and can be used in conjunction with Mariner xPath
            // expressions to obtain the headers, parameters and cookies
            // returned in the response to the request.
            if ((value = attributes.getValue("id")) != null) {
                operation.setId(value);
            }

            // This flag is used to determine whether the operation process
            // silently follows HTTP 302 response codes.
            if ((value = attributes.getValue("followRedirects")) != null) {
                operation.setFollowRedirects(value);
            }

            // This flag is used to determine whether the operation process
            // sends http error content throught the pipeline or ignores it.
            if ((value = attributes.getValue("ignoreErroredContent")) != null) {
                operation.setIgnoreErroredContent(value);
            }

            // Set the timeout on the operation.
            Period period = determineTimeout(dynamicProcess, attributes);
            operation.setTimeout(period);

        } else {
            forwardError(dynamicProcess, "URL is required. Value is: " + url);
        }
View Full Code Here


     * @param urlString url Request prepated by {@link #prepareRequestUrl}
     *
     * @throws SAXException thrown from the inside
     */
    private void performOperation(final XMLPipeline pipeline, final String urlString) throws SAXException {
        HTTPRequestOperationProcess operation = new HTTPRequestOperationProcess() {
                protected void processResponse(String redirectURL,
                                   InputStream response,
                                   int statusCode,
                                   String contentType,
                                   String contentEncoding) throws IOException, SAXException {

                    if (!processSpecificResponse(redirectURL,
                                   response,
                                   statusCode,
                                   contentType,
                                   contentEncoding,
                                   pipeline,
                                   urlString)) {
                        super.processResponse(redirectURL,
                                   response,
                                   statusCode,
                                   contentType,
                                   contentEncoding);
                    }
                }
        };
        operation.setFollowRedirects("false");
        operation.setNextProcess(getTargetProcess(pipeline));
        operation.setPipeline(pipeline);
        operation.setUrlString(urlString);

        operation.setRequestType(HTTPRequestType.GET);
        operation.stopProcess();
    }
View Full Code Here

            ServletOutputStream outputStream = httpResponse.getOutputStream();
            XMLSerializer serializer = getSerializer(outputStream);
            filter.setContentHandler(serializer.asContentHandler());

            // Create and initialise the request process.
            HTTPRequestOperationProcess requestOperation =
                    new HTTPRequestOperationProcess();
            requestOperation.setFollowRedirects(
                    Boolean.toString(webdConfig.getFollowRedirects()));
            requestOperation.setUrlString(remappedURL);
            requestOperation.setRequestType(HTTPRequestType.GET);
            // todo this is wrong as the request operation timeout is in
            // todo seconds but the configuration is in milliseconds.
            Period timeout = Period.treatNonPositiveAsIndefinitely(
                    webdConfig.getTimeoutInMillis());
            requestOperation.setTimeout(timeout);

            // This is necessary in order for the request process to be
            // able to pick up the headers, parameters, cookies etc.
            WebDriverAccessor webdAccessor = createWebDriverAccessor(
                    createWebDriverRequest(httpRequest,
View Full Code Here

TOP

Related Classes of com.volantis.xml.pipeline.sax.drivers.web.HTTPRequestOperationProcess

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.