diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Media.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Media.java index aadde7aedb..e9370582df 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Media.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Media.java @@ -92,10 +92,17 @@ public class Media extends ResourceEntityType { @Override public Media build() { - Media media = new Media(); + Media media = new Media(href, name); media.setOwner(owner); media.setImageType(imageType); media.setSize(size); + media.setFiles(files); + media.setStatus(status); + media.setDescription(description); + media.setTasksInProgress(tasksInProgress); + media.setId(id); + media.setType(type); + media.setLinks(links); return media; } @@ -200,7 +207,11 @@ public class Media extends ResourceEntityType { } public Media() { - super(); + // for JAXB + } + + protected Media(URI href, String name) { + super(href, name); } @XmlElement(namespace = VCLOUD_1_5_NS, name = "Owner") diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Owner.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Owner.java index 88e392cfd3..18708835c9 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Owner.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Owner.java @@ -89,8 +89,10 @@ public class Owner public Owner build() { - Owner owner = new Owner(); + Owner owner = new Owner(href); owner.setUser(user); + owner.setType(type); + owner.setLinks(links); return owner; } @@ -145,6 +147,10 @@ public class Owner private Owner() { // For JAXB and builder use } + + private Owner(URI href) { + super(href); + } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntityType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntityType.java index d72a21523c..43bfebe723 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntityType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntityType.java @@ -54,8 +54,8 @@ public class ResourceEntityType> extends EntityT public static class Builder> extends EntityType.Builder { - private FilesList files; - private Integer status; + protected FilesList files; + protected Integer status; /** * @see ResourceEntityType#getFiles() @@ -75,9 +75,14 @@ public class ResourceEntityType> extends EntityT @Override public ResourceEntityType build() { - ResourceEntityType resourceEntity = new ResourceEntityType(); + ResourceEntityType resourceEntity = new ResourceEntityType(href, name); resourceEntity.setFiles(files); resourceEntity.setStatus(status); + resourceEntity.setDescription(description); + resourceEntity.setTasksInProgress(tasksInProgress); + resourceEntity.setId(id); + resourceEntity.setType(type); + resourceEntity.setLinks(links); return resourceEntity; } @@ -135,6 +140,7 @@ public class ResourceEntityType> extends EntityT return this; } + @SuppressWarnings("unchecked") @Override public Builder fromResourceType(ResourceType in) { return Builder.class.cast(super.fromResourceType(in)); @@ -145,9 +151,13 @@ public class ResourceEntityType> extends EntityT } } - public ResourceEntityType() { + protected ResourceEntityType() { // for JAXB } + + protected ResourceEntityType(URI href, String name) { + super(href, name); + } @XmlElement(name = "Files") protected FilesList files;