Package org.jets3t.service.impl.rest

Examples of org.jets3t.service.impl.rest.CloudFrontXmlResponsesSaxParser


                            throw new CloudFrontServiceException("Encountered too many CloudFront Internal Server errors ("
                                + internalErrorCount + "), aborting request.");                           
                        }
                    } else {
                        // Parse XML error message.
                        ErrorHandler handler = (new CloudFrontXmlResponsesSaxParser())
                            .parseErrorResponse(httpMethod.getResponseBodyAsStream());
                           
                        CloudFrontServiceException exception = new CloudFrontServiceException(
                            "Request failed with CloudFront Service error",
                            responseCode, handler.getType(), handler.getCode(),
View Full Code Here


            boolean incompleteListing = true;
            do {
                HttpMethod httpMethod = new GetMethod(ENDPOINT + VERSION + "/distribution");           
                performRestRequest(httpMethod, 200);

                ListDistributionListHandler handler = (new CloudFrontXmlResponsesSaxParser())
                    .parseDistributionListResponse(httpMethod.getResponseBodyAsStream());
                distributions.addAll(handler.getDistributions());
               
                incompleteListing = handler.isTruncated();
                // TODO: Under what circumstances are IsTruncated and Marker elements used?          
View Full Code Here

            httpMethod.setRequestEntity(
                new StringRequestEntity(builder.asString(null), "text/xml", Constants.DEFAULT_ENCODING));

            performRestRequest(httpMethod, 201);

            DistributionHandler handler = (new CloudFrontXmlResponsesSaxParser())
                .parseDistributionResponse(httpMethod.getResponseBodyAsStream());
           
            return handler.getDistribution();
        } catch (CloudFrontServiceException e) {
            throw e;
View Full Code Here

        GetMethod httpMethod = new GetMethod(ENDPOINT + VERSION + "/distribution/" + id);
       
        try {
            performRestRequest(httpMethod, 200);

            DistributionHandler handler = (new CloudFrontXmlResponsesSaxParser())
                .parseDistributionResponse(httpMethod.getResponseBodyAsStream());
           
            return handler.getDistribution();
        } catch (CloudFrontServiceException e) {
            throw e;
View Full Code Here

        GetMethod httpMethod = new GetMethod(ENDPOINT + VERSION + "/distribution/" + id + "/config");
       
        try {
            performRestRequest(httpMethod, 200);

            DistributionConfigHandler handler = (new CloudFrontXmlResponsesSaxParser())
                .parseDistributionConfigResponse(httpMethod.getResponseBodyAsStream());
           
            DistributionConfig config = handler.getDistributionConfig();
            config.setEtag(httpMethod.getResponseHeader("ETag").getValue());           
            return config;
View Full Code Here

                new StringRequestEntity(builder.asString(null), "text/xml", Constants.DEFAULT_ENCODING));
            httpMethod.setRequestHeader("If-Match", oldConfig.getEtag());

            performRestRequest(httpMethod, 200);

            DistributionConfigHandler handler = (new CloudFrontXmlResponsesSaxParser())
                .parseDistributionConfigResponse(httpMethod.getResponseBodyAsStream());

            DistributionConfig config = handler.getDistributionConfig();
            config.setEtag(httpMethod.getResponseHeader("ETag").getValue());           
            return config;
View Full Code Here

                                    + internalErrorCount + "), aborting request.");
                        }
                    }
                    else {
                        // Parse XML error message.
                        ErrorHandler handler = new CloudFrontXmlResponsesSaxParser(
                                this.jets3tProperties).parseErrorResponse(
                                response.getEntity().getContent());

                        CloudFrontServiceException exception = new CloudFrontServiceException(
                                "Request failed with CloudFront Service error",
View Full Code Here

                }
                HttpRequestBase httpMethod = new HttpGet(uri);
                HttpResponse response = performRestRequest(httpMethod, 200);

                DistributionListHandler handler =
                        (new CloudFrontXmlResponsesSaxParser(this.jets3tProperties))
                                .parseDistributionListResponse(response.getEntity().getContent());
                distributions.addAll(handler.getDistributions());

                incompleteListing = handler.isTruncated();
                nextMarker = handler.getNextMarker();
View Full Code Here

                    ContentType.create("text/xml", Constants.DEFAULT_ENCODING)));

            HttpResponse response = performRestRequest(httpMethod, 201);

            DistributionHandler handler =
                    (new CloudFrontXmlResponsesSaxParser(this.jets3tProperties))
                            .parseDistributionResponse(response.getEntity().getContent());

            return handler.getDistribution();
        }
        catch(CloudFrontServiceException e) {
View Full Code Here

                + distributionId);

        try {
            HttpResponse response = performRestRequest(httpMethod, 200);
            DistributionHandler handler =
                    (new CloudFrontXmlResponsesSaxParser(this.jets3tProperties))
                            .parseDistributionResponse(response.getEntity().getContent());

            return handler.getDistribution();
        }
        catch(CloudFrontServiceException e) {
View Full Code Here

TOP

Related Classes of org.jets3t.service.impl.rest.CloudFrontXmlResponsesSaxParser

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.