Updating domain objects

This commit is contained in:
Andrew Donald Kennedy 2012-02-10 12:11:04 +00:00
parent ca54098661
commit 751d99c143
5 changed files with 37 additions and 13 deletions

View File

@ -43,7 +43,7 @@ import com.google.common.collect.Sets;
* *
* @author grkvlt@apache.org * @author grkvlt@apache.org
*/ */
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "Catalog") @XmlRootElement(namespace = VCLOUD_1_5_NS, name = "CatalogItem")
public class CatalogItem extends EntityType<CatalogItem> { public class CatalogItem extends EntityType<CatalogItem> {
public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG_ITEM; public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG_ITEM;
@ -197,14 +197,16 @@ public class CatalogItem extends EntityType<CatalogItem> {
private List<Property> properties = Lists.newArrayList(); private List<Property> properties = Lists.newArrayList();
/** /**
* Gets the value of the entity property. * A reference to a VappTemplate or Media object.
*/ */
public Reference getEntity() { public Reference getEntity() {
return entity; return entity;
} }
/** /**
* Gets the value of the properties property. * User-specified key/value pair.
*
* This element has been superseded by the {@link Metadata} element, which is the preferred way to specify key/value pairs for objects.
*/ */
public List<Property> getProperties() { public List<Property> getProperties() {
return this.properties; return this.properties;

View File

@ -29,7 +29,6 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.Link.Builder;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper; import com.google.common.base.Objects.ToStringHelper;
@ -61,7 +60,7 @@ public class MetadataEntry extends ResourceType<MetadataEntry> {
public static class Builder extends ResourceType.Builder<MetadataEntry> { public static class Builder extends ResourceType.Builder<MetadataEntry> {
private String key; private String key;
private MetadataValue value; private String value;
/** /**
* @see MetadataEntry#getKey() * @see MetadataEntry#getKey()
@ -74,7 +73,7 @@ public class MetadataEntry extends ResourceType<MetadataEntry> {
/** /**
* @see MetadataEntry#getValue() * @see MetadataEntry#getValue()
*/ */
public Builder value(MetadataValue value) { public Builder value(String value) {
this.value = value; this.value = value;
return this; return this;
} }
@ -83,7 +82,7 @@ public class MetadataEntry extends ResourceType<MetadataEntry> {
* @see MetadataEntry#getKey() * @see MetadataEntry#getKey()
* @see MetadataEntry#getValue() * @see MetadataEntry#getValue()
*/ */
public Builder entry(String key, MetadataValue value) { public Builder entry(String key, String value) {
this.key = key; this.key = key;
this.value = value; this.value = value;
return this; return this;
@ -150,7 +149,7 @@ public class MetadataEntry extends ResourceType<MetadataEntry> {
// For JAXB and builder use // For JAXB and builder use
} }
private MetadataEntry(URI href, String key, MetadataValue value) { private MetadataEntry(URI href, String key, String value) {
super(href); super(href);
this.key = checkNotNull(key, "key"); this.key = checkNotNull(key, "key");
this.value = checkNotNull(value, "value"); this.value = checkNotNull(value, "value");
@ -159,7 +158,7 @@ public class MetadataEntry extends ResourceType<MetadataEntry> {
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Key") @XmlElement(namespace = VCLOUD_1_5_NS, name = "Key")
private String key; private String key;
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Value") @XmlElement(namespace = VCLOUD_1_5_NS, name = "Value")
private MetadataValue value; private String value;
/** /**
* @return key of the entry * @return key of the entry
@ -171,7 +170,7 @@ public class MetadataEntry extends ResourceType<MetadataEntry> {
/** /**
* @return value of the entry * @return value of the entry
*/ */
public MetadataValue getValue() { public String getValue() {
return value; return value;
} }

View File

@ -29,7 +29,6 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.MetadataValue.Builder;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper; import com.google.common.base.Objects.ToStringHelper;
@ -42,7 +41,7 @@ import com.google.common.collect.Sets;
* &lt;xs:complexType name="MetadataType"&gt; * &lt;xs:complexType name="MetadataType"&gt;
* </pre> * </pre>
* *
* @author danikov * @author grkvlt@apache.org
*/ */
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "MetadataValue") @XmlRootElement(namespace = VCLOUD_1_5_NS, name = "MetadataValue")
public class MetadataValue extends ResourceType<MetadataValue> { public class MetadataValue extends ResourceType<MetadataValue> {

View File

@ -219,7 +219,7 @@ public class Org extends EntityType<Org> {
return isEnabled; return isEnabled;
} }
public void isEnabled(Boolean isEnabled) { public void setIsEnabled(Boolean isEnabled) {
this.isEnabled = isEnabled; this.isEnabled = isEnabled;
} }

View File

@ -0,0 +1,24 @@
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@XmlSchema(namespace = VCLOUD_1_5_NS, elementFormDefault = XmlNsForm.QUALIFIED)
package org.jclouds.vcloud.director.v1_5.domain;
import javax.xml.bind.annotation.XmlNsForm;
import javax.xml.bind.annotation.XmlSchema;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*;