Skip to content
Permalink
Browse files
JCLOUDS-686: Glance API ListImageOptions should support changesSince()
  • Loading branch information
Jeremy Daggett committed Sep 4, 2014
1 parent e7a52c1 commit 978234238abc5f2a8771dffca054feb3a22dfb3c
Showing 1 changed file with 21 additions and 16 deletions.
@@ -16,6 +16,7 @@
*/
package org.jclouds.openstack.glance.v1_0.options;

import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.openstack.glance.v1_0.options.ImageField.CONTAINER_FORMAT;
import static org.jclouds.openstack.glance.v1_0.options.ImageField.DISK_FORMAT;
import static org.jclouds.openstack.glance.v1_0.options.ImageField.IS_PUBLIC;
@@ -45,12 +46,30 @@
* // this will list the first 10 images with the name "name", minimum required disk of 5GB.
* list = api.list(name("newName"), limit(10), minDisk(5));
* <code>
*
* @see <a href="http://glance.openstack.org/glanceapi.html"/>
*
*/
public class ListImageOptions extends PaginationOptions {
public static final ListImageOptions NONE = new ListImageOptions();

/**
* Return only those images having a matching name attribute
*/
public ListImageOptions changesSince(Date ifModifiedSince) {
queryParameters.put("changes-since",
checkNotNull(ifModifiedSince, "modification date should not be null").getTime() / 1000 + "");
return this;
}

@Override
public ListImageOptions marker(String marker) {
return ListImageOptions.class.cast(super.marker(marker));
}

@Override
public ListImageOptions limit(int limit) {
return ListImageOptions.class.cast(super.limit(limit));
}

/**
* Return only those images having a matching name attribute
*/
@@ -250,18 +269,4 @@ public static ListImageOptions marker(String marker) {
}
}

@Override
public ListImageOptions changesSince(Date ifModifiedSince) {
return ListImageOptions.class.cast(super.changesSince(ifModifiedSince));
}

@Override
public ListImageOptions marker(String marker) {
return ListImageOptions.class.cast(super.marker(marker));
}

@Override
public ListImageOptions limit(int limit) {
return ListImageOptions.class.cast(super.limit(limit));
}
}

0 comments on commit 9782342

Please sign in to comment.