Example usage for com.amazonaws.services.ec2.model DescribeVolumesRequest setMaxResults

List of usage examples for com.amazonaws.services.ec2.model DescribeVolumesRequest setMaxResults

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model DescribeVolumesRequest setMaxResults.

Prototype


public void setMaxResults(Integer maxResults) 

Source Link

Document

The maximum number of volume results returned by DescribeVolumes in paginated output.

Usage

From source file:com.vmware.photon.controller.model.adapters.awsadapter.enumeration.AWSBlockStorageEnumerationAdapterService.java

License:Open Source License

/**
 * Initializes and saves a reference to the request object that is sent to AWS to get a page of
 * volumes. Also saves an instance to the async handler that will be used to handle the
 * responses received from AWS. It sets the nextToken value in the request object sent to AWS
 * for getting the next page of results from AWS.
 *
 * @param aws//  w  w  w  .j av a 2 s  . c  om
 */
private void creatAWSRequestAndAsyncHandler(BlockStorageEnumerationContext aws) {
    DescribeVolumesRequest request = new DescribeVolumesRequest();
    request.setMaxResults(getQueryPageSize());
    request.setNextToken(aws.nextToken);
    aws.describeVolumesRequest = request;
    AsyncHandler<DescribeVolumesRequest, DescribeVolumesResult> resultHandler = new AWSStorageEnumerationAsyncHandler(
            this, aws);
    aws.resultHandler = resultHandler;
}