diff --git a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/BaseToPagedIterable.java b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/BaseToPagedIterable.java index adb429838a..2e8beb5232 100644 --- a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/BaseToPagedIterable.java +++ b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/BaseToPagedIterable.java @@ -19,9 +19,9 @@ package org.jclouds.googlecompute.functions.internal; -import static com.google.common.base.Predicates.instanceOf; -import static com.google.common.collect.Iterables.tryFind; - +import com.google.common.annotations.Beta; +import com.google.common.base.Function; +import com.google.common.base.Optional; import org.jclouds.collect.IterableWithMarker; import org.jclouds.collect.PagedIterable; import org.jclouds.collect.PagedIterables; @@ -31,9 +31,8 @@ import org.jclouds.http.HttpRequest; import org.jclouds.rest.InvocationContext; import org.jclouds.rest.internal.GeneratedHttpRequest; -import com.google.common.annotations.Beta; -import com.google.common.base.Function; -import com.google.common.base.Optional; +import static com.google.common.base.Predicates.instanceOf; +import static com.google.common.collect.Iterables.tryFind; /** * @author Adrian Cole @@ -57,13 +56,11 @@ public abstract class BaseToPagedIterable + "project", request.getCaller().get().getInvokable()); return PagedIterables.advance( - input, - fetchNextPage(project.get().toString(), (String) input.nextMarker().orNull(), - (ListOptions) listOptions.orNull())); + input, fetchNextPage(project.get().toString(), (ListOptions) listOptions.orNull())); } - protected abstract Function> fetchNextPage(String projectName, String marker, - ListOptions listOptions); + protected abstract Function> fetchNextPage(String projectName, + ListOptions listOptions); @SuppressWarnings("unchecked") @Override diff --git a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseDisks.java b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseDisks.java index 5973ebbb5a..05719d8801 100644 --- a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseDisks.java +++ b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseDisks.java @@ -56,13 +56,12 @@ public class ParseDisks extends ParseJson> { @Override protected Function> fetchNextPage(final String projectName, - final String marker, final ListOptions options) { return new Function>() { @Override public IterableWithMarker apply(Object input) { - return api.getDiskApiForProject(projectName).listAtMarker(marker, options); + return api.getDiskApiForProject(projectName).listAtMarker(input.toString(), options); } }; } diff --git a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseFirewalls.java b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseFirewalls.java index 4568c5555f..3f980ff9bf 100644 --- a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseFirewalls.java +++ b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseFirewalls.java @@ -54,13 +54,12 @@ public class ParseFirewalls extends ParseJson> { @Override protected Function> fetchNextPage(final String projectName, - final String marker, final ListOptions options) { return new Function>() { @Override public IterableWithMarker apply(Object input) { - return api.getFirewallApiForProject(projectName).listAtMarker(marker, options); + return api.getFirewallApiForProject(projectName).listAtMarker(input.toString(), options); } }; } diff --git a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseKernels.java b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseKernels.java index 3f744d1603..e9f9d7c7e2 100644 --- a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseKernels.java +++ b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseKernels.java @@ -54,13 +54,12 @@ public class ParseKernels extends ParseJson> { @Override protected Function> fetchNextPage(final String projectName, - final String marker, final ListOptions options) { return new Function>() { @Override public IterableWithMarker apply(Object input) { - return api.getKernelApiForProject(projectName).listAtMarker(marker, options); + return api.getKernelApiForProject(projectName).listAtMarker(input.toString(), options); } }; } diff --git a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseMachineTypes.java b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseMachineTypes.java index 03b4c35cfa..596d28ad30 100644 --- a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseMachineTypes.java +++ b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseMachineTypes.java @@ -54,13 +54,12 @@ public class ParseMachineTypes extends ParseJson> { @Override protected Function> fetchNextPage(final String projectName, - final String marker, final ListOptions options) { return new Function>() { @Override public IterableWithMarker apply(Object input) { - return api.getMachineTypeApiForProject(projectName).listAtMarker(marker, options); + return api.getMachineTypeApiForProject(projectName).listAtMarker(input.toString(), options); } }; } diff --git a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseNetworks.java b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseNetworks.java index 53c643273f..1261826ad5 100644 --- a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseNetworks.java +++ b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseNetworks.java @@ -54,13 +54,12 @@ public class ParseNetworks extends ParseJson> { @Override protected Function> fetchNextPage(final String projectName, - final String marker, final ListOptions options) { return new Function>() { @Override public IterableWithMarker apply(Object input) { - return api.getNetworkApiForProject(projectName).listAtMarker(marker, options); + return api.getNetworkApiForProject(projectName).listAtMarker(input.toString(), options); } }; } diff --git a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseOperations.java b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseOperations.java index 6f9c67258a..e940096825 100644 --- a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseOperations.java +++ b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseOperations.java @@ -54,13 +54,12 @@ public class ParseOperations extends ParseJson> { @Override protected Function> fetchNextPage(final String projectName, - final String marker, final ListOptions options) { return new Function>() { @Override public IterableWithMarker apply(Object input) { - return api.getOperationApiForProject(projectName).listAtMarker(marker, options); + return api.getOperationApiForProject(projectName).listAtMarker(input.toString(), options); } }; } diff --git a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseZones.java b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseZones.java index 06f5d309dd..43a217fb28 100644 --- a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseZones.java +++ b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/ParseZones.java @@ -53,13 +53,13 @@ public class ParseZones extends ParseJson> { } @Override - protected Function> fetchNextPage(final String projectName, final String marker, + protected Function> fetchNextPage(final String projectName, final ListOptions options) { return new Function>() { @Override public IterableWithMarker apply(Object input) { - return api.getZoneApiForProject(projectName).listAtMarker(marker, options); + return api.getZoneApiForProject(projectName).listAtMarker(input.toString(), options); } }; }