@Override public boolean hasNext() { return oldResponse == null || nextPageFetcher.hasNextPage(oldResponse); }
@Override public ResponseT next() { if (!hasNext()) { throw new NoSuchElementException("No more pages left"); } oldResponse = nextPageFetcher.nextPage(oldResponse); return oldResponse; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link ListClustersIterable} that can be used to retrieve the * consecutive pages that follows the input page. * </p> */ private final ListClustersIterable resume(ListClustersResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new ListClustersIterable(client, firstRequest.toBuilder().nextToken(lastSuccessfulPage.nextToken()).build()); } return new ListClustersIterable(client, firstRequest) { @Override public Iterator<ListClustersResponse> iterator() { return Collections.emptyIterator(); } }; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link GetDevEndpointsIterable} that can be used to retrieve the * consecutive pages that follows the input page. * </p> */ private final GetDevEndpointsIterable resume(GetDevEndpointsResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new GetDevEndpointsIterable(client, firstRequest.toBuilder().nextToken(lastSuccessfulPage.nextToken()).build()); } return new GetDevEndpointsIterable(client, firstRequest) { @Override public Iterator<GetDevEndpointsResponse> iterator() { return Collections.emptyIterator(); } }; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link ListDetectorsIterable} that can be used to retrieve the * consecutive pages that follows the input page. * </p> */ private final ListDetectorsIterable resume(ListDetectorsResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new ListDetectorsIterable(client, firstRequest.toBuilder().nextToken(lastSuccessfulPage.nextToken()).build()); } return new ListDetectorsIterable(client, firstRequest) { @Override public Iterator<ListDetectorsResponse> iterator() { return Collections.emptyIterator(); } }; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link ListAliasesIterable} that can be used to retrieve the consecutive * pages that follows the input page. * </p> */ private final ListAliasesIterable resume(ListAliasesResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new ListAliasesIterable(client, firstRequest.toBuilder().marker(lastSuccessfulPage.nextMarker()).build()); } return new ListAliasesIterable(client, firstRequest) { @Override public Iterator<ListAliasesResponse> iterator() { return Collections.emptyIterator(); } }; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link GetIntentsIterable} that can be used to retrieve the consecutive * pages that follows the input page. * </p> */ private final GetIntentsIterable resume(GetIntentsResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new GetIntentsIterable(client, firstRequest.toBuilder().nextToken(lastSuccessfulPage.nextToken()).build()); } return new GetIntentsIterable(client, firstRequest) { @Override public Iterator<GetIntentsResponse> iterator() { return Collections.emptyIterator(); } }; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link ListChannelsIterable} that can be used to retrieve the * consecutive pages that follows the input page. * </p> */ private final ListChannelsIterable resume(ListChannelsResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new ListChannelsIterable(client, firstRequest.toBuilder().nextToken(lastSuccessfulPage.nextToken()).build()); } return new ListChannelsIterable(client, firstRequest) { @Override public Iterator<ListChannelsResponse> iterator() { return Collections.emptyIterator(); } }; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link DescribeTagsIterable} that can be used to retrieve the * consecutive pages that follows the input page. * </p> */ private final DescribeTagsIterable resume(DescribeTagsResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new DescribeTagsIterable(client, firstRequest.toBuilder().nextToken(lastSuccessfulPage.nextToken()).build()); } return new DescribeTagsIterable(client, firstRequest) { @Override public Iterator<DescribeTagsResponse> iterator() { return Collections.emptyIterator(); } }; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link DescribeBackupsIterable} that can be used to retrieve the * consecutive pages that follows the input page. * </p> */ private final DescribeBackupsIterable resume(DescribeBackupsResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new DescribeBackupsIterable(client, firstRequest.toBuilder().nextToken(lastSuccessfulPage.nextToken()).build()); } return new DescribeBackupsIterable(client, firstRequest) { @Override public Iterator<DescribeBackupsResponse> iterator() { return Collections.emptyIterator(); } }; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link DescribeListenersIterable} that can be used to retrieve the * consecutive pages that follows the input page. * </p> */ private final DescribeListenersIterable resume(DescribeListenersResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new DescribeListenersIterable(client, firstRequest.toBuilder().marker(lastSuccessfulPage.nextMarker()).build()); } return new DescribeListenersIterable(client, firstRequest) { @Override public Iterator<DescribeListenersResponse> iterator() { return Collections.emptyIterator(); } }; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link ListDatastoresIterable} that can be used to retrieve the * consecutive pages that follows the input page. * </p> */ private final ListDatastoresIterable resume(ListDatastoresResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new ListDatastoresIterable(client, firstRequest.toBuilder().nextToken(lastSuccessfulPage.nextToken()).build()); } return new ListDatastoresIterable(client, firstRequest) { @Override public Iterator<ListDatastoresResponse> iterator() { return Collections.emptyIterator(); } }; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link DescribeOptionGroupsIterable} that can be used to retrieve the * consecutive pages that follows the input page. * </p> */ private final DescribeOptionGroupsIterable resume(DescribeOptionGroupsResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new DescribeOptionGroupsIterable(client, firstRequest.toBuilder().marker(lastSuccessfulPage.marker()).build()); } return new DescribeOptionGroupsIterable(client, firstRequest) { @Override public Iterator<DescribeOptionGroupsResponse> iterator() { return Collections.emptyIterator(); } }; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link DescribeUsersIterable} that can be used to retrieve the * consecutive pages that follows the input page. * </p> */ private final DescribeUsersIterable resume(DescribeUsersResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new DescribeUsersIterable(client, firstRequest.toBuilder().marker(lastSuccessfulPage.marker()).build()); } return new DescribeUsersIterable(client, firstRequest) { @Override public Iterator<DescribeUsersResponse> iterator() { return Collections.emptyIterator(); } }; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link ListInstancesIterable} that can be used to retrieve the * consecutive pages that follows the input page. * </p> */ private final ListInstancesIterable resume(ListInstancesResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new ListInstancesIterable(client, firstRequest.toBuilder().marker(lastSuccessfulPage.marker()).build()); } return new ListInstancesIterable(client, firstRequest) { @Override public Iterator<ListInstancesResponse> iterator() { return Collections.emptyIterator(); } }; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link ListQueuesIterable} that can be used to retrieve the consecutive * pages that follows the input page. * </p> */ private final ListQueuesIterable resume(ListQueuesResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new ListQueuesIterable(client, firstRequest.toBuilder().nextToken(lastSuccessfulPage.nextToken()).build()); } return new ListQueuesIterable(client, firstRequest) { @Override public Iterator<ListQueuesResponse> iterator() { return Collections.emptyIterator(); } }; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link DescribeDBLogFilesIterable} that can be used to retrieve the * consecutive pages that follows the input page. * </p> */ private final DescribeDBLogFilesIterable resume(DescribeDbLogFilesResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new DescribeDBLogFilesIterable(client, firstRequest.toBuilder().marker(lastSuccessfulPage.marker()).build()); } return new DescribeDBLogFilesIterable(client, firstRequest) { @Override public Iterator<DescribeDbLogFilesResponse> iterator() { return Collections.emptyIterator(); } }; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link ListTagsIterable} that can be used to retrieve the consecutive * pages that follows the input page. * </p> */ private final ListTagsIterable resume(ListTagsResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new ListTagsIterable(client, firstRequest.toBuilder().nextToken(lastSuccessfulPage.nextToken()).build()); } return new ListTagsIterable(client, firstRequest) { @Override public Iterator<ListTagsResponse> iterator() { return Collections.emptyIterator(); } }; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link ListAliasesIterable} that can be used to retrieve the consecutive * pages that follows the input page. * </p> */ private final ListAliasesIterable resume(ListAliasesResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new ListAliasesIterable(client, firstRequest.toBuilder().nextToken(lastSuccessfulPage.nextToken()).build()); } return new ListAliasesIterable(client, firstRequest) { @Override public Iterator<ListAliasesResponse> iterator() { return Collections.emptyIterator(); } }; }
/** * <p> * A helper method to resume the pages in case of unexpected failures. The method takes the last successful response * page as input and returns an instance of {@link DescribeStacksIterable} that can be used to retrieve the * consecutive pages that follows the input page. * </p> */ private final DescribeStacksIterable resume(DescribeStacksResponse lastSuccessfulPage) { if (nextPageFetcher.hasNextPage(lastSuccessfulPage)) { return new DescribeStacksIterable(client, firstRequest.toBuilder().nextToken(lastSuccessfulPage.nextToken()).build()); } return new DescribeStacksIterable(client, firstRequest) { @Override public Iterator<DescribeStacksResponse> iterator() { return Collections.emptyIterator(); } }; }