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

Examples of com.volantis.xml.pipeline.sax.drivers.uri.Fetcher


            XMLPipeline pipeline = dynamicProcess.getPipeline();

            // In order to get the required template definition to be processed
            // we need to invoke a URI inclusion based on the given href.
            Fetcher fetcher = new Fetcher(pipeline);
            fetcher.setHref(href);

            fetcher.doInclude();
        }

        super.doAction(dynamicProcess);
    }
View Full Code Here


        if (!"".equals(queryString)) {
            hrefAttr.append("?").append(queryString);
        }

        Fetcher operation = new Fetcher(pipeline);

        // OK to pass null strings to operations attribute setters
        // Operation process can validate the attributes whenever
        // it performs its operation
        operation.setHref(hrefAttr.toString());
        operation.setParse(PARSE_ATTRIBUTE_VALUE);
        operation.setEncoding(ENCODING_ATTRIBUTE_VALUE);

        // Handle the timeout setting. Firstly, we need to see if there is a
        // timeout attribute. We default to -1 to indicate no timeout
        String timeoutAttr = TIMEOUT_ATTRIBUTE_VALUE;
        Period timeout = null;

        if (timeoutAttr != null) {
            // The attribute should contain an integer number of seconds
            int timeoutInSecs;
            try {
                timeoutInSecs = Integer.parseInt(timeoutAttr);
            } catch (NumberFormatException e) {
                LOGGER.warn("invalid-timeout", timeoutAttr);
                throw e;
            }

            timeout = Period.treatNonPositiveAsIndefinitely(
                    timeoutInSecs * 1000);
    }

        operation.setTimeout(timeout);

        operation.doInclude();

        return null;
    }
View Full Code Here

        }

        queryString.append("&").append(MessageFormat.format(
                FLICKR_PAGE_PARAM, pageIndex));

        Fetcher operation = new Fetcher(pipeline);

        // OK to pass null strings to operations attribute setters
        // Operation process can validate the attributes whenever
        // it performs its operation
        operation.setHref(FLICKR_REST_API_URL + queryString.toString());
        operation.setParse(PARSE_ATTRIBUTE_VALUE);
        operation.setEncoding(ENCODING_ATTRIBUTE_VALUE);

        // Handle the timeout setting. Firstly, we need to see if there is a
        // timeout attribute. We default to -1 to indicate no timeout
        String timeoutAttr = TIMEOUT_ATTRIBUTE_VALUE;
        Period timeout = null;

        if (timeoutAttr != null) {
            // The attribute should contain an integer number of seconds
            int timeoutInSecs;
            try {
                timeoutInSecs = Integer.parseInt(timeoutAttr);
            } catch (NumberFormatException e) {
                LOGGER.warn("invalid-timeout", timeoutAttr);
                throw e;
            }

            timeout = Period.treatNonPositiveAsIndefinitely(
                    timeoutInSecs * 1000);
        }

        operation.setTimeout(timeout);

        operation.doInclude();

        return null;
    }
View Full Code Here

TOP

Related Classes of com.volantis.xml.pipeline.sax.drivers.uri.Fetcher

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.