Package com.amazonaws

Examples of com.amazonaws.DefaultRequest


      return execute(convertToRequest(httpRequest), responseHandler, errorResponseHandler);
    }

    @Deprecated
    protected Request<?> convertToRequest(HttpRequest httpRequest) {
        Request<?> request = new DefaultRequest(httpRequest.getServiceName());
        request.setContent(httpRequest.getContent());
        request.setEndpoint(httpRequest.getEndpoint());
        request.setHttpMethod(httpRequest.getMethodName());
        request.setResourcePath(httpRequest.getResourcePath());

        for (Entry<String, String> parameter : httpRequest.getParameters().entrySet()) {
            request.addParameter(parameter.getKey(), parameter.getValue());
        }

        for (Entry<String, String> parameter : httpRequest.getHeaders().entrySet()) {
            request.addHeader(parameter.getKey(), parameter.getValue());
        }

        return request;
    }
View Full Code Here


        return response.getAwsResponse();
    }


    private Request buildRequest(HttpMethodName httpMethodName, String resourcePath, Object representation) {
        Request request = new DefaultRequest(null);

        request.setHttpMethod(httpMethodName);
        request.setEndpoint(endpoint);

        populateResourcePathAndParameters(request, resourcePath);

        if (representation != null) {
            assignContent(request, representation);
View Full Code Here

    public <T> T putResource(Class<T> resourceClass, String resourcePath, Object representation) {
        ExecutionContext executionContext = createExecutionContext();
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();

        awsRequestMetrics.startEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());
        Request request = new DefaultRequest(null);
        request.setHttpMethod(HttpMethodName.PUT);
        populateResourcePathAndParameters(request, resourcePath);
        assignContent(request, representation);
        awsRequestMetrics.endEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());

        OptionalJsonResponseHandler<HalResource> responseHandler = new OptionalJsonResponseHandler<>(HalJsonResourceUnmarshaller.getInstance());
View Full Code Here

    public <T> T postResource(Class<T> resourceClass, String resourcePath, Object representation) {
        ExecutionContext executionContext = createExecutionContext();
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();

        awsRequestMetrics.startEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());
        Request request = new DefaultRequest(null);
        request.setHttpMethod(HttpMethodName.POST);
        populateResourcePathAndParameters(request, resourcePath);
        assignContent(request, representation);
        awsRequestMetrics.endEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());

        OptionalJsonResponseHandler<HalResource> responseHandler = new OptionalJsonResponseHandler<>(HalJsonResourceUnmarshaller.getInstance());
View Full Code Here

    public void deleteResource(String resourcePath) {
        ExecutionContext executionContext = createExecutionContext();
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();

        awsRequestMetrics.startEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());
        Request request = new DefaultRequest(null);
        request.setHttpMethod(HttpMethodName.DELETE);
        populateResourcePathAndParameters(request, resourcePath);
        awsRequestMetrics.endEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());

        JsonResponseHandler<HalResource> responseHandler = new JsonResponseHandler<>(HalJsonResourceUnmarshaller.getInstance());
View Full Code Here

    HalResource getHalResource(String resourcePath) {
        ExecutionContext executionContext = createExecutionContext();
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();

        awsRequestMetrics.startEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());
        Request request = new DefaultRequest(null);
        request.setHttpMethod(HttpMethodName.GET);
        populateResourcePathAndParameters(request, resourcePath);
        awsRequestMetrics.endEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());

        JsonResponseHandler<HalResource> responseHandler = new JsonResponseHandler<>(HalJsonResourceUnmarshaller.getInstance());
View Full Code Here

    public <T> T putResource(Class<T> resourceClass, String resourcePath, Object representation) {
        ExecutionContext executionContext = createExecutionContext();
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();

        awsRequestMetrics.startEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());
        Request request = new DefaultRequest(null);
        request.setHttpMethod(HttpMethodName.PUT);
        populateResourcePathAndParameters(request, resourcePath);
        assignContent(request, representation);
        awsRequestMetrics.endEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());

        OptionalJsonResponseHandler<HalResource> responseHandler
View Full Code Here

    public <T> T postResource(Class<T> resourceClass, String resourcePath, Object representation) {
        ExecutionContext executionContext = createExecutionContext();
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();

        awsRequestMetrics.startEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());
        Request request = new DefaultRequest(null);
        request.setHttpMethod(HttpMethodName.POST);
        populateResourcePathAndParameters(request, resourcePath);
        assignContent(request, representation);
        awsRequestMetrics.endEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());

        OptionalJsonResponseHandler<HalResource> responseHandler
View Full Code Here

    public void deleteResource(String resourcePath) {
        ExecutionContext executionContext = createExecutionContext();
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();

        awsRequestMetrics.startEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());
        Request request = new DefaultRequest(null);
        request.setHttpMethod(HttpMethodName.DELETE);
        populateResourcePathAndParameters(request, resourcePath);
        awsRequestMetrics.endEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());

        JsonResponseHandler<HalResource> responseHandler
                = new JsonResponseHandler<>(HalJsonResourceUnmarshaller.getInstance());
View Full Code Here

    HalResource getHalResource(String resourcePath) {
        ExecutionContext executionContext = createExecutionContext();
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();

        awsRequestMetrics.startEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());
        Request request = new DefaultRequest(null);
        request.setHttpMethod(HttpMethodName.GET);
        populateResourcePathAndParameters(request, resourcePath);
        awsRequestMetrics.endEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());

        return invoke(request, new JsonResponseHandler<>(HalJsonResourceUnmarshaller.getInstance()), executionContext);
    }
View Full Code Here

TOP

Related Classes of com.amazonaws.DefaultRequest

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.