You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ad...@apache.org on 2014/10/12 05:45:29 UTC
[1/6] Fold dmtf into vcloud-director (its only user).
Repository: jclouds-labs
Updated Branches:
refs/heads/master a58cf0c6a -> 7ec7f0771
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/ProductSectionProperty.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/ProductSectionProperty.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/ProductSectionProperty.java
new file mode 100644
index 0000000..318a2bb
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/ProductSectionProperty.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Property element
+ *
+ * <pre>
+ * <element name="Property" />
+ * </pre>
+ */
+@XmlType(name = "")
+@XmlRootElement(name = "Property")
+public class ProductSectionProperty extends Property {
+ // TODO hashCode, equals, toString
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Property.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Property.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Property.java
new file mode 100644
index 0000000..eb19fef
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Property.java
@@ -0,0 +1,302 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf;
+
+import static com.google.common.base.Objects.equal;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+
+import com.google.common.base.Joiner;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import com.google.common.collect.Sets;
+
+@XmlType(name = "Property")
+@XmlSeeAlso({ ProductSectionProperty.class })
+public class Property {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return builder().fromProperty(this);
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ }
+
+ public abstract static class Builder<B extends Builder<B>> {
+
+ protected String key;
+ protected Set<PropertyConfigurationValueType> values = Sets.newLinkedHashSet();
+ protected MsgType label;
+ protected MsgType description;
+ protected String type;
+ protected String qualifiers;
+ protected Boolean userConfigurable;
+ protected String defaultValue = "";
+
+ @SuppressWarnings("unchecked")
+ protected B self() {
+ return (B) this;
+ }
+
+ /**
+ * @see Property#getKey()
+ */
+ public B key(String key) {
+ this.key = key;
+ return self();
+ }
+
+ /**
+ * @see Property#getValues()
+ */
+ public B values(Set<PropertyConfigurationValueType> values) {
+ this.values = checkNotNull(values, "values");
+ return self();
+ }
+
+ /**
+ * @see Property#getValues()
+ */
+ public B value(PropertyConfigurationValueType value) {
+ this.values.add(checkNotNull(value, "value"));
+ return self();
+ }
+
+ /**
+ * @see Property#getLabel()
+ */
+ public B label(MsgType label) {
+ this.label = label;
+ return self();
+ }
+
+ /**
+ * @see Property#getDescription()
+ */
+ public B description(MsgType description) {
+ this.description = description;
+ return self();
+ }
+
+ /**
+ * @see Property#getType()
+ */
+ public B type(String type) {
+ this.type = type;
+ return self();
+ }
+
+ /**
+ * @see Property#getQualifiers()
+ */
+ public B qualifiers(String qualifiers) {
+ this.qualifiers = qualifiers;
+ return self();
+ }
+
+ /**
+ * @see Property#getQualifiers()
+ */
+ public B qualifiers(Iterable<String> qualifiers) {
+ this.qualifiers = Joiner.on(',').join(qualifiers);
+ return self();
+ }
+
+ /**
+ * @see Property#getQualifiers()
+ */
+ public B qualifiers(String...qualifiers) {
+ this.qualifiers = Joiner.on(',').join(qualifiers);
+ return self();
+ }
+
+ /**
+ * @see Property#isUserConfigurable()
+ */
+ public B isUserConfigurable(Boolean userConfigurable) {
+ this.userConfigurable = userConfigurable;
+ return self();
+ }
+
+ /**
+ * @see Property#isUserConfigurable()
+ */
+ public B userConfigurable() {
+ this.userConfigurable = Boolean.TRUE;
+ return self();
+ }
+
+ /**
+ * @see Property#isUserConfigurable()
+ */
+ public B notUserConfigurable() {
+ this.userConfigurable = Boolean.FALSE;
+ return self();
+ }
+
+ /**
+ * @see Property#getDefaultValue()
+ */
+ public B defaultValue(String defaultValue) {
+ this.defaultValue = defaultValue;
+ return self();
+ }
+
+ public Property build() {
+ return new Property(this);
+ }
+
+ public B fromProperty(Property in) {
+ return key(in.getKey()).values(in.getValues()).description(in.getDescription()).label(in.getLabel())
+ .type(in.getType()).qualifiers(in.getQualifiers()).isUserConfigurable(in.isUserConfigurable()).defaultValue(in.getDefaultValue());
+ }
+ }
+
+ @XmlAttribute
+ private String key;
+ @XmlElement(name = "Value")
+ private Set<PropertyConfigurationValueType> values;
+ @XmlElement(name = "Label")
+ private MsgType label;
+ @XmlElement(name = "Description")
+ private MsgType description;
+ @XmlAttribute(required = true)
+ private String type;
+ @XmlAttribute(required = true)
+ private String qualifiers;
+ @XmlAttribute
+ private Boolean userConfigurable;
+ @XmlAttribute(name = "value")
+ private String defaultValue;
+
+ protected Property(Builder<?> builder) {
+ this.key = builder.key;
+ this.values = builder.values;
+ this.label = builder.label;
+ this.description = builder.description;
+ this.type = builder.type;
+ this.qualifiers = builder.qualifiers;
+ this.userConfigurable = builder.userConfigurable;
+ this.defaultValue = builder.defaultValue;
+ }
+
+ protected Property() {
+ // for JAXB
+ }
+
+ /**
+ * Property identifier.
+ */
+ public String getKey() {
+ return key;
+ }
+
+ /**
+ * Description of property.
+ */
+ public MsgType getDescription() {
+ return description;
+ }
+
+ /**
+ * Short description of property.
+ */
+ public MsgType getLabel() {
+ return label;
+ }
+
+ /**
+ * Alternative default property values for different configuration
+ */
+ public Set<PropertyConfigurationValueType> getValues() {
+ return values;
+ }
+
+ /**
+ * Property type.
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * A comma-separated set of type qualifiers.
+ */
+ public String getQualifiers() {
+ return qualifiers;
+ }
+
+ /**
+ * Determines whether the property value is configurable during installation.
+ */
+ public Boolean isUserConfigurable() {
+ return userConfigurable;
+ }
+
+ /**
+ * A Default value for property.
+ */
+ public String getDefaultValue() {
+ if (defaultValue == null) {
+ return "";
+ } else {
+ return defaultValue;
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(key, values, label, description, type, qualifiers, userConfigurable, defaultValue);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Property that = Property.class.cast(obj);
+ return equal(this.key, that.key) &&
+ equal(this.values, that.values) &&
+ equal(this.label, that.label) &&
+ equal(this.description, that.description) &&
+ equal(this.type, that.type) &&
+ equal(this.qualifiers, that.qualifiers) &&
+ equal(this.userConfigurable, that.userConfigurable) &&
+ equal(this.defaultValue, that.defaultValue);
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper("")
+ .add("key", key).add("values", values).add("label", label).add("description", description)
+ .add("type", type).add("qualifiers", qualifiers).add("userConfigurable", userConfigurable).add("defaultValue", defaultValue)
+ .toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/PropertyConfigurationValueType.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/PropertyConfigurationValueType.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/PropertyConfigurationValueType.java
new file mode 100644
index 0000000..7efb08e
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/PropertyConfigurationValueType.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Type for alternative default values for properties when DeploymentOptionSection is used
+ *
+ * <pre>
+ * <complexType name="PropertyConfigurationValue_Type">
+ * </pre>
+ */
+@XmlType(name = "PropertyConfigurationValue_Type")
+public class PropertyConfigurationValueType {
+
+ // TODO Builder
+
+ @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true)
+ protected String value;
+ @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1")
+ protected String configuration;
+
+ /**
+ * Gets the value of the value property.
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Gets the value of the configuration property.
+ */
+ public String getConfiguration() {
+ return configuration;
+ }
+
+ // TODO hashCode, equals, toString
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/SectionType.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/SectionType.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/SectionType.java
new file mode 100644
index 0000000..aadaf96
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/SectionType.java
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf;
+
+import static com.google.common.base.Objects.equal;
+import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * Metadata about a virtual machine or grouping of them.
+ *
+ * Base type for Sections, subclassing this is the most common form of extensibility. Subtypes define more specific elements.
+ */
+@XmlType(name = "Section_Type")
+public abstract class SectionType {
+
+ public abstract static class Builder<B extends Builder<B>> {
+ private String info;
+ private Boolean required;
+
+ @SuppressWarnings("unchecked")
+ protected B self() {
+ return (B) this;
+ }
+
+ public abstract SectionType build();
+
+ /**
+ * @see SectionType#getInfo()
+ */
+ public B info(String info) {
+ this.info = info;
+ return self();
+ }
+
+ /**
+ * @see SectionType#isRequired()
+ */
+ public B required(Boolean required) {
+ this.required = required;
+ return self();
+ }
+
+ /**
+ * @see SectionType#isRequired()
+ */
+ public B required() {
+ this.required = Boolean.TRUE;
+ return self();
+ }
+
+ /**
+ * @see SectionType#isRequired()
+ */
+ public B notRequired() {
+ this.required = Boolean.FALSE;
+ return self();
+ }
+
+ public B fromSectionType(SectionType in) {
+ return info(in.getInfo()).required(in.isRequired());
+ }
+ }
+
+ @XmlElement(name = "Info", required = true)
+ private String info;
+ @XmlAttribute(namespace = OVF_NS)
+ private Boolean required;
+
+ protected SectionType(Builder<?> builder) {
+ this.info = builder.info;
+ this.required = builder.required;
+ }
+
+ protected SectionType() {
+ // For JAXB
+ }
+
+ /**
+ * Info element describes the meaning of the Section, this is typically shown if the Section is not understood by an application
+ *
+ * @return ovf info
+ */
+ public String getInfo() {
+ return info;
+ }
+
+ public void setInfo(String info) {
+ this.info = info;
+ }
+
+ public Boolean isRequired() {
+ return required;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(info, required);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ SectionType other = (SectionType) obj;
+ return equal(this.info, other.info) && equal(this.required, other.required);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+ protected MoreObjects.ToStringHelper string() {
+ return MoreObjects.toStringHelper("").add("info", info).add("required", required);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/StartupSection.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/StartupSection.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/StartupSection.java
new file mode 100644
index 0000000..3acf05a
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/StartupSection.java
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf;
+
+import static com.google.common.base.Objects.equal;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects.ToStringHelper;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Lists;
+
+/**
+ * Specifies the order in which entities in a VirtualSystemCollection are powered on and shut down
+ *
+ * <pre>
+ * <complexType name="StartupSection_Type" />
+ * </pre>
+ */
+@XmlRootElement(name = "StartupSection")
+@XmlType(name = "StartupSection_Type")
+public class StartupSection extends SectionType {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return builder().fromStartupSection(this);
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ }
+
+ public static class Builder<B extends Builder<B>> extends SectionType.Builder<B> {
+
+ private List<StartupSectionItem> items = Lists.newArrayList();
+
+ /**
+ * @see StartupSection#getItem()
+ */
+ public B items(List<StartupSectionItem> items) {
+ this.items = checkNotNull(items, "items");
+ return self();
+ }
+
+ /**
+ * @see StartupSection#getItem()
+ */
+ public B item(StartupSectionItem item) {
+ this.items.add(checkNotNull(item, "item"));
+ return self();
+ }
+
+ @Override
+ public StartupSection build() {
+ return new StartupSection(this);
+ }
+
+ public B fromStartupSection(StartupSection in) {
+ return fromSectionType(in).items(in.getItems());
+ }
+ }
+
+ @XmlElement(name = "Item")
+ private List<StartupSectionItem> items = Lists.newArrayList();
+
+ protected StartupSection() {
+ // For JAXB
+ }
+
+ public StartupSection(Builder<?> builder) {
+ super(builder);
+ this.items = (items != null) ? ImmutableList.<StartupSectionItem>copyOf(builder.items) : ImmutableList.<StartupSectionItem>of();
+ }
+
+ /**
+ * Gets the value of the item property.
+ */
+ public List<StartupSectionItem> getItems() {
+ return items;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o)
+ return true;
+ if (o == null || getClass() != o.getClass())
+ return false;
+ StartupSection that = StartupSection.class.cast(o);
+ return super.equals(that) && equal(this.items, that.items);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(super.hashCode(), items);
+ }
+
+ @Override
+ public ToStringHelper string() {
+ return super.string().add("items", items);
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/StartupSectionItem.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/StartupSectionItem.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/StartupSectionItem.java
new file mode 100644
index 0000000..e1cd012
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/StartupSectionItem.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Java class for Item element declaration.
+ *
+ * <pre>
+ * <element name="Item">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="order" use="required" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" />
+ * <attribute name="startDelay" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
+ * <attribute name="waitingForGuest" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ * <attribute name="stopDelay" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
+ * <attribute name="startAction" type="{http://www.w3.org/2001/XMLSchema}string" default="powerOn" />
+ * <attribute name="stopAction" type="{http://www.w3.org/2001/XMLSchema}string" default="powerOff" />
+ * <anyAttribute processContents='lax'/>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </pre>
+ */
+@XmlType
+@XmlRootElement(name = "Item")
+public class StartupSectionItem extends Item {
+
+ // TODO Builder
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ StartupSectionItem that = StartupSectionItem.class.cast(obj);
+ return super.equals(that);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/VirtualHardwareSection.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/VirtualHardwareSection.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/VirtualHardwareSection.java
new file mode 100644
index 0000000..0d4d0f9
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/VirtualHardwareSection.java
@@ -0,0 +1,199 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf;
+
+import static com.google.common.base.Objects.equal;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+
+import org.jclouds.dmtf.cim.ResourceAllocationSettingData;
+import org.jclouds.dmtf.cim.VirtualSystemSettingData;
+
+import com.google.common.base.Joiner;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
+
+/**
+ * The virtual hardware required by a virtual machine is specified in VirtualHardwareSection.
+ *
+ * This specification supports abstract or incomplete hardware descriptions in which only the major
+ * devices are described. The hypervisor is allowed to create additional virtual hardware
+ * controllers and devices, as long as the required devices listed in the descriptor are realized.
+ */
+public class VirtualHardwareSection extends SectionType {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return builder().fromVirtualHardwareSection(this);
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ }
+
+ public static class Builder<B extends Builder<B>> extends SectionType.Builder<B> {
+
+ private VirtualSystemSettingData virtualSystem;
+ private String transport;
+ private Set<ResourceAllocationSettingData> items = Sets.newLinkedHashSet();
+
+ /**
+ * @see VirtualHardwareSection#getSystem()
+ */
+ public B system(VirtualSystemSettingData virtualSystem) {
+ this.virtualSystem = virtualSystem;
+ return self();
+ }
+
+ /**
+ * @see VirtualHardwareSection#getTransport()
+ */
+ public B transport(String transport) {
+ this.transport = transport;
+ return self();
+ }
+
+ /**
+ * @see VirtualHardwareSection#getTransport()
+ */
+ public B transport(Iterable<String> transports) {
+ this.transport = Joiner.on(',').join(transports);
+ return self();
+ }
+
+ /**
+ * @see VirtualHardwareSection#getTransport()
+ */
+ public B transport(String...transports) {
+ this.transport = Joiner.on(',').join(transports);
+ return self();
+ }
+
+ /**
+ * @see VirtualHardwareSection#getItems()
+ */
+ public B item(ResourceAllocationSettingData item) {
+ this.items.add(checkNotNull(item, "item"));
+ return self();
+ }
+
+ /**
+ * @see VirtualHardwareSection#getItems()
+ */
+ public B items(Iterable<? extends ResourceAllocationSettingData> items) {
+ this.items = Sets.newLinkedHashSet(checkNotNull(items, "items"));
+ return self();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public VirtualHardwareSection build() {
+ return new VirtualHardwareSection(this);
+ }
+
+ public B fromVirtualHardwareSection(VirtualHardwareSection in) {
+ return fromSectionType(in)
+ .items(in.getItems())
+ .transport(in.getTransport())
+ .system(in.getSystem());
+ }
+ }
+
+ @XmlElement(name = "System")
+ protected VirtualSystemSettingData virtualSystem;
+ @XmlAttribute(name = "transport")
+ protected String transport;
+ @XmlElement(name = "Item")
+ protected Set<? extends ResourceAllocationSettingData> items = Sets.newLinkedHashSet();
+
+ protected VirtualHardwareSection(Builder<?> builder) {
+ super(builder);
+ this.virtualSystem = builder.virtualSystem;
+ this.transport = builder.transport;
+ this.items = builder.items != null ? ImmutableSet.copyOf(builder.items) : Sets.<ResourceAllocationSettingData>newLinkedHashSet();
+ }
+
+ protected VirtualHardwareSection() {
+ // For JAXB
+ }
+
+ /**
+ * Comma-separated list of supported transports types for the OVF descriptor.
+ *
+ * Transport types define methods by which the environment document is communicated from the
+ * deployment platform to the guest software.
+ * <p>
+ * To enable interoperability, this specification defines an "iso" transport type which all
+ * implementations that support CD-ROM devices are required to support. The iso transport
+ * communicates the environment 1346 document by making a dynamically generated ISO image
+ * available to the guest software. To support the iso transport type, prior to booting a virtual
+ * machine, an implementation shall make an ISO 9660 read-only disk image available as backing
+ * for a disconnected CD-ROM. If the iso transport is selected for a VirtualHardwareSection, at
+ * least one disconnected CD-ROM device shall be present in this section.
+ * <p>
+ * Support for the "iso" transport type is not a requirement for virtual hardware architectures
+ * or guest 1351 operating systems which do not have CD-ROM device support.
+ *
+ * @return
+ */
+ public String getTransport() {
+ return transport;
+ }
+
+ public VirtualSystemSettingData getSystem() {
+ return virtualSystem;
+ }
+
+ public Set<? extends ResourceAllocationSettingData> getItems() {
+ return ImmutableSet.copyOf(items);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(super.hashCode(), transport, virtualSystem, items);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null) return false;
+ if (getClass() != obj.getClass()) return false;
+ VirtualHardwareSection that = VirtualHardwareSection.class.cast(obj);
+ return super.equals(that)
+ && equal(this.transport, that.transport)
+ && equal(this.virtualSystem, that.virtualSystem)
+ && equal(this.items, that.items);
+ }
+
+ @Override
+ protected MoreObjects.ToStringHelper string() {
+ return super.string()
+ .add("transport", transport)
+ .add("virtualSystem", virtualSystem)
+ .add("items", items);
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/EntityType.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/EntityType.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/EntityType.java
new file mode 100644
index 0000000..aeedeaf
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/EntityType.java
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf.environment;
+
+import static org.jclouds.dmtf.DMTFConstants.OVF_ENV_NS;
+
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElementRef;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+
+/**
+ * Container of sections for a specific entity
+ *
+ * <pre>
+ * <complexType name="Entity_Type">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element ref="{http://schemas.dmtf.org/ovf/environment/1}Section" maxOccurs="unbounded" minOccurs="0"/>
+ * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <anyAttribute processContents='lax'/>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ */
+@XmlType(name = "Entity_Type")
+public class EntityType {
+
+ @XmlElementRef(name = "Section", namespace = OVF_ENV_NS)
+ protected Set<SectionType<?>> sections = Sets.newLinkedHashSet();
+ @XmlAnyElement(lax = true)
+ protected Set<Object> any = Sets.newLinkedHashSet();
+ @XmlAttribute(namespace = OVF_ENV_NS, required = true)
+ protected String id;
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = Maps.newLinkedHashMap();
+
+ /**
+ * Gets the value of the sections property.
+ */
+ public Set<SectionType<?>> getSection() {
+ return sections;
+ }
+
+ /**
+ * Gets the value of the any property.
+ */
+ public Set<Object> getAny() {
+ return any;
+ }
+
+ /**
+ * Gets the value of the id property.
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ */
+ public Map<QName, String> getOtherAttributes() {
+ return otherAttributes;
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/EnvironmentType.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/EnvironmentType.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/EnvironmentType.java
new file mode 100644
index 0000000..ee15f55
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/EnvironmentType.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf.environment;
+
+import static org.jclouds.dmtf.DMTFConstants.OVF_ENV_NS;
+
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementRef;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+
+/**
+ * Type for root OVF environment
+ *
+ * <pre>
+ * <complexType name="Environment_Type">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element ref="{http://schemas.dmtf.org/ovf/environment/1}Section" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="Entity" type="{http://schemas.dmtf.org/ovf/environment/1}Entity_Type" maxOccurs="unbounded" minOccurs="0"/>
+ * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
+ * <anyAttribute processContents='lax'/>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ */
+@XmlType(name = "Environment_Type")
+public class EnvironmentType {
+
+ @XmlElementRef(name = "Section", namespace = OVF_ENV_NS)
+ protected Set<SectionType<?>> sections = Sets.newLinkedHashSet();
+ @XmlElement(name = "Entity")
+ protected Set<EntityType> entities = Sets.newLinkedHashSet();
+ @XmlAnyElement(lax = true)
+ protected Set<Object> any = Sets.newLinkedHashSet();
+ @XmlAttribute(namespace = OVF_ENV_NS)
+ protected String id;
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = Maps.newLinkedHashMap();
+
+ /**
+ * Entity independent meta-data sections Gets the value of the sections property.
+ */
+ public Set<SectionType<?>> getSections() {
+ return sections;
+ }
+
+ /**
+ * Gets the value of the entities property.
+ */
+ public Set<EntityType> getEntities() {
+ return entities;
+ }
+
+ /**
+ * Gets the value of the any property.
+ */
+ public Set<Object> getAny() {
+ return any;
+ }
+
+ /**
+ * Gets the value of the id property.
+ */
+ public String getId() {
+ if (id == null) {
+ return "";
+ } else {
+ return id;
+ }
+ }
+
+ /**
+ * Sets the value of the id property.
+ */
+ public void setId(String value) {
+ this.id = value;
+ }
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ */
+ public Map<QName, String> getOtherAttributes() {
+ return otherAttributes;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/PlatformSectionType.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/PlatformSectionType.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/PlatformSectionType.java
new file mode 100644
index 0000000..0a766de
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/PlatformSectionType.java
@@ -0,0 +1,141 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf.environment;
+
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jclouds.dmtf.cim.CimString;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import com.google.common.collect.Sets;
+
+/**
+ * Information about deployment platform
+ *
+ * <pre>
+ * <complexType name="PlatformSection_Type">
+ * <complexContent>
+ * <extension base="{http://schemas.dmtf.org/ovf/environment/1}Section_Type">
+ * <sequence>
+ * <element name="Kind" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
+ * <element name="Version" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
+ * <element name="Vendor" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
+ * <element name="Locale" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
+ * <element name="Timezone" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * <anyAttribute processContents='lax'/>
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ */
+@XmlRootElement(name = "PlatformSection")
+@XmlType(name = "PlatformSection_Type")
+public class PlatformSectionType extends SectionType<PlatformSectionType> {
+
+ @XmlElement(name = "Kind")
+ protected CimString kind;
+ @XmlElement(name = "Version")
+ protected CimString version;
+ @XmlElement(name = "Vendor")
+ protected CimString vendor;
+ @XmlElement(name = "Locale")
+ protected CimString locale;
+ @XmlElement(name = "Timezone")
+ protected Integer timezone;
+ @XmlAnyElement(lax = true)
+ protected Set<Object> any = Sets.newLinkedHashSet();
+
+ /**
+ * Gets the value of the kind property.
+ */
+ public CimString getKind() {
+ return kind;
+ }
+
+ /**
+ * Gets the value of the version property.
+ */
+ public CimString getVersion() {
+ return version;
+ }
+
+ /**
+ * Gets the value of the vendor property.
+ */
+ public CimString getVendor() {
+ return vendor;
+ }
+
+ /**
+ * Gets the value of the locale property.
+ */
+ public CimString getLocale() {
+ return locale;
+ }
+
+ /**
+ * Gets the value of the timezone property.
+ */
+ public Integer getTimezone() {
+ return timezone;
+ }
+
+ /**
+ * Gets the value of the any property.
+ */
+ public Set<Object> getAny() {
+ return any;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(super.hashCode(), version, vendor, timezone, locale, kind, any);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ PlatformSectionType that = (PlatformSectionType) obj;
+ return super.equals(that) &&
+ Objects.equal(this.version, that.version) &&
+ Objects.equal(this.vendor, that.vendor) &&
+ Objects.equal(this.timezone, that.timezone) &&
+ Objects.equal(this.locale, that.locale) &&
+ Objects.equal(this.kind, that.kind) &&
+ Objects.equal(this.any, that.any);
+ }
+
+ @Override
+ protected MoreObjects.ToStringHelper string() {
+ return super.string()
+ .add("version", version).add("vendor", vendor).add("timezone", timezone)
+ .add("locale", locale).add("kind", kind).add("any", any);
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/Property.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/Property.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/Property.java
new file mode 100644
index 0000000..2baf2bd
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/Property.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf.environment;
+
+import static org.jclouds.dmtf.DMTFConstants.OVF_ENV_NS;
+
+import java.util.Map;
+
+import com.google.common.collect.Maps;
+
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+/**
+ * Java class for anonymous complex type.
+ */
+@XmlType(name = "")
+public class Property {
+
+ @XmlAttribute(namespace = OVF_ENV_NS, required = true)
+ protected String key;
+ @XmlAttribute(namespace = OVF_ENV_NS, required = true)
+ protected String value;
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = Maps.newHashMap();
+
+ /**
+ * Gets the value of the key property.
+ */
+ public String getKey() {
+ return key;
+ }
+
+ /**
+ * Sets the value of the key property.
+ */
+ public void setKey(String value) {
+ this.key = value;
+ }
+
+ /**
+ * Gets the value of the value property.
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ */
+ public Map<QName, String> getOtherAttributes() {
+ return otherAttributes;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/PropertySectionType.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/PropertySectionType.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/PropertySectionType.java
new file mode 100644
index 0000000..cb1229f
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/PropertySectionType.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf.environment;
+
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import com.google.common.collect.Sets;
+
+/**
+ * Key/value pairs of assigned properties for an entity
+ *
+ * <pre>
+ * <complexType name="PropertySection_Type">
+ * <complexContent>
+ * <extension base="{http://schemas.dmtf.org/ovf/environment/1}Section_Type">
+ * <sequence>
+ * <element name="Property" maxOccurs="unbounded" minOccurs="0">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <anyAttribute processContents='lax'/>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * <anyAttribute processContents='lax'/>
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ */
+@XmlRootElement(name = "PropertySection")
+@XmlType(name = "PropertySection_Type")
+public class PropertySectionType extends SectionType<PropertySectionType> {
+
+ @XmlElement(name = "Property")
+ protected Set<Property> properties = Sets.newLinkedHashSet();
+ @XmlAnyElement(lax = true)
+ protected Set<Object> any = Sets.newLinkedHashSet();
+
+ /**
+ * Gets the value of the properties property.
+ */
+ public Set<Property> getProperties() {
+ return properties;
+ }
+
+ /**
+ * Gets the value of the any property.
+ */
+ public Set<Object> getAny() {
+ return any;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(super.hashCode(), properties, any);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ PropertySectionType that = (PropertySectionType) obj;
+ return super.equals(that) &&
+ Objects.equal(this.properties, that.properties) &&
+ Objects.equal(this.any, that.any);
+ }
+
+ @Override
+ protected MoreObjects.ToStringHelper string() {
+ return super.string()
+ .add("properties", properties).add("any", any);
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/SectionType.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/SectionType.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/SectionType.java
new file mode 100644
index 0000000..6f8e653
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/SectionType.java
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf.environment;
+
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import com.google.common.collect.Maps;
+
+/**
+ * Abstract type for all sections in
+ * environment
+ *
+ * <p>Java class for Section_Type complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Section_Type">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <anyAttribute processContents='lax'/>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ */
+@XmlType(name = "Section_Type")
+@XmlSeeAlso({
+ PlatformSectionType.class,
+ PropertySectionType.class
+})
+public abstract class SectionType<T extends SectionType<T>> {
+
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = Maps.newLinkedHashMap();
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ */
+ public Map<QName, String> getOtherAttributes() {
+ return otherAttributes;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(otherAttributes);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ SectionType<?> that = (SectionType<?>) obj;
+ return Objects.equal(this.otherAttributes, that.otherAttributes);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+ protected MoreObjects.ToStringHelper string() {
+ return MoreObjects.toStringHelper("").add("otherAttributes", otherAttributes);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/package-info.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/package-info.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/package-info.java
new file mode 100644
index 0000000..303b2f0
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/environment/package-info.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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 = OVF_ENV_NS,
+ elementFormDefault = XmlNsForm.QUALIFIED,
+ xmlns = {
+ @XmlNs(prefix = "cim", namespaceURI = CIM_NS),
+ @XmlNs(prefix = "ovf", namespaceURI = OVF_NS),
+ @XmlNs(prefix = "env", namespaceURI = OVF_ENV_NS)
+ }
+)
+@XmlAccessorType(XmlAccessType.FIELD)
+package org.jclouds.dmtf.ovf.environment;
+
+import static org.jclouds.dmtf.DMTFConstants.CIM_NS;
+import static org.jclouds.dmtf.DMTFConstants.OVF_ENV_NS;
+import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlSchema;
+
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/internal/BaseEnvelope.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/internal/BaseEnvelope.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/internal/BaseEnvelope.java
new file mode 100644
index 0000000..f105f78
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/internal/BaseEnvelope.java
@@ -0,0 +1,177 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf.internal;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.Set;
+
+import org.jclouds.dmtf.ovf.DiskSection;
+import org.jclouds.dmtf.ovf.NetworkSection;
+import org.jclouds.dmtf.ovf.SectionType;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
+
+public abstract class BaseEnvelope<V extends BaseVirtualSystem, E extends BaseEnvelope<V, E>> {
+
+ public abstract Builder<?, V, E> toBuilder();
+
+ public abstract static class Builder<B extends Builder<B, V, E>, V extends BaseVirtualSystem, E extends BaseEnvelope<V, E>> {
+
+ protected Set<DiskSection> diskSections = Sets.newLinkedHashSet();
+ protected Set<NetworkSection> networkSections = Sets.newLinkedHashSet();
+ protected Set<SectionType> additionalSections = Sets.newLinkedHashSet();
+ protected V virtualSystem;
+
+ @SuppressWarnings("unchecked")
+ protected B self() {
+ return (B) this;
+ }
+
+ /**
+ * @see BaseEnvelope#getDiskSections
+ */
+ public B diskSection(DiskSection diskSection) {
+ this.diskSections.add(checkNotNull(diskSection, "diskSection"));
+ return self();
+ }
+
+ /**
+ * @see BaseEnvelope#getDiskSections
+ */
+ public B diskSections(Iterable<? extends DiskSection> diskSections) {
+ this.diskSections = ImmutableSet.<DiskSection> copyOf(checkNotNull(diskSections, "diskSections"));
+ return self();
+ }
+
+ /**
+ * @see BaseEnvelope#getNetworkSections
+ */
+ public B networkSection(NetworkSection networkSection) {
+ this.networkSections.add(checkNotNull(networkSection, "networkSection"));
+ return self();
+ }
+
+ /**
+ * @see BaseEnvelope#getNetworkSections
+ */
+ public B networkSections(Iterable<? extends NetworkSection> networkSections) {
+ this.networkSections = ImmutableSet.<NetworkSection> copyOf(checkNotNull(networkSections, "networkSections"));
+ return self();
+ }
+
+ /**
+ * @see BaseEnvelope#getAdditionalSections
+ */
+ public B additionalSection(SectionType additionalSection) {
+ this.additionalSections.add(checkNotNull(additionalSection, "additionalSection"));
+ return self();
+ }
+
+ /**
+ * @see BaseEnvelope#getAdditionalSections
+ */
+ public B additionalSections(Iterable<? extends SectionType> additionalSections) {
+ this.additionalSections = ImmutableSet.<SectionType> copyOf(checkNotNull(additionalSections, "additionalSections"));
+ return self();
+ }
+
+ /**
+ * @see BaseEnvelope#getVirtualSystem
+ */
+ public B virtualSystem(V virtualSystem) {
+ this.virtualSystem = virtualSystem;
+ return self();
+ }
+
+ public abstract E build();
+
+ public B fromEnvelope(BaseEnvelope<V, E> in) {
+ return virtualSystem(in.getVirtualSystem())
+ .diskSections(in.getDiskSections())
+ .networkSections(networkSections)
+ .additionalSections(in.getAdditionalSections());
+ }
+
+ }
+
+ private Set<DiskSection> diskSections;
+ private Set<NetworkSection> networkSections;
+ private Set<SectionType> additionalSections;
+ private V virtualSystem;
+
+ protected BaseEnvelope(Builder<?, V, E> builder) {
+ this.diskSections = ImmutableSet.copyOf(checkNotNull(builder.diskSections, "diskSections"));
+ this.networkSections = ImmutableSet.copyOf(checkNotNull(builder.networkSections, "networkSections"));
+ this.additionalSections = ImmutableSet.copyOf(checkNotNull(builder.additionalSections, "additionalSections"));
+ this.virtualSystem = checkNotNull(builder.virtualSystem, "virtualSystem");
+ }
+
+ protected BaseEnvelope() {
+ // for JAXB
+ }
+
+ public V getVirtualSystem() {
+ return virtualSystem;
+ }
+
+ public Set<DiskSection> getDiskSections() {
+ return diskSections;
+ }
+
+ public Set<NetworkSection> getNetworkSections() {
+ return networkSections;
+ }
+
+ public Set<SectionType> getAdditionalSections() {
+ return additionalSections;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(additionalSections, diskSections, networkSections, virtualSystem);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null) return false;
+ if (getClass() != obj.getClass()) return false;
+
+ BaseEnvelope<?, ?> other = (BaseEnvelope<?, ?>) obj;
+ return Objects.equal(additionalSections, other.additionalSections)
+ && Objects.equal(diskSections, other.diskSections)
+ && Objects.equal(networkSections, other.networkSections)
+ && Objects.equal(virtualSystem, other.virtualSystem);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+ protected MoreObjects.ToStringHelper string() {
+ return MoreObjects.toStringHelper("")
+ .add("diskSections", diskSections)
+ .add("networkSections", networkSections)
+ .add("additionalSections", additionalSections)
+ .add("virtualSystem", virtualSystem);
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/internal/BaseVirtualSystem.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/internal/BaseVirtualSystem.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/internal/BaseVirtualSystem.java
new file mode 100644
index 0000000..4a82f74
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/internal/BaseVirtualSystem.java
@@ -0,0 +1,171 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf.internal;
+
+import static com.google.common.base.Objects.equal;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
+
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementRef;
+
+import org.jclouds.dmtf.ovf.ProductSection;
+import org.jclouds.dmtf.ovf.SectionType;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
+
+public abstract class BaseVirtualSystem extends SectionType {
+
+ public abstract static class Builder<B extends Builder<B>> extends SectionType.Builder<B> {
+
+ private String id;
+ private String name;
+ private Set<ProductSection> productSections = Sets.newLinkedHashSet();
+ private Set<SectionType> additionalSections = Sets.newLinkedHashSet();
+
+ /**
+ * @see BaseVirtualSystem#getName()
+ */
+ public B name(String name) {
+ this.name = name;
+ return self();
+ }
+
+ /**
+ * @see BaseVirtualSystem#getId()
+ */
+ public B id(String id) {
+ this.id = id;
+ return self();
+ }
+
+ /**
+ * @see BaseVirtualSystem#getProductSections()
+ */
+ public B productSection(ProductSection productSection) {
+ this.productSections.add(checkNotNull(productSection, "productSection"));
+ return self();
+ }
+
+ /**
+ * @see BaseVirtualSystem#getProductSections()
+ */
+ public B productSections(Iterable<ProductSection> productSections) {
+ this.productSections = Sets.newLinkedHashSet(checkNotNull(productSections, "productSections"));
+ return self();
+ }
+
+ /**
+ * @see BaseVirtualSystem#getAdditionalSections()
+ */
+ public B additionalSection(SectionType additionalSection) {
+ this.additionalSections.add(checkNotNull(additionalSection, "additionalSection"));
+ return self();
+ }
+
+ /**
+ * @see BaseVirtualSystem#getAdditionalSections()
+ */
+ public B additionalSections(Iterable<? extends SectionType> additionalSections) {
+ this.additionalSections = Sets.newLinkedHashSet(checkNotNull(additionalSections, "additionalSections"));
+ return self();
+ }
+
+ public B fromBaseVirtualSystem(BaseVirtualSystem in) {
+ return fromSectionType(in)
+ .id(in.getId())
+ .name(in.getName())
+ .productSections(in.getProductSections())
+ .additionalSections(in.getAdditionalSections());
+ }
+ }
+
+ @XmlAttribute(namespace = OVF_NS)
+ private String id;
+ @XmlElement(name = "Name")
+ private String name;
+ @XmlElement(name = "ProductSection")
+ private Set<ProductSection> productSections;
+ @XmlElementRef
+ private Set<SectionType> additionalSections;
+
+ protected BaseVirtualSystem(Builder<?> builder) {
+ super(builder);
+ this.id = builder.id;
+ this.name = builder.name;
+ this.productSections = ImmutableSet.copyOf(checkNotNull(builder.productSections, "productSections"));
+ this.additionalSections = ImmutableSet.copyOf(checkNotNull(builder.additionalSections, "additionalSections"));
+ }
+
+ protected BaseVirtualSystem() {
+ // For JAXB
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Specifies product-information for a package, such as product name and version, along with a
+ * set of properties that can be configured
+ */
+ public Set<ProductSection> getProductSections() {
+ return productSections;
+ }
+
+ public Set<SectionType> getAdditionalSections() {
+ return additionalSections;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(super.hashCode(), id, name, productSections, additionalSections);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null) return false;
+ if (getClass() != obj.getClass()) return false;
+
+ BaseVirtualSystem other = (BaseVirtualSystem) obj;
+ return super.equals(other)
+ && equal(id, other.id)
+ && equal(name, other.name)
+ && equal(productSections, other.productSections)
+ && equal(additionalSections, other.additionalSections);
+ }
+
+ @Override
+ protected MoreObjects.ToStringHelper string() {
+ return super.string()
+ .add("id", id)
+ .add("name", name)
+ .add("productSections", productSections)
+ .add("additionalSections", additionalSections);
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/internal/package-info.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/internal/package-info.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/internal/package-info.java
new file mode 100644
index 0000000..1d2fb9e
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/internal/package-info.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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 = OVF_NS,
+ elementFormDefault = XmlNsForm.QUALIFIED,
+ xmlns = {
+ @XmlNs(prefix = "cim", namespaceURI = CIM_NS),
+ @XmlNs(prefix = "ovf", namespaceURI = OVF_NS)
+ }
+)
+@XmlAccessorType(XmlAccessType.FIELD)
+package org.jclouds.dmtf.ovf.internal;
+
+import static org.jclouds.dmtf.DMTFConstants.CIM_NS;
+import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlSchema;
+
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/package-info.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/package-info.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/package-info.java
new file mode 100644
index 0000000..94516cf
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/package-info.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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 = OVF_NS,
+ elementFormDefault = XmlNsForm.QUALIFIED,
+ xmlns = {
+ @XmlNs(prefix = "cim", namespaceURI = CIM_NS),
+ @XmlNs(prefix = "ovf", namespaceURI = OVF_NS)
+ }
+)
+@XmlAccessorType(XmlAccessType.FIELD)
+package org.jclouds.dmtf.ovf;
+
+import static org.jclouds.dmtf.DMTFConstants.CIM_NS;
+import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlSchema;
+
[6/6] git commit: Fold dmtf into vcloud-director (its only user).
Posted by ad...@apache.org.
Fold dmtf into vcloud-director (its only user).
Project: http://git-wip-us.apache.org/repos/asf/jclouds-labs/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/7ec7f077
Tree: http://git-wip-us.apache.org/repos/asf/jclouds-labs/tree/7ec7f077
Diff: http://git-wip-us.apache.org/repos/asf/jclouds-labs/diff/7ec7f077
Branch: refs/heads/master
Commit: 7ec7f07719c4bcd8620ee94f29bbb6d2ac7dc007
Parents: a58cf0c
Author: Adrian Cole <ad...@gmail.com>
Authored: Sat Oct 11 10:55:22 2014 -0700
Committer: Adrian Cole <ad...@apache.org>
Committed: Sat Oct 11 20:39:24 2014 -0700
----------------------------------------------------------------------
dmtf/pom.xml | 52 --
.../java/org/jclouds/dmtf/CIMPredicates.java | 53 --
.../java/org/jclouds/dmtf/DMTFConstants.java | 37 -
.../org/jclouds/dmtf/cim/CimAnySimpleType.java | 69 --
.../dmtf/cim/CimAnySimpleTypeAdapter.java | 36 -
.../java/org/jclouds/dmtf/cim/CimBoolean.java | 79 --
.../java/org/jclouds/dmtf/cim/CimReference.java | 95 --
.../java/org/jclouds/dmtf/cim/CimString.java | 95 --
.../org/jclouds/dmtf/cim/CimUnsignedInt.java | 79 --
.../org/jclouds/dmtf/cim/CimUnsignedLong.java | 88 --
.../org/jclouds/dmtf/cim/CimUnsignedShort.java | 95 --
.../main/java/org/jclouds/dmtf/cim/OSType.java | 198 ----
.../dmtf/cim/ResourceAllocationCaption.java | 28 -
.../cim/ResourceAllocationChangeableType.java | 28 -
.../dmtf/cim/ResourceAllocationSettingData.java | 903 -------------------
.../jclouds/dmtf/cim/VirtualSystemCaption.java | 28 -
.../dmtf/cim/VirtualSystemChangeableType.java | 28 -
.../dmtf/cim/VirtualSystemSettingData.java | 720 ---------------
.../HardwareBuilderFromResourceAllocations.java | 70 --
.../java/org/jclouds/dmtf/cim/package-info.java | 39 -
.../org/jclouds/dmtf/ovf/Configuration.java | 147 ---
.../dmtf/ovf/DeploymentOptionSection.java | 122 ---
.../main/java/org/jclouds/dmtf/ovf/Disk.java | 237 -----
.../java/org/jclouds/dmtf/ovf/DiskSection.java | 127 ---
.../main/java/org/jclouds/dmtf/ovf/Item.java | 193 ----
.../main/java/org/jclouds/dmtf/ovf/MsgType.java | 142 ---
.../main/java/org/jclouds/dmtf/ovf/Network.java | 111 ---
.../org/jclouds/dmtf/ovf/NetworkSection.java | 124 ---
.../dmtf/ovf/OperatingSystemSection.java | 156 ----
.../org/jclouds/dmtf/ovf/ProductSection.java | 300 ------
.../dmtf/ovf/ProductSectionProperty.java | 34 -
.../java/org/jclouds/dmtf/ovf/Property.java | 302 -------
.../ovf/PropertyConfigurationValueType.java | 54 --
.../java/org/jclouds/dmtf/ovf/SectionType.java | 142 ---
.../org/jclouds/dmtf/ovf/StartupSection.java | 123 ---
.../jclouds/dmtf/ovf/StartupSectionItem.java | 62 --
.../dmtf/ovf/VirtualHardwareSection.java | 199 ----
.../dmtf/ovf/environment/EntityType.java | 91 --
.../dmtf/ovf/environment/EnvironmentType.java | 114 ---
.../ovf/environment/PlatformSectionType.java | 141 ---
.../jclouds/dmtf/ovf/environment/Property.java | 78 --
.../ovf/environment/PropertySectionType.java | 104 ---
.../dmtf/ovf/environment/SectionType.java | 91 --
.../dmtf/ovf/environment/package-info.java | 37 -
.../jclouds/dmtf/ovf/internal/BaseEnvelope.java | 177 ----
.../dmtf/ovf/internal/BaseVirtualSystem.java | 171 ----
.../jclouds/dmtf/ovf/internal/package-info.java | 35 -
.../java/org/jclouds/dmtf/ovf/package-info.java | 35 -
pom.xml | 1 -
vcloud-director/pom.xml | 17 +-
.../java/org/jclouds/dmtf/CIMPredicates.java | 53 ++
.../java/org/jclouds/dmtf/DMTFConstants.java | 37 +
.../org/jclouds/dmtf/cim/CimAnySimpleType.java | 69 ++
.../dmtf/cim/CimAnySimpleTypeAdapter.java | 36 +
.../java/org/jclouds/dmtf/cim/CimBoolean.java | 79 ++
.../java/org/jclouds/dmtf/cim/CimReference.java | 95 ++
.../java/org/jclouds/dmtf/cim/CimString.java | 95 ++
.../org/jclouds/dmtf/cim/CimUnsignedInt.java | 79 ++
.../org/jclouds/dmtf/cim/CimUnsignedLong.java | 88 ++
.../org/jclouds/dmtf/cim/CimUnsignedShort.java | 95 ++
.../main/java/org/jclouds/dmtf/cim/OSType.java | 198 ++++
.../dmtf/cim/ResourceAllocationCaption.java | 28 +
.../cim/ResourceAllocationChangeableType.java | 28 +
.../dmtf/cim/ResourceAllocationSettingData.java | 903 +++++++++++++++++++
.../jclouds/dmtf/cim/VirtualSystemCaption.java | 28 +
.../dmtf/cim/VirtualSystemChangeableType.java | 28 +
.../dmtf/cim/VirtualSystemSettingData.java | 720 +++++++++++++++
.../HardwareBuilderFromResourceAllocations.java | 70 ++
.../java/org/jclouds/dmtf/cim/package-info.java | 39 +
.../org/jclouds/dmtf/ovf/Configuration.java | 147 +++
.../dmtf/ovf/DeploymentOptionSection.java | 122 +++
.../main/java/org/jclouds/dmtf/ovf/Disk.java | 237 +++++
.../java/org/jclouds/dmtf/ovf/DiskSection.java | 127 +++
.../main/java/org/jclouds/dmtf/ovf/Item.java | 193 ++++
.../main/java/org/jclouds/dmtf/ovf/MsgType.java | 142 +++
.../main/java/org/jclouds/dmtf/ovf/Network.java | 111 +++
.../org/jclouds/dmtf/ovf/NetworkSection.java | 124 +++
.../dmtf/ovf/OperatingSystemSection.java | 156 ++++
.../org/jclouds/dmtf/ovf/ProductSection.java | 300 ++++++
.../dmtf/ovf/ProductSectionProperty.java | 34 +
.../java/org/jclouds/dmtf/ovf/Property.java | 302 +++++++
.../ovf/PropertyConfigurationValueType.java | 54 ++
.../java/org/jclouds/dmtf/ovf/SectionType.java | 142 +++
.../org/jclouds/dmtf/ovf/StartupSection.java | 123 +++
.../jclouds/dmtf/ovf/StartupSectionItem.java | 62 ++
.../dmtf/ovf/VirtualHardwareSection.java | 199 ++++
.../dmtf/ovf/environment/EntityType.java | 91 ++
.../dmtf/ovf/environment/EnvironmentType.java | 114 +++
.../ovf/environment/PlatformSectionType.java | 141 +++
.../jclouds/dmtf/ovf/environment/Property.java | 78 ++
.../ovf/environment/PropertySectionType.java | 104 +++
.../dmtf/ovf/environment/SectionType.java | 91 ++
.../dmtf/ovf/environment/package-info.java | 37 +
.../jclouds/dmtf/ovf/internal/BaseEnvelope.java | 177 ++++
.../dmtf/ovf/internal/BaseVirtualSystem.java | 171 ++++
.../jclouds/dmtf/ovf/internal/package-info.java | 35 +
.../java/org/jclouds/dmtf/ovf/package-info.java | 35 +
97 files changed, 6420 insertions(+), 6484 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/pom.xml
----------------------------------------------------------------------
diff --git a/dmtf/pom.xml b/dmtf/pom.xml
deleted file mode 100644
index e7cdc2d..0000000
--- a/dmtf/pom.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF 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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>jclouds-labs</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
-
- <!-- TODO: consider merging this with vcloud-director as it is not used anywhere else -->
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>dmtf</artifactId>
- <name>jclouds dmtf domain objects</name>
- <description>jclouds implementation of DMTF OVF and CIM domain objects</description>
- <packaging>bundle</packaging>
-
- <properties>
- <jclouds.osgi.export>org.jclouds.dmtf.*;version="${project.version}"</jclouds.osgi.export>
- <jclouds.osgi.import>
- org.jclouds.labs*;version="${project.version}",
- org.jclouds*;version="${jclouds.version}",
- *
- </jclouds.osgi.import>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-compute</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/CIMPredicates.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/CIMPredicates.java b/dmtf/src/main/java/org/jclouds/dmtf/CIMPredicates.java
deleted file mode 100644
index 8fc0671..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/CIMPredicates.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Set;
-
-import org.jclouds.dmtf.cim.ResourceAllocationSettingData;
-import org.jclouds.dmtf.cim.ResourceAllocationSettingData.ResourceType;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.ImmutableSet;
-
-public class CIMPredicates {
-
- /**
- * Return resource allocations of the specific type.
- *
- * @param type
- * type to match the items
- * @return predicate
- */
- public static Predicate<ResourceAllocationSettingData> resourceTypeIn(final ResourceType... types) {
- checkNotNull(types, "resourceTypes");
- final Set<ResourceType> resourceTypes = ImmutableSet.copyOf(types);
- return new Predicate<ResourceAllocationSettingData>() {
- @Override
- public boolean apply(ResourceAllocationSettingData in) {
- return resourceTypes.contains(in.getResourceType());
- }
-
- @Override
- public String toString() {
- return "resourceTypeIn(" + resourceTypes + ")";
- }
- };
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/DMTFConstants.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/DMTFConstants.java b/dmtf/src/main/java/org/jclouds/dmtf/DMTFConstants.java
deleted file mode 100644
index 47eced7..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/DMTFConstants.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf;
-
-/**
- * Constants used by DMTF.
- */
-public final class DMTFConstants {
-
- public static final String OVF_NS = "http://schemas.dmtf.org/ovf/envelope/1";
-
- public static final String OVF_ENV_NS = "http://schemas.dmtf.org/ovf/environment/1";
-
- public static final String CIM_NS = "http://schemas.dmtf.org/wbem/wscim/1/common";
-
- public static final String CIM_VSSD_NS = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData";
-
- public static final String CIM_RASD_NS = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData";
-
- private DMTFConstants() {
- throw new AssertionError("intentionally unimplemented");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/cim/CimAnySimpleType.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/cim/CimAnySimpleType.java b/dmtf/src/main/java/org/jclouds/dmtf/cim/CimAnySimpleType.java
deleted file mode 100644
index 80c0459..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/cim/CimAnySimpleType.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.cim;
-
-import static org.jclouds.dmtf.DMTFConstants.CIM_NS;
-
-import java.util.Map;
-
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-
-import com.google.common.collect.Maps;
-
-/**
- * <p>Java class for cimAnySimpleType complex type.
- *
- * <pre>
- * <complexType name="cimAnySimpleType" />
- * </pre>
- */
-@XmlType(name = "cimAnySimpleType", namespace = CIM_NS)
-public class CimAnySimpleType {
-
- @XmlValue
- @XmlJavaTypeAdapter(CimAnySimpleTypeAdapter.class)
- @XmlSchemaType(name = "anySimpleType")
- protected String value;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = Maps.newHashMap();
-
- /**
- * Gets the value of the value property.
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
- */
- public void setValue(String value) {
- this.value = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/cim/CimAnySimpleTypeAdapter.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/cim/CimAnySimpleTypeAdapter.java b/dmtf/src/main/java/org/jclouds/dmtf/cim/CimAnySimpleTypeAdapter.java
deleted file mode 100644
index b788df9..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/cim/CimAnySimpleTypeAdapter.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.cim;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
-public class CimAnySimpleTypeAdapter extends XmlAdapter<String, String> {
-
- @Override
- public String unmarshal(String value) {
- return javax.xml.bind.DatatypeConverter.parseAnySimpleType(value);
- }
-
- @Override
- public String marshal(String value) {
- if (value == null) {
- return null;
- }
- return javax.xml.bind.DatatypeConverter.printAnySimpleType(value);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/cim/CimBoolean.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/cim/CimBoolean.java b/dmtf/src/main/java/org/jclouds/dmtf/cim/CimBoolean.java
deleted file mode 100644
index 61d7211..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/cim/CimBoolean.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.cim;
-
-import static org.jclouds.dmtf.DMTFConstants.CIM_NS;
-
-import java.util.Map;
-
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-import javax.xml.namespace.QName;
-
-import com.google.common.collect.Maps;
-
-/**
- * Java class for cimBoolean complex type.
- *
- * <pre>
- * <complexType name="cimBoolean" />
- * </pre>
- */
-@XmlType(name = "cimBoolean", namespace = CIM_NS)
-public class CimBoolean {
-
- @XmlValue
- protected boolean value;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = Maps.newHashMap();
-
- /**
- * Gets the value of the value property.
- *
- */
- public boolean isValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
- *
- */
- public void setValue(boolean value) {
- this.value = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and
- * the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute
- * by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return
- * always non-null
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/cim/CimReference.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/cim/CimReference.java b/dmtf/src/main/java/org/jclouds/dmtf/cim/CimReference.java
deleted file mode 100644
index 517e35b..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/cim/CimReference.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.cim;
-
-import static org.jclouds.dmtf.DMTFConstants.CIM_NS;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-/**
- * Java class for cimReference complex type.
- *
- * <pre>
- * <complexType name="cimReference" />
- * </pre>
- */
-@XmlType(name = "cimReference", namespace = CIM_NS)
-public class CimReference {
-
- @XmlAnyElement(lax = true)
- protected List<Object> any;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = Maps.newHashMap();
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Object }
- * {@link Element }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = Lists.newArrayList();
- }
- return this.any;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and
- * the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute
- * by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return
- * always non-null
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/cim/CimString.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/cim/CimString.java b/dmtf/src/main/java/org/jclouds/dmtf/cim/CimString.java
deleted file mode 100644
index 8f8b18d..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/cim/CimString.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.cim;
-
-import static com.google.common.base.Objects.equal;
-
-import java.util.Map;
-
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-import javax.xml.namespace.QName;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.Maps;
-
-/**
- * Java class for cimString complex type.
- *
- * <pre>
- * <complexType name="cimString" />
- * </pre>
- */
-@XmlType(name = "cimString")
-public class CimString {
-
- public CimString() {
- // JAXB
- }
-
- public CimString(String value) {
- this.value = value;
- }
-
- @XmlValue
- protected String value;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = Maps.newHashMap();
-
- /**
- * Gets the value of the value property.
- */
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(value);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- CimString that = CimString.class.cast(obj);
- return equal(this.value, that.value);
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper("").add("value", value).toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/cim/CimUnsignedInt.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/cim/CimUnsignedInt.java b/dmtf/src/main/java/org/jclouds/dmtf/cim/CimUnsignedInt.java
deleted file mode 100644
index 2fd5406..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/cim/CimUnsignedInt.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.cim;
-
-import java.util.Map;
-
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-import javax.xml.namespace.QName;
-
-import com.google.common.collect.Maps;
-
-/**
- * Java class for cimUnsignedInt complex type.
- *
- * <pre>
- * <complexType name="cimUnsignedInt" />
- * </pre>
- */
-@XmlType(name = "cimUnsignedInt", namespace = "http://schemas.dmtf.org/wbem/wscim/1/common")
-public class CimUnsignedInt {
-
- @XmlValue
- @XmlSchemaType(name = "unsignedInt")
- protected long value;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = Maps.newHashMap();
-
- /**
- * Gets the value of the value property.
- *
- */
- public long getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
- *
- */
- public void setValue(long value) {
- this.value = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and
- * the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute
- * by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return
- * always non-null
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/cim/CimUnsignedLong.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/cim/CimUnsignedLong.java b/dmtf/src/main/java/org/jclouds/dmtf/cim/CimUnsignedLong.java
deleted file mode 100644
index cbf7b3e..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/cim/CimUnsignedLong.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.cim;
-
-import java.math.BigInteger;
-import java.util.Map;
-
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-import javax.xml.namespace.QName;
-
-import com.google.common.collect.Maps;
-
-/**
- * Java class for cimUnsignedLong complex type.
- *
- * <pre>
- * <complexType name="cimUnsignedLong" />
- * </pre>
- */
-@XmlType(name = "cimUnsignedLong", namespace = "http://schemas.dmtf.org/wbem/wscim/1/common")
-public class CimUnsignedLong {
-
- @XmlValue
- @XmlSchemaType(name = "unsignedLong")
- protected BigInteger value;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = Maps.newHashMap();
-
- /**
- * Gets the value of the value property.
- *
- * @return
- * possible object is
- * {@link BigInteger }
- *
- */
- public BigInteger getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
- *
- * @param value
- * allowed object is
- * {@link BigInteger }
- *
- */
- public void setValue(BigInteger value) {
- this.value = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and
- * the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute
- * by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return
- * always non-null
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/cim/CimUnsignedShort.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/cim/CimUnsignedShort.java b/dmtf/src/main/java/org/jclouds/dmtf/cim/CimUnsignedShort.java
deleted file mode 100644
index 5f888e5..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/cim/CimUnsignedShort.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.02.08 at 02:47:44 PM GMT
-//
-
-
-package org.jclouds.dmtf.cim;
-
-import java.util.Map;
-
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-import javax.xml.namespace.QName;
-
-import com.google.common.collect.Maps;
-
-/**
- * <p>Java class for cimUnsignedShort complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="cimUnsignedShort">
- * <simpleContent>
- * <extension base="<http://www.w3.org/2001/XMLSchema>unsignedShort">
- * <anyAttribute processContents='lax'/>
- * </extension>
- * </simpleContent>
- * </complexType>
- * </pre>
- */
-@XmlType(name = "cimUnsignedShort", namespace = "http://schemas.dmtf.org/wbem/wscim/1/common")
-public class CimUnsignedShort {
-
- @XmlValue
- @XmlSchemaType(name = "unsignedShort")
- protected int value;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = Maps.newHashMap();
-
- /**
- * Gets the value of the value property.
- *
- */
- public int getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
- *
- */
- public void setValue(int value) {
- this.value = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and
- * the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute
- * by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return
- * always non-null
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/cim/OSType.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/cim/OSType.java b/dmtf/src/main/java/org/jclouds/dmtf/cim/OSType.java
deleted file mode 100644
index 004c7d1..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/cim/OSType.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.cim;
-
-import org.jclouds.compute.domain.OsFamily;
-
-/**
- * Operating system based on DMTF CIM model.
- *
- * @see <a
- * href="http://dmtf.org/sites/default/files/cim/cim_schema_v2280/cim_schema_2.28.0Final-Doc.zip"
- * />
- */
-public enum OSType {
-
- /** Other */
- OTHER(1, "Other", OsFamily.UNRECOGNIZED, false),
-
- /** MACOS */
- MACOS(2, "MACOS", OsFamily.DARWIN, false),
-
- /** Solaris */
- SOLARIS(29, "Solaris", OsFamily.SOLARIS, false),
-
- /** LINUX */
- LINUX(36, "LINUX", OsFamily.LINUX, false),
-
- /** FreeBSD */
- FREEBSD(42, "FreeBSD", OsFamily.FREEBSD, false),
-
- /** NetBSD */
- NETBSD(43, "NetBSD", OsFamily.NETBSD, false),
-
- /** OpenBSD */
- OPENBSD(65, "OpenBSD", OsFamily.OPENBSD, false),
-
- /** Not Applicable */
- NOT_APPLICABLE(66, "Not Applicable", OsFamily.UNRECOGNIZED, false),
-
- /** Microsoft Windows Server 2003 */
- WINDOWS_SERVER_2003(69, "Microsoft Windows Server 2003", OsFamily.WINDOWS, false),
-
- /** Microsoft Windows Server 2003 64-Bit */
- WINDOWS_SERVER_2003_64(70, "Microsoft Windows Server 2003 64-Bit", OsFamily.WINDOWS, true),
-
- /** Microsoft Windows Server 2008 */
- WINDOWS_SERVER_2008(76, "Microsoft Windows Server 2008", OsFamily.WINDOWS, false),
-
- /** Microsoft Windows Server 2008 64-Bit */
- WINDOWS_SERVER_2008_64(77, "Microsoft Windows Server 2008 64-Bit", OsFamily.WINDOWS, true),
-
- /** FreeBSD 64-Bit */
- FREEBSD_64(78, "FreeBSD 64-Bit", OsFamily.FREEBSD, true),
-
- /** RedHat Enterprise Linux */
- RHEL(79, "RedHat Enterprise Linux", OsFamily.RHEL, false),
-
- /** RedHat Enterprise Linux 64-Bit */
- RHEL_64(80, "RedHat Enterprise Linux 64-Bit", OsFamily.RHEL, true),
-
- /** Solaris 64-Bit */
- SOLARIS_64(81, "Solaris 64-Bit", OsFamily.SOLARIS, true),
-
- /** SUSE */
- SUSE(82, "SUSE", OsFamily.SUSE, false),
-
- /** SUSE 64-Bit */
- SUSE_64(83, "SUSE 64-Bit", OsFamily.SUSE, true),
-
- /** SLES */
- SLES(84, "SLES", OsFamily.SUSE, false),
-
- /** SLES 64-Bit */
- SLES_64(85, "SLES 64-Bit", OsFamily.SUSE, true),
-
- /** Novell OES */
- NOVELL_OES(86, "Novell OES", OsFamily.SUSE, true),
-
- /** Mandriva */
- MANDRIVA(89, "Mandriva", OsFamily.MANDRIVA, false),
-
- /** Mandriva 64-Bit */
- MANDRIVA_64(90, "Mandriva 64-Bit", OsFamily.MANDRIVA, true),
-
- /** TurboLinux */
- TURBOLINUX(91, "TurboLinux", OsFamily.TURBOLINUX, false),
-
- /** TurboLinux 64-Bit */
- TURBOLINUX_64(92, "TurboLinux 64-Bit", OsFamily.TURBOLINUX, true),
-
- /** Ubuntu */
- UBUNTU(93, "Ubuntu", OsFamily.UBUNTU, false),
-
- /** Ubuntu 64-Bit */
- UBUNTU_64(94, "Ubuntu 64-Bit", OsFamily.UBUNTU, true),
-
- /** Debian */
- DEBIAN(95, "Debian", OsFamily.DEBIAN, false),
-
- /** Debian 64-Bit */
- DEBIAN_64(96, "Debian 64-Bit", OsFamily.DEBIAN, false),
-
- /** Linux 2.4.x */
- LINUX_2_4(97, "Linux 2.4.x", OsFamily.LINUX, false),
-
- /** Linux 2.4.x 64-Bi */
- LINUX_2_4_64(98, "Linux 2.4.x 64-Bit", OsFamily.LINUX, true),
-
- /** Linux 2.6.x */
- LINUX_2_6(99, "Linux 2.6.x", OsFamily.LINUX, false),
-
- /** Linux 2.6.x 64-Bit */
- LINUX_2_6_64(100, "Linux 2.6.x 64-Bit", OsFamily.LINUX, true),
-
- /** Linux 64-Bit */
- LINUX_64(101, "Linux 64-Bit", OsFamily.LINUX, true),
-
- /** Other 64-Bit */
- OTHER_64(102, "Other 64-Bit", OsFamily.UNRECOGNIZED, true),
-
- /** Microsoft Windows Server 2008 R2 */
- WINDOWS_SERVER_2008_R2(103, "Microsoft Windows Server 2008 R2", OsFamily.WINDOWS, true),
-
- /** VMware ESXi */
- ESXI(104, "VMware ESXi", OsFamily.ESX, true),
-
- /** Microsoft Windows 7 */
- WINDOWS_7(105, "Microsoft Windows 7", OsFamily.WINDOWS, false),
-
- /** CentOS 32-bit */
- CENTOS(106, "CentOS 32-bit", OsFamily.CENTOS, false),
-
- /** CentOS 64-bit */
- CENTOS_64(107, "CentOS 64-bit", OsFamily.CENTOS, true),
-
- /** Oracle Enterprise Linux 32-bit */
- ORACLE_ENTERPRISE_LINUX(108, "Oracle Enterprise Linux 32-bit", OsFamily.OEL, false),
-
- /** Oracle Enterprise Linux 64-bit */
- ORACLE_ENTERPRISE_LINUX_64(109, "Oracle Enterprise Linux 64-bit", OsFamily.OEL, true),
-
- /** eComStation 32-bitx */
- ECOMSTATION_32(109, "eComStation 32-bitx", OsFamily.UNRECOGNIZED, false),
-
- UNRECOGNIZED(Integer.MAX_VALUE, "UNRECOGNIZED", null, true);
-
- private final int code;
-
- public int getCode() {
- return code;
- }
-
- public String getValue() {
- return value;
- }
-
- public OsFamily getFamily() {
- return family;
- }
-
- public boolean is64Bit() {
- return is64Bit;
- }
-
- private final String value;
- private final OsFamily family;
- private final boolean is64Bit;
-
- OSType(int code, String value, OsFamily family, boolean is64Bit) {
- this.code = code;
- this.value = value;
- this.family = family;
- this.is64Bit = is64Bit;
- }
-
- public static OSType fromValue(int code) {
- for (OSType type : values()) {
- if (type.code == code)
- return type;
- }
- return UNRECOGNIZED;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationCaption.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationCaption.java b/dmtf/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationCaption.java
deleted file mode 100644
index 1b3305a..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationCaption.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.cim;
-
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * Java class for anonymous complex type.
- */
-@XmlType(name = "")
-public class ResourceAllocationCaption extends CimString {
-
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationChangeableType.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationChangeableType.java b/dmtf/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationChangeableType.java
deleted file mode 100644
index 14fda0d..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationChangeableType.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.cim;
-
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * Java class for anonymous complex type.
- */
-@XmlType(name = "")
-public class ResourceAllocationChangeableType extends CimUnsignedShort {
-
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationSettingData.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationSettingData.java b/dmtf/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationSettingData.java
deleted file mode 100644
index 8b76485..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationSettingData.java
+++ /dev/null
@@ -1,903 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.cim;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.dmtf.DMTFConstants.CIM_RASD_NS;
-import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
-
-import java.math.BigInteger;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlEnum;
-import javax.xml.bind.annotation.XmlEnumValue;
-import javax.xml.bind.annotation.XmlType;
-
-import com.google.common.base.Function;
-import com.google.common.base.MoreObjects;
-import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-
-/**
- * The ResourceAllocationSettingData class represents settings specifically
- * related to an allocated resource that are outside the scope of the CIM class
- * typically used to represent the resource itself.
- *
- * These settings include information specific to the allocation that may not
- * be visible to the consumer of the resource itself. For example, a virtual
- * processor may look like a 2 GHz processor to the consumer (virtual computer
- * system), however the virtualization system may use time-slicing to schedule
- * the the virtual processor to only allow it to use 1 GHz.
- *
- * @see <a href="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_ResourceAllocationSettingData.xsd">CIM_ResourceAllocationSettingData</a>
- */
-@XmlType(name = "CIM_ResourceAllocationSettingData_Type", namespace = OVF_NS,
- propOrder = {
- "address",
- "addressOnParent",
- "allocationUnits",
- "automaticAllocation",
- "automaticDeallocation",
- "caption",
- "connections",
- "consumerVisibility",
- "description",
- "elementName",
- "hostResources",
- "instanceID",
- "limit",
- "mappingBehavior",
- "otherResourceType",
- "parent",
- "poolID",
- "reservation",
- "resourceSubType",
- "resourceType",
- "virtualQuantity",
- "virtualQuantityUnits",
- "weight"
- }
-)
-public class ResourceAllocationSettingData {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return builder().fromResourceAllocationSettingData(this);
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- }
-
- public static class Builder<B extends Builder<B>> {
-
- private String elementName;
- private String instanceID;
- private String caption;
- private String description;
- private String address;
- private String addressOnParent;
- private String allocationUnits;
- private Boolean automaticAllocation;
- private Boolean automaticDeallocation;
- private ConsumerVisibility consumerVisibility;
- private BigInteger limit;
- private MappingBehavior mappingBehavior;
- private String otherResourceType;
- private String parent;
- private String poolID;
- private BigInteger reservation;
- private String resourceSubType;
- private ResourceType resourceType;
- private BigInteger virtualQuantity;
- private String virtualQuantityUnits;
- private Long weight;
- private Set<CimString> connections = Sets.newLinkedHashSet();
- private Set<CimString> hostResources = Sets.newLinkedHashSet();
-
- @SuppressWarnings("unchecked")
- protected B self() {
- return (B) this;
- }
-
- /**
- * @see ResourceAllocationSettingData#getElementName()
- */
- public B elementName(String elementName) {
- this.elementName = elementName;
- return self();
- }
-
- /**
- *@see ResourceAllocationSettingData#getInstanceId()
- */
- public B instanceID(String instanceID) {
- this.instanceID = instanceID;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getCaption()
- */
- public B caption(String caption) {
- this.caption = caption;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getDescription()
- */
- public B description(String description) {
- this.description = description;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getAddress
- */
- public B address(String address) {
- this.address = address;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getAddressOnParent
- */
- public B addressOnParent(String addressOnParent) {
- this.addressOnParent = addressOnParent;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getAllocationUnits
- */
- public B allocationUnits(String allocationUnits) {
- this.allocationUnits = allocationUnits;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#isAutomaticAllocation()
- */
- public B automaticAllocation(Boolean automaticAllocation) {
- this.automaticAllocation = automaticAllocation;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#isAutomaticDeallocation()
- */
- public B automaticDeallocation(Boolean automaticDeallocation) {
- this.automaticDeallocation = automaticDeallocation;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getConsumerVisibility
- */
- public B consumerVisibility(ConsumerVisibility consumerVisibility) {
- this.consumerVisibility = consumerVisibility;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getLimit
- */
- public B limit(BigInteger limit) {
- this.limit = limit;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getMappingBehavior
- */
- public B mappingBehavior(MappingBehavior mappingBehavior) {
- this.mappingBehavior = mappingBehavior;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getOtherResourceType
- */
- public B otherResourceType(String otherResourceType) {
- this.otherResourceType = otherResourceType;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getParent
- */
- public B parent(String parent) {
- this.parent = parent;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getPoolID
- */
- public B poolID(String poolID) {
- this.poolID = poolID;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getReservation
- */
- public B reservation(BigInteger reservation) {
- this.reservation = reservation;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getResourceSubType
- */
- public B resourceSubType(String resourceSubType) {
- this.resourceSubType = resourceSubType;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getResourceType
- */
- public B resourceType(ResourceType resourceType) {
- this.resourceType = resourceType;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getVirtualQuantity
- */
- public B virtualQuantity(BigInteger virtualQuantity) {
- this.virtualQuantity = virtualQuantity;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getVirtualQuantityUnits
- */
- public B virtualQuantityUnits(String virtualQuantityUnits) {
- this.virtualQuantityUnits = virtualQuantityUnits;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getWeight
- */
- public B weight(Long weight) {
- this.weight = weight;
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getConnections()
- */
- public B connection(CimString connection) {
- this.connections.add(checkNotNull(connection, "connection"));
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getConnections
- */
- public B connections(Iterable<CimString> connections) {
- this.connections = Sets.newLinkedHashSet(checkNotNull(connections, "connections"));
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getHostResources()
- */
- public B hostResource(CimString hostResource) {
- this.hostResources.add(checkNotNull(hostResource, "hostResource"));
- return self();
- }
-
- /**
- * @see ResourceAllocationSettingData#getHostResources
- */
- public B hostResources(Iterable<CimString> hostResources) {
- this.hostResources = Sets.newLinkedHashSet(checkNotNull(hostResources, "hostResources"));
- return self();
- }
-
- public ResourceAllocationSettingData build() {
- return new ResourceAllocationSettingData(this);
- }
-
- public B fromResourceAllocationSettingData(ResourceAllocationSettingData in) {
- return elementName(in.getElementName())
- .instanceID(in.getInstanceID())
- .caption(in.getCaption())
- .description(in.getDescription())
- .address(in.getAddress())
- .addressOnParent(in.getAddressOnParent())
- .allocationUnits(in.getAllocationUnits())
- .automaticAllocation(in.isAutomaticAllocation())
- .automaticDeallocation(in.isAutomaticDeallocation())
- .consumerVisibility(in.getConsumerVisibility())
- .limit(in.getLimit())
- .mappingBehavior(in.getMappingBehavior())
- .otherResourceType(in.getOtherResourceType())
- .parent(in.getParent())
- .poolID(in.getPoolID())
- .reservation(in.getReservation())
- .resourceSubType(in.getResourceSubType())
- .resourceType(in.getResourceType())
- .virtualQuantity(in.getVirtualQuantity())
- .virtualQuantityUnits(in.getVirtualQuantityUnits())
- .weight(in.getWeight())
- .connections(in.getConnections())
- .hostResources(in.getHostResources());
- }
- }
-
- /**
- * The type of resource this allocation setting represents.
- */
- @XmlType
- @XmlEnum(Integer.class)
- public static enum ResourceType {
- @XmlEnumValue("1") OTHER(1),
- @XmlEnumValue("2") COMPUTER_SYSTEM(2),
- @XmlEnumValue("3") PROCESSOR(3),
- @XmlEnumValue("4") MEMORY(4),
- @XmlEnumValue("5") IDE_CONTROLLER(5),
- @XmlEnumValue("6") PARALLEL_SCSI_HBA(6),
- @XmlEnumValue("7") FC_HBA(7),
- @XmlEnumValue("8") ISCSI_HBA(8),
- @XmlEnumValue("9") IB_HCA(9),
- @XmlEnumValue("10") ETHERNET_ADAPTER(10),
- @XmlEnumValue("11") OTHER_NETWORK_ADAPTER(11),
- @XmlEnumValue("12") IO_SLOT(12),
- @XmlEnumValue("13") IO_DEVICE(13),
- @XmlEnumValue("14") FLOPPY_DRIVE(14),
- @XmlEnumValue("15") CD_DRIVE(15),
- @XmlEnumValue("16") DVD_DRIVE(16),
- @XmlEnumValue("17") DISK_DRIVE(17),
- @XmlEnumValue("18") TAPE_DRIVE(18),
- @XmlEnumValue("19") STORAGE_EXTENT(19),
- @XmlEnumValue("20") OTHER_STORAGE_DEVICE(20),
- @XmlEnumValue("21") SERIAL_PORT(21),
- @XmlEnumValue("22") PARALLEL_PORT(22),
- @XmlEnumValue("23") USB_CONTROLLER(23),
- @XmlEnumValue("24") GRAPHICS_CONTROLLER(24),
- @XmlEnumValue("25") IEEE_1394_CONTROLLER(25),
- @XmlEnumValue("26") PARTITIONABLE_UNIT(26),
- @XmlEnumValue("27") BASE_PARTITIONABLE_UNIT(27),
- @XmlEnumValue("28") POWER(28),
- @XmlEnumValue("29") COOLING_CAPACITY(29),
- @XmlEnumValue("30") ETHERNET_SWITCH_PORT(30),
- @XmlEnumValue("31") LOGICAL_DISK(31),
- @XmlEnumValue("32") STORAGE_VOLUME(32),
- @XmlEnumValue("33") ETHERNET_CONNECTION(33),
- @XmlEnumValue("32768") DMTF_RESERVED(Integer.valueOf("8000", 16)),
- @XmlEnumValue("65535") VENDOR_RESERVED(Integer.valueOf("FFFF", 16));
-
- protected final int code;
-
- ResourceType(int code) {
- this.code = code;
- }
-
- public String value() {
- return Integer.toString(code);
- }
-
- protected static final Map<Integer, ResourceType> RESOURCE_TYPE_BY_ID = Maps.uniqueIndex(
- ImmutableSet.copyOf(ResourceType.values()), new Function<ResourceType, Integer>() {
- @Override
- public Integer apply(ResourceType input) {
- return input.code;
- }
- });
-
- public static ResourceType fromValue(String type) {
- return RESOURCE_TYPE_BY_ID.get(Integer.valueOf(checkNotNull(type, "type")));
- }
- }
-
- /**
- * Describes the consumers visibility to the allocated resource.
- */
- @XmlType
- @XmlEnum(Integer.class)
- public static enum ConsumerVisibility {
- @XmlEnumValue("0") UNKNOWN(0),
-
- /**
- * indicates the underlying or host resource is utilized and passed
- * through to the consumer, possibly using partitioning. At least one item
- * shall be present in the HostResource property.
- */
- @XmlEnumValue("2") PASSED_THROUGH(2),
-
- /**
- * indicates the resource is virtualized and may not map directly to an
- * underlying/host resource. Some implementations may support specific
- * assignment for virtualized resources, in which case the host
- * resource(s) are exposed using the HostResource property.
- */
- @XmlEnumValue("3") VIRTUALIZED(3),
-
- /**
- * indicates a representation of the resource does not exist within the
- * context of the resource consumer.
- */
- @XmlEnumValue("4") NOT_REPRESENTED(4),
- @XmlEnumValue("32768") DMTF_RESERVED(Integer.valueOf("8000", 16)),
- @XmlEnumValue("65535") VENDOR_RESERVED(Integer.valueOf("FFFF", 16));
-
- protected final int code;
-
- ConsumerVisibility(int code) {
- this.code = code;
- }
-
- public String value() {
- return Integer.toString(code);
- }
-
- protected static final Map<Integer, ConsumerVisibility> MAPPING_BEHAVIOR_BY_ID = Maps.uniqueIndex(
- ImmutableSet.copyOf(ConsumerVisibility.values()), new Function<ConsumerVisibility, Integer>() {
- @Override
- public Integer apply(ConsumerVisibility input) {
- return input.code;
- }
- });
-
- public static ConsumerVisibility fromValue(String behavior) {
- return MAPPING_BEHAVIOR_BY_ID.get(Integer.valueOf(checkNotNull(behavior, "behavior")));
- }
- }
-
- /**
- * Specifies how this resource maps to underlying resourcesIf the
- * HostResource array contains any entries, this property reflects how the
- * resource maps to those specific resources.
- */
- @XmlType
- @XmlEnum(Integer.class)
- public static enum MappingBehavior {
- @XmlEnumValue("0") UNKNOWN(0),
- @XmlEnumValue("2") NOT_SUPPORTED(2),
- @XmlEnumValue("3") DEDICATED(3),
- @XmlEnumValue("4") SOFT_AFFINITY(4),
- @XmlEnumValue("5") HARD_AFFINITY(5),
- @XmlEnumValue("32768") DMTF_RESERVED(Integer.valueOf("8000", 16)),
- @XmlEnumValue("65535") VENDOR_RESERVED(Integer.valueOf("FFFF", 16));
-
- protected final int code;
-
- MappingBehavior(int code) {
- this.code = code;
- }
-
- public String value() {
- return Integer.toString(code);
- }
-
- protected static final Map<Integer, MappingBehavior> MAPPING_BEHAVIOR_BY_ID = Maps.uniqueIndex(
- ImmutableSet.copyOf(MappingBehavior.values()), new Function<MappingBehavior, Integer>() {
- @Override
- public Integer apply(MappingBehavior input) {
- return input.code;
- }
- });
-
- public static MappingBehavior fromValue(String behavior) {
- return MAPPING_BEHAVIOR_BY_ID.get(Integer.valueOf(checkNotNull(behavior, "behavior")));
- }
- }
-
- @XmlElement(name = "ElementName", namespace = CIM_RASD_NS)
- private String elementName;
- @XmlElement(name = "InstanceID", namespace = CIM_RASD_NS)
- private String instanceID;
- @XmlElement(name = "Caption", namespace = CIM_RASD_NS)
- private String caption;
- @XmlElement(name = "Description", namespace = CIM_RASD_NS)
- private String description;
- @XmlElement(name = "Address", namespace = CIM_RASD_NS)
- private String address;
- @XmlElement(name = "AddressOnParent", namespace = CIM_RASD_NS)
- private String addressOnParent;
- @XmlElement(name = "AllocationUnits", namespace = CIM_RASD_NS)
- private String allocationUnits;
- @XmlElement(name = "AutomaticAllocation", namespace = CIM_RASD_NS)
- private Boolean automaticAllocation;
- @XmlElement(name = "AutomaticDeallocation", namespace = CIM_RASD_NS)
- private Boolean automaticDeallocation;
- @XmlElement(name = "ConsumerVisibility", namespace = CIM_RASD_NS)
- private ConsumerVisibility consumerVisibility;
- @XmlElement(name = "Limit", namespace = CIM_RASD_NS)
- private BigInteger limit;
- @XmlElement(name = "MappingBehavior", namespace = CIM_RASD_NS)
- private MappingBehavior mappingBehavior;
- @XmlElement(name = "OtherResourceType", namespace = CIM_RASD_NS)
- private String otherResourceType;
- @XmlElement(name = "Parent", namespace = CIM_RASD_NS)
- private String parent;
- @XmlElement(name = "PoolID", namespace = CIM_RASD_NS)
- private String poolID;
- @XmlElement(name = "Reservation", namespace = CIM_RASD_NS)
- private BigInteger reservation;
- @XmlElement(name = "ResourceSubType", namespace = CIM_RASD_NS)
- private String resourceSubType;
- @XmlElement(name = "ResourceType", namespace = CIM_RASD_NS)
- private ResourceType resourceType;
- @XmlElement(name = "VirtualQuantity", namespace = CIM_RASD_NS)
- private BigInteger virtualQuantity;
- @XmlElement(name = "VirtualQuantityUnits", namespace = CIM_RASD_NS)
- private String virtualQuantityUnits;
- @XmlElement(name = "Weight", namespace = CIM_RASD_NS)
- private Long weight;
- @XmlElement(name = "Connection", namespace = CIM_RASD_NS)
- private Set<CimString> connections = Sets.newLinkedHashSet();
- @XmlElement(name = "HostResource", namespace = CIM_RASD_NS)
- private Set<CimString> hostResources = Sets.newLinkedHashSet();
-
- protected ResourceAllocationSettingData(Builder<?> builder) {
- this.elementName = builder.elementName;
- this.instanceID = builder.instanceID;
- this.caption = builder.caption;
- this.description = builder.description;
- this.address = builder.address;
- this.addressOnParent = builder.addressOnParent;
- this.allocationUnits = builder.allocationUnits;
- this.automaticAllocation = builder.automaticAllocation;
- this.automaticDeallocation = builder.automaticDeallocation;
- this.consumerVisibility = builder.consumerVisibility;
- this.limit = builder.limit;
- this.mappingBehavior = builder.mappingBehavior;
- this.otherResourceType = builder.otherResourceType;
- this.parent = builder.parent;
- this.poolID = builder.poolID;
- this.reservation = builder.reservation;
- this.resourceSubType = builder.resourceSubType;
- this.resourceType = builder.resourceType;
- this.virtualQuantity = builder.virtualQuantity;
- this.virtualQuantityUnits = builder.virtualQuantityUnits;
- this.weight = builder.weight;
- this.connections = builder.connections != null ? ImmutableSet.copyOf(builder.connections) : ImmutableSet.<CimString>of();
- this.hostResources = builder.hostResources != null ? ImmutableSet.copyOf(builder.hostResources) : ImmutableSet.<CimString>of();
- }
-
- protected ResourceAllocationSettingData() {
- // for JAXB
- }
-
- /**
- * The user-friendly name for this instance of SettingData. In addition, the user-friendly name
- * can be used as an index property for a search or query. (Note: The name does not have to be
- * unique within a namespace.)
- */
- public String getElementName() {
- return elementName;
- }
-
- /**
- * Within the scope of the instantiating Namespace, InstanceID opaquely and uniquely identifies
- * an instance of this class.
- */
- public String getInstanceID() {
- return instanceID;
- }
-
- /**
- * The Caption property is a short textual description (one- line string) of the object.
- */
- public String getCaption() {
- return caption;
- }
-
- /**
- * The Description property provides a textual description of the object.
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * The address of the resource. For example, the MAC address of a Ethernet
- * port.
- */
- public String getAddress() {
- return address;
- }
-
- /**
- * Describes the address of this resource in the context of the Parent. The
- * Parent/AddressOnParent properties are used to describe the controller
- * relationship as well the ordering of devices on a controller.For example,
- * if the parent is a PCI Controller, this property would specify the PCI
- * slot of this child device.
- */
- public String getAddressOnParent() {
- return addressOnParent;
- }
-
- /**
- * This property specifies the units of allocation used by the Reservation
- * and Limit properties. For example, when ResourceType=Processor,
- * AllocationUnits may be set to hertz*10^6 or percent. When
- * ResourceType=Memory, AllocationUnits may be set to bytes*10^3. It is
- * expected that profiles constrain the units that apply in context of
- * particular resource types. The value of this property shall be a legal
- * value of the Programmatic Units qualifier as defined in Annex C.1 of
- * DSP0004 V2.5 or later.
- */
- public String getAllocationUnits() {
- return allocationUnits;
- }
-
- /**
- * This property specifies if the resource will be automatically allocated.
- * For example when set to true, when the consuming virtual computer system
- * is powered on, this resource would be allocated. A value of false
- * indicates the resource must be explicitly allocated. For example, the
- * setting may represent removable media (cdrom, floppy, etc.) where at power
- * on time, the media is not present. An explicit operation is required to
- * allocate the resource.
- */
- public Boolean isAutomaticAllocation() {
- return automaticAllocation;
- }
-
- /**
- * This property specifies if the resource will be automatically
- * de-allocated. For example, when set to true, when the consuming virtual
- * computer system is powered off, this resource would be de-allocated. When
- * set to false, the resource will remain allocated and must be explicitly
- * de-allocated.
- */
- public Boolean isAutomaticDeallocation() {
- return automaticDeallocation;
- }
-
- /**
- * Describes the consumers visibility to the allocated resource.
- */
- public ConsumerVisibility getConsumerVisibility() {
- return consumerVisibility;
- }
-
- /**
- * This property specifies the upper bound, or maximum amount of resource
- * that will be granted for this allocation. For example, a system which
- * supports memory paging may support setting the Limit of a Memory
- * allocation below that of the VirtualQuantity, thus forcing paging to occur
- * for this allocation. The value of the Limit property is expressed in the
- * unit specified by the value of the AllocationUnits property.
- */
- public BigInteger getLimit() {
- return limit;
- }
-
- /**
- * Specifies how this resource maps to underlying resourcesIf the
- * HostResource array contains any entries, this property reflects how the
- * resource maps to those specific resources.
- */
- public MappingBehavior getMappingBehavior() {
- return mappingBehavior;
- }
-
- /**
- * A string that describes the resource type when a well defined value is not
- * available and ResourceType has the value "Other".
- */
- public String getOtherResourceType() {
- return otherResourceType;
- }
-
- /**
- * The Parent of the resource. For example, a controller for the current
- * allocation
- */
- public String getParent() {
- return parent;
- }
-
- /**
- * This property specifies which ResourcePool the resource is currently
- * allocated from, or which ResourcePool the resource will be allocated from
- * when the allocation occurs.
- */
- public String getPoolID() {
- return poolID;
- }
-
- /**
- * This property specifies the amount of resource guaranteed to be available
- * for this allocation. On system which support over-commitment of resources,
- * this value is typically used for admission control to prevent an an
- * allocation from being accepted thus preventing starvation. The value of
- * the Reservation property is expressed in the unit specified by the value
- * of the AllocationUnits property.
- */
- public BigInteger getReservation() {
- return reservation;
- }
-
- /**
- * A string describing an implementation specific sub-type for this resource.
- */
- public String getResourceSubType() {
- return resourceSubType;
- }
-
- /**
- * The type of resource this allocation setting represents.
- */
- public ResourceType getResourceType() {
- return resourceType;
- }
-
- /**
- * This property specifies the quantity of resources presented to the
- * consumer. For example, when ResourceType=Processor, this property would
- * reflect the number of discrete Processors presented to the virtual
- * computer system. When ResourceType=Memory, this property could reflect the
- * number of MB reported to the virtual computer system. The value of the
- * VirtualQuantity property should be expressed in units as defined by the
- * value of the VirtualQuantityUnits property.
- */
- public BigInteger getVirtualQuantity() {
- return virtualQuantity;
- }
-
- /**
- * This property specifies the units used by the VirtualQuantity property.
- * For example - if ResourceType=Processor, the value of the
- * VirtualQuantityUnits property may be set to "count", indicating that the
- * value of the VirtualQuantity property is expressed as a count. - if
- * ResourceType=Memory, the value of the VirtualQuantityUnits property may be
- * set to "bytes*10^3", indicating that the value of the VirtualQuantity
- * property is expressed in kilobyte. It is expected that profiles constrain
- * the units that apply in context of particular resource types. The value of
- * this property shall be a legal value of the Programmatic Units qualifier
- * as defined in Annex C.1 of DSP0004 V2.5 or later.
- */
- public String getVirtualQuantityUnits() {
- return virtualQuantityUnits;
- }
-
- /**
- * This property specifies a relative priority for this allocation in
- * relation to other allocations from the same ResourcePool. This property
- * has no unit of measure, and is only relevant when compared to other
- * allocations vying for the same host resources.
- */
- public Long getWeight() {
- return weight;
- }
-
- /**
- * The thing to which this resource is connected. For example, a named
- * network or switch port.
- */
- public Set<CimString> getConnections() {
- return ImmutableSet.copyOf(connections);
- }
-
- /**
- * This property exposes specific assignment of resources. Each non-null
- * value of the HostResource property shall be formatted as a URI per RFC3986.
- * If this resource is modeled then a value should be a WBEM URI (DSP0207).
- * If the resource is not modeled then see the appropriate profile. Profiles
- * may further constrain the type of URI. A NULL value or empty array
- * requests the implementation decide the kind of host resource. If the
- * virtual resource is mapped to more than one underlying resource, this
- * property may be left NULL. If NULL, the DeviceAllocatedFromPool or
- * ResourceAllocationFromPool associations may be used to determine the pool
- * of host resources this virtual resource may use. If specific assignment is
- * utilized, all underlying resources used by this virtual resource should be
- * listed.The kind of dependency is specified by the ConsumerVisibility and
- * the MappingBehavior properties. Typically the array contains one item,
- * however multiple host resources may be specified. A client may set the
- * value(s) to indicate that the requested virtual resource allocation be
- * based on host resources that are identified by element values.
- */
- public Set<CimString> getHostResources() {
- return ImmutableSet.copyOf(hostResources);
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
- public ToStringHelper string() {
- return MoreObjects.toStringHelper("")
- .add("elementName", elementName)
- .add("instanceID", instanceID)
- .add("caption", caption)
- .add("description", description)
- .add("address", address)
- .add("addressOnParent", addressOnParent)
- .add("allocationUnits", allocationUnits)
- .add("automaticAllocation", automaticAllocation)
- .add("automaticDeallocation", automaticDeallocation)
- .add("connections", connections)
- .add("consumerVisibility", consumerVisibility)
- .add("hostResources", hostResources)
- .add("limit", limit)
- .add("mappingBehavior", mappingBehavior)
- .add("otherResourceType", otherResourceType)
- .add("parent", parent)
- .add("poolID", poolID)
- .add("reservation", reservation)
- .add("resourceSubType", resourceSubType)
- .add("resourceType", resourceType)
- .add("virtualQuantity", virtualQuantity)
- .add("virtualQuantityUnits", virtualQuantityUnits)
- .add("weight", weight);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(elementName, instanceID, caption, description,
- address, addressOnParent, allocationUnits,
- automaticAllocation, automaticDeallocation, connections,
- consumerVisibility, hostResources, limit, mappingBehavior,
- otherResourceType, parent, poolID, reservation, resourceSubType,
- resourceType, virtualQuantity, virtualQuantityUnits, weight);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- ResourceAllocationSettingData that = ResourceAllocationSettingData.class.cast(obj);
- return equal(this.elementName, that.elementName) &&
- equal(this.instanceID, that.instanceID) &&
- equal(this.caption, that.caption) &&
- equal(this.description, that.description) &&
- equal(this.address, that.address) &&
- equal(this.addressOnParent, that.addressOnParent) &&
- equal(this.allocationUnits, that.allocationUnits) &&
- equal(this.automaticAllocation, that.automaticAllocation) &&
- equal(this.automaticDeallocation, that.automaticDeallocation) &&
- equal(this.connections, that.connections) &&
- equal(this.consumerVisibility, that.consumerVisibility) &&
- equal(this.hostResources, that.hostResources) &&
- equal(this.limit, that.limit) &&
- equal(this.mappingBehavior, that.mappingBehavior) &&
- equal(this.otherResourceType, that.otherResourceType) &&
- equal(this.parent, that.parent) &&
- equal(this.poolID, that.poolID) &&
- equal(this.reservation, that.reservation) &&
- equal(this.resourceSubType, that.resourceSubType) &&
- equal(this.resourceType, that.resourceType) &&
- equal(this.virtualQuantity, that.virtualQuantity) &&
- equal(this.virtualQuantityUnits, that.virtualQuantityUnits) &&
- equal(this.weight, that.weight);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/cim/VirtualSystemCaption.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/cim/VirtualSystemCaption.java b/dmtf/src/main/java/org/jclouds/dmtf/cim/VirtualSystemCaption.java
deleted file mode 100644
index c246a0f..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/cim/VirtualSystemCaption.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.cim;
-
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * <p>Java class for anonymous complex type.
- */
-@XmlType(name = "")
-public class VirtualSystemCaption extends CimString {
-
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/cim/VirtualSystemChangeableType.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/cim/VirtualSystemChangeableType.java b/dmtf/src/main/java/org/jclouds/dmtf/cim/VirtualSystemChangeableType.java
deleted file mode 100644
index dffd2f2..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/cim/VirtualSystemChangeableType.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.cim;
-
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * Java class for anonymous complex type.
- */
-@XmlType(name = "")
-public class VirtualSystemChangeableType extends CimUnsignedShort {
-
-
-}
[4/6] Fold dmtf into vcloud-director (its only user).
Posted by ad...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/ProductSectionProperty.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/ProductSectionProperty.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/ProductSectionProperty.java
deleted file mode 100644
index 318a2bb..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/ProductSectionProperty.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * Property element
- *
- * <pre>
- * <element name="Property" />
- * </pre>
- */
-@XmlType(name = "")
-@XmlRootElement(name = "Property")
-public class ProductSectionProperty extends Property {
- // TODO hashCode, equals, toString
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/Property.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/Property.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/Property.java
deleted file mode 100644
index eb19fef..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/Property.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.bind.annotation.XmlType;
-
-import com.google.common.base.Joiner;
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.Sets;
-
-@XmlType(name = "Property")
-@XmlSeeAlso({ ProductSectionProperty.class })
-public class Property {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return builder().fromProperty(this);
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- }
-
- public abstract static class Builder<B extends Builder<B>> {
-
- protected String key;
- protected Set<PropertyConfigurationValueType> values = Sets.newLinkedHashSet();
- protected MsgType label;
- protected MsgType description;
- protected String type;
- protected String qualifiers;
- protected Boolean userConfigurable;
- protected String defaultValue = "";
-
- @SuppressWarnings("unchecked")
- protected B self() {
- return (B) this;
- }
-
- /**
- * @see Property#getKey()
- */
- public B key(String key) {
- this.key = key;
- return self();
- }
-
- /**
- * @see Property#getValues()
- */
- public B values(Set<PropertyConfigurationValueType> values) {
- this.values = checkNotNull(values, "values");
- return self();
- }
-
- /**
- * @see Property#getValues()
- */
- public B value(PropertyConfigurationValueType value) {
- this.values.add(checkNotNull(value, "value"));
- return self();
- }
-
- /**
- * @see Property#getLabel()
- */
- public B label(MsgType label) {
- this.label = label;
- return self();
- }
-
- /**
- * @see Property#getDescription()
- */
- public B description(MsgType description) {
- this.description = description;
- return self();
- }
-
- /**
- * @see Property#getType()
- */
- public B type(String type) {
- this.type = type;
- return self();
- }
-
- /**
- * @see Property#getQualifiers()
- */
- public B qualifiers(String qualifiers) {
- this.qualifiers = qualifiers;
- return self();
- }
-
- /**
- * @see Property#getQualifiers()
- */
- public B qualifiers(Iterable<String> qualifiers) {
- this.qualifiers = Joiner.on(',').join(qualifiers);
- return self();
- }
-
- /**
- * @see Property#getQualifiers()
- */
- public B qualifiers(String...qualifiers) {
- this.qualifiers = Joiner.on(',').join(qualifiers);
- return self();
- }
-
- /**
- * @see Property#isUserConfigurable()
- */
- public B isUserConfigurable(Boolean userConfigurable) {
- this.userConfigurable = userConfigurable;
- return self();
- }
-
- /**
- * @see Property#isUserConfigurable()
- */
- public B userConfigurable() {
- this.userConfigurable = Boolean.TRUE;
- return self();
- }
-
- /**
- * @see Property#isUserConfigurable()
- */
- public B notUserConfigurable() {
- this.userConfigurable = Boolean.FALSE;
- return self();
- }
-
- /**
- * @see Property#getDefaultValue()
- */
- public B defaultValue(String defaultValue) {
- this.defaultValue = defaultValue;
- return self();
- }
-
- public Property build() {
- return new Property(this);
- }
-
- public B fromProperty(Property in) {
- return key(in.getKey()).values(in.getValues()).description(in.getDescription()).label(in.getLabel())
- .type(in.getType()).qualifiers(in.getQualifiers()).isUserConfigurable(in.isUserConfigurable()).defaultValue(in.getDefaultValue());
- }
- }
-
- @XmlAttribute
- private String key;
- @XmlElement(name = "Value")
- private Set<PropertyConfigurationValueType> values;
- @XmlElement(name = "Label")
- private MsgType label;
- @XmlElement(name = "Description")
- private MsgType description;
- @XmlAttribute(required = true)
- private String type;
- @XmlAttribute(required = true)
- private String qualifiers;
- @XmlAttribute
- private Boolean userConfigurable;
- @XmlAttribute(name = "value")
- private String defaultValue;
-
- protected Property(Builder<?> builder) {
- this.key = builder.key;
- this.values = builder.values;
- this.label = builder.label;
- this.description = builder.description;
- this.type = builder.type;
- this.qualifiers = builder.qualifiers;
- this.userConfigurable = builder.userConfigurable;
- this.defaultValue = builder.defaultValue;
- }
-
- protected Property() {
- // for JAXB
- }
-
- /**
- * Property identifier.
- */
- public String getKey() {
- return key;
- }
-
- /**
- * Description of property.
- */
- public MsgType getDescription() {
- return description;
- }
-
- /**
- * Short description of property.
- */
- public MsgType getLabel() {
- return label;
- }
-
- /**
- * Alternative default property values for different configuration
- */
- public Set<PropertyConfigurationValueType> getValues() {
- return values;
- }
-
- /**
- * Property type.
- */
- public String getType() {
- return type;
- }
-
- /**
- * A comma-separated set of type qualifiers.
- */
- public String getQualifiers() {
- return qualifiers;
- }
-
- /**
- * Determines whether the property value is configurable during installation.
- */
- public Boolean isUserConfigurable() {
- return userConfigurable;
- }
-
- /**
- * A Default value for property.
- */
- public String getDefaultValue() {
- if (defaultValue == null) {
- return "";
- } else {
- return defaultValue;
- }
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(key, values, label, description, type, qualifiers, userConfigurable, defaultValue);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Property that = Property.class.cast(obj);
- return equal(this.key, that.key) &&
- equal(this.values, that.values) &&
- equal(this.label, that.label) &&
- equal(this.description, that.description) &&
- equal(this.type, that.type) &&
- equal(this.qualifiers, that.qualifiers) &&
- equal(this.userConfigurable, that.userConfigurable) &&
- equal(this.defaultValue, that.defaultValue);
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper("")
- .add("key", key).add("values", values).add("label", label).add("description", description)
- .add("type", type).add("qualifiers", qualifiers).add("userConfigurable", userConfigurable).add("defaultValue", defaultValue)
- .toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/PropertyConfigurationValueType.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/PropertyConfigurationValueType.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/PropertyConfigurationValueType.java
deleted file mode 100644
index 7efb08e..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/PropertyConfigurationValueType.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * Type for alternative default values for properties when DeploymentOptionSection is used
- *
- * <pre>
- * <complexType name="PropertyConfigurationValue_Type">
- * </pre>
- */
-@XmlType(name = "PropertyConfigurationValue_Type")
-public class PropertyConfigurationValueType {
-
- // TODO Builder
-
- @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true)
- protected String value;
- @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1")
- protected String configuration;
-
- /**
- * Gets the value of the value property.
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Gets the value of the configuration property.
- */
- public String getConfiguration() {
- return configuration;
- }
-
- // TODO hashCode, equals, toString
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/SectionType.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/SectionType.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/SectionType.java
deleted file mode 100644
index aadaf96..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/SectionType.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf;
-
-import static com.google.common.base.Objects.equal;
-import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-
-/**
- * Metadata about a virtual machine or grouping of them.
- *
- * Base type for Sections, subclassing this is the most common form of extensibility. Subtypes define more specific elements.
- */
-@XmlType(name = "Section_Type")
-public abstract class SectionType {
-
- public abstract static class Builder<B extends Builder<B>> {
- private String info;
- private Boolean required;
-
- @SuppressWarnings("unchecked")
- protected B self() {
- return (B) this;
- }
-
- public abstract SectionType build();
-
- /**
- * @see SectionType#getInfo()
- */
- public B info(String info) {
- this.info = info;
- return self();
- }
-
- /**
- * @see SectionType#isRequired()
- */
- public B required(Boolean required) {
- this.required = required;
- return self();
- }
-
- /**
- * @see SectionType#isRequired()
- */
- public B required() {
- this.required = Boolean.TRUE;
- return self();
- }
-
- /**
- * @see SectionType#isRequired()
- */
- public B notRequired() {
- this.required = Boolean.FALSE;
- return self();
- }
-
- public B fromSectionType(SectionType in) {
- return info(in.getInfo()).required(in.isRequired());
- }
- }
-
- @XmlElement(name = "Info", required = true)
- private String info;
- @XmlAttribute(namespace = OVF_NS)
- private Boolean required;
-
- protected SectionType(Builder<?> builder) {
- this.info = builder.info;
- this.required = builder.required;
- }
-
- protected SectionType() {
- // For JAXB
- }
-
- /**
- * Info element describes the meaning of the Section, this is typically shown if the Section is not understood by an application
- *
- * @return ovf info
- */
- public String getInfo() {
- return info;
- }
-
- public void setInfo(String info) {
- this.info = info;
- }
-
- public Boolean isRequired() {
- return required;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(info, required);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- SectionType other = (SectionType) obj;
- return equal(this.info, other.info) && equal(this.required, other.required);
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
- protected MoreObjects.ToStringHelper string() {
- return MoreObjects.toStringHelper("").add("info", info).add("required", required);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/StartupSection.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/StartupSection.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/StartupSection.java
deleted file mode 100644
index 3acf05a..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/StartupSection.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-import com.google.common.base.Objects;
-import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Lists;
-
-/**
- * Specifies the order in which entities in a VirtualSystemCollection are powered on and shut down
- *
- * <pre>
- * <complexType name="StartupSection_Type" />
- * </pre>
- */
-@XmlRootElement(name = "StartupSection")
-@XmlType(name = "StartupSection_Type")
-public class StartupSection extends SectionType {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return builder().fromStartupSection(this);
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- }
-
- public static class Builder<B extends Builder<B>> extends SectionType.Builder<B> {
-
- private List<StartupSectionItem> items = Lists.newArrayList();
-
- /**
- * @see StartupSection#getItem()
- */
- public B items(List<StartupSectionItem> items) {
- this.items = checkNotNull(items, "items");
- return self();
- }
-
- /**
- * @see StartupSection#getItem()
- */
- public B item(StartupSectionItem item) {
- this.items.add(checkNotNull(item, "item"));
- return self();
- }
-
- @Override
- public StartupSection build() {
- return new StartupSection(this);
- }
-
- public B fromStartupSection(StartupSection in) {
- return fromSectionType(in).items(in.getItems());
- }
- }
-
- @XmlElement(name = "Item")
- private List<StartupSectionItem> items = Lists.newArrayList();
-
- protected StartupSection() {
- // For JAXB
- }
-
- public StartupSection(Builder<?> builder) {
- super(builder);
- this.items = (items != null) ? ImmutableList.<StartupSectionItem>copyOf(builder.items) : ImmutableList.<StartupSectionItem>of();
- }
-
- /**
- * Gets the value of the item property.
- */
- public List<StartupSectionItem> getItems() {
- return items;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o == null || getClass() != o.getClass())
- return false;
- StartupSection that = StartupSection.class.cast(o);
- return super.equals(that) && equal(this.items, that.items);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(super.hashCode(), items);
- }
-
- @Override
- public ToStringHelper string() {
- return super.string().add("items", items);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/StartupSectionItem.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/StartupSectionItem.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/StartupSectionItem.java
deleted file mode 100644
index e1cd012..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/StartupSectionItem.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * Java class for Item element declaration.
- *
- * <pre>
- * <element name="Item">
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="order" use="required" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" />
- * <attribute name="startDelay" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
- * <attribute name="waitingForGuest" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- * <attribute name="stopDelay" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
- * <attribute name="startAction" type="{http://www.w3.org/2001/XMLSchema}string" default="powerOn" />
- * <attribute name="stopAction" type="{http://www.w3.org/2001/XMLSchema}string" default="powerOff" />
- * <anyAttribute processContents='lax'/>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </element>
- * </pre>
- */
-@XmlType
-@XmlRootElement(name = "Item")
-public class StartupSectionItem extends Item {
-
- // TODO Builder
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- StartupSectionItem that = StartupSectionItem.class.cast(obj);
- return super.equals(that);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/VirtualHardwareSection.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/VirtualHardwareSection.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/VirtualHardwareSection.java
deleted file mode 100644
index 0d4d0f9..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/VirtualHardwareSection.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-
-import org.jclouds.dmtf.cim.ResourceAllocationSettingData;
-import org.jclouds.dmtf.cim.VirtualSystemSettingData;
-
-import com.google.common.base.Joiner;
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-/**
- * The virtual hardware required by a virtual machine is specified in VirtualHardwareSection.
- *
- * This specification supports abstract or incomplete hardware descriptions in which only the major
- * devices are described. The hypervisor is allowed to create additional virtual hardware
- * controllers and devices, as long as the required devices listed in the descriptor are realized.
- */
-public class VirtualHardwareSection extends SectionType {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return builder().fromVirtualHardwareSection(this);
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- }
-
- public static class Builder<B extends Builder<B>> extends SectionType.Builder<B> {
-
- private VirtualSystemSettingData virtualSystem;
- private String transport;
- private Set<ResourceAllocationSettingData> items = Sets.newLinkedHashSet();
-
- /**
- * @see VirtualHardwareSection#getSystem()
- */
- public B system(VirtualSystemSettingData virtualSystem) {
- this.virtualSystem = virtualSystem;
- return self();
- }
-
- /**
- * @see VirtualHardwareSection#getTransport()
- */
- public B transport(String transport) {
- this.transport = transport;
- return self();
- }
-
- /**
- * @see VirtualHardwareSection#getTransport()
- */
- public B transport(Iterable<String> transports) {
- this.transport = Joiner.on(',').join(transports);
- return self();
- }
-
- /**
- * @see VirtualHardwareSection#getTransport()
- */
- public B transport(String...transports) {
- this.transport = Joiner.on(',').join(transports);
- return self();
- }
-
- /**
- * @see VirtualHardwareSection#getItems()
- */
- public B item(ResourceAllocationSettingData item) {
- this.items.add(checkNotNull(item, "item"));
- return self();
- }
-
- /**
- * @see VirtualHardwareSection#getItems()
- */
- public B items(Iterable<? extends ResourceAllocationSettingData> items) {
- this.items = Sets.newLinkedHashSet(checkNotNull(items, "items"));
- return self();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public VirtualHardwareSection build() {
- return new VirtualHardwareSection(this);
- }
-
- public B fromVirtualHardwareSection(VirtualHardwareSection in) {
- return fromSectionType(in)
- .items(in.getItems())
- .transport(in.getTransport())
- .system(in.getSystem());
- }
- }
-
- @XmlElement(name = "System")
- protected VirtualSystemSettingData virtualSystem;
- @XmlAttribute(name = "transport")
- protected String transport;
- @XmlElement(name = "Item")
- protected Set<? extends ResourceAllocationSettingData> items = Sets.newLinkedHashSet();
-
- protected VirtualHardwareSection(Builder<?> builder) {
- super(builder);
- this.virtualSystem = builder.virtualSystem;
- this.transport = builder.transport;
- this.items = builder.items != null ? ImmutableSet.copyOf(builder.items) : Sets.<ResourceAllocationSettingData>newLinkedHashSet();
- }
-
- protected VirtualHardwareSection() {
- // For JAXB
- }
-
- /**
- * Comma-separated list of supported transports types for the OVF descriptor.
- *
- * Transport types define methods by which the environment document is communicated from the
- * deployment platform to the guest software.
- * <p>
- * To enable interoperability, this specification defines an "iso" transport type which all
- * implementations that support CD-ROM devices are required to support. The iso transport
- * communicates the environment 1346 document by making a dynamically generated ISO image
- * available to the guest software. To support the iso transport type, prior to booting a virtual
- * machine, an implementation shall make an ISO 9660 read-only disk image available as backing
- * for a disconnected CD-ROM. If the iso transport is selected for a VirtualHardwareSection, at
- * least one disconnected CD-ROM device shall be present in this section.
- * <p>
- * Support for the "iso" transport type is not a requirement for virtual hardware architectures
- * or guest 1351 operating systems which do not have CD-ROM device support.
- *
- * @return
- */
- public String getTransport() {
- return transport;
- }
-
- public VirtualSystemSettingData getSystem() {
- return virtualSystem;
- }
-
- public Set<? extends ResourceAllocationSettingData> getItems() {
- return ImmutableSet.copyOf(items);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(super.hashCode(), transport, virtualSystem, items);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null) return false;
- if (getClass() != obj.getClass()) return false;
- VirtualHardwareSection that = VirtualHardwareSection.class.cast(obj);
- return super.equals(that)
- && equal(this.transport, that.transport)
- && equal(this.virtualSystem, that.virtualSystem)
- && equal(this.items, that.items);
- }
-
- @Override
- protected MoreObjects.ToStringHelper string() {
- return super.string()
- .add("transport", transport)
- .add("virtualSystem", virtualSystem)
- .add("items", items);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/EntityType.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/EntityType.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/EntityType.java
deleted file mode 100644
index aeedeaf..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/EntityType.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf.environment;
-
-import static org.jclouds.dmtf.DMTFConstants.OVF_ENV_NS;
-
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElementRef;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-
-/**
- * Container of sections for a specific entity
- *
- * <pre>
- * <complexType name="Entity_Type">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element ref="{http://schemas.dmtf.org/ovf/environment/1}Section" maxOccurs="unbounded" minOccurs="0"/>
- * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <anyAttribute processContents='lax'/>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- */
-@XmlType(name = "Entity_Type")
-public class EntityType {
-
- @XmlElementRef(name = "Section", namespace = OVF_ENV_NS)
- protected Set<SectionType<?>> sections = Sets.newLinkedHashSet();
- @XmlAnyElement(lax = true)
- protected Set<Object> any = Sets.newLinkedHashSet();
- @XmlAttribute(namespace = OVF_ENV_NS, required = true)
- protected String id;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = Maps.newLinkedHashMap();
-
- /**
- * Gets the value of the sections property.
- */
- public Set<SectionType<?>> getSection() {
- return sections;
- }
-
- /**
- * Gets the value of the any property.
- */
- public Set<Object> getAny() {
- return any;
- }
-
- /**
- * Gets the value of the id property.
- */
- public String getId() {
- return id;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/EnvironmentType.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/EnvironmentType.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/EnvironmentType.java
deleted file mode 100644
index ee15f55..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/EnvironmentType.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf.environment;
-
-import static org.jclouds.dmtf.DMTFConstants.OVF_ENV_NS;
-
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementRef;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-
-/**
- * Type for root OVF environment
- *
- * <pre>
- * <complexType name="Environment_Type">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element ref="{http://schemas.dmtf.org/ovf/environment/1}Section" maxOccurs="unbounded" minOccurs="0"/>
- * <element name="Entity" type="{http://schemas.dmtf.org/ovf/environment/1}Entity_Type" maxOccurs="unbounded" minOccurs="0"/>
- * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
- * <anyAttribute processContents='lax'/>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- */
-@XmlType(name = "Environment_Type")
-public class EnvironmentType {
-
- @XmlElementRef(name = "Section", namespace = OVF_ENV_NS)
- protected Set<SectionType<?>> sections = Sets.newLinkedHashSet();
- @XmlElement(name = "Entity")
- protected Set<EntityType> entities = Sets.newLinkedHashSet();
- @XmlAnyElement(lax = true)
- protected Set<Object> any = Sets.newLinkedHashSet();
- @XmlAttribute(namespace = OVF_ENV_NS)
- protected String id;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = Maps.newLinkedHashMap();
-
- /**
- * Entity independent meta-data sections Gets the value of the sections property.
- */
- public Set<SectionType<?>> getSections() {
- return sections;
- }
-
- /**
- * Gets the value of the entities property.
- */
- public Set<EntityType> getEntities() {
- return entities;
- }
-
- /**
- * Gets the value of the any property.
- */
- public Set<Object> getAny() {
- return any;
- }
-
- /**
- * Gets the value of the id property.
- */
- public String getId() {
- if (id == null) {
- return "";
- } else {
- return id;
- }
- }
-
- /**
- * Sets the value of the id property.
- */
- public void setId(String value) {
- this.id = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/PlatformSectionType.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/PlatformSectionType.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/PlatformSectionType.java
deleted file mode 100644
index 0a766de..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/PlatformSectionType.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf.environment;
-
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.jclouds.dmtf.cim.CimString;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.Sets;
-
-/**
- * Information about deployment platform
- *
- * <pre>
- * <complexType name="PlatformSection_Type">
- * <complexContent>
- * <extension base="{http://schemas.dmtf.org/ovf/environment/1}Section_Type">
- * <sequence>
- * <element name="Kind" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
- * <element name="Version" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
- * <element name="Vendor" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
- * <element name="Locale" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
- * <element name="Timezone" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
- * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * <anyAttribute processContents='lax'/>
- * </extension>
- * </complexContent>
- * </complexType>
- * </pre>
- */
-@XmlRootElement(name = "PlatformSection")
-@XmlType(name = "PlatformSection_Type")
-public class PlatformSectionType extends SectionType<PlatformSectionType> {
-
- @XmlElement(name = "Kind")
- protected CimString kind;
- @XmlElement(name = "Version")
- protected CimString version;
- @XmlElement(name = "Vendor")
- protected CimString vendor;
- @XmlElement(name = "Locale")
- protected CimString locale;
- @XmlElement(name = "Timezone")
- protected Integer timezone;
- @XmlAnyElement(lax = true)
- protected Set<Object> any = Sets.newLinkedHashSet();
-
- /**
- * Gets the value of the kind property.
- */
- public CimString getKind() {
- return kind;
- }
-
- /**
- * Gets the value of the version property.
- */
- public CimString getVersion() {
- return version;
- }
-
- /**
- * Gets the value of the vendor property.
- */
- public CimString getVendor() {
- return vendor;
- }
-
- /**
- * Gets the value of the locale property.
- */
- public CimString getLocale() {
- return locale;
- }
-
- /**
- * Gets the value of the timezone property.
- */
- public Integer getTimezone() {
- return timezone;
- }
-
- /**
- * Gets the value of the any property.
- */
- public Set<Object> getAny() {
- return any;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(super.hashCode(), version, vendor, timezone, locale, kind, any);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- PlatformSectionType that = (PlatformSectionType) obj;
- return super.equals(that) &&
- Objects.equal(this.version, that.version) &&
- Objects.equal(this.vendor, that.vendor) &&
- Objects.equal(this.timezone, that.timezone) &&
- Objects.equal(this.locale, that.locale) &&
- Objects.equal(this.kind, that.kind) &&
- Objects.equal(this.any, that.any);
- }
-
- @Override
- protected MoreObjects.ToStringHelper string() {
- return super.string()
- .add("version", version).add("vendor", vendor).add("timezone", timezone)
- .add("locale", locale).add("kind", kind).add("any", any);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/Property.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/Property.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/Property.java
deleted file mode 100644
index 2baf2bd..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/Property.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf.environment;
-
-import static org.jclouds.dmtf.DMTFConstants.OVF_ENV_NS;
-
-import java.util.Map;
-
-import com.google.common.collect.Maps;
-
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-
-/**
- * Java class for anonymous complex type.
- */
-@XmlType(name = "")
-public class Property {
-
- @XmlAttribute(namespace = OVF_ENV_NS, required = true)
- protected String key;
- @XmlAttribute(namespace = OVF_ENV_NS, required = true)
- protected String value;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = Maps.newHashMap();
-
- /**
- * Gets the value of the key property.
- */
- public String getKey() {
- return key;
- }
-
- /**
- * Sets the value of the key property.
- */
- public void setKey(String value) {
- this.key = value;
- }
-
- /**
- * Gets the value of the value property.
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
- */
- public void setValue(String value) {
- this.value = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/PropertySectionType.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/PropertySectionType.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/PropertySectionType.java
deleted file mode 100644
index cb1229f..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/PropertySectionType.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf.environment;
-
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.Sets;
-
-/**
- * Key/value pairs of assigned properties for an entity
- *
- * <pre>
- * <complexType name="PropertySection_Type">
- * <complexContent>
- * <extension base="{http://schemas.dmtf.org/ovf/environment/1}Section_Type">
- * <sequence>
- * <element name="Property" maxOccurs="unbounded" minOccurs="0">
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <attribute name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <anyAttribute processContents='lax'/>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </element>
- * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * <anyAttribute processContents='lax'/>
- * </extension>
- * </complexContent>
- * </complexType>
- * </pre>
- */
-@XmlRootElement(name = "PropertySection")
-@XmlType(name = "PropertySection_Type")
-public class PropertySectionType extends SectionType<PropertySectionType> {
-
- @XmlElement(name = "Property")
- protected Set<Property> properties = Sets.newLinkedHashSet();
- @XmlAnyElement(lax = true)
- protected Set<Object> any = Sets.newLinkedHashSet();
-
- /**
- * Gets the value of the properties property.
- */
- public Set<Property> getProperties() {
- return properties;
- }
-
- /**
- * Gets the value of the any property.
- */
- public Set<Object> getAny() {
- return any;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(super.hashCode(), properties, any);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- PropertySectionType that = (PropertySectionType) obj;
- return super.equals(that) &&
- Objects.equal(this.properties, that.properties) &&
- Objects.equal(this.any, that.any);
- }
-
- @Override
- protected MoreObjects.ToStringHelper string() {
- return super.string()
- .add("properties", properties).add("any", any);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/SectionType.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/SectionType.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/SectionType.java
deleted file mode 100644
index 6f8e653..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/SectionType.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf.environment;
-
-import java.util.Map;
-
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.Maps;
-
-/**
- * Abstract type for all sections in
- * environment
- *
- * <p>Java class for Section_Type complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Section_Type">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <anyAttribute processContents='lax'/>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- */
-@XmlType(name = "Section_Type")
-@XmlSeeAlso({
- PlatformSectionType.class,
- PropertySectionType.class
-})
-public abstract class SectionType<T extends SectionType<T>> {
-
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = Maps.newLinkedHashMap();
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(otherAttributes);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- SectionType<?> that = (SectionType<?>) obj;
- return Objects.equal(this.otherAttributes, that.otherAttributes);
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
- protected MoreObjects.ToStringHelper string() {
- return MoreObjects.toStringHelper("").add("otherAttributes", otherAttributes);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/package-info.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/package-info.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/package-info.java
deleted file mode 100644
index 303b2f0..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/environment/package-info.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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 = OVF_ENV_NS,
- elementFormDefault = XmlNsForm.QUALIFIED,
- xmlns = {
- @XmlNs(prefix = "cim", namespaceURI = CIM_NS),
- @XmlNs(prefix = "ovf", namespaceURI = OVF_NS),
- @XmlNs(prefix = "env", namespaceURI = OVF_ENV_NS)
- }
-)
-@XmlAccessorType(XmlAccessType.FIELD)
-package org.jclouds.dmtf.ovf.environment;
-
-import static org.jclouds.dmtf.DMTFConstants.CIM_NS;
-import static org.jclouds.dmtf.DMTFConstants.OVF_ENV_NS;
-import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlNs;
-import javax.xml.bind.annotation.XmlNsForm;
-import javax.xml.bind.annotation.XmlSchema;
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/internal/BaseEnvelope.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/internal/BaseEnvelope.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/internal/BaseEnvelope.java
deleted file mode 100644
index f105f78..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/internal/BaseEnvelope.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Set;
-
-import org.jclouds.dmtf.ovf.DiskSection;
-import org.jclouds.dmtf.ovf.NetworkSection;
-import org.jclouds.dmtf.ovf.SectionType;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-public abstract class BaseEnvelope<V extends BaseVirtualSystem, E extends BaseEnvelope<V, E>> {
-
- public abstract Builder<?, V, E> toBuilder();
-
- public abstract static class Builder<B extends Builder<B, V, E>, V extends BaseVirtualSystem, E extends BaseEnvelope<V, E>> {
-
- protected Set<DiskSection> diskSections = Sets.newLinkedHashSet();
- protected Set<NetworkSection> networkSections = Sets.newLinkedHashSet();
- protected Set<SectionType> additionalSections = Sets.newLinkedHashSet();
- protected V virtualSystem;
-
- @SuppressWarnings("unchecked")
- protected B self() {
- return (B) this;
- }
-
- /**
- * @see BaseEnvelope#getDiskSections
- */
- public B diskSection(DiskSection diskSection) {
- this.diskSections.add(checkNotNull(diskSection, "diskSection"));
- return self();
- }
-
- /**
- * @see BaseEnvelope#getDiskSections
- */
- public B diskSections(Iterable<? extends DiskSection> diskSections) {
- this.diskSections = ImmutableSet.<DiskSection> copyOf(checkNotNull(diskSections, "diskSections"));
- return self();
- }
-
- /**
- * @see BaseEnvelope#getNetworkSections
- */
- public B networkSection(NetworkSection networkSection) {
- this.networkSections.add(checkNotNull(networkSection, "networkSection"));
- return self();
- }
-
- /**
- * @see BaseEnvelope#getNetworkSections
- */
- public B networkSections(Iterable<? extends NetworkSection> networkSections) {
- this.networkSections = ImmutableSet.<NetworkSection> copyOf(checkNotNull(networkSections, "networkSections"));
- return self();
- }
-
- /**
- * @see BaseEnvelope#getAdditionalSections
- */
- public B additionalSection(SectionType additionalSection) {
- this.additionalSections.add(checkNotNull(additionalSection, "additionalSection"));
- return self();
- }
-
- /**
- * @see BaseEnvelope#getAdditionalSections
- */
- public B additionalSections(Iterable<? extends SectionType> additionalSections) {
- this.additionalSections = ImmutableSet.<SectionType> copyOf(checkNotNull(additionalSections, "additionalSections"));
- return self();
- }
-
- /**
- * @see BaseEnvelope#getVirtualSystem
- */
- public B virtualSystem(V virtualSystem) {
- this.virtualSystem = virtualSystem;
- return self();
- }
-
- public abstract E build();
-
- public B fromEnvelope(BaseEnvelope<V, E> in) {
- return virtualSystem(in.getVirtualSystem())
- .diskSections(in.getDiskSections())
- .networkSections(networkSections)
- .additionalSections(in.getAdditionalSections());
- }
-
- }
-
- private Set<DiskSection> diskSections;
- private Set<NetworkSection> networkSections;
- private Set<SectionType> additionalSections;
- private V virtualSystem;
-
- protected BaseEnvelope(Builder<?, V, E> builder) {
- this.diskSections = ImmutableSet.copyOf(checkNotNull(builder.diskSections, "diskSections"));
- this.networkSections = ImmutableSet.copyOf(checkNotNull(builder.networkSections, "networkSections"));
- this.additionalSections = ImmutableSet.copyOf(checkNotNull(builder.additionalSections, "additionalSections"));
- this.virtualSystem = checkNotNull(builder.virtualSystem, "virtualSystem");
- }
-
- protected BaseEnvelope() {
- // for JAXB
- }
-
- public V getVirtualSystem() {
- return virtualSystem;
- }
-
- public Set<DiskSection> getDiskSections() {
- return diskSections;
- }
-
- public Set<NetworkSection> getNetworkSections() {
- return networkSections;
- }
-
- public Set<SectionType> getAdditionalSections() {
- return additionalSections;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(additionalSections, diskSections, networkSections, virtualSystem);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null) return false;
- if (getClass() != obj.getClass()) return false;
-
- BaseEnvelope<?, ?> other = (BaseEnvelope<?, ?>) obj;
- return Objects.equal(additionalSections, other.additionalSections)
- && Objects.equal(diskSections, other.diskSections)
- && Objects.equal(networkSections, other.networkSections)
- && Objects.equal(virtualSystem, other.virtualSystem);
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
- protected MoreObjects.ToStringHelper string() {
- return MoreObjects.toStringHelper("")
- .add("diskSections", diskSections)
- .add("networkSections", networkSections)
- .add("additionalSections", additionalSections)
- .add("virtualSystem", virtualSystem);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/internal/BaseVirtualSystem.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/internal/BaseVirtualSystem.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/internal/BaseVirtualSystem.java
deleted file mode 100644
index 4a82f74..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/internal/BaseVirtualSystem.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf.internal;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
-
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementRef;
-
-import org.jclouds.dmtf.ovf.ProductSection;
-import org.jclouds.dmtf.ovf.SectionType;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-public abstract class BaseVirtualSystem extends SectionType {
-
- public abstract static class Builder<B extends Builder<B>> extends SectionType.Builder<B> {
-
- private String id;
- private String name;
- private Set<ProductSection> productSections = Sets.newLinkedHashSet();
- private Set<SectionType> additionalSections = Sets.newLinkedHashSet();
-
- /**
- * @see BaseVirtualSystem#getName()
- */
- public B name(String name) {
- this.name = name;
- return self();
- }
-
- /**
- * @see BaseVirtualSystem#getId()
- */
- public B id(String id) {
- this.id = id;
- return self();
- }
-
- /**
- * @see BaseVirtualSystem#getProductSections()
- */
- public B productSection(ProductSection productSection) {
- this.productSections.add(checkNotNull(productSection, "productSection"));
- return self();
- }
-
- /**
- * @see BaseVirtualSystem#getProductSections()
- */
- public B productSections(Iterable<ProductSection> productSections) {
- this.productSections = Sets.newLinkedHashSet(checkNotNull(productSections, "productSections"));
- return self();
- }
-
- /**
- * @see BaseVirtualSystem#getAdditionalSections()
- */
- public B additionalSection(SectionType additionalSection) {
- this.additionalSections.add(checkNotNull(additionalSection, "additionalSection"));
- return self();
- }
-
- /**
- * @see BaseVirtualSystem#getAdditionalSections()
- */
- public B additionalSections(Iterable<? extends SectionType> additionalSections) {
- this.additionalSections = Sets.newLinkedHashSet(checkNotNull(additionalSections, "additionalSections"));
- return self();
- }
-
- public B fromBaseVirtualSystem(BaseVirtualSystem in) {
- return fromSectionType(in)
- .id(in.getId())
- .name(in.getName())
- .productSections(in.getProductSections())
- .additionalSections(in.getAdditionalSections());
- }
- }
-
- @XmlAttribute(namespace = OVF_NS)
- private String id;
- @XmlElement(name = "Name")
- private String name;
- @XmlElement(name = "ProductSection")
- private Set<ProductSection> productSections;
- @XmlElementRef
- private Set<SectionType> additionalSections;
-
- protected BaseVirtualSystem(Builder<?> builder) {
- super(builder);
- this.id = builder.id;
- this.name = builder.name;
- this.productSections = ImmutableSet.copyOf(checkNotNull(builder.productSections, "productSections"));
- this.additionalSections = ImmutableSet.copyOf(checkNotNull(builder.additionalSections, "additionalSections"));
- }
-
- protected BaseVirtualSystem() {
- // For JAXB
- }
-
- public String getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
- /**
- * Specifies product-information for a package, such as product name and version, along with a
- * set of properties that can be configured
- */
- public Set<ProductSection> getProductSections() {
- return productSections;
- }
-
- public Set<SectionType> getAdditionalSections() {
- return additionalSections;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(super.hashCode(), id, name, productSections, additionalSections);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null) return false;
- if (getClass() != obj.getClass()) return false;
-
- BaseVirtualSystem other = (BaseVirtualSystem) obj;
- return super.equals(other)
- && equal(id, other.id)
- && equal(name, other.name)
- && equal(productSections, other.productSections)
- && equal(additionalSections, other.additionalSections);
- }
-
- @Override
- protected MoreObjects.ToStringHelper string() {
- return super.string()
- .add("id", id)
- .add("name", name)
- .add("productSections", productSections)
- .add("additionalSections", additionalSections);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/internal/package-info.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/internal/package-info.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/internal/package-info.java
deleted file mode 100644
index 1d2fb9e..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/internal/package-info.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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 = OVF_NS,
- elementFormDefault = XmlNsForm.QUALIFIED,
- xmlns = {
- @XmlNs(prefix = "cim", namespaceURI = CIM_NS),
- @XmlNs(prefix = "ovf", namespaceURI = OVF_NS)
- }
-)
-@XmlAccessorType(XmlAccessType.FIELD)
-package org.jclouds.dmtf.ovf.internal;
-
-import static org.jclouds.dmtf.DMTFConstants.CIM_NS;
-import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlNs;
-import javax.xml.bind.annotation.XmlNsForm;
-import javax.xml.bind.annotation.XmlSchema;
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/package-info.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/package-info.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/package-info.java
deleted file mode 100644
index 94516cf..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/package-info.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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 = OVF_NS,
- elementFormDefault = XmlNsForm.QUALIFIED,
- xmlns = {
- @XmlNs(prefix = "cim", namespaceURI = CIM_NS),
- @XmlNs(prefix = "ovf", namespaceURI = OVF_NS)
- }
-)
-@XmlAccessorType(XmlAccessType.FIELD)
-package org.jclouds.dmtf.ovf;
-
-import static org.jclouds.dmtf.DMTFConstants.CIM_NS;
-import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlNs;
-import javax.xml.bind.annotation.XmlNsForm;
-import javax.xml.bind.annotation.XmlSchema;
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9140562..85242a7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,7 +69,6 @@
<module>docker</module>
<module>virtualbox</module>
<module>vcloud-director</module>
- <module>dmtf</module>
<module>cdmi</module>
<module>cloudsigma2</module>
<module>cloudsigma2-lvs</module>
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/pom.xml
----------------------------------------------------------------------
diff --git a/vcloud-director/pom.xml b/vcloud-director/pom.xml
index eb0e64f..f84723d 100644
--- a/vcloud-director/pom.xml
+++ b/vcloud-director/pom.xml
@@ -52,21 +52,15 @@
<!-- URN format: ex. urn:vcloud:user:7212e451-76e1-4631-b2de-ba1dfd8080e4 -->
<test.vcloud-director.user-id />
- <jclouds.osgi.export>org.jclouds.vcloud.director.v1_5*;version="${project.version}"</jclouds.osgi.export>
- <jclouds.osgi.import>
- org.jclouds.compute.internal;version="${jclouds.version}",
- org.jclouds.rest.internal;version="${jclouds.version}",
- org.jclouds.labs*;version="${project.version}",
- org.jclouds*;version="${jclouds.version}",
- *
- </jclouds.osgi.import>
+ <jclouds.osgi.export>org.jclouds.vcloud.director.v1_5*;version="${project.version}",org.jclouds.dmtf*;version="${jclouds.version}"</jclouds.osgi.export>
+ <jclouds.osgi.import>org.jclouds*;version="${jclouds.version}",*</jclouds.osgi.import>
</properties>
<dependencies>
<dependency>
<groupId>com.jamesmurty.utils</groupId>
<artifactId>java-xmlbuilder</artifactId>
- <version>0.4</version>
+ <version>1.1</version>
</dependency>
<dependency>
<groupId>org.apache.jclouds</groupId>
@@ -74,11 +68,6 @@
<version>${jclouds.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>dmtf</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
<groupId>org.apache.jclouds</groupId>
<artifactId>jclouds-core</artifactId>
<version>${jclouds.version}</version>
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/CIMPredicates.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/CIMPredicates.java b/vcloud-director/src/main/java/org/jclouds/dmtf/CIMPredicates.java
new file mode 100644
index 0000000..8fc0671
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/CIMPredicates.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.Set;
+
+import org.jclouds.dmtf.cim.ResourceAllocationSettingData;
+import org.jclouds.dmtf.cim.ResourceAllocationSettingData.ResourceType;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableSet;
+
+public class CIMPredicates {
+
+ /**
+ * Return resource allocations of the specific type.
+ *
+ * @param type
+ * type to match the items
+ * @return predicate
+ */
+ public static Predicate<ResourceAllocationSettingData> resourceTypeIn(final ResourceType... types) {
+ checkNotNull(types, "resourceTypes");
+ final Set<ResourceType> resourceTypes = ImmutableSet.copyOf(types);
+ return new Predicate<ResourceAllocationSettingData>() {
+ @Override
+ public boolean apply(ResourceAllocationSettingData in) {
+ return resourceTypes.contains(in.getResourceType());
+ }
+
+ @Override
+ public String toString() {
+ return "resourceTypeIn(" + resourceTypes + ")";
+ }
+ };
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/DMTFConstants.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/DMTFConstants.java b/vcloud-director/src/main/java/org/jclouds/dmtf/DMTFConstants.java
new file mode 100644
index 0000000..47eced7
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/DMTFConstants.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf;
+
+/**
+ * Constants used by DMTF.
+ */
+public final class DMTFConstants {
+
+ public static final String OVF_NS = "http://schemas.dmtf.org/ovf/envelope/1";
+
+ public static final String OVF_ENV_NS = "http://schemas.dmtf.org/ovf/environment/1";
+
+ public static final String CIM_NS = "http://schemas.dmtf.org/wbem/wscim/1/common";
+
+ public static final String CIM_VSSD_NS = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData";
+
+ public static final String CIM_RASD_NS = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData";
+
+ private DMTFConstants() {
+ throw new AssertionError("intentionally unimplemented");
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimAnySimpleType.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimAnySimpleType.java b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimAnySimpleType.java
new file mode 100644
index 0000000..80c0459
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimAnySimpleType.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.cim;
+
+import static org.jclouds.dmtf.DMTFConstants.CIM_NS;
+
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.namespace.QName;
+
+import com.google.common.collect.Maps;
+
+/**
+ * <p>Java class for cimAnySimpleType complex type.
+ *
+ * <pre>
+ * <complexType name="cimAnySimpleType" />
+ * </pre>
+ */
+@XmlType(name = "cimAnySimpleType", namespace = CIM_NS)
+public class CimAnySimpleType {
+
+ @XmlValue
+ @XmlJavaTypeAdapter(CimAnySimpleTypeAdapter.class)
+ @XmlSchemaType(name = "anySimpleType")
+ protected String value;
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = Maps.newHashMap();
+
+ /**
+ * Gets the value of the value property.
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ */
+ public Map<QName, String> getOtherAttributes() {
+ return otherAttributes;
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimAnySimpleTypeAdapter.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimAnySimpleTypeAdapter.java b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimAnySimpleTypeAdapter.java
new file mode 100644
index 0000000..b788df9
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimAnySimpleTypeAdapter.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.cim;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+public class CimAnySimpleTypeAdapter extends XmlAdapter<String, String> {
+
+ @Override
+ public String unmarshal(String value) {
+ return javax.xml.bind.DatatypeConverter.parseAnySimpleType(value);
+ }
+
+ @Override
+ public String marshal(String value) {
+ if (value == null) {
+ return null;
+ }
+ return javax.xml.bind.DatatypeConverter.printAnySimpleType(value);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimBoolean.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimBoolean.java b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimBoolean.java
new file mode 100644
index 0000000..61d7211
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimBoolean.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.cim;
+
+import static org.jclouds.dmtf.DMTFConstants.CIM_NS;
+
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.namespace.QName;
+
+import com.google.common.collect.Maps;
+
+/**
+ * Java class for cimBoolean complex type.
+ *
+ * <pre>
+ * <complexType name="cimBoolean" />
+ * </pre>
+ */
+@XmlType(name = "cimBoolean", namespace = CIM_NS)
+public class CimBoolean {
+
+ @XmlValue
+ protected boolean value;
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = Maps.newHashMap();
+
+ /**
+ * Gets the value of the value property.
+ *
+ */
+ public boolean isValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ */
+ public void setValue(boolean value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ *
+ * <p>
+ * the map is keyed by the name of the attribute and
+ * the value is the string value of the attribute.
+ *
+ * the map returned by this method is live, and you can add new attribute
+ * by updating the map directly. Because of this design, there's no setter.
+ *
+ *
+ * @return
+ * always non-null
+ */
+ public Map<QName, String> getOtherAttributes() {
+ return otherAttributes;
+ }
+
+}
[5/6] Fold dmtf into vcloud-director (its only user).
Posted by ad...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/cim/VirtualSystemSettingData.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/cim/VirtualSystemSettingData.java b/dmtf/src/main/java/org/jclouds/dmtf/cim/VirtualSystemSettingData.java
deleted file mode 100644
index 7e7ee35..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/cim/VirtualSystemSettingData.java
+++ /dev/null
@@ -1,720 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.cim;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.dmtf.DMTFConstants.CIM_VSSD_NS;
-import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
-
-import java.math.BigInteger;
-import java.util.Date;
-import java.util.Map;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlEnum;
-import javax.xml.bind.annotation.XmlEnumValue;
-import javax.xml.bind.annotation.XmlType;
-
-import com.google.common.base.Function;
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Maps;
-
-/**
- * VirtualSystemSettingData defines the virtual aspects of a virtual system through a set of
- * virtualization specific properties.
- *
- * VirtualSystemSettingData is also used as the top level class of virtual system configurations.
- * Virtual system configurations model configuration information about virtual systems and their
- * components. A virtual system configuration consists of one top-level instance of class
- * VirtualSystemSettingData that aggregates a number of instances of class
- * {@link ResourceAllocationSettingData}, using association {@link ConcreteComponent).
- * <p>
- * Virtual system configurations may for example be used to reflect configurations of:
- * <ul>
- * <li>virtual systems that are defined at a virtualization platform
- * <li>virtual systems that are currently active
- * <li>input requests to create new virtual systems
- * <li>input requests to modify existing virtual systems
- * <li>snapshots of virtual systems
- * </ul>
- *
- * @see <a href="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_VirtualSystemSettingData.xsd">CIM_VirtualSystemSettingData</a>
- */
-@XmlType(name = "CIM_VirtualSystemSettingData_Type", namespace = OVF_NS,
- propOrder = {
- "automaticRecoveryAction",
- "automaticShutdownAction",
- "automaticStartupAction",
- "automaticStartupActionDelay",
- "automaticStartupActionSequenceNumber",
- "caption",
- "configurationDataRoot",
- "configurationFile",
- "configurationID",
- "creationTime",
- "description",
- "elementName",
- "instanceID",
- "logDataRoot",
- "notes",
- "recoveryFile",
- "snapshotDataRoot",
- "suspendDataRoot",
- "swapFileDataRoot",
- "virtualSystemIdentifier",
- "virtualSystemType"
- }
-)
-public class VirtualSystemSettingData {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return builder().fromVirtualSystemSettingData(this);
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- }
-
- public static class Builder<B extends Builder<B>> {
-
- private String elementName;
- private String instanceID;
- private String caption;
- private String description;
- private AutomaticRecoveryAction automaticRecoveryAction;
- private AutomaticShutdownAction automaticShutdownAction;
- private AutomaticStartupAction automaticStartupAction;
- private BigInteger automaticStartupActionDelay;
- private Long automaticStartupActionSequenceNumber;
- private String configurationDataRoot;
- private String configurationFile;
- private String configurationID;
- private Date creationTime;
- private String logDataRoot;
- private String recoveryFile;
- private String snapshotDataRoot;
- private String suspendDataRoot;
- private String swapFileDataRoot;
- private String virtualSystemIdentifier;
- private String virtualSystemType;
- private String notes;
-
- @SuppressWarnings("unchecked")
- protected B self() {
- return (B) this;
- }
-
- public B elementName(String elementName) {
- this.elementName = elementName;
- return self();
- }
-
- public B instanceID(String instanceID) {
- this.instanceID = instanceID;
- return self();
- }
-
- public B caption(String caption) {
- this.caption = caption;
- return self();
- }
-
- public B description(String description) {
- this.description = description;
- return self();
- }
-
- public B automaticRecoveryAction(AutomaticRecoveryAction automaticRecoveryAction) {
- this.automaticRecoveryAction = automaticRecoveryAction;
- return self();
- }
-
- public B automaticShutdownAction(AutomaticShutdownAction automaticShutdownAction) {
- this.automaticShutdownAction = automaticShutdownAction;
- return self();
- }
-
- public B automaticStartupAction(AutomaticStartupAction automaticStartupAction) {
- this.automaticStartupAction = automaticStartupAction;
- return self();
- }
-
- public B automaticStartupActionDelay(BigInteger automaticStartupActionDelay) {
- this.automaticStartupActionDelay = automaticStartupActionDelay;
- return self();
- }
-
- public B automaticStartupActionSequenceNumber(Long automaticStartupActionSequenceNumber) {
- this.automaticStartupActionSequenceNumber = automaticStartupActionSequenceNumber;
- return self();
- }
-
- public B configurationDataRoot(String configurationDataRoot) {
- this.configurationDataRoot = configurationDataRoot;
- return self();
- }
-
- public B configurationFile(String configurationFile) {
- this.configurationFile = configurationFile;
- return self();
- }
-
- public B configurationID(String configurationID) {
- this.configurationID = configurationID;
- return self();
- }
-
- public B creationTime(Date creationTime) {
- this.creationTime = creationTime;
- return self();
- }
-
- public B logDataRoot(String logDataRoot) {
- this.logDataRoot = logDataRoot;
- return self();
- }
-
- public B recoveryFile(String recoveryFile) {
- this.recoveryFile = recoveryFile;
- return self();
- }
-
- public B snapshotDataRoot(String snapshotDataRoot) {
- this.snapshotDataRoot = snapshotDataRoot;
- return self();
- }
-
- public B suspendDataRoot(String suspendDataRoot) {
- this.suspendDataRoot = suspendDataRoot;
- return self();
- }
-
- public B swapFileDataRoot(String swapFileDataRoot) {
- this.swapFileDataRoot = swapFileDataRoot;
- return self();
- }
-
- public B virtualSystemIdentifier(String virtualSystemIdentifier) {
- this.virtualSystemIdentifier = virtualSystemIdentifier;
- return self();
- }
-
- public B virtualSystemType(String virtualSystemType) {
- this.virtualSystemType = virtualSystemType;
- return self();
- }
-
- public B notes(String notes) {
- this.notes = notes;
- return self();
- }
-
- public VirtualSystemSettingData build() {
- return new VirtualSystemSettingData(this);
- }
-
- public B fromVirtualSystemSettingData(VirtualSystemSettingData in) {
- return elementName(in.getElementName())
- .instanceID(in.getInstanceID())
- .caption(in.getCaption())
- .description(in.getDescription())
- .automaticRecoveryAction(in.getAutomaticRecoveryAction())
- .automaticShutdownAction(in.getAutomaticShutdownAction())
- .automaticStartupAction(in.getAutomaticStartupAction())
- .automaticStartupActionDelay(in.getAutomaticStartupActionDelay())
- .automaticStartupActionSequenceNumber(in.getAutomaticStartupActionSequenceNumber())
- .configurationDataRoot(in.getConfigurationDataRoot())
- .configurationFile(in.getConfigurationFile())
- .configurationID(in.getConfigurationID())
- .creationTime(in.getCreationTime())
- .logDataRoot(in.getLogDataRoot())
- .recoveryFile(in.getRecoveryFile())
- .snapshotDataRoot(in.getSnapshotDataRoot())
- .suspendDataRoot(in.getSuspendDataRoot())
- .swapFileDataRoot(in.getSwapFileDataRoot())
- .virtualSystemIdentifier(in.getVirtualSystemIdentifier())
- .virtualSystemType(in.getVirtualSystemType())
- .notes(in.getNotes());
- }
-
- }
-
- /**
- * Action to take for the virtual system when the software executed by the virtual system fails.
- *
- * Failures in this case means a failure that is detectable by the host platform, such as a
- * non-interruptible wait state condition.
- */
- @XmlType
- @XmlEnum(Integer.class)
- public static enum AutomaticRecoveryAction {
-
- @XmlEnumValue("2") NONE(2),
- @XmlEnumValue("3") RESTART(3),
- @XmlEnumValue("4") REVERT_TO_SNAPSHOT(4);
-
- protected final int code;
-
- AutomaticRecoveryAction(int code) {
- this.code = code;
- }
-
- public String value() {
- return Integer.toString(code);
- }
-
- protected static final Map<Integer, AutomaticRecoveryAction> AUTOMATIC_RECOVERY_ACTION_BY_ID = Maps.uniqueIndex(
- ImmutableSet.copyOf(AutomaticRecoveryAction.values()), new Function<AutomaticRecoveryAction, Integer>() {
- @Override
- public Integer apply(AutomaticRecoveryAction input) {
- return input.code;
- }
- });
-
- public static AutomaticRecoveryAction fromValue(String automaticRecoveryAction) {
- return AUTOMATIC_RECOVERY_ACTION_BY_ID.get(Integer.valueOf(checkNotNull(automaticRecoveryAction, "automaticRecoveryAction")));
- }
- }
-
- /**
- * Action to take for the virtual system when the host is shut down.
- */
- @XmlType
- @XmlEnum(Integer.class)
- public static enum AutomaticShutdownAction {
-
- @XmlEnumValue("2") TURN_OFF(2),
- @XmlEnumValue("3") SAVE_STATE(3),
- @XmlEnumValue("4") SHUTDOWN(4);
-
- protected final int code;
-
- AutomaticShutdownAction(int code) {
- this.code = code;
- }
-
- public String value() {
- return Integer.toString(code);
- }
-
- protected static final Map<Integer, AutomaticShutdownAction> AUTOMATIC_SHUTDOWN_ACTION_BY_ID = Maps.uniqueIndex(
- ImmutableSet.copyOf(AutomaticShutdownAction.values()), new Function<AutomaticShutdownAction, Integer>() {
- @Override
- public Integer apply(AutomaticShutdownAction input) {
- return input.code;
- }
- });
-
- public static AutomaticShutdownAction fromValue(String automaticShutdownAction) {
- return AUTOMATIC_SHUTDOWN_ACTION_BY_ID.get(Integer.valueOf(checkNotNull(automaticShutdownAction, "automaticShutdownAction")));
- }
- }
-
- /**
- * Action to take for the virtual system when the host is started.
- */
- @XmlType
- @XmlEnum(Integer.class)
- public static enum AutomaticStartupAction {
-
- @XmlEnumValue("2") NONE(2),
- @XmlEnumValue("3") RESTART_IF_PREVIOUSLY_ACTIVE(3),
- @XmlEnumValue("4") ALWAYS_STARTUP(4);
-
- protected final int code;
-
- AutomaticStartupAction(int code) {
- this.code = code;
- }
-
- public String value() {
- return Integer.toString(code);
- }
-
- protected static final Map<Integer, AutomaticStartupAction> AUTOMATIC_STARTUP_ACTION_BY_ID = Maps.uniqueIndex(
- ImmutableSet.copyOf(AutomaticStartupAction.values()), new Function<AutomaticStartupAction, Integer>() {
- @Override
- public Integer apply(AutomaticStartupAction input) {
- return input.code;
- }
- });
-
- public static AutomaticStartupAction fromValue(String automaticStartupAction) {
- return AUTOMATIC_STARTUP_ACTION_BY_ID.get(Integer.valueOf(checkNotNull(automaticStartupAction, "automaticStartupAction")));
- }
- }
-
- @XmlElement(name = "ElementName", namespace = CIM_VSSD_NS)
- private String elementName;
- @XmlElement(name = "InstanceID", namespace = CIM_VSSD_NS)
- private String instanceID;
- @XmlElement(name = "Caption", namespace = CIM_VSSD_NS)
- private String caption;
- @XmlElement(name = "Description", namespace = CIM_VSSD_NS)
- private String description;
- @XmlElement(name = "VirtualSystemIdentifier", namespace = CIM_VSSD_NS)
- private String virtualSystemIdentifier;
- @XmlElement(name = "VirtualSystemType", namespace = CIM_VSSD_NS)
- private String virtualSystemType;
- @XmlElement(name = "AutomaticRecoveryAction", namespace = CIM_VSSD_NS)
- private AutomaticRecoveryAction automaticRecoveryAction;
- @XmlElement(name = "AutomaticShutdownAction", namespace = CIM_VSSD_NS)
- private AutomaticShutdownAction automaticShutdownAction;
- @XmlElement(name = "AutomaticStartupAction", namespace = CIM_VSSD_NS)
- private AutomaticStartupAction automaticStartupAction;
- @XmlElement(name = "AutomaticStartupActionDelay", namespace = CIM_VSSD_NS)
- private BigInteger automaticStartupActionDelay;
- @XmlElement(name = "AutomaticStartupActionSequenceNumber", namespace = CIM_VSSD_NS)
- private Long automaticStartupActionSequenceNumber;
- @XmlElement(name = "ConfigurationDataRoot", namespace = CIM_VSSD_NS)
- private String configurationDataRoot;
- @XmlElement(name = "ConfigurationFile", namespace = CIM_VSSD_NS)
- private String configurationFile;
- @XmlElement(name = "ConfigurationID", namespace = CIM_VSSD_NS)
- private String configurationID;
- @XmlElement(name = "CreationTime", namespace = CIM_VSSD_NS)
- private Date creationTime;
- @XmlElement(name = "LogDataRoot", namespace = CIM_VSSD_NS)
- private String logDataRoot;
- @XmlElement(name = "RecoveryFile", namespace = CIM_VSSD_NS)
- private String recoveryFile;
- @XmlElement(name = "SnapshotDataRoot", namespace = CIM_VSSD_NS)
- private String snapshotDataRoot;
- @XmlElement(name = "SuspendDataRoot", namespace = CIM_VSSD_NS)
- private String suspendDataRoot;
- @XmlElement(name = "SwapFileDataRoot", namespace = CIM_VSSD_NS)
- private String swapFileDataRoot;
- @XmlElement(name = "Notes", namespace = CIM_VSSD_NS)
- private String notes;
-
- private VirtualSystemSettingData(Builder<?> builder) {
- this.elementName = builder.elementName;
- this.instanceID = builder.instanceID;
- this.caption = builder.caption;
- this.description = builder.description;
- this.automaticRecoveryAction = builder.automaticRecoveryAction;
- this.automaticShutdownAction = builder.automaticShutdownAction;
- this.automaticStartupAction = builder.automaticStartupAction;
- this.automaticStartupActionDelay = builder.automaticStartupActionDelay;
- this.automaticStartupActionSequenceNumber = builder.automaticStartupActionSequenceNumber;
- this.configurationDataRoot = builder.configurationDataRoot;
- this.configurationFile = builder.configurationFile;
- this.configurationID = builder.configurationID;
- this.creationTime = builder.creationTime;
- this.logDataRoot = builder.logDataRoot;
- this.recoveryFile = builder.recoveryFile;
- this.snapshotDataRoot = builder.snapshotDataRoot;
- this.suspendDataRoot = builder.suspendDataRoot;
- this.swapFileDataRoot = builder.swapFileDataRoot;
- this.virtualSystemIdentifier = builder.virtualSystemIdentifier;
- this.virtualSystemType = builder.virtualSystemType;
- this.notes = builder.notes;
- }
-
- private VirtualSystemSettingData(String elementName, String instanceID, String caption, String description,
- AutomaticRecoveryAction automaticRecoveryAction, AutomaticShutdownAction automaticShutdownAction,
- AutomaticStartupAction automaticStartupAction, BigInteger automaticStartupActionDelay,
- Long automaticStartupActionSequenceNumber, String configurationDataRoot, String configurationFile,
- String configurationID, Date creationTime, String logDataRoot, String recoveryFile, String snapshotDataRoot,
- String suspendDataRoot, String swapFileDataRoot, String virtualSystemIdentifier,
- String virtualSystemType, String notes) {
- this.elementName = elementName;
- this.instanceID = instanceID;
- this.caption = caption;
- this.description = description;
- this.automaticRecoveryAction = automaticRecoveryAction;
- this.automaticShutdownAction = automaticShutdownAction;
- this.automaticStartupAction = automaticStartupAction;
- this.automaticStartupActionDelay = automaticStartupActionDelay;
- this.automaticStartupActionSequenceNumber = automaticStartupActionSequenceNumber;
- this.configurationDataRoot = configurationDataRoot;
- this.configurationFile = configurationFile;
- this.configurationID = configurationID;
- this.creationTime = creationTime;
- this.logDataRoot = logDataRoot;
- this.recoveryFile = recoveryFile;
- this.snapshotDataRoot = snapshotDataRoot;
- this.suspendDataRoot = suspendDataRoot;
- this.swapFileDataRoot = swapFileDataRoot;
- this.virtualSystemIdentifier = virtualSystemIdentifier;
- this.virtualSystemType = virtualSystemType;
- this.notes = notes;
- }
-
- private VirtualSystemSettingData() {
- // for JAXB
- }
-
- /**
- * The user-friendly name for this instance of SettingData. In addition, the user-friendly name
- * can be used as an index property for a search or query. (Note: The name does not have to be
- * unique within a namespace.)
- */
- public String getElementName() {
- return elementName;
- }
-
- /**
- * Within the scope of the instantiating Namespace, InstanceID opaquely and uniquely identifies
- * an instance of this class.
- */
- public String getInstanceID() {
- return instanceID;
- }
-
- /**
- * The Caption property is a short textual description (one- line string) of the object.
- */
- public String getCaption() {
- return caption;
- }
-
- /**
- * The Description property provides a textual description of the object.
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Action to take for the virtual system when the software executed by the virtual system fails.
- * Failures in this case means a failure that is detectable by the host platform, such as a
- * non-interruptible wait state condition.
- */
- public AutomaticRecoveryAction getAutomaticRecoveryAction() {
- return automaticRecoveryAction;
- }
-
- /**
- * Action to take for the virtual system when the host is shut down.
- */
- public AutomaticShutdownAction getAutomaticShutdownAction() {
- return automaticShutdownAction;
- }
-
- /**
- * Action to take for the virtual system when the host is started.
- */
- public AutomaticStartupAction getAutomaticStartupAction() {
- return automaticStartupAction;
- }
-
- /**
- * Delay applicable to startup action. The value shall be in the interval variant of the datetime
- * datatype.
- */
- public BigInteger getAutomaticStartupActionDelay() {
- return automaticStartupActionDelay;
- }
-
- /**
- * Number indicating the relative sequence of virtual system activation when the host system is
- * started. A lower number indicates earlier activation. If one or more configurations show the
- * same value, the sequence is implementation dependent. A value of 0 indicates that the sequence
- * is implementation dependent.
- */
- public Long getAutomaticStartupActionSequenceNumber() {
- return automaticStartupActionSequenceNumber;
- }
-
- /**
- * Filepath of a directory where information about the virtual system configuration is
- * stored.
- *
- * Format shall be String based on RFC-2079.
- */
- public String getConfigurationDataRoot() {
- return configurationDataRoot;
- }
-
- /**
- * Filepath of a file where information about the virtual system configuration is stored.
- *
- * A relative path appends to the value of the {@link #getConfigurationDataRoot()} property.
- * <p>
- * Format shall be String based on RFC-2079.
- */
- public String getConfigurationFile() {
- return configurationFile;
- }
-
- /**
- * Unique id of the virtual system configuration. Note that the ConfigurationID is different from
- * the InstanceID as it is assigned by the implementation to a virtual system or a virtual system
- * configuration. It is not a key, and the same value may occur within more than one instance.
- */
- public String getConfigurationID() {
- return configurationID;
- }
-
- /**
- * Time when the virtual system configuration was created.
- */
- public Date getCreationTime() {
- return creationTime;
- }
-
- /**
- * Filepath of a directory where log information about the virtual system is stored.
- *
- * A relative path appends to the value of the {@link #getConfigurationDataRoot()} property.
- * <p>
- * Format shall be String based on RFC-2079.
- */
- public String getLogDataRoot() {
- return logDataRoot;
- }
-
- /**
- * Filepath of a file where recovery related information of the virtual system is stored.
- *
- * Format shall be String based on RFC-2079.
- */
- public String getRecoveryFile() {
- return recoveryFile;
- }
-
- /**
- * Filepath of a directory where information about virtual system snapshots is stored.
- *
- * A relative path appends to the value of the {@link #getConfigurationDataRoot()} property.
- * <p>
- * Format shall be String based on RFC-2079.
- */
- public String getSnapshotDataRoot() {
- return snapshotDataRoot;
- }
-
- /**
- * Filepath of a directory where suspend related information about the virtual system is stored.
- *
- * A relative path appends to the value of the {@link #getConfigurationDataRoot()} property.
- * <p>
- * Format shall be String based on RFC-2079.
- */
- public String getSuspendDataRoot() {
- return suspendDataRoot;
- }
-
- /**
- * Filepath of a directory where swapfiles of the virtual system are stored.
- *
- * A relative path appends to the value of the {@link #getConfigurationDataRoot()} property.
- * <p>
- * Format shall be String based on RFC-2079.
- */
- public String getSwapFileDataRoot() {
- return swapFileDataRoot;
- }
-
- /**
- * VirtualSystemIdentifier shall reflect a unique name for the system as it is used within the
- * virtualization platform.
- *
- * Note that the VirtualSystemIdentifier is not the hostname assigned to
- * the operating system instance running within the virtual system, nor is it an IP address or
- * MAC address assigned to any of its network ports. On create requests VirtualSystemIdentifier
- * may contain implementation specific rules (like simple patterns or regular expression) that
- * may be interpreted by the implementation when assigning a VirtualSystemIdentifier.
- */
- public String getVirtualSystemIdentifier() {
- return virtualSystemIdentifier;
- }
-
- /**
- * VirtualSystemType shall reflect a particular type of virtual system.
- */
- public String getVirtualSystemType() {
- return virtualSystemType;
- }
-
- /**
- * End-user supplied notes that are related to the virtual system.
- */
- public String getNotes() {
- return notes;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(elementName, instanceID, caption, description, virtualSystemIdentifier, virtualSystemType);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- VirtualSystemSettingData that = VirtualSystemSettingData.class.cast(obj);
- return equal(this.elementName, that.elementName)
- && equal(this.instanceID, that.instanceID)
- && equal(this.caption, that.caption)
- && equal(this.description, that.description)
- && equal(this.automaticRecoveryAction, that.automaticRecoveryAction)
- && equal(this.automaticShutdownAction, that.automaticShutdownAction)
- && equal(this.automaticStartupAction, that.automaticStartupAction)
- && equal(this.automaticStartupActionDelay, that.automaticStartupActionDelay)
- && equal(this.automaticStartupActionSequenceNumber, that.automaticStartupActionSequenceNumber)
- && equal(this.configurationDataRoot, that.configurationDataRoot)
- && equal(this.configurationFile, that.configurationFile)
- && equal(this.configurationID, that.configurationID)
- && equal(this.creationTime, that.creationTime)
- && equal(this.logDataRoot, that.logDataRoot)
- && equal(this.recoveryFile, that.recoveryFile)
- && equal(this.snapshotDataRoot, that.snapshotDataRoot)
- && equal(this.suspendDataRoot, that.suspendDataRoot)
- && equal(this.swapFileDataRoot, that.swapFileDataRoot)
- && equal(this.virtualSystemIdentifier, that.virtualSystemIdentifier)
- && equal(this.virtualSystemType, that.virtualSystemType);
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper("")
- .add("elementName", elementName)
- .add("instanceID", instanceID)
- .add("caption", caption)
- .add("description", description)
- .add("automaticRecoveryAction", automaticRecoveryAction)
- .add("automaticShutdownAction", automaticShutdownAction)
- .add("automaticStartupAction", automaticStartupAction)
- .add("automaticStartupActionDelay", automaticStartupActionDelay)
- .add("automaticStartupActionSequenceNumber", automaticStartupActionSequenceNumber)
- .add("configurationDataRoot", configurationDataRoot)
- .add("configurationFile", configurationFile)
- .add("configurationID", configurationID)
- .add("creationTime", creationTime)
- .add("logDataRoot", logDataRoot)
- .add("recoveryFile", recoveryFile)
- .add("snapshotDataRoot", snapshotDataRoot)
- .add("suspendDataRoot", suspendDataRoot)
- .add("swapFileDataRoot", swapFileDataRoot)
- .add("virtualSystemIdentifier", virtualSystemIdentifier)
- .add("virtualSystemType", virtualSystemType)
- .toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/cim/functions/HardwareBuilderFromResourceAllocations.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/cim/functions/HardwareBuilderFromResourceAllocations.java b/dmtf/src/main/java/org/jclouds/dmtf/cim/functions/HardwareBuilderFromResourceAllocations.java
deleted file mode 100644
index cea2526..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/cim/functions/HardwareBuilderFromResourceAllocations.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.cim.functions;
-
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.transform;
-
-import javax.inject.Singleton;
-
-import org.jclouds.compute.domain.HardwareBuilder;
-import org.jclouds.compute.domain.Processor;
-import org.jclouds.compute.domain.Volume;
-import org.jclouds.compute.domain.internal.VolumeImpl;
-import org.jclouds.dmtf.CIMPredicates;
-import org.jclouds.dmtf.cim.ResourceAllocationSettingData;
-import org.jclouds.dmtf.cim.ResourceAllocationSettingData.ResourceType;
-
-import com.google.common.base.Function;
-
-@Singleton
-public class HardwareBuilderFromResourceAllocations implements
- Function<Iterable<? extends ResourceAllocationSettingData>, HardwareBuilder> {
- @Override
- public HardwareBuilder apply(Iterable<? extends ResourceAllocationSettingData> from) {
- HardwareBuilder builder = new HardwareBuilder();
- builder.volumes(transform(filter(from, CIMPredicates.resourceTypeIn(ResourceType.DISK_DRIVE,
- ResourceType.BASE_PARTITIONABLE_UNIT, ResourceType.PARTITIONABLE_UNIT)),
- new Function<ResourceAllocationSettingData, Volume>() {
-
- @Override
- public Volume apply(ResourceAllocationSettingData from) {
- return HardwareBuilderFromResourceAllocations.this.apply(from);
- }
-
- }));
-
- builder.ram((int) find(from, CIMPredicates.resourceTypeIn(ResourceType.MEMORY)).getVirtualQuantity().longValue());
-
- builder.processors(transform(filter(from, CIMPredicates.resourceTypeIn(ResourceType.PROCESSOR)),
- new Function<ResourceAllocationSettingData, Processor>() {
-
- @Override
- public Processor apply(ResourceAllocationSettingData arg0) {
- return new Processor(arg0.getVirtualQuantity().longValue(), 1);
- }
- }));
- return builder;
- }
-
- public Volume apply(ResourceAllocationSettingData from) {
- return new VolumeImpl(from.getAddressOnParent() + "", Volume.Type.LOCAL, from.getVirtualQuantity() == null ? null
- : from.getVirtualQuantity().longValue() / (float) (1024 * 1024), null, "0".equals(from.getAddressOnParent())
- || ResourceType.BASE_PARTITIONABLE_UNIT.equals(from.getResourceType()), true);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/cim/package-info.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/cim/package-info.java b/dmtf/src/main/java/org/jclouds/dmtf/cim/package-info.java
deleted file mode 100644
index d531ada..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/cim/package-info.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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 = CIM_NS, elementFormDefault = XmlNsForm.QUALIFIED,
- xmlns = {
- @XmlNs(prefix = "cim", namespaceURI = CIM_NS),
- @XmlNs(prefix = "ovf", namespaceURI = OVF_NS),
- @XmlNs(prefix = "vssd", namespaceURI = CIM_VSSD_NS),
- @XmlNs(prefix = "rasd", namespaceURI = CIM_RASD_NS)
- }
-)
-@XmlAccessorType(XmlAccessType.FIELD)
-package org.jclouds.dmtf.cim;
-
-import static org.jclouds.dmtf.DMTFConstants.CIM_NS;
-import static org.jclouds.dmtf.DMTFConstants.CIM_RASD_NS;
-import static org.jclouds.dmtf.DMTFConstants.CIM_VSSD_NS;
-import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlNs;
-import javax.xml.bind.annotation.XmlNsForm;
-import javax.xml.bind.annotation.XmlSchema;
-
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/Configuration.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/Configuration.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/Configuration.java
deleted file mode 100644
index 0669a32..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/Configuration.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf;
-
-import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-
-@XmlType(name = "Configuration", namespace = OVF_NS, propOrder = {
- "label", "description"
-})
-public class Configuration {
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- private String id;
- private boolean isDefault;
- private String label;
- private String description;
-
- /**
- * @see Configuration#getId
- */
- public Builder id(String id) {
- this.id = id;
- return this;
- }
-
- /**
- * @see Configuration#getLabel
- */
- public Builder label(String label) {
- this.label = label;
- return this;
- }
-
- /**
- * @see Configuration#getDescription
- */
- public Builder description(String description) {
- this.description = description;
- return this;
- }
-
- /**
- * @see Configuration#isDefault
- */
- public Builder isDefault(boolean isDefault) {
- this.isDefault = isDefault;
- return this;
- }
-
- public Configuration build() {
- return new Configuration(id, isDefault, label, description);
- }
-
- public Builder fromConfiguration(Configuration in) {
- return id(in.getId()).description(in.getDescription()).label(in.getLabel());
- }
- }
-
- @XmlAttribute
- private String id;
- @XmlAttribute(name = "default")
- private boolean isDefault;
- @XmlElement(name = "Label")
- private String label;
- @XmlElement(name = "Description")
- private String description;
-
- public Configuration(String id, boolean isDefault, String label, String description) {
- this.id = id;
- this.label = label;
- this.description = description;
- this.isDefault = isDefault;
- }
-
- public Configuration() {
- // for JAXB
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(id, label, description);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Configuration other = (Configuration) obj;
- return Objects.equal(id, other.id)
- && Objects.equal(label, other.label)
- && Objects.equal(description, other.description);
- }
-
-
- @Override
- public String toString() {
- return string().toString();
- }
-
- protected MoreObjects.ToStringHelper string() {
- return MoreObjects.toStringHelper("").add("id", id).add("default", isDefault).add("label", label).add("description", description);
- }
-
- public String getId() {
- return id;
- }
-
- public String getDescription() {
- return description;
- }
-
- public String getLabel() {
- return label;
- }
-
- public boolean isDefault() {
- return isDefault;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/DeploymentOptionSection.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/DeploymentOptionSection.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/DeploymentOptionSection.java
deleted file mode 100644
index 253bc0b..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/DeploymentOptionSection.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Collections;
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-/**
- * The DeploymentOptionSection specifies a discrete set of intended resource configurations. The
- * author of an OVF package can include sizing metadata for different configurations. A consumer of
- * the OVF shall select a configuration, for example, by prompting the user. The selected
- * configuration is visible in the OVF environment, enabling guest software to adapt to the selected
- * configuration.
- */
-@XmlRootElement(name = "DeploymentOptionSection")
-@XmlType(name = "DeploymentOptionSection_Type")
-public class DeploymentOptionSection extends SectionType {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return builder().fromDeploymentOptionSection(this);
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- }
-
- public static class Builder<B extends Builder<B>> extends SectionType.Builder<B> {
- private Set<Configuration> configurations = Sets.newLinkedHashSet();
-
- /**
- * @see DeploymentOptionSection#getConfigurations
- */
- public B configuration(Configuration configuration) {
- this.configurations.add(checkNotNull(configuration, "configuration"));
- return self();
- }
-
- /**
- * @see DeploymentOptionSection#getConfigurations
- */
- public B configurations(Iterable<Configuration> configurations) {
- this.configurations = ImmutableSet.<Configuration>copyOf(checkNotNull(configurations, "configurations"));
- return self();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public DeploymentOptionSection build() {
- return new DeploymentOptionSection(this);
- }
-
- public B fromDeploymentOptionSection(DeploymentOptionSection in) {
- return fromSectionType(in).configurations(in.getConfigurations());
- }
- }
-
- @XmlElement(name = "Configuration")
- protected Set<Configuration> configurations;
-
- private DeploymentOptionSection(Builder<?> builder) {
- super(builder);
- this.configurations = ImmutableSet.copyOf(builder.configurations);
- }
-
- private DeploymentOptionSection() {
- // For JAXB
- }
-
- public Set<Configuration> getConfigurations() {
- return Collections.unmodifiableSet(configurations);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(super.hashCode(), configurations);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (!super.equals(obj)) return false;
- if (getClass() != obj.getClass()) return false;
-
- DeploymentOptionSection other = (DeploymentOptionSection) obj;
- return super.equals(other) && Objects.equal(configurations, other.configurations);
- }
-
- @Override
- protected MoreObjects.ToStringHelper string() {
- return super.string().add("configurations", configurations);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/Disk.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/Disk.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/Disk.java
deleted file mode 100644
index 41f96ac..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/Disk.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf;
-
-import java.net.URI;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement(name = "Disk")
-public class Disk implements Comparable<Disk>{
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- private String id;
- private Long capacity;
- private String parentRef;
- private String fileRef;
- private URI format;
- private Long populatedSize;
- private String capacityAllocationUnits;
-
- /**
- * @see Disk#getId
- */
- public Builder id(String id) {
- this.id = id;
- return this;
- }
-
- /**
- * @see Disk#getCapacity
- */
- public Builder capacity(Long capacity) {
- this.capacity = capacity;
- return this;
- }
-
- /**
- * @see Disk#getParentRef
- */
- public Builder parentRef(String parentRef) {
- this.parentRef = parentRef;
- return this;
- }
-
- /**
- * @see Disk#getFileRef
- */
- public Builder fileRef(String fileRef) {
- this.fileRef = fileRef;
- return this;
- }
-
- /**
- * @see Disk#getFormat
- */
- public Builder format(URI format) {
- this.format = format;
- return this;
- }
-
- /**
- * @see Disk#getPopulatedSize
- */
- public Builder populatedSize(Long populatedSize) {
- this.populatedSize = populatedSize;
- return this;
- }
-
- /**
- * @see Disk#getCapacityAllocationUnits
- */
- public Builder capacityAllocationUnits(String capacityAllocationUnits) {
- this.capacityAllocationUnits = capacityAllocationUnits;
- return this;
- }
-
- public Disk build() {
- return new Disk(id, capacity, parentRef, fileRef, format, populatedSize, capacityAllocationUnits);
- }
-
- public Builder fromDisk(Disk in) {
- return id(in.getId()).capacity(in.getCapacity()).parentRef(in.getParentRef()).fileRef(in.getFileRef()).format(
- in.getFormat()).populatedSize(in.getPopulatedSize()).capacityAllocationUnits(
- in.getCapacityAllocationUnits());
- }
- }
-
- private String id;
- private Long capacity;
- private String parentRef;
- private String fileRef;
- private URI format;
- private Long populatedSize;
- private String capacityAllocationUnits;
-
- private Disk(String id, Long capacity, String parentRef, String fileRef, URI format, Long populatedSize,
- String capacityAllocationUnits) {
- this.id = id;
- this.capacity = capacity;
- this.parentRef = parentRef;
- this.fileRef = fileRef;
- this.format = format;
- this.populatedSize = populatedSize;
- this.capacityAllocationUnits = capacityAllocationUnits;
- }
-
- private Disk() {
- // For Jaxb
- }
-
- /**
- * Each virtual disk is represented by a Disk element that shall be given a identifier using the
- * {@code id} attribute, the identifier shall be unique within the {@link DiskSection}.
- */
- public String getId() {
- return id;
- }
-
- /**
- * The capacity of a virtual disk shall be specified by the {@code capacity} attribute with an
- * xs:long integer value. The default unit of allocation shall be bytes.
- */
- public Long getCapacity() {
- return capacity;
- }
-
- /**
- * OVF allows a disk image to be represented as a set of modified blocks in comparison to a
- * parent image. The use of parent disks can often significantly reduce the size of an OVF
- * package, if it contains multiple disks with similar content. For a Disk element, a parent disk
- * may optionally be specified using the {@code parentRef} attribute, which shall contain a valid
- * ovf:id reference to a different Disk element. If a disk block does not exist locally, lookup
- * for that disk block then occurs in the parent disk. In {@link DiskSection}, parent Disk
- * elements shall occur before child Disk elements that refer to them.
- */
- public String getParentRef() {
- return parentRef;
- }
-
- /**
- * The ovf:fileRef attribute denotes the virtual disk content by identifying an existing File
- * element in the References element, the File element is identified by matching its {@code id}
- * attribute value with the {@code fileRef} attribute value. Omitting the {@code fileRef}
- * attribute shall indicate an empty disk. In this case, the disk shall be created and the entire
- * disk content zeroed at installation time. The guest software will typically format empty disks
- * in some file system format.
- */
- public String getFileRef() {
- return fileRef;
- }
-
- /**
- * The format URI of a non-empty virtual disk shall be specified by the {@code format} attribute.
- */
- public URI getFormat() {
- return format;
- }
-
- /**
- * For non-empty disks, the actual used size of the disk may optionally be specified using the
- * {@code populatedSize} attribute. The unit of this attribute is always bytes. {@code
- * populatedSize} is allowed to be an estimate of used disk size but shall not be larger than
- * {@code capacity}.
- */
- public Long getPopulatedSize() {
- return populatedSize;
- }
-
- /**
- * The optional string attribute {@code ovf:capacityAllocationUnits} may be used to specify a
- * particular unit of allocation. Values for {@code ovf:capacityAllocationUnits} shall match the
- * format for programmatic units defined in DSP0004.
- */
- public String getCapacityAllocationUnits() {
- return capacityAllocationUnits;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((id == null) ? 0 : id.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Disk other = (Disk) obj;
- if (id == null) {
- if (other.id != null)
- return false;
- } else if (!id.equals(other.id))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return String
- .format(
- "[id=%s, capacity=%s, capacityAllocationUnits=%s, fileRef=%s, format=%s, parentRef=%s, populatedSize=%s]",
- id, capacity, capacityAllocationUnits, fileRef, format, parentRef, populatedSize);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int compareTo(Disk o) {
- if (id == null)
- return -1;
- return (this == o) ? 0 : id.compareTo(o.id);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/DiskSection.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/DiskSection.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/DiskSection.java
deleted file mode 100644
index 7c19370..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/DiskSection.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-/**
- * A DiskSection describes meta-information about virtual disks in the OVF package. Virtual disks
- * and their metadata are described outside the virtual hardware to facilitate sharing between
- * virtual machines within an OVF package.
- */
-@XmlRootElement(name = "DiskSection")
-@XmlType(propOrder = {
- "disks"
-})
-public class DiskSection extends SectionType {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return builder().fromDiskSection(this);
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- }
-
- public static class Builder<B extends Builder<B>> extends SectionType.Builder<B> {
- private Set<Disk> disks = Sets.newLinkedHashSet();
-
- /**
- * @see DiskSection#getDisks
- */
- public B disk(Disk disk) {
- this.disks.add(checkNotNull(disk, "disk"));
- return self();
- }
-
- /**
- * @see DiskSection#getDisks
- */
- public B disks(Iterable<Disk> disks) {
- this.disks = ImmutableSet.<Disk>copyOf(checkNotNull(disks, "disks"));
- return self();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public DiskSection build() {
- return new DiskSection(this);
- }
-
- public B fromDiskSection(DiskSection in) {
- return disks(in.getDisks()).info(in.getInfo());
- }
- }
-
- @XmlElement(name = "Disk")
- private Set<Disk> disks;
-
- protected DiskSection(Builder<?> builder) {
- super(builder);
- this.disks = ImmutableSet.<Disk>copyOf(checkNotNull(builder.disks, "disks"));
- }
-
- protected DiskSection() {
- // for JAXB
- }
-
- /**
- * All disks referred to from Connection elements in all {@link VirtualHardwareSection} elements
- * shall be defined in the DiskSection.
- *
- * @return
- */
- public Set<Disk> getDisks() {
- return disks;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(super.hashCode(), disks);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null) return false;
- if (getClass() != obj.getClass()) return false;
-
- DiskSection other = (DiskSection) obj;
- return super.equals(other) && Objects.equal(disks, other.disks);
- }
-
- @Override
- protected MoreObjects.ToStringHelper string() {
- return super.string().add("disks", disks);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/Item.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/Item.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/Item.java
deleted file mode 100644
index 7c9e07f..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/Item.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf;
-
-import static com.google.common.base.Objects.equal;
-
-import java.util.Map;
-
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.Maps;
-
-/**
- * Java class for anonymous complex type.
- *
- * <pre>
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="order" use="required" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" />
- * <attribute name="startDelay" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
- * <attribute name="waitingForGuest" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- * <attribute name="stopDelay" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
- * <attribute name="startAction" type="{http://www.w3.org/2001/XMLSchema}string" default="powerOn" />
- * <attribute name="stopAction" type="{http://www.w3.org/2001/XMLSchema}string" default="powerOff" />
- * <anyAttribute processContents='lax'/>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- */
-@XmlType
-@XmlSeeAlso({
- StartupSectionItem.class
-})
-public class Item {
-
- // TODO Builder
-
- @XmlAttribute(required = true)
- protected String id;
- @XmlAttribute(required = true)
- @XmlSchemaType(name = "unsignedShort")
- protected int order;
- @XmlAttribute
- @XmlSchemaType(name = "unsignedShort")
- protected Integer startDelay;
- @XmlAttribute
- protected Boolean waitingForGuest;
- @XmlAttribute
- @XmlSchemaType(name = "unsignedShort")
- protected Integer stopDelay;
- @XmlAttribute
- protected String startAction;
- @XmlAttribute
- protected String stopAction;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = Maps.newHashMap();
-
- /**
- * Gets the value of the id property.
- */
- public String getId() {
- return id;
- }
-
- /**
- * Gets the value of the order property.
- */
- public int getOrder() {
- return order;
- }
-
- /**
- * Gets the value of the startDelay property.
- */
- public int getStartDelay() {
- if (startDelay == null) {
- return 0;
- } else {
- return startDelay;
- }
- }
-
- /**
- * Gets the value of the waitingForGuest property.
- */
- public boolean isWaitingForGuest() {
- if (waitingForGuest == null) {
- return false;
- } else {
- return waitingForGuest;
- }
- }
-
- /**
- * Gets the value of the stopDelay property.
- */
- public int getStopDelay() {
- if (stopDelay == null) {
- return 0;
- } else {
- return stopDelay;
- }
- }
-
- /**
- * Gets the value of the startAction property.
- */
- public String getStartAction() {
- if (startAction == null) {
- return "powerOn";
- } else {
- return startAction;
- }
- }
-
- /**
- * Gets the value of the stopAction property.
- */
- public String getStopAction() {
- if (stopAction == null) {
- return "powerOff";
- } else {
- return stopAction;
- }
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(id, order, startDelay, waitingForGuest, stopDelay, startAction, stopAction);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Item that = Item.class.cast(obj);
- return equal(this.id, that.id) &&
- equal(this.order, that.order) &&
- equal(this.startDelay, that.startDelay) &&
- equal(this.waitingForGuest, that.waitingForGuest) &&
- equal(this.stopDelay, that.stopDelay) &&
- equal(this.startAction, that.startAction) &&
- equal(this.stopAction, that.stopAction);
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper("")
- .add("id", id)
- .add("order", order)
- .add("startDelay", startDelay)
- .add("waitingForGuest", waitingForGuest)
- .add("stopDelay", stopDelay)
- .add("startAction", startAction)
- .add("stopAction", stopAction)
- .toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/MsgType.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/MsgType.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/MsgType.java
deleted file mode 100644
index 069d42a..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/MsgType.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf;
-
-import static com.google.common.base.Objects.equal;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-
-
-/**
- * Type for localizable string.
- *
- * Default string value
- *
- * <pre>
- * <complexType name="Msg_Type" />
- * </pre>
- */
-@XmlType(name = "Msg_Type")
-public class MsgType {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return builder().fromMsgType(this);
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- }
-
- public abstract static class Builder<B extends Builder<B>> {
-
- protected String value;
- protected String msgid;
-
- @SuppressWarnings("unchecked")
- protected B self() {
- return (B) this;
- }
-
- /**
- * @see MsgType#getValue()
- */
- public B value(String value) {
- this.value = value;
- return self();
- }
-
- /**
- * @see MsgType#getMsgid()
- */
- public B msgid(String msgid) {
- this.msgid = msgid;
- return self();
- }
-
- public MsgType build() {
- return new MsgType(this);
- }
-
- public B fromMsgType(MsgType in) {
- return value(in.getValue()).msgid(in.getMsgid());
- }
- }
-
- @XmlValue
- protected String value;
- @XmlAttribute
- protected String msgid;
-
- private MsgType() {
- // JAXB
- }
-
- private MsgType(Builder<?> builder) {
- this.value = builder.value;
- this.msgid = builder.msgid;
- }
-
- /**
- * Gets the value of the value property.
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Gets the value of the msgid property.
- */
- public String getMsgid() {
- if (msgid == null) {
- return "";
- } else {
- return msgid;
- }
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(value, msgid);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- MsgType that = MsgType.class.cast(obj);
- return equal(this.value, that.value) &&
- equal(this.msgid, that.msgid);
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper("")
- .add("value", value).add("msgid", msgid).toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/Network.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/Network.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/Network.java
deleted file mode 100644
index 0bf0a9d..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/Network.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement(name = "Network")
-public class Network {
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- protected String name;
- protected String description;
-
- /**
- * @see Network#getName
- */
- public Builder name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * @see Network#getDescription
- */
- public Builder description(String description) {
- this.description = description;
- return this;
- }
-
- public Network build() {
- return new Network(name, description);
- }
-
- public Builder fromNetwork(Network in) {
- return name(in.getName()).description(in.getDescription());
- }
- }
-
- private String name;
- private String description;
-
- protected Network(String name, String description) {
- this.name = name;
- this.description = description;
- }
-
- protected Network() {
- // for JAXB
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((description == null) ? 0 : description.hashCode());
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Network other = (Network) obj;
- if (description == null) {
- if (other.description != null)
- return false;
- } else if (!description.equals(other.description))
- return false;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "[name=" + name + ", description=" + description + "]";
- }
-
- public String getName() {
- return name;
- }
-
- public String getDescription() {
- return description;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/NetworkSection.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/NetworkSection.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/NetworkSection.java
deleted file mode 100644
index e40f177..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/NetworkSection.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-/**
- * The NetworkSection element shall list all logical networks used in the OVF package.
- */
-@XmlRootElement(name = "NetworkSection")
-@XmlType(name = "NetworkSection_Type")
-public class NetworkSection extends SectionType {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return builder().fromNetworkSection(this);
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- }
-
- public static class Builder<B extends Builder<B>> extends SectionType.Builder<B> {
- protected Set<Network> networks = Sets.newLinkedHashSet();
-
- /**
- * @see NetworkSection#getNetworks
- */
- public B network(Network network) {
- this.networks.add(checkNotNull(network, "network"));
- return self();
- }
-
- /**
- * @see NetworkSection#getNetworks
- */
- public B networks(Iterable<Network> networks) {
- this.networks = ImmutableSet.<Network> copyOf(checkNotNull(networks, "networks"));
- return self();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public NetworkSection build() {
- return new NetworkSection(this);
- }
-
- public B fromNetworkSection(NetworkSection in) {
- return networks(in.getNetworks()).info(in.getInfo());
- }
- }
-
- private Set<Network> networks;
-
- private NetworkSection(Builder<?> builder) {
- super(builder);
- this.networks = ImmutableSet.copyOf(checkNotNull(networks, "networks"));
- }
-
- private NetworkSection() {
- // for JAXB
- }
-
- /**
- * All networks referred to from Connection elements in all {@link VirtualHardwareSection}
- * elements shall be defined in the NetworkSection.
- */
- public Set<Network> getNetworks() {
- return networks;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(super.hashCode(), networks);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- NetworkSection other = (NetworkSection) obj;
- return super.equals(other)
- && Objects.equal(networks, other.networks);
- }
-
- @Override
- protected MoreObjects.ToStringHelper string() {
- return super.string()
- .add("networks", networks);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/OperatingSystemSection.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/OperatingSystemSection.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/OperatingSystemSection.java
deleted file mode 100644
index b01bed7..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/OperatingSystemSection.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf;
-
-import static com.google.common.base.Objects.equal;
-import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-
-/**
- * An OperatingSystemSection specifies the operating system installed on a virtual machine.
- */
-public class OperatingSystemSection extends SectionType {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return builder().fromOperatingSystemSection(this);
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- }
-
- public static class Builder<B extends Builder<B>> extends SectionType.Builder<B> {
-
- private int id;
- private String description;
- private String version;
-
- /**
- * @see OperatingSystemSection#getId()
- */
- public B id(int id) {
- this.id = id;
- return self();
- }
-
- /**
- * @see OperatingSystemSection#getVersion()
- */
- public B version(String version) {
- this.version = version;
- return self();
- }
-
- /**
- * @see OperatingSystemSection#getDescription
- */
- public B description(String description) {
- this.description = description;
- return self();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public OperatingSystemSection build() {
- return new OperatingSystemSection(this);
- }
-
- public B fromOperatingSystemSection(OperatingSystemSection in) {
- return fromSectionType(in)
- .id(in.getId())
- .version(in.getVersion())
- .description(in.getDescription());
- }
- }
-
- @XmlAttribute(namespace = OVF_NS, required = true)
- protected int id;
- @XmlAttribute(namespace = OVF_NS)
- protected String version;
- @XmlElement(name = "Description")
- protected String description;
-
- public OperatingSystemSection(Builder<?> builder) {
- super(builder);
- this.id = builder.id;
- this.description = builder.description;
- this.version = builder.version;
- }
-
- protected OperatingSystemSection() {
- // For Builders and JAXB
- }
-
- /**
- * Gets the OVF id
- *
- * @see org.jclouds.vcloud.director.v1_5.domain.cim.OSType#getCode()
- */
- public int getId() {
- return id;
- }
-
- /**
- * Gets the version
- */
- public String getVersion() {
- return version;
- }
-
- /**
- * Gets the description or null
- */
- public String getDescription() {
- return description;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(super.hashCode(), id, version, description);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null) return false;
- if (getClass() != obj.getClass()) return false;
-
- OperatingSystemSection that = (OperatingSystemSection) obj;
- return super.equals(that)
- && equal(this.id, that.id)
- && equal(this.version, that.version)
- && equal(this.description, that.description);
- }
-
- @Override
- protected MoreObjects.ToStringHelper string() {
- return super.string()
- .add("id", id)
- .add("version", version)
- .add("description", description);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/dmtf/src/main/java/org/jclouds/dmtf/ovf/ProductSection.java
----------------------------------------------------------------------
diff --git a/dmtf/src/main/java/org/jclouds/dmtf/ovf/ProductSection.java b/dmtf/src/main/java/org/jclouds/dmtf/ovf/ProductSection.java
deleted file mode 100644
index ac3bb26..0000000
--- a/dmtf/src/main/java/org/jclouds/dmtf/ovf/ProductSection.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.
- */
-package org.jclouds.dmtf.ovf;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.dmtf.DMTFConstants.CIM_NS;
-
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.jclouds.dmtf.cim.CimString;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-/**
- * The ProductSection element specifies product-information for an appliance, such as product name,
- * version, and vendor.
- */
-@XmlRootElement(name = "ProductSection")
-@XmlType(name = "ProductSection_Type")
-public class ProductSection extends SectionType {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return builder().fromProductSection(this);
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- }
-
- public static class Builder<B extends Builder<B>> extends SectionType.Builder<B> {
-
- private MsgType product;
- private MsgType vendor;
- private CimString version;
- private CimString fullVersion;
- private CimString productUrl;
- private CimString vendorUrl;
- private CimString appUrl;
- protected Set<ProductSectionProperty> properties = Sets.newLinkedHashSet();
-
- @Override
- @SuppressWarnings("unchecked")
- protected B self() {
- return (B) this;
- }
-
- /**
- * @see ProductSection#getProduct()
- */
- public B product(MsgType product) {
- this.product = product;
- return self();
- }
-
- /**
- * @see ProductSection#getVendor()
- */
- public B vendor(MsgType vendor) {
- this.vendor = vendor;
- return self();
- }
-
- /**
- * @see ProductSection#getVersion()
- */
- public B version(CimString version) {
- this.version = version;
- return self();
- }
-
- /**
- * @see ProductSection#geFullVersion()
- */
- public B fullVersion(CimString fullVersion) {
- this.fullVersion = fullVersion;
- return self();
- }
-
- /**
- * @see ProductSection#getProductUrl()
- */
- public B productUrl(CimString productUrl) {
- this.productUrl = productUrl;
- return self();
- }
-
- /**
- * @see ProductSection#getProductUrl()
- */
- public B productUrl(String productUrl) {
- this.productUrl = new CimString(productUrl);
- return self();
- }
-
- /**
- * @see ProductSection#getVendorUrl()
- */
- public B vendorUrl(CimString vendorUrl) {
- this.vendorUrl = vendorUrl;
- return self();
- }
-
- /**
- * @see ProductSection#getAppUrl()
- */
- public B appUrl(CimString appUrl) {
- this.appUrl = appUrl;
- return self();
- }
-
- /**
- * @see ProductSection#getProperties()
- */
- public B property(ProductSectionProperty property) {
- this.properties.add(checkNotNull(property, "property"));
- return self();
- }
-
- /**
- * @see ProductSection#getProperties
- */
- public B properties(Iterable<ProductSectionProperty> properties) {
- this.properties = ImmutableSet.copyOf(checkNotNull(properties, "properties"));
- return self();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public ProductSection build() {
- return new ProductSection(this);
- }
-
- public B fromProductSection(ProductSection in) {
- return fromSectionType(in)
- .product(in.getProduct())
- .vendor(in.getVendor())
- .version(in.getVersion())
- .fullVersion(in.getFullVersion())
- .productUrl(in.getProductUrl())
- .vendorUrl(in.getVendorUrl())
- .appUrl(in.getAppUrl())
- .properties(Sets.newLinkedHashSet(in.getProperties()));
- }
- }
-
- private ProductSection(Builder<?> builder) {
- super(builder);
- this.product = builder.product;
- this.vendor = builder.vendor;
- this.version = builder.version;
- this.fullVersion = builder.fullVersion;
- this.productUrl = builder.productUrl;
- this.vendorUrl = builder.vendorUrl;
- this.appUrl = builder.appUrl;
- this.properties = builder.properties != null ? ImmutableSet.copyOf(checkNotNull(builder.properties, "properties")) : ImmutableSet.<ProductSectionProperty>of();
- }
-
- private ProductSection() {
- // For JAXB
- }
-
- @XmlElement(name = "Product")
- private MsgType product;
- @XmlElement(name = "Vendor")
- private MsgType vendor;
- @XmlElement(name = "Version", namespace = CIM_NS)
- private CimString version;
- @XmlElement(name = "FullVersion", namespace = CIM_NS)
- private CimString fullVersion;
- @XmlElement(name = "ProductUrl", namespace = CIM_NS)
- private CimString productUrl;
- @XmlElement(name = "VendorUrl", namespace = CIM_NS)
- private CimString vendorUrl;
- @XmlElement(name = "AppUrl", namespace = CIM_NS)
- private CimString appUrl;
- @XmlElement(name = "Property")
- private Set<ProductSectionProperty> properties = Sets.newLinkedHashSet();
-
- /**
- * Name of product.
- */
- public MsgType getProduct() {
- return product;
- }
-
- /**
- * Name of product vendor.
- */
- public MsgType getVendor() {
- return vendor;
- }
-
- /**
- * Product version, short form.
- */
- public CimString getVersion() {
- return version;
- }
-
- /**
- * Product version, long form.
- */
- public CimString getFullVersion() {
- return fullVersion;
- }
-
- /**
- * URL resolving to product description.
- */
- public CimString getProductUrl() {
- return productUrl;
- }
-
- /**
- * URL resolving to vendor description.
- */
- public CimString getVendorUrl() {
- return vendorUrl;
- }
-
- /**
- * Experimental: URL resolving to deployed product instance.
- */
- public CimString getAppUrl() {
- return appUrl;
- }
-
- // TODO Set<Icon>
-
- /**
- * Properties for application-level customization.
- */
- public Set<ProductSectionProperty> getProperties() {
- return properties;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(super.hashCode(), product, vendor, version, fullVersion, productUrl, vendorUrl, appUrl, properties);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (!super.equals(obj)) return false;
- if (getClass() != obj.getClass()) return false;
-
- ProductSection that = ProductSection.class.cast(obj);
- return super.equals(that) &&
- equal(this.product, that.product) &&
- equal(this.vendor, that.vendor) &&
- equal(this.version, that.version) &&
- equal(this.fullVersion, that.fullVersion) &&
- equal(this.productUrl, that.productUrl) &&
- equal(this.vendorUrl, that.vendorUrl) &&
- equal(this.appUrl, that.appUrl) &&
- equal(this.properties, that.properties);
- }
-
- @Override
- protected MoreObjects.ToStringHelper string() {
- return super.string()
- .add("product", product)
- .add("vendor", vendor)
- .add("version", version)
- .add("fullVersion", fullVersion)
- .add("productUrl", productUrl)
- .add("vendorUrl", vendorUrl)
- .add("appUrl", appUrl)
- .add("properties", properties);
- }
-
-}
[3/6] Fold dmtf into vcloud-director (its only user).
Posted by ad...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimReference.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimReference.java b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimReference.java
new file mode 100644
index 0000000..517e35b
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimReference.java
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.cim;
+
+import static org.jclouds.dmtf.DMTFConstants.CIM_NS;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+
+/**
+ * Java class for cimReference complex type.
+ *
+ * <pre>
+ * <complexType name="cimReference" />
+ * </pre>
+ */
+@XmlType(name = "cimReference", namespace = CIM_NS)
+public class CimReference {
+
+ @XmlAnyElement(lax = true)
+ protected List<Object> any;
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = Maps.newHashMap();
+
+ /**
+ * Gets the value of the any property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the any property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getAny().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link Object }
+ * {@link Element }
+ *
+ *
+ */
+ public List<Object> getAny() {
+ if (any == null) {
+ any = Lists.newArrayList();
+ }
+ return this.any;
+ }
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ *
+ * <p>
+ * the map is keyed by the name of the attribute and
+ * the value is the string value of the attribute.
+ *
+ * the map returned by this method is live, and you can add new attribute
+ * by updating the map directly. Because of this design, there's no setter.
+ *
+ *
+ * @return
+ * always non-null
+ */
+ public Map<QName, String> getOtherAttributes() {
+ return otherAttributes;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimString.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimString.java b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimString.java
new file mode 100644
index 0000000..8f8b18d
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimString.java
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.cim;
+
+import static com.google.common.base.Objects.equal;
+
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.namespace.QName;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import com.google.common.collect.Maps;
+
+/**
+ * Java class for cimString complex type.
+ *
+ * <pre>
+ * <complexType name="cimString" />
+ * </pre>
+ */
+@XmlType(name = "cimString")
+public class CimString {
+
+ public CimString() {
+ // JAXB
+ }
+
+ public CimString(String value) {
+ this.value = value;
+ }
+
+ @XmlValue
+ protected String value;
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = Maps.newHashMap();
+
+ /**
+ * Gets the value of the value property.
+ */
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ */
+ public Map<QName, String> getOtherAttributes() {
+ return otherAttributes;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(value);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ CimString that = CimString.class.cast(obj);
+ return equal(this.value, that.value);
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper("").add("value", value).toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimUnsignedInt.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimUnsignedInt.java b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimUnsignedInt.java
new file mode 100644
index 0000000..2fd5406
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimUnsignedInt.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.cim;
+
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.namespace.QName;
+
+import com.google.common.collect.Maps;
+
+/**
+ * Java class for cimUnsignedInt complex type.
+ *
+ * <pre>
+ * <complexType name="cimUnsignedInt" />
+ * </pre>
+ */
+@XmlType(name = "cimUnsignedInt", namespace = "http://schemas.dmtf.org/wbem/wscim/1/common")
+public class CimUnsignedInt {
+
+ @XmlValue
+ @XmlSchemaType(name = "unsignedInt")
+ protected long value;
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = Maps.newHashMap();
+
+ /**
+ * Gets the value of the value property.
+ *
+ */
+ public long getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ */
+ public void setValue(long value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ *
+ * <p>
+ * the map is keyed by the name of the attribute and
+ * the value is the string value of the attribute.
+ *
+ * the map returned by this method is live, and you can add new attribute
+ * by updating the map directly. Because of this design, there's no setter.
+ *
+ *
+ * @return
+ * always non-null
+ */
+ public Map<QName, String> getOtherAttributes() {
+ return otherAttributes;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimUnsignedLong.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimUnsignedLong.java b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimUnsignedLong.java
new file mode 100644
index 0000000..cbf7b3e
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimUnsignedLong.java
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.cim;
+
+import java.math.BigInteger;
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.namespace.QName;
+
+import com.google.common.collect.Maps;
+
+/**
+ * Java class for cimUnsignedLong complex type.
+ *
+ * <pre>
+ * <complexType name="cimUnsignedLong" />
+ * </pre>
+ */
+@XmlType(name = "cimUnsignedLong", namespace = "http://schemas.dmtf.org/wbem/wscim/1/common")
+public class CimUnsignedLong {
+
+ @XmlValue
+ @XmlSchemaType(name = "unsignedLong")
+ protected BigInteger value;
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = Maps.newHashMap();
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setValue(BigInteger value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ *
+ * <p>
+ * the map is keyed by the name of the attribute and
+ * the value is the string value of the attribute.
+ *
+ * the map returned by this method is live, and you can add new attribute
+ * by updating the map directly. Because of this design, there's no setter.
+ *
+ *
+ * @return
+ * always non-null
+ */
+ public Map<QName, String> getOtherAttributes() {
+ return otherAttributes;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimUnsignedShort.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimUnsignedShort.java b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimUnsignedShort.java
new file mode 100644
index 0000000..5f888e5
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/CimUnsignedShort.java
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2012.02.08 at 02:47:44 PM GMT
+//
+
+
+package org.jclouds.dmtf.cim;
+
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.namespace.QName;
+
+import com.google.common.collect.Maps;
+
+/**
+ * <p>Java class for cimUnsignedShort complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="cimUnsignedShort">
+ * <simpleContent>
+ * <extension base="<http://www.w3.org/2001/XMLSchema>unsignedShort">
+ * <anyAttribute processContents='lax'/>
+ * </extension>
+ * </simpleContent>
+ * </complexType>
+ * </pre>
+ */
+@XmlType(name = "cimUnsignedShort", namespace = "http://schemas.dmtf.org/wbem/wscim/1/common")
+public class CimUnsignedShort {
+
+ @XmlValue
+ @XmlSchemaType(name = "unsignedShort")
+ protected int value;
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = Maps.newHashMap();
+
+ /**
+ * Gets the value of the value property.
+ *
+ */
+ public int getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ */
+ public void setValue(int value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ *
+ * <p>
+ * the map is keyed by the name of the attribute and
+ * the value is the string value of the attribute.
+ *
+ * the map returned by this method is live, and you can add new attribute
+ * by updating the map directly. Because of this design, there's no setter.
+ *
+ *
+ * @return
+ * always non-null
+ */
+ public Map<QName, String> getOtherAttributes() {
+ return otherAttributes;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/cim/OSType.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/cim/OSType.java b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/OSType.java
new file mode 100644
index 0000000..004c7d1
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/OSType.java
@@ -0,0 +1,198 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.cim;
+
+import org.jclouds.compute.domain.OsFamily;
+
+/**
+ * Operating system based on DMTF CIM model.
+ *
+ * @see <a
+ * href="http://dmtf.org/sites/default/files/cim/cim_schema_v2280/cim_schema_2.28.0Final-Doc.zip"
+ * />
+ */
+public enum OSType {
+
+ /** Other */
+ OTHER(1, "Other", OsFamily.UNRECOGNIZED, false),
+
+ /** MACOS */
+ MACOS(2, "MACOS", OsFamily.DARWIN, false),
+
+ /** Solaris */
+ SOLARIS(29, "Solaris", OsFamily.SOLARIS, false),
+
+ /** LINUX */
+ LINUX(36, "LINUX", OsFamily.LINUX, false),
+
+ /** FreeBSD */
+ FREEBSD(42, "FreeBSD", OsFamily.FREEBSD, false),
+
+ /** NetBSD */
+ NETBSD(43, "NetBSD", OsFamily.NETBSD, false),
+
+ /** OpenBSD */
+ OPENBSD(65, "OpenBSD", OsFamily.OPENBSD, false),
+
+ /** Not Applicable */
+ NOT_APPLICABLE(66, "Not Applicable", OsFamily.UNRECOGNIZED, false),
+
+ /** Microsoft Windows Server 2003 */
+ WINDOWS_SERVER_2003(69, "Microsoft Windows Server 2003", OsFamily.WINDOWS, false),
+
+ /** Microsoft Windows Server 2003 64-Bit */
+ WINDOWS_SERVER_2003_64(70, "Microsoft Windows Server 2003 64-Bit", OsFamily.WINDOWS, true),
+
+ /** Microsoft Windows Server 2008 */
+ WINDOWS_SERVER_2008(76, "Microsoft Windows Server 2008", OsFamily.WINDOWS, false),
+
+ /** Microsoft Windows Server 2008 64-Bit */
+ WINDOWS_SERVER_2008_64(77, "Microsoft Windows Server 2008 64-Bit", OsFamily.WINDOWS, true),
+
+ /** FreeBSD 64-Bit */
+ FREEBSD_64(78, "FreeBSD 64-Bit", OsFamily.FREEBSD, true),
+
+ /** RedHat Enterprise Linux */
+ RHEL(79, "RedHat Enterprise Linux", OsFamily.RHEL, false),
+
+ /** RedHat Enterprise Linux 64-Bit */
+ RHEL_64(80, "RedHat Enterprise Linux 64-Bit", OsFamily.RHEL, true),
+
+ /** Solaris 64-Bit */
+ SOLARIS_64(81, "Solaris 64-Bit", OsFamily.SOLARIS, true),
+
+ /** SUSE */
+ SUSE(82, "SUSE", OsFamily.SUSE, false),
+
+ /** SUSE 64-Bit */
+ SUSE_64(83, "SUSE 64-Bit", OsFamily.SUSE, true),
+
+ /** SLES */
+ SLES(84, "SLES", OsFamily.SUSE, false),
+
+ /** SLES 64-Bit */
+ SLES_64(85, "SLES 64-Bit", OsFamily.SUSE, true),
+
+ /** Novell OES */
+ NOVELL_OES(86, "Novell OES", OsFamily.SUSE, true),
+
+ /** Mandriva */
+ MANDRIVA(89, "Mandriva", OsFamily.MANDRIVA, false),
+
+ /** Mandriva 64-Bit */
+ MANDRIVA_64(90, "Mandriva 64-Bit", OsFamily.MANDRIVA, true),
+
+ /** TurboLinux */
+ TURBOLINUX(91, "TurboLinux", OsFamily.TURBOLINUX, false),
+
+ /** TurboLinux 64-Bit */
+ TURBOLINUX_64(92, "TurboLinux 64-Bit", OsFamily.TURBOLINUX, true),
+
+ /** Ubuntu */
+ UBUNTU(93, "Ubuntu", OsFamily.UBUNTU, false),
+
+ /** Ubuntu 64-Bit */
+ UBUNTU_64(94, "Ubuntu 64-Bit", OsFamily.UBUNTU, true),
+
+ /** Debian */
+ DEBIAN(95, "Debian", OsFamily.DEBIAN, false),
+
+ /** Debian 64-Bit */
+ DEBIAN_64(96, "Debian 64-Bit", OsFamily.DEBIAN, false),
+
+ /** Linux 2.4.x */
+ LINUX_2_4(97, "Linux 2.4.x", OsFamily.LINUX, false),
+
+ /** Linux 2.4.x 64-Bi */
+ LINUX_2_4_64(98, "Linux 2.4.x 64-Bit", OsFamily.LINUX, true),
+
+ /** Linux 2.6.x */
+ LINUX_2_6(99, "Linux 2.6.x", OsFamily.LINUX, false),
+
+ /** Linux 2.6.x 64-Bit */
+ LINUX_2_6_64(100, "Linux 2.6.x 64-Bit", OsFamily.LINUX, true),
+
+ /** Linux 64-Bit */
+ LINUX_64(101, "Linux 64-Bit", OsFamily.LINUX, true),
+
+ /** Other 64-Bit */
+ OTHER_64(102, "Other 64-Bit", OsFamily.UNRECOGNIZED, true),
+
+ /** Microsoft Windows Server 2008 R2 */
+ WINDOWS_SERVER_2008_R2(103, "Microsoft Windows Server 2008 R2", OsFamily.WINDOWS, true),
+
+ /** VMware ESXi */
+ ESXI(104, "VMware ESXi", OsFamily.ESX, true),
+
+ /** Microsoft Windows 7 */
+ WINDOWS_7(105, "Microsoft Windows 7", OsFamily.WINDOWS, false),
+
+ /** CentOS 32-bit */
+ CENTOS(106, "CentOS 32-bit", OsFamily.CENTOS, false),
+
+ /** CentOS 64-bit */
+ CENTOS_64(107, "CentOS 64-bit", OsFamily.CENTOS, true),
+
+ /** Oracle Enterprise Linux 32-bit */
+ ORACLE_ENTERPRISE_LINUX(108, "Oracle Enterprise Linux 32-bit", OsFamily.OEL, false),
+
+ /** Oracle Enterprise Linux 64-bit */
+ ORACLE_ENTERPRISE_LINUX_64(109, "Oracle Enterprise Linux 64-bit", OsFamily.OEL, true),
+
+ /** eComStation 32-bitx */
+ ECOMSTATION_32(109, "eComStation 32-bitx", OsFamily.UNRECOGNIZED, false),
+
+ UNRECOGNIZED(Integer.MAX_VALUE, "UNRECOGNIZED", null, true);
+
+ private final int code;
+
+ public int getCode() {
+ return code;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public OsFamily getFamily() {
+ return family;
+ }
+
+ public boolean is64Bit() {
+ return is64Bit;
+ }
+
+ private final String value;
+ private final OsFamily family;
+ private final boolean is64Bit;
+
+ OSType(int code, String value, OsFamily family, boolean is64Bit) {
+ this.code = code;
+ this.value = value;
+ this.family = family;
+ this.is64Bit = is64Bit;
+ }
+
+ public static OSType fromValue(int code) {
+ for (OSType type : values()) {
+ if (type.code == code)
+ return type;
+ }
+ return UNRECOGNIZED;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationCaption.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationCaption.java b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationCaption.java
new file mode 100644
index 0000000..1b3305a
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationCaption.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.cim;
+
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Java class for anonymous complex type.
+ */
+@XmlType(name = "")
+public class ResourceAllocationCaption extends CimString {
+
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationChangeableType.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationChangeableType.java b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationChangeableType.java
new file mode 100644
index 0000000..14fda0d
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationChangeableType.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.cim;
+
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Java class for anonymous complex type.
+ */
+@XmlType(name = "")
+public class ResourceAllocationChangeableType extends CimUnsignedShort {
+
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationSettingData.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationSettingData.java b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationSettingData.java
new file mode 100644
index 0000000..8b76485
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/ResourceAllocationSettingData.java
@@ -0,0 +1,903 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.cim;
+
+import static com.google.common.base.Objects.equal;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.jclouds.dmtf.DMTFConstants.CIM_RASD_NS;
+import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
+
+import java.math.BigInteger;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlEnumValue;
+import javax.xml.bind.annotation.XmlType;
+
+import com.google.common.base.Function;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.MoreObjects.ToStringHelper;
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+
+/**
+ * The ResourceAllocationSettingData class represents settings specifically
+ * related to an allocated resource that are outside the scope of the CIM class
+ * typically used to represent the resource itself.
+ *
+ * These settings include information specific to the allocation that may not
+ * be visible to the consumer of the resource itself. For example, a virtual
+ * processor may look like a 2 GHz processor to the consumer (virtual computer
+ * system), however the virtualization system may use time-slicing to schedule
+ * the the virtual processor to only allow it to use 1 GHz.
+ *
+ * @see <a href="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_ResourceAllocationSettingData.xsd">CIM_ResourceAllocationSettingData</a>
+ */
+@XmlType(name = "CIM_ResourceAllocationSettingData_Type", namespace = OVF_NS,
+ propOrder = {
+ "address",
+ "addressOnParent",
+ "allocationUnits",
+ "automaticAllocation",
+ "automaticDeallocation",
+ "caption",
+ "connections",
+ "consumerVisibility",
+ "description",
+ "elementName",
+ "hostResources",
+ "instanceID",
+ "limit",
+ "mappingBehavior",
+ "otherResourceType",
+ "parent",
+ "poolID",
+ "reservation",
+ "resourceSubType",
+ "resourceType",
+ "virtualQuantity",
+ "virtualQuantityUnits",
+ "weight"
+ }
+)
+public class ResourceAllocationSettingData {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return builder().fromResourceAllocationSettingData(this);
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ }
+
+ public static class Builder<B extends Builder<B>> {
+
+ private String elementName;
+ private String instanceID;
+ private String caption;
+ private String description;
+ private String address;
+ private String addressOnParent;
+ private String allocationUnits;
+ private Boolean automaticAllocation;
+ private Boolean automaticDeallocation;
+ private ConsumerVisibility consumerVisibility;
+ private BigInteger limit;
+ private MappingBehavior mappingBehavior;
+ private String otherResourceType;
+ private String parent;
+ private String poolID;
+ private BigInteger reservation;
+ private String resourceSubType;
+ private ResourceType resourceType;
+ private BigInteger virtualQuantity;
+ private String virtualQuantityUnits;
+ private Long weight;
+ private Set<CimString> connections = Sets.newLinkedHashSet();
+ private Set<CimString> hostResources = Sets.newLinkedHashSet();
+
+ @SuppressWarnings("unchecked")
+ protected B self() {
+ return (B) this;
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getElementName()
+ */
+ public B elementName(String elementName) {
+ this.elementName = elementName;
+ return self();
+ }
+
+ /**
+ *@see ResourceAllocationSettingData#getInstanceId()
+ */
+ public B instanceID(String instanceID) {
+ this.instanceID = instanceID;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getCaption()
+ */
+ public B caption(String caption) {
+ this.caption = caption;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getDescription()
+ */
+ public B description(String description) {
+ this.description = description;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getAddress
+ */
+ public B address(String address) {
+ this.address = address;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getAddressOnParent
+ */
+ public B addressOnParent(String addressOnParent) {
+ this.addressOnParent = addressOnParent;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getAllocationUnits
+ */
+ public B allocationUnits(String allocationUnits) {
+ this.allocationUnits = allocationUnits;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#isAutomaticAllocation()
+ */
+ public B automaticAllocation(Boolean automaticAllocation) {
+ this.automaticAllocation = automaticAllocation;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#isAutomaticDeallocation()
+ */
+ public B automaticDeallocation(Boolean automaticDeallocation) {
+ this.automaticDeallocation = automaticDeallocation;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getConsumerVisibility
+ */
+ public B consumerVisibility(ConsumerVisibility consumerVisibility) {
+ this.consumerVisibility = consumerVisibility;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getLimit
+ */
+ public B limit(BigInteger limit) {
+ this.limit = limit;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getMappingBehavior
+ */
+ public B mappingBehavior(MappingBehavior mappingBehavior) {
+ this.mappingBehavior = mappingBehavior;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getOtherResourceType
+ */
+ public B otherResourceType(String otherResourceType) {
+ this.otherResourceType = otherResourceType;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getParent
+ */
+ public B parent(String parent) {
+ this.parent = parent;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getPoolID
+ */
+ public B poolID(String poolID) {
+ this.poolID = poolID;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getReservation
+ */
+ public B reservation(BigInteger reservation) {
+ this.reservation = reservation;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getResourceSubType
+ */
+ public B resourceSubType(String resourceSubType) {
+ this.resourceSubType = resourceSubType;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getResourceType
+ */
+ public B resourceType(ResourceType resourceType) {
+ this.resourceType = resourceType;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getVirtualQuantity
+ */
+ public B virtualQuantity(BigInteger virtualQuantity) {
+ this.virtualQuantity = virtualQuantity;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getVirtualQuantityUnits
+ */
+ public B virtualQuantityUnits(String virtualQuantityUnits) {
+ this.virtualQuantityUnits = virtualQuantityUnits;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getWeight
+ */
+ public B weight(Long weight) {
+ this.weight = weight;
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getConnections()
+ */
+ public B connection(CimString connection) {
+ this.connections.add(checkNotNull(connection, "connection"));
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getConnections
+ */
+ public B connections(Iterable<CimString> connections) {
+ this.connections = Sets.newLinkedHashSet(checkNotNull(connections, "connections"));
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getHostResources()
+ */
+ public B hostResource(CimString hostResource) {
+ this.hostResources.add(checkNotNull(hostResource, "hostResource"));
+ return self();
+ }
+
+ /**
+ * @see ResourceAllocationSettingData#getHostResources
+ */
+ public B hostResources(Iterable<CimString> hostResources) {
+ this.hostResources = Sets.newLinkedHashSet(checkNotNull(hostResources, "hostResources"));
+ return self();
+ }
+
+ public ResourceAllocationSettingData build() {
+ return new ResourceAllocationSettingData(this);
+ }
+
+ public B fromResourceAllocationSettingData(ResourceAllocationSettingData in) {
+ return elementName(in.getElementName())
+ .instanceID(in.getInstanceID())
+ .caption(in.getCaption())
+ .description(in.getDescription())
+ .address(in.getAddress())
+ .addressOnParent(in.getAddressOnParent())
+ .allocationUnits(in.getAllocationUnits())
+ .automaticAllocation(in.isAutomaticAllocation())
+ .automaticDeallocation(in.isAutomaticDeallocation())
+ .consumerVisibility(in.getConsumerVisibility())
+ .limit(in.getLimit())
+ .mappingBehavior(in.getMappingBehavior())
+ .otherResourceType(in.getOtherResourceType())
+ .parent(in.getParent())
+ .poolID(in.getPoolID())
+ .reservation(in.getReservation())
+ .resourceSubType(in.getResourceSubType())
+ .resourceType(in.getResourceType())
+ .virtualQuantity(in.getVirtualQuantity())
+ .virtualQuantityUnits(in.getVirtualQuantityUnits())
+ .weight(in.getWeight())
+ .connections(in.getConnections())
+ .hostResources(in.getHostResources());
+ }
+ }
+
+ /**
+ * The type of resource this allocation setting represents.
+ */
+ @XmlType
+ @XmlEnum(Integer.class)
+ public static enum ResourceType {
+ @XmlEnumValue("1") OTHER(1),
+ @XmlEnumValue("2") COMPUTER_SYSTEM(2),
+ @XmlEnumValue("3") PROCESSOR(3),
+ @XmlEnumValue("4") MEMORY(4),
+ @XmlEnumValue("5") IDE_CONTROLLER(5),
+ @XmlEnumValue("6") PARALLEL_SCSI_HBA(6),
+ @XmlEnumValue("7") FC_HBA(7),
+ @XmlEnumValue("8") ISCSI_HBA(8),
+ @XmlEnumValue("9") IB_HCA(9),
+ @XmlEnumValue("10") ETHERNET_ADAPTER(10),
+ @XmlEnumValue("11") OTHER_NETWORK_ADAPTER(11),
+ @XmlEnumValue("12") IO_SLOT(12),
+ @XmlEnumValue("13") IO_DEVICE(13),
+ @XmlEnumValue("14") FLOPPY_DRIVE(14),
+ @XmlEnumValue("15") CD_DRIVE(15),
+ @XmlEnumValue("16") DVD_DRIVE(16),
+ @XmlEnumValue("17") DISK_DRIVE(17),
+ @XmlEnumValue("18") TAPE_DRIVE(18),
+ @XmlEnumValue("19") STORAGE_EXTENT(19),
+ @XmlEnumValue("20") OTHER_STORAGE_DEVICE(20),
+ @XmlEnumValue("21") SERIAL_PORT(21),
+ @XmlEnumValue("22") PARALLEL_PORT(22),
+ @XmlEnumValue("23") USB_CONTROLLER(23),
+ @XmlEnumValue("24") GRAPHICS_CONTROLLER(24),
+ @XmlEnumValue("25") IEEE_1394_CONTROLLER(25),
+ @XmlEnumValue("26") PARTITIONABLE_UNIT(26),
+ @XmlEnumValue("27") BASE_PARTITIONABLE_UNIT(27),
+ @XmlEnumValue("28") POWER(28),
+ @XmlEnumValue("29") COOLING_CAPACITY(29),
+ @XmlEnumValue("30") ETHERNET_SWITCH_PORT(30),
+ @XmlEnumValue("31") LOGICAL_DISK(31),
+ @XmlEnumValue("32") STORAGE_VOLUME(32),
+ @XmlEnumValue("33") ETHERNET_CONNECTION(33),
+ @XmlEnumValue("32768") DMTF_RESERVED(Integer.valueOf("8000", 16)),
+ @XmlEnumValue("65535") VENDOR_RESERVED(Integer.valueOf("FFFF", 16));
+
+ protected final int code;
+
+ ResourceType(int code) {
+ this.code = code;
+ }
+
+ public String value() {
+ return Integer.toString(code);
+ }
+
+ protected static final Map<Integer, ResourceType> RESOURCE_TYPE_BY_ID = Maps.uniqueIndex(
+ ImmutableSet.copyOf(ResourceType.values()), new Function<ResourceType, Integer>() {
+ @Override
+ public Integer apply(ResourceType input) {
+ return input.code;
+ }
+ });
+
+ public static ResourceType fromValue(String type) {
+ return RESOURCE_TYPE_BY_ID.get(Integer.valueOf(checkNotNull(type, "type")));
+ }
+ }
+
+ /**
+ * Describes the consumers visibility to the allocated resource.
+ */
+ @XmlType
+ @XmlEnum(Integer.class)
+ public static enum ConsumerVisibility {
+ @XmlEnumValue("0") UNKNOWN(0),
+
+ /**
+ * indicates the underlying or host resource is utilized and passed
+ * through to the consumer, possibly using partitioning. At least one item
+ * shall be present in the HostResource property.
+ */
+ @XmlEnumValue("2") PASSED_THROUGH(2),
+
+ /**
+ * indicates the resource is virtualized and may not map directly to an
+ * underlying/host resource. Some implementations may support specific
+ * assignment for virtualized resources, in which case the host
+ * resource(s) are exposed using the HostResource property.
+ */
+ @XmlEnumValue("3") VIRTUALIZED(3),
+
+ /**
+ * indicates a representation of the resource does not exist within the
+ * context of the resource consumer.
+ */
+ @XmlEnumValue("4") NOT_REPRESENTED(4),
+ @XmlEnumValue("32768") DMTF_RESERVED(Integer.valueOf("8000", 16)),
+ @XmlEnumValue("65535") VENDOR_RESERVED(Integer.valueOf("FFFF", 16));
+
+ protected final int code;
+
+ ConsumerVisibility(int code) {
+ this.code = code;
+ }
+
+ public String value() {
+ return Integer.toString(code);
+ }
+
+ protected static final Map<Integer, ConsumerVisibility> MAPPING_BEHAVIOR_BY_ID = Maps.uniqueIndex(
+ ImmutableSet.copyOf(ConsumerVisibility.values()), new Function<ConsumerVisibility, Integer>() {
+ @Override
+ public Integer apply(ConsumerVisibility input) {
+ return input.code;
+ }
+ });
+
+ public static ConsumerVisibility fromValue(String behavior) {
+ return MAPPING_BEHAVIOR_BY_ID.get(Integer.valueOf(checkNotNull(behavior, "behavior")));
+ }
+ }
+
+ /**
+ * Specifies how this resource maps to underlying resourcesIf the
+ * HostResource array contains any entries, this property reflects how the
+ * resource maps to those specific resources.
+ */
+ @XmlType
+ @XmlEnum(Integer.class)
+ public static enum MappingBehavior {
+ @XmlEnumValue("0") UNKNOWN(0),
+ @XmlEnumValue("2") NOT_SUPPORTED(2),
+ @XmlEnumValue("3") DEDICATED(3),
+ @XmlEnumValue("4") SOFT_AFFINITY(4),
+ @XmlEnumValue("5") HARD_AFFINITY(5),
+ @XmlEnumValue("32768") DMTF_RESERVED(Integer.valueOf("8000", 16)),
+ @XmlEnumValue("65535") VENDOR_RESERVED(Integer.valueOf("FFFF", 16));
+
+ protected final int code;
+
+ MappingBehavior(int code) {
+ this.code = code;
+ }
+
+ public String value() {
+ return Integer.toString(code);
+ }
+
+ protected static final Map<Integer, MappingBehavior> MAPPING_BEHAVIOR_BY_ID = Maps.uniqueIndex(
+ ImmutableSet.copyOf(MappingBehavior.values()), new Function<MappingBehavior, Integer>() {
+ @Override
+ public Integer apply(MappingBehavior input) {
+ return input.code;
+ }
+ });
+
+ public static MappingBehavior fromValue(String behavior) {
+ return MAPPING_BEHAVIOR_BY_ID.get(Integer.valueOf(checkNotNull(behavior, "behavior")));
+ }
+ }
+
+ @XmlElement(name = "ElementName", namespace = CIM_RASD_NS)
+ private String elementName;
+ @XmlElement(name = "InstanceID", namespace = CIM_RASD_NS)
+ private String instanceID;
+ @XmlElement(name = "Caption", namespace = CIM_RASD_NS)
+ private String caption;
+ @XmlElement(name = "Description", namespace = CIM_RASD_NS)
+ private String description;
+ @XmlElement(name = "Address", namespace = CIM_RASD_NS)
+ private String address;
+ @XmlElement(name = "AddressOnParent", namespace = CIM_RASD_NS)
+ private String addressOnParent;
+ @XmlElement(name = "AllocationUnits", namespace = CIM_RASD_NS)
+ private String allocationUnits;
+ @XmlElement(name = "AutomaticAllocation", namespace = CIM_RASD_NS)
+ private Boolean automaticAllocation;
+ @XmlElement(name = "AutomaticDeallocation", namespace = CIM_RASD_NS)
+ private Boolean automaticDeallocation;
+ @XmlElement(name = "ConsumerVisibility", namespace = CIM_RASD_NS)
+ private ConsumerVisibility consumerVisibility;
+ @XmlElement(name = "Limit", namespace = CIM_RASD_NS)
+ private BigInteger limit;
+ @XmlElement(name = "MappingBehavior", namespace = CIM_RASD_NS)
+ private MappingBehavior mappingBehavior;
+ @XmlElement(name = "OtherResourceType", namespace = CIM_RASD_NS)
+ private String otherResourceType;
+ @XmlElement(name = "Parent", namespace = CIM_RASD_NS)
+ private String parent;
+ @XmlElement(name = "PoolID", namespace = CIM_RASD_NS)
+ private String poolID;
+ @XmlElement(name = "Reservation", namespace = CIM_RASD_NS)
+ private BigInteger reservation;
+ @XmlElement(name = "ResourceSubType", namespace = CIM_RASD_NS)
+ private String resourceSubType;
+ @XmlElement(name = "ResourceType", namespace = CIM_RASD_NS)
+ private ResourceType resourceType;
+ @XmlElement(name = "VirtualQuantity", namespace = CIM_RASD_NS)
+ private BigInteger virtualQuantity;
+ @XmlElement(name = "VirtualQuantityUnits", namespace = CIM_RASD_NS)
+ private String virtualQuantityUnits;
+ @XmlElement(name = "Weight", namespace = CIM_RASD_NS)
+ private Long weight;
+ @XmlElement(name = "Connection", namespace = CIM_RASD_NS)
+ private Set<CimString> connections = Sets.newLinkedHashSet();
+ @XmlElement(name = "HostResource", namespace = CIM_RASD_NS)
+ private Set<CimString> hostResources = Sets.newLinkedHashSet();
+
+ protected ResourceAllocationSettingData(Builder<?> builder) {
+ this.elementName = builder.elementName;
+ this.instanceID = builder.instanceID;
+ this.caption = builder.caption;
+ this.description = builder.description;
+ this.address = builder.address;
+ this.addressOnParent = builder.addressOnParent;
+ this.allocationUnits = builder.allocationUnits;
+ this.automaticAllocation = builder.automaticAllocation;
+ this.automaticDeallocation = builder.automaticDeallocation;
+ this.consumerVisibility = builder.consumerVisibility;
+ this.limit = builder.limit;
+ this.mappingBehavior = builder.mappingBehavior;
+ this.otherResourceType = builder.otherResourceType;
+ this.parent = builder.parent;
+ this.poolID = builder.poolID;
+ this.reservation = builder.reservation;
+ this.resourceSubType = builder.resourceSubType;
+ this.resourceType = builder.resourceType;
+ this.virtualQuantity = builder.virtualQuantity;
+ this.virtualQuantityUnits = builder.virtualQuantityUnits;
+ this.weight = builder.weight;
+ this.connections = builder.connections != null ? ImmutableSet.copyOf(builder.connections) : ImmutableSet.<CimString>of();
+ this.hostResources = builder.hostResources != null ? ImmutableSet.copyOf(builder.hostResources) : ImmutableSet.<CimString>of();
+ }
+
+ protected ResourceAllocationSettingData() {
+ // for JAXB
+ }
+
+ /**
+ * The user-friendly name for this instance of SettingData. In addition, the user-friendly name
+ * can be used as an index property for a search or query. (Note: The name does not have to be
+ * unique within a namespace.)
+ */
+ public String getElementName() {
+ return elementName;
+ }
+
+ /**
+ * Within the scope of the instantiating Namespace, InstanceID opaquely and uniquely identifies
+ * an instance of this class.
+ */
+ public String getInstanceID() {
+ return instanceID;
+ }
+
+ /**
+ * The Caption property is a short textual description (one- line string) of the object.
+ */
+ public String getCaption() {
+ return caption;
+ }
+
+ /**
+ * The Description property provides a textual description of the object.
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * The address of the resource. For example, the MAC address of a Ethernet
+ * port.
+ */
+ public String getAddress() {
+ return address;
+ }
+
+ /**
+ * Describes the address of this resource in the context of the Parent. The
+ * Parent/AddressOnParent properties are used to describe the controller
+ * relationship as well the ordering of devices on a controller.For example,
+ * if the parent is a PCI Controller, this property would specify the PCI
+ * slot of this child device.
+ */
+ public String getAddressOnParent() {
+ return addressOnParent;
+ }
+
+ /**
+ * This property specifies the units of allocation used by the Reservation
+ * and Limit properties. For example, when ResourceType=Processor,
+ * AllocationUnits may be set to hertz*10^6 or percent. When
+ * ResourceType=Memory, AllocationUnits may be set to bytes*10^3. It is
+ * expected that profiles constrain the units that apply in context of
+ * particular resource types. The value of this property shall be a legal
+ * value of the Programmatic Units qualifier as defined in Annex C.1 of
+ * DSP0004 V2.5 or later.
+ */
+ public String getAllocationUnits() {
+ return allocationUnits;
+ }
+
+ /**
+ * This property specifies if the resource will be automatically allocated.
+ * For example when set to true, when the consuming virtual computer system
+ * is powered on, this resource would be allocated. A value of false
+ * indicates the resource must be explicitly allocated. For example, the
+ * setting may represent removable media (cdrom, floppy, etc.) where at power
+ * on time, the media is not present. An explicit operation is required to
+ * allocate the resource.
+ */
+ public Boolean isAutomaticAllocation() {
+ return automaticAllocation;
+ }
+
+ /**
+ * This property specifies if the resource will be automatically
+ * de-allocated. For example, when set to true, when the consuming virtual
+ * computer system is powered off, this resource would be de-allocated. When
+ * set to false, the resource will remain allocated and must be explicitly
+ * de-allocated.
+ */
+ public Boolean isAutomaticDeallocation() {
+ return automaticDeallocation;
+ }
+
+ /**
+ * Describes the consumers visibility to the allocated resource.
+ */
+ public ConsumerVisibility getConsumerVisibility() {
+ return consumerVisibility;
+ }
+
+ /**
+ * This property specifies the upper bound, or maximum amount of resource
+ * that will be granted for this allocation. For example, a system which
+ * supports memory paging may support setting the Limit of a Memory
+ * allocation below that of the VirtualQuantity, thus forcing paging to occur
+ * for this allocation. The value of the Limit property is expressed in the
+ * unit specified by the value of the AllocationUnits property.
+ */
+ public BigInteger getLimit() {
+ return limit;
+ }
+
+ /**
+ * Specifies how this resource maps to underlying resourcesIf the
+ * HostResource array contains any entries, this property reflects how the
+ * resource maps to those specific resources.
+ */
+ public MappingBehavior getMappingBehavior() {
+ return mappingBehavior;
+ }
+
+ /**
+ * A string that describes the resource type when a well defined value is not
+ * available and ResourceType has the value "Other".
+ */
+ public String getOtherResourceType() {
+ return otherResourceType;
+ }
+
+ /**
+ * The Parent of the resource. For example, a controller for the current
+ * allocation
+ */
+ public String getParent() {
+ return parent;
+ }
+
+ /**
+ * This property specifies which ResourcePool the resource is currently
+ * allocated from, or which ResourcePool the resource will be allocated from
+ * when the allocation occurs.
+ */
+ public String getPoolID() {
+ return poolID;
+ }
+
+ /**
+ * This property specifies the amount of resource guaranteed to be available
+ * for this allocation. On system which support over-commitment of resources,
+ * this value is typically used for admission control to prevent an an
+ * allocation from being accepted thus preventing starvation. The value of
+ * the Reservation property is expressed in the unit specified by the value
+ * of the AllocationUnits property.
+ */
+ public BigInteger getReservation() {
+ return reservation;
+ }
+
+ /**
+ * A string describing an implementation specific sub-type for this resource.
+ */
+ public String getResourceSubType() {
+ return resourceSubType;
+ }
+
+ /**
+ * The type of resource this allocation setting represents.
+ */
+ public ResourceType getResourceType() {
+ return resourceType;
+ }
+
+ /**
+ * This property specifies the quantity of resources presented to the
+ * consumer. For example, when ResourceType=Processor, this property would
+ * reflect the number of discrete Processors presented to the virtual
+ * computer system. When ResourceType=Memory, this property could reflect the
+ * number of MB reported to the virtual computer system. The value of the
+ * VirtualQuantity property should be expressed in units as defined by the
+ * value of the VirtualQuantityUnits property.
+ */
+ public BigInteger getVirtualQuantity() {
+ return virtualQuantity;
+ }
+
+ /**
+ * This property specifies the units used by the VirtualQuantity property.
+ * For example - if ResourceType=Processor, the value of the
+ * VirtualQuantityUnits property may be set to "count", indicating that the
+ * value of the VirtualQuantity property is expressed as a count. - if
+ * ResourceType=Memory, the value of the VirtualQuantityUnits property may be
+ * set to "bytes*10^3", indicating that the value of the VirtualQuantity
+ * property is expressed in kilobyte. It is expected that profiles constrain
+ * the units that apply in context of particular resource types. The value of
+ * this property shall be a legal value of the Programmatic Units qualifier
+ * as defined in Annex C.1 of DSP0004 V2.5 or later.
+ */
+ public String getVirtualQuantityUnits() {
+ return virtualQuantityUnits;
+ }
+
+ /**
+ * This property specifies a relative priority for this allocation in
+ * relation to other allocations from the same ResourcePool. This property
+ * has no unit of measure, and is only relevant when compared to other
+ * allocations vying for the same host resources.
+ */
+ public Long getWeight() {
+ return weight;
+ }
+
+ /**
+ * The thing to which this resource is connected. For example, a named
+ * network or switch port.
+ */
+ public Set<CimString> getConnections() {
+ return ImmutableSet.copyOf(connections);
+ }
+
+ /**
+ * This property exposes specific assignment of resources. Each non-null
+ * value of the HostResource property shall be formatted as a URI per RFC3986.
+ * If this resource is modeled then a value should be a WBEM URI (DSP0207).
+ * If the resource is not modeled then see the appropriate profile. Profiles
+ * may further constrain the type of URI. A NULL value or empty array
+ * requests the implementation decide the kind of host resource. If the
+ * virtual resource is mapped to more than one underlying resource, this
+ * property may be left NULL. If NULL, the DeviceAllocatedFromPool or
+ * ResourceAllocationFromPool associations may be used to determine the pool
+ * of host resources this virtual resource may use. If specific assignment is
+ * utilized, all underlying resources used by this virtual resource should be
+ * listed.The kind of dependency is specified by the ConsumerVisibility and
+ * the MappingBehavior properties. Typically the array contains one item,
+ * however multiple host resources may be specified. A client may set the
+ * value(s) to indicate that the requested virtual resource allocation be
+ * based on host resources that are identified by element values.
+ */
+ public Set<CimString> getHostResources() {
+ return ImmutableSet.copyOf(hostResources);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+ public ToStringHelper string() {
+ return MoreObjects.toStringHelper("")
+ .add("elementName", elementName)
+ .add("instanceID", instanceID)
+ .add("caption", caption)
+ .add("description", description)
+ .add("address", address)
+ .add("addressOnParent", addressOnParent)
+ .add("allocationUnits", allocationUnits)
+ .add("automaticAllocation", automaticAllocation)
+ .add("automaticDeallocation", automaticDeallocation)
+ .add("connections", connections)
+ .add("consumerVisibility", consumerVisibility)
+ .add("hostResources", hostResources)
+ .add("limit", limit)
+ .add("mappingBehavior", mappingBehavior)
+ .add("otherResourceType", otherResourceType)
+ .add("parent", parent)
+ .add("poolID", poolID)
+ .add("reservation", reservation)
+ .add("resourceSubType", resourceSubType)
+ .add("resourceType", resourceType)
+ .add("virtualQuantity", virtualQuantity)
+ .add("virtualQuantityUnits", virtualQuantityUnits)
+ .add("weight", weight);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(elementName, instanceID, caption, description,
+ address, addressOnParent, allocationUnits,
+ automaticAllocation, automaticDeallocation, connections,
+ consumerVisibility, hostResources, limit, mappingBehavior,
+ otherResourceType, parent, poolID, reservation, resourceSubType,
+ resourceType, virtualQuantity, virtualQuantityUnits, weight);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ResourceAllocationSettingData that = ResourceAllocationSettingData.class.cast(obj);
+ return equal(this.elementName, that.elementName) &&
+ equal(this.instanceID, that.instanceID) &&
+ equal(this.caption, that.caption) &&
+ equal(this.description, that.description) &&
+ equal(this.address, that.address) &&
+ equal(this.addressOnParent, that.addressOnParent) &&
+ equal(this.allocationUnits, that.allocationUnits) &&
+ equal(this.automaticAllocation, that.automaticAllocation) &&
+ equal(this.automaticDeallocation, that.automaticDeallocation) &&
+ equal(this.connections, that.connections) &&
+ equal(this.consumerVisibility, that.consumerVisibility) &&
+ equal(this.hostResources, that.hostResources) &&
+ equal(this.limit, that.limit) &&
+ equal(this.mappingBehavior, that.mappingBehavior) &&
+ equal(this.otherResourceType, that.otherResourceType) &&
+ equal(this.parent, that.parent) &&
+ equal(this.poolID, that.poolID) &&
+ equal(this.reservation, that.reservation) &&
+ equal(this.resourceSubType, that.resourceSubType) &&
+ equal(this.resourceType, that.resourceType) &&
+ equal(this.virtualQuantity, that.virtualQuantity) &&
+ equal(this.virtualQuantityUnits, that.virtualQuantityUnits) &&
+ equal(this.weight, that.weight);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/cim/VirtualSystemCaption.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/cim/VirtualSystemCaption.java b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/VirtualSystemCaption.java
new file mode 100644
index 0000000..c246a0f
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/VirtualSystemCaption.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.cim;
+
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * <p>Java class for anonymous complex type.
+ */
+@XmlType(name = "")
+public class VirtualSystemCaption extends CimString {
+
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/cim/VirtualSystemChangeableType.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/cim/VirtualSystemChangeableType.java b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/VirtualSystemChangeableType.java
new file mode 100644
index 0000000..dffd2f2
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/VirtualSystemChangeableType.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.cim;
+
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Java class for anonymous complex type.
+ */
+@XmlType(name = "")
+public class VirtualSystemChangeableType extends CimUnsignedShort {
+
+
+}
[2/6] Fold dmtf into vcloud-director (its only user).
Posted by ad...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/cim/VirtualSystemSettingData.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/cim/VirtualSystemSettingData.java b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/VirtualSystemSettingData.java
new file mode 100644
index 0000000..7e7ee35
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/VirtualSystemSettingData.java
@@ -0,0 +1,720 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.cim;
+
+import static com.google.common.base.Objects.equal;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.jclouds.dmtf.DMTFConstants.CIM_VSSD_NS;
+import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
+
+import java.math.BigInteger;
+import java.util.Date;
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlEnumValue;
+import javax.xml.bind.annotation.XmlType;
+
+import com.google.common.base.Function;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Maps;
+
+/**
+ * VirtualSystemSettingData defines the virtual aspects of a virtual system through a set of
+ * virtualization specific properties.
+ *
+ * VirtualSystemSettingData is also used as the top level class of virtual system configurations.
+ * Virtual system configurations model configuration information about virtual systems and their
+ * components. A virtual system configuration consists of one top-level instance of class
+ * VirtualSystemSettingData that aggregates a number of instances of class
+ * {@link ResourceAllocationSettingData}, using association {@link ConcreteComponent).
+ * <p>
+ * Virtual system configurations may for example be used to reflect configurations of:
+ * <ul>
+ * <li>virtual systems that are defined at a virtualization platform
+ * <li>virtual systems that are currently active
+ * <li>input requests to create new virtual systems
+ * <li>input requests to modify existing virtual systems
+ * <li>snapshots of virtual systems
+ * </ul>
+ *
+ * @see <a href="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_VirtualSystemSettingData.xsd">CIM_VirtualSystemSettingData</a>
+ */
+@XmlType(name = "CIM_VirtualSystemSettingData_Type", namespace = OVF_NS,
+ propOrder = {
+ "automaticRecoveryAction",
+ "automaticShutdownAction",
+ "automaticStartupAction",
+ "automaticStartupActionDelay",
+ "automaticStartupActionSequenceNumber",
+ "caption",
+ "configurationDataRoot",
+ "configurationFile",
+ "configurationID",
+ "creationTime",
+ "description",
+ "elementName",
+ "instanceID",
+ "logDataRoot",
+ "notes",
+ "recoveryFile",
+ "snapshotDataRoot",
+ "suspendDataRoot",
+ "swapFileDataRoot",
+ "virtualSystemIdentifier",
+ "virtualSystemType"
+ }
+)
+public class VirtualSystemSettingData {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return builder().fromVirtualSystemSettingData(this);
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ }
+
+ public static class Builder<B extends Builder<B>> {
+
+ private String elementName;
+ private String instanceID;
+ private String caption;
+ private String description;
+ private AutomaticRecoveryAction automaticRecoveryAction;
+ private AutomaticShutdownAction automaticShutdownAction;
+ private AutomaticStartupAction automaticStartupAction;
+ private BigInteger automaticStartupActionDelay;
+ private Long automaticStartupActionSequenceNumber;
+ private String configurationDataRoot;
+ private String configurationFile;
+ private String configurationID;
+ private Date creationTime;
+ private String logDataRoot;
+ private String recoveryFile;
+ private String snapshotDataRoot;
+ private String suspendDataRoot;
+ private String swapFileDataRoot;
+ private String virtualSystemIdentifier;
+ private String virtualSystemType;
+ private String notes;
+
+ @SuppressWarnings("unchecked")
+ protected B self() {
+ return (B) this;
+ }
+
+ public B elementName(String elementName) {
+ this.elementName = elementName;
+ return self();
+ }
+
+ public B instanceID(String instanceID) {
+ this.instanceID = instanceID;
+ return self();
+ }
+
+ public B caption(String caption) {
+ this.caption = caption;
+ return self();
+ }
+
+ public B description(String description) {
+ this.description = description;
+ return self();
+ }
+
+ public B automaticRecoveryAction(AutomaticRecoveryAction automaticRecoveryAction) {
+ this.automaticRecoveryAction = automaticRecoveryAction;
+ return self();
+ }
+
+ public B automaticShutdownAction(AutomaticShutdownAction automaticShutdownAction) {
+ this.automaticShutdownAction = automaticShutdownAction;
+ return self();
+ }
+
+ public B automaticStartupAction(AutomaticStartupAction automaticStartupAction) {
+ this.automaticStartupAction = automaticStartupAction;
+ return self();
+ }
+
+ public B automaticStartupActionDelay(BigInteger automaticStartupActionDelay) {
+ this.automaticStartupActionDelay = automaticStartupActionDelay;
+ return self();
+ }
+
+ public B automaticStartupActionSequenceNumber(Long automaticStartupActionSequenceNumber) {
+ this.automaticStartupActionSequenceNumber = automaticStartupActionSequenceNumber;
+ return self();
+ }
+
+ public B configurationDataRoot(String configurationDataRoot) {
+ this.configurationDataRoot = configurationDataRoot;
+ return self();
+ }
+
+ public B configurationFile(String configurationFile) {
+ this.configurationFile = configurationFile;
+ return self();
+ }
+
+ public B configurationID(String configurationID) {
+ this.configurationID = configurationID;
+ return self();
+ }
+
+ public B creationTime(Date creationTime) {
+ this.creationTime = creationTime;
+ return self();
+ }
+
+ public B logDataRoot(String logDataRoot) {
+ this.logDataRoot = logDataRoot;
+ return self();
+ }
+
+ public B recoveryFile(String recoveryFile) {
+ this.recoveryFile = recoveryFile;
+ return self();
+ }
+
+ public B snapshotDataRoot(String snapshotDataRoot) {
+ this.snapshotDataRoot = snapshotDataRoot;
+ return self();
+ }
+
+ public B suspendDataRoot(String suspendDataRoot) {
+ this.suspendDataRoot = suspendDataRoot;
+ return self();
+ }
+
+ public B swapFileDataRoot(String swapFileDataRoot) {
+ this.swapFileDataRoot = swapFileDataRoot;
+ return self();
+ }
+
+ public B virtualSystemIdentifier(String virtualSystemIdentifier) {
+ this.virtualSystemIdentifier = virtualSystemIdentifier;
+ return self();
+ }
+
+ public B virtualSystemType(String virtualSystemType) {
+ this.virtualSystemType = virtualSystemType;
+ return self();
+ }
+
+ public B notes(String notes) {
+ this.notes = notes;
+ return self();
+ }
+
+ public VirtualSystemSettingData build() {
+ return new VirtualSystemSettingData(this);
+ }
+
+ public B fromVirtualSystemSettingData(VirtualSystemSettingData in) {
+ return elementName(in.getElementName())
+ .instanceID(in.getInstanceID())
+ .caption(in.getCaption())
+ .description(in.getDescription())
+ .automaticRecoveryAction(in.getAutomaticRecoveryAction())
+ .automaticShutdownAction(in.getAutomaticShutdownAction())
+ .automaticStartupAction(in.getAutomaticStartupAction())
+ .automaticStartupActionDelay(in.getAutomaticStartupActionDelay())
+ .automaticStartupActionSequenceNumber(in.getAutomaticStartupActionSequenceNumber())
+ .configurationDataRoot(in.getConfigurationDataRoot())
+ .configurationFile(in.getConfigurationFile())
+ .configurationID(in.getConfigurationID())
+ .creationTime(in.getCreationTime())
+ .logDataRoot(in.getLogDataRoot())
+ .recoveryFile(in.getRecoveryFile())
+ .snapshotDataRoot(in.getSnapshotDataRoot())
+ .suspendDataRoot(in.getSuspendDataRoot())
+ .swapFileDataRoot(in.getSwapFileDataRoot())
+ .virtualSystemIdentifier(in.getVirtualSystemIdentifier())
+ .virtualSystemType(in.getVirtualSystemType())
+ .notes(in.getNotes());
+ }
+
+ }
+
+ /**
+ * Action to take for the virtual system when the software executed by the virtual system fails.
+ *
+ * Failures in this case means a failure that is detectable by the host platform, such as a
+ * non-interruptible wait state condition.
+ */
+ @XmlType
+ @XmlEnum(Integer.class)
+ public static enum AutomaticRecoveryAction {
+
+ @XmlEnumValue("2") NONE(2),
+ @XmlEnumValue("3") RESTART(3),
+ @XmlEnumValue("4") REVERT_TO_SNAPSHOT(4);
+
+ protected final int code;
+
+ AutomaticRecoveryAction(int code) {
+ this.code = code;
+ }
+
+ public String value() {
+ return Integer.toString(code);
+ }
+
+ protected static final Map<Integer, AutomaticRecoveryAction> AUTOMATIC_RECOVERY_ACTION_BY_ID = Maps.uniqueIndex(
+ ImmutableSet.copyOf(AutomaticRecoveryAction.values()), new Function<AutomaticRecoveryAction, Integer>() {
+ @Override
+ public Integer apply(AutomaticRecoveryAction input) {
+ return input.code;
+ }
+ });
+
+ public static AutomaticRecoveryAction fromValue(String automaticRecoveryAction) {
+ return AUTOMATIC_RECOVERY_ACTION_BY_ID.get(Integer.valueOf(checkNotNull(automaticRecoveryAction, "automaticRecoveryAction")));
+ }
+ }
+
+ /**
+ * Action to take for the virtual system when the host is shut down.
+ */
+ @XmlType
+ @XmlEnum(Integer.class)
+ public static enum AutomaticShutdownAction {
+
+ @XmlEnumValue("2") TURN_OFF(2),
+ @XmlEnumValue("3") SAVE_STATE(3),
+ @XmlEnumValue("4") SHUTDOWN(4);
+
+ protected final int code;
+
+ AutomaticShutdownAction(int code) {
+ this.code = code;
+ }
+
+ public String value() {
+ return Integer.toString(code);
+ }
+
+ protected static final Map<Integer, AutomaticShutdownAction> AUTOMATIC_SHUTDOWN_ACTION_BY_ID = Maps.uniqueIndex(
+ ImmutableSet.copyOf(AutomaticShutdownAction.values()), new Function<AutomaticShutdownAction, Integer>() {
+ @Override
+ public Integer apply(AutomaticShutdownAction input) {
+ return input.code;
+ }
+ });
+
+ public static AutomaticShutdownAction fromValue(String automaticShutdownAction) {
+ return AUTOMATIC_SHUTDOWN_ACTION_BY_ID.get(Integer.valueOf(checkNotNull(automaticShutdownAction, "automaticShutdownAction")));
+ }
+ }
+
+ /**
+ * Action to take for the virtual system when the host is started.
+ */
+ @XmlType
+ @XmlEnum(Integer.class)
+ public static enum AutomaticStartupAction {
+
+ @XmlEnumValue("2") NONE(2),
+ @XmlEnumValue("3") RESTART_IF_PREVIOUSLY_ACTIVE(3),
+ @XmlEnumValue("4") ALWAYS_STARTUP(4);
+
+ protected final int code;
+
+ AutomaticStartupAction(int code) {
+ this.code = code;
+ }
+
+ public String value() {
+ return Integer.toString(code);
+ }
+
+ protected static final Map<Integer, AutomaticStartupAction> AUTOMATIC_STARTUP_ACTION_BY_ID = Maps.uniqueIndex(
+ ImmutableSet.copyOf(AutomaticStartupAction.values()), new Function<AutomaticStartupAction, Integer>() {
+ @Override
+ public Integer apply(AutomaticStartupAction input) {
+ return input.code;
+ }
+ });
+
+ public static AutomaticStartupAction fromValue(String automaticStartupAction) {
+ return AUTOMATIC_STARTUP_ACTION_BY_ID.get(Integer.valueOf(checkNotNull(automaticStartupAction, "automaticStartupAction")));
+ }
+ }
+
+ @XmlElement(name = "ElementName", namespace = CIM_VSSD_NS)
+ private String elementName;
+ @XmlElement(name = "InstanceID", namespace = CIM_VSSD_NS)
+ private String instanceID;
+ @XmlElement(name = "Caption", namespace = CIM_VSSD_NS)
+ private String caption;
+ @XmlElement(name = "Description", namespace = CIM_VSSD_NS)
+ private String description;
+ @XmlElement(name = "VirtualSystemIdentifier", namespace = CIM_VSSD_NS)
+ private String virtualSystemIdentifier;
+ @XmlElement(name = "VirtualSystemType", namespace = CIM_VSSD_NS)
+ private String virtualSystemType;
+ @XmlElement(name = "AutomaticRecoveryAction", namespace = CIM_VSSD_NS)
+ private AutomaticRecoveryAction automaticRecoveryAction;
+ @XmlElement(name = "AutomaticShutdownAction", namespace = CIM_VSSD_NS)
+ private AutomaticShutdownAction automaticShutdownAction;
+ @XmlElement(name = "AutomaticStartupAction", namespace = CIM_VSSD_NS)
+ private AutomaticStartupAction automaticStartupAction;
+ @XmlElement(name = "AutomaticStartupActionDelay", namespace = CIM_VSSD_NS)
+ private BigInteger automaticStartupActionDelay;
+ @XmlElement(name = "AutomaticStartupActionSequenceNumber", namespace = CIM_VSSD_NS)
+ private Long automaticStartupActionSequenceNumber;
+ @XmlElement(name = "ConfigurationDataRoot", namespace = CIM_VSSD_NS)
+ private String configurationDataRoot;
+ @XmlElement(name = "ConfigurationFile", namespace = CIM_VSSD_NS)
+ private String configurationFile;
+ @XmlElement(name = "ConfigurationID", namespace = CIM_VSSD_NS)
+ private String configurationID;
+ @XmlElement(name = "CreationTime", namespace = CIM_VSSD_NS)
+ private Date creationTime;
+ @XmlElement(name = "LogDataRoot", namespace = CIM_VSSD_NS)
+ private String logDataRoot;
+ @XmlElement(name = "RecoveryFile", namespace = CIM_VSSD_NS)
+ private String recoveryFile;
+ @XmlElement(name = "SnapshotDataRoot", namespace = CIM_VSSD_NS)
+ private String snapshotDataRoot;
+ @XmlElement(name = "SuspendDataRoot", namespace = CIM_VSSD_NS)
+ private String suspendDataRoot;
+ @XmlElement(name = "SwapFileDataRoot", namespace = CIM_VSSD_NS)
+ private String swapFileDataRoot;
+ @XmlElement(name = "Notes", namespace = CIM_VSSD_NS)
+ private String notes;
+
+ private VirtualSystemSettingData(Builder<?> builder) {
+ this.elementName = builder.elementName;
+ this.instanceID = builder.instanceID;
+ this.caption = builder.caption;
+ this.description = builder.description;
+ this.automaticRecoveryAction = builder.automaticRecoveryAction;
+ this.automaticShutdownAction = builder.automaticShutdownAction;
+ this.automaticStartupAction = builder.automaticStartupAction;
+ this.automaticStartupActionDelay = builder.automaticStartupActionDelay;
+ this.automaticStartupActionSequenceNumber = builder.automaticStartupActionSequenceNumber;
+ this.configurationDataRoot = builder.configurationDataRoot;
+ this.configurationFile = builder.configurationFile;
+ this.configurationID = builder.configurationID;
+ this.creationTime = builder.creationTime;
+ this.logDataRoot = builder.logDataRoot;
+ this.recoveryFile = builder.recoveryFile;
+ this.snapshotDataRoot = builder.snapshotDataRoot;
+ this.suspendDataRoot = builder.suspendDataRoot;
+ this.swapFileDataRoot = builder.swapFileDataRoot;
+ this.virtualSystemIdentifier = builder.virtualSystemIdentifier;
+ this.virtualSystemType = builder.virtualSystemType;
+ this.notes = builder.notes;
+ }
+
+ private VirtualSystemSettingData(String elementName, String instanceID, String caption, String description,
+ AutomaticRecoveryAction automaticRecoveryAction, AutomaticShutdownAction automaticShutdownAction,
+ AutomaticStartupAction automaticStartupAction, BigInteger automaticStartupActionDelay,
+ Long automaticStartupActionSequenceNumber, String configurationDataRoot, String configurationFile,
+ String configurationID, Date creationTime, String logDataRoot, String recoveryFile, String snapshotDataRoot,
+ String suspendDataRoot, String swapFileDataRoot, String virtualSystemIdentifier,
+ String virtualSystemType, String notes) {
+ this.elementName = elementName;
+ this.instanceID = instanceID;
+ this.caption = caption;
+ this.description = description;
+ this.automaticRecoveryAction = automaticRecoveryAction;
+ this.automaticShutdownAction = automaticShutdownAction;
+ this.automaticStartupAction = automaticStartupAction;
+ this.automaticStartupActionDelay = automaticStartupActionDelay;
+ this.automaticStartupActionSequenceNumber = automaticStartupActionSequenceNumber;
+ this.configurationDataRoot = configurationDataRoot;
+ this.configurationFile = configurationFile;
+ this.configurationID = configurationID;
+ this.creationTime = creationTime;
+ this.logDataRoot = logDataRoot;
+ this.recoveryFile = recoveryFile;
+ this.snapshotDataRoot = snapshotDataRoot;
+ this.suspendDataRoot = suspendDataRoot;
+ this.swapFileDataRoot = swapFileDataRoot;
+ this.virtualSystemIdentifier = virtualSystemIdentifier;
+ this.virtualSystemType = virtualSystemType;
+ this.notes = notes;
+ }
+
+ private VirtualSystemSettingData() {
+ // for JAXB
+ }
+
+ /**
+ * The user-friendly name for this instance of SettingData. In addition, the user-friendly name
+ * can be used as an index property for a search or query. (Note: The name does not have to be
+ * unique within a namespace.)
+ */
+ public String getElementName() {
+ return elementName;
+ }
+
+ /**
+ * Within the scope of the instantiating Namespace, InstanceID opaquely and uniquely identifies
+ * an instance of this class.
+ */
+ public String getInstanceID() {
+ return instanceID;
+ }
+
+ /**
+ * The Caption property is a short textual description (one- line string) of the object.
+ */
+ public String getCaption() {
+ return caption;
+ }
+
+ /**
+ * The Description property provides a textual description of the object.
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Action to take for the virtual system when the software executed by the virtual system fails.
+ * Failures in this case means a failure that is detectable by the host platform, such as a
+ * non-interruptible wait state condition.
+ */
+ public AutomaticRecoveryAction getAutomaticRecoveryAction() {
+ return automaticRecoveryAction;
+ }
+
+ /**
+ * Action to take for the virtual system when the host is shut down.
+ */
+ public AutomaticShutdownAction getAutomaticShutdownAction() {
+ return automaticShutdownAction;
+ }
+
+ /**
+ * Action to take for the virtual system when the host is started.
+ */
+ public AutomaticStartupAction getAutomaticStartupAction() {
+ return automaticStartupAction;
+ }
+
+ /**
+ * Delay applicable to startup action. The value shall be in the interval variant of the datetime
+ * datatype.
+ */
+ public BigInteger getAutomaticStartupActionDelay() {
+ return automaticStartupActionDelay;
+ }
+
+ /**
+ * Number indicating the relative sequence of virtual system activation when the host system is
+ * started. A lower number indicates earlier activation. If one or more configurations show the
+ * same value, the sequence is implementation dependent. A value of 0 indicates that the sequence
+ * is implementation dependent.
+ */
+ public Long getAutomaticStartupActionSequenceNumber() {
+ return automaticStartupActionSequenceNumber;
+ }
+
+ /**
+ * Filepath of a directory where information about the virtual system configuration is
+ * stored.
+ *
+ * Format shall be String based on RFC-2079.
+ */
+ public String getConfigurationDataRoot() {
+ return configurationDataRoot;
+ }
+
+ /**
+ * Filepath of a file where information about the virtual system configuration is stored.
+ *
+ * A relative path appends to the value of the {@link #getConfigurationDataRoot()} property.
+ * <p>
+ * Format shall be String based on RFC-2079.
+ */
+ public String getConfigurationFile() {
+ return configurationFile;
+ }
+
+ /**
+ * Unique id of the virtual system configuration. Note that the ConfigurationID is different from
+ * the InstanceID as it is assigned by the implementation to a virtual system or a virtual system
+ * configuration. It is not a key, and the same value may occur within more than one instance.
+ */
+ public String getConfigurationID() {
+ return configurationID;
+ }
+
+ /**
+ * Time when the virtual system configuration was created.
+ */
+ public Date getCreationTime() {
+ return creationTime;
+ }
+
+ /**
+ * Filepath of a directory where log information about the virtual system is stored.
+ *
+ * A relative path appends to the value of the {@link #getConfigurationDataRoot()} property.
+ * <p>
+ * Format shall be String based on RFC-2079.
+ */
+ public String getLogDataRoot() {
+ return logDataRoot;
+ }
+
+ /**
+ * Filepath of a file where recovery related information of the virtual system is stored.
+ *
+ * Format shall be String based on RFC-2079.
+ */
+ public String getRecoveryFile() {
+ return recoveryFile;
+ }
+
+ /**
+ * Filepath of a directory where information about virtual system snapshots is stored.
+ *
+ * A relative path appends to the value of the {@link #getConfigurationDataRoot()} property.
+ * <p>
+ * Format shall be String based on RFC-2079.
+ */
+ public String getSnapshotDataRoot() {
+ return snapshotDataRoot;
+ }
+
+ /**
+ * Filepath of a directory where suspend related information about the virtual system is stored.
+ *
+ * A relative path appends to the value of the {@link #getConfigurationDataRoot()} property.
+ * <p>
+ * Format shall be String based on RFC-2079.
+ */
+ public String getSuspendDataRoot() {
+ return suspendDataRoot;
+ }
+
+ /**
+ * Filepath of a directory where swapfiles of the virtual system are stored.
+ *
+ * A relative path appends to the value of the {@link #getConfigurationDataRoot()} property.
+ * <p>
+ * Format shall be String based on RFC-2079.
+ */
+ public String getSwapFileDataRoot() {
+ return swapFileDataRoot;
+ }
+
+ /**
+ * VirtualSystemIdentifier shall reflect a unique name for the system as it is used within the
+ * virtualization platform.
+ *
+ * Note that the VirtualSystemIdentifier is not the hostname assigned to
+ * the operating system instance running within the virtual system, nor is it an IP address or
+ * MAC address assigned to any of its network ports. On create requests VirtualSystemIdentifier
+ * may contain implementation specific rules (like simple patterns or regular expression) that
+ * may be interpreted by the implementation when assigning a VirtualSystemIdentifier.
+ */
+ public String getVirtualSystemIdentifier() {
+ return virtualSystemIdentifier;
+ }
+
+ /**
+ * VirtualSystemType shall reflect a particular type of virtual system.
+ */
+ public String getVirtualSystemType() {
+ return virtualSystemType;
+ }
+
+ /**
+ * End-user supplied notes that are related to the virtual system.
+ */
+ public String getNotes() {
+ return notes;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(elementName, instanceID, caption, description, virtualSystemIdentifier, virtualSystemType);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ VirtualSystemSettingData that = VirtualSystemSettingData.class.cast(obj);
+ return equal(this.elementName, that.elementName)
+ && equal(this.instanceID, that.instanceID)
+ && equal(this.caption, that.caption)
+ && equal(this.description, that.description)
+ && equal(this.automaticRecoveryAction, that.automaticRecoveryAction)
+ && equal(this.automaticShutdownAction, that.automaticShutdownAction)
+ && equal(this.automaticStartupAction, that.automaticStartupAction)
+ && equal(this.automaticStartupActionDelay, that.automaticStartupActionDelay)
+ && equal(this.automaticStartupActionSequenceNumber, that.automaticStartupActionSequenceNumber)
+ && equal(this.configurationDataRoot, that.configurationDataRoot)
+ && equal(this.configurationFile, that.configurationFile)
+ && equal(this.configurationID, that.configurationID)
+ && equal(this.creationTime, that.creationTime)
+ && equal(this.logDataRoot, that.logDataRoot)
+ && equal(this.recoveryFile, that.recoveryFile)
+ && equal(this.snapshotDataRoot, that.snapshotDataRoot)
+ && equal(this.suspendDataRoot, that.suspendDataRoot)
+ && equal(this.swapFileDataRoot, that.swapFileDataRoot)
+ && equal(this.virtualSystemIdentifier, that.virtualSystemIdentifier)
+ && equal(this.virtualSystemType, that.virtualSystemType);
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper("")
+ .add("elementName", elementName)
+ .add("instanceID", instanceID)
+ .add("caption", caption)
+ .add("description", description)
+ .add("automaticRecoveryAction", automaticRecoveryAction)
+ .add("automaticShutdownAction", automaticShutdownAction)
+ .add("automaticStartupAction", automaticStartupAction)
+ .add("automaticStartupActionDelay", automaticStartupActionDelay)
+ .add("automaticStartupActionSequenceNumber", automaticStartupActionSequenceNumber)
+ .add("configurationDataRoot", configurationDataRoot)
+ .add("configurationFile", configurationFile)
+ .add("configurationID", configurationID)
+ .add("creationTime", creationTime)
+ .add("logDataRoot", logDataRoot)
+ .add("recoveryFile", recoveryFile)
+ .add("snapshotDataRoot", snapshotDataRoot)
+ .add("suspendDataRoot", suspendDataRoot)
+ .add("swapFileDataRoot", swapFileDataRoot)
+ .add("virtualSystemIdentifier", virtualSystemIdentifier)
+ .add("virtualSystemType", virtualSystemType)
+ .toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/cim/functions/HardwareBuilderFromResourceAllocations.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/cim/functions/HardwareBuilderFromResourceAllocations.java b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/functions/HardwareBuilderFromResourceAllocations.java
new file mode 100644
index 0000000..cea2526
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/functions/HardwareBuilderFromResourceAllocations.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.cim.functions;
+
+import static com.google.common.collect.Iterables.filter;
+import static com.google.common.collect.Iterables.find;
+import static com.google.common.collect.Iterables.transform;
+
+import javax.inject.Singleton;
+
+import org.jclouds.compute.domain.HardwareBuilder;
+import org.jclouds.compute.domain.Processor;
+import org.jclouds.compute.domain.Volume;
+import org.jclouds.compute.domain.internal.VolumeImpl;
+import org.jclouds.dmtf.CIMPredicates;
+import org.jclouds.dmtf.cim.ResourceAllocationSettingData;
+import org.jclouds.dmtf.cim.ResourceAllocationSettingData.ResourceType;
+
+import com.google.common.base.Function;
+
+@Singleton
+public class HardwareBuilderFromResourceAllocations implements
+ Function<Iterable<? extends ResourceAllocationSettingData>, HardwareBuilder> {
+ @Override
+ public HardwareBuilder apply(Iterable<? extends ResourceAllocationSettingData> from) {
+ HardwareBuilder builder = new HardwareBuilder();
+ builder.volumes(transform(filter(from, CIMPredicates.resourceTypeIn(ResourceType.DISK_DRIVE,
+ ResourceType.BASE_PARTITIONABLE_UNIT, ResourceType.PARTITIONABLE_UNIT)),
+ new Function<ResourceAllocationSettingData, Volume>() {
+
+ @Override
+ public Volume apply(ResourceAllocationSettingData from) {
+ return HardwareBuilderFromResourceAllocations.this.apply(from);
+ }
+
+ }));
+
+ builder.ram((int) find(from, CIMPredicates.resourceTypeIn(ResourceType.MEMORY)).getVirtualQuantity().longValue());
+
+ builder.processors(transform(filter(from, CIMPredicates.resourceTypeIn(ResourceType.PROCESSOR)),
+ new Function<ResourceAllocationSettingData, Processor>() {
+
+ @Override
+ public Processor apply(ResourceAllocationSettingData arg0) {
+ return new Processor(arg0.getVirtualQuantity().longValue(), 1);
+ }
+ }));
+ return builder;
+ }
+
+ public Volume apply(ResourceAllocationSettingData from) {
+ return new VolumeImpl(from.getAddressOnParent() + "", Volume.Type.LOCAL, from.getVirtualQuantity() == null ? null
+ : from.getVirtualQuantity().longValue() / (float) (1024 * 1024), null, "0".equals(from.getAddressOnParent())
+ || ResourceType.BASE_PARTITIONABLE_UNIT.equals(from.getResourceType()), true);
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/cim/package-info.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/cim/package-info.java b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/package-info.java
new file mode 100644
index 0000000..d531ada
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/cim/package-info.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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 = CIM_NS, elementFormDefault = XmlNsForm.QUALIFIED,
+ xmlns = {
+ @XmlNs(prefix = "cim", namespaceURI = CIM_NS),
+ @XmlNs(prefix = "ovf", namespaceURI = OVF_NS),
+ @XmlNs(prefix = "vssd", namespaceURI = CIM_VSSD_NS),
+ @XmlNs(prefix = "rasd", namespaceURI = CIM_RASD_NS)
+ }
+)
+@XmlAccessorType(XmlAccessType.FIELD)
+package org.jclouds.dmtf.cim;
+
+import static org.jclouds.dmtf.DMTFConstants.CIM_NS;
+import static org.jclouds.dmtf.DMTFConstants.CIM_RASD_NS;
+import static org.jclouds.dmtf.DMTFConstants.CIM_VSSD_NS;
+import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlSchema;
+
+
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Configuration.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Configuration.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Configuration.java
new file mode 100644
index 0000000..0669a32
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Configuration.java
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf;
+
+import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+@XmlType(name = "Configuration", namespace = OVF_NS, propOrder = {
+ "label", "description"
+})
+public class Configuration {
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ private String id;
+ private boolean isDefault;
+ private String label;
+ private String description;
+
+ /**
+ * @see Configuration#getId
+ */
+ public Builder id(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * @see Configuration#getLabel
+ */
+ public Builder label(String label) {
+ this.label = label;
+ return this;
+ }
+
+ /**
+ * @see Configuration#getDescription
+ */
+ public Builder description(String description) {
+ this.description = description;
+ return this;
+ }
+
+ /**
+ * @see Configuration#isDefault
+ */
+ public Builder isDefault(boolean isDefault) {
+ this.isDefault = isDefault;
+ return this;
+ }
+
+ public Configuration build() {
+ return new Configuration(id, isDefault, label, description);
+ }
+
+ public Builder fromConfiguration(Configuration in) {
+ return id(in.getId()).description(in.getDescription()).label(in.getLabel());
+ }
+ }
+
+ @XmlAttribute
+ private String id;
+ @XmlAttribute(name = "default")
+ private boolean isDefault;
+ @XmlElement(name = "Label")
+ private String label;
+ @XmlElement(name = "Description")
+ private String description;
+
+ public Configuration(String id, boolean isDefault, String label, String description) {
+ this.id = id;
+ this.label = label;
+ this.description = description;
+ this.isDefault = isDefault;
+ }
+
+ public Configuration() {
+ // for JAXB
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, label, description);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Configuration other = (Configuration) obj;
+ return Objects.equal(id, other.id)
+ && Objects.equal(label, other.label)
+ && Objects.equal(description, other.description);
+ }
+
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+ protected MoreObjects.ToStringHelper string() {
+ return MoreObjects.toStringHelper("").add("id", id).add("default", isDefault).add("label", label).add("description", description);
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public boolean isDefault() {
+ return isDefault;
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/DeploymentOptionSection.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/DeploymentOptionSection.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/DeploymentOptionSection.java
new file mode 100644
index 0000000..253bc0b
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/DeploymentOptionSection.java
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.Collections;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
+
+/**
+ * The DeploymentOptionSection specifies a discrete set of intended resource configurations. The
+ * author of an OVF package can include sizing metadata for different configurations. A consumer of
+ * the OVF shall select a configuration, for example, by prompting the user. The selected
+ * configuration is visible in the OVF environment, enabling guest software to adapt to the selected
+ * configuration.
+ */
+@XmlRootElement(name = "DeploymentOptionSection")
+@XmlType(name = "DeploymentOptionSection_Type")
+public class DeploymentOptionSection extends SectionType {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return builder().fromDeploymentOptionSection(this);
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ }
+
+ public static class Builder<B extends Builder<B>> extends SectionType.Builder<B> {
+ private Set<Configuration> configurations = Sets.newLinkedHashSet();
+
+ /**
+ * @see DeploymentOptionSection#getConfigurations
+ */
+ public B configuration(Configuration configuration) {
+ this.configurations.add(checkNotNull(configuration, "configuration"));
+ return self();
+ }
+
+ /**
+ * @see DeploymentOptionSection#getConfigurations
+ */
+ public B configurations(Iterable<Configuration> configurations) {
+ this.configurations = ImmutableSet.<Configuration>copyOf(checkNotNull(configurations, "configurations"));
+ return self();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DeploymentOptionSection build() {
+ return new DeploymentOptionSection(this);
+ }
+
+ public B fromDeploymentOptionSection(DeploymentOptionSection in) {
+ return fromSectionType(in).configurations(in.getConfigurations());
+ }
+ }
+
+ @XmlElement(name = "Configuration")
+ protected Set<Configuration> configurations;
+
+ private DeploymentOptionSection(Builder<?> builder) {
+ super(builder);
+ this.configurations = ImmutableSet.copyOf(builder.configurations);
+ }
+
+ private DeploymentOptionSection() {
+ // For JAXB
+ }
+
+ public Set<Configuration> getConfigurations() {
+ return Collections.unmodifiableSet(configurations);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(super.hashCode(), configurations);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (!super.equals(obj)) return false;
+ if (getClass() != obj.getClass()) return false;
+
+ DeploymentOptionSection other = (DeploymentOptionSection) obj;
+ return super.equals(other) && Objects.equal(configurations, other.configurations);
+ }
+
+ @Override
+ protected MoreObjects.ToStringHelper string() {
+ return super.string().add("configurations", configurations);
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Disk.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Disk.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Disk.java
new file mode 100644
index 0000000..41f96ac
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Disk.java
@@ -0,0 +1,237 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf;
+
+import java.net.URI;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "Disk")
+public class Disk implements Comparable<Disk>{
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ private String id;
+ private Long capacity;
+ private String parentRef;
+ private String fileRef;
+ private URI format;
+ private Long populatedSize;
+ private String capacityAllocationUnits;
+
+ /**
+ * @see Disk#getId
+ */
+ public Builder id(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * @see Disk#getCapacity
+ */
+ public Builder capacity(Long capacity) {
+ this.capacity = capacity;
+ return this;
+ }
+
+ /**
+ * @see Disk#getParentRef
+ */
+ public Builder parentRef(String parentRef) {
+ this.parentRef = parentRef;
+ return this;
+ }
+
+ /**
+ * @see Disk#getFileRef
+ */
+ public Builder fileRef(String fileRef) {
+ this.fileRef = fileRef;
+ return this;
+ }
+
+ /**
+ * @see Disk#getFormat
+ */
+ public Builder format(URI format) {
+ this.format = format;
+ return this;
+ }
+
+ /**
+ * @see Disk#getPopulatedSize
+ */
+ public Builder populatedSize(Long populatedSize) {
+ this.populatedSize = populatedSize;
+ return this;
+ }
+
+ /**
+ * @see Disk#getCapacityAllocationUnits
+ */
+ public Builder capacityAllocationUnits(String capacityAllocationUnits) {
+ this.capacityAllocationUnits = capacityAllocationUnits;
+ return this;
+ }
+
+ public Disk build() {
+ return new Disk(id, capacity, parentRef, fileRef, format, populatedSize, capacityAllocationUnits);
+ }
+
+ public Builder fromDisk(Disk in) {
+ return id(in.getId()).capacity(in.getCapacity()).parentRef(in.getParentRef()).fileRef(in.getFileRef()).format(
+ in.getFormat()).populatedSize(in.getPopulatedSize()).capacityAllocationUnits(
+ in.getCapacityAllocationUnits());
+ }
+ }
+
+ private String id;
+ private Long capacity;
+ private String parentRef;
+ private String fileRef;
+ private URI format;
+ private Long populatedSize;
+ private String capacityAllocationUnits;
+
+ private Disk(String id, Long capacity, String parentRef, String fileRef, URI format, Long populatedSize,
+ String capacityAllocationUnits) {
+ this.id = id;
+ this.capacity = capacity;
+ this.parentRef = parentRef;
+ this.fileRef = fileRef;
+ this.format = format;
+ this.populatedSize = populatedSize;
+ this.capacityAllocationUnits = capacityAllocationUnits;
+ }
+
+ private Disk() {
+ // For Jaxb
+ }
+
+ /**
+ * Each virtual disk is represented by a Disk element that shall be given a identifier using the
+ * {@code id} attribute, the identifier shall be unique within the {@link DiskSection}.
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * The capacity of a virtual disk shall be specified by the {@code capacity} attribute with an
+ * xs:long integer value. The default unit of allocation shall be bytes.
+ */
+ public Long getCapacity() {
+ return capacity;
+ }
+
+ /**
+ * OVF allows a disk image to be represented as a set of modified blocks in comparison to a
+ * parent image. The use of parent disks can often significantly reduce the size of an OVF
+ * package, if it contains multiple disks with similar content. For a Disk element, a parent disk
+ * may optionally be specified using the {@code parentRef} attribute, which shall contain a valid
+ * ovf:id reference to a different Disk element. If a disk block does not exist locally, lookup
+ * for that disk block then occurs in the parent disk. In {@link DiskSection}, parent Disk
+ * elements shall occur before child Disk elements that refer to them.
+ */
+ public String getParentRef() {
+ return parentRef;
+ }
+
+ /**
+ * The ovf:fileRef attribute denotes the virtual disk content by identifying an existing File
+ * element in the References element, the File element is identified by matching its {@code id}
+ * attribute value with the {@code fileRef} attribute value. Omitting the {@code fileRef}
+ * attribute shall indicate an empty disk. In this case, the disk shall be created and the entire
+ * disk content zeroed at installation time. The guest software will typically format empty disks
+ * in some file system format.
+ */
+ public String getFileRef() {
+ return fileRef;
+ }
+
+ /**
+ * The format URI of a non-empty virtual disk shall be specified by the {@code format} attribute.
+ */
+ public URI getFormat() {
+ return format;
+ }
+
+ /**
+ * For non-empty disks, the actual used size of the disk may optionally be specified using the
+ * {@code populatedSize} attribute. The unit of this attribute is always bytes. {@code
+ * populatedSize} is allowed to be an estimate of used disk size but shall not be larger than
+ * {@code capacity}.
+ */
+ public Long getPopulatedSize() {
+ return populatedSize;
+ }
+
+ /**
+ * The optional string attribute {@code ovf:capacityAllocationUnits} may be used to specify a
+ * particular unit of allocation. Values for {@code ovf:capacityAllocationUnits} shall match the
+ * format for programmatic units defined in DSP0004.
+ */
+ public String getCapacityAllocationUnits() {
+ return capacityAllocationUnits;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Disk other = (Disk) obj;
+ if (id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!id.equals(other.id))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return String
+ .format(
+ "[id=%s, capacity=%s, capacityAllocationUnits=%s, fileRef=%s, format=%s, parentRef=%s, populatedSize=%s]",
+ id, capacity, capacityAllocationUnits, fileRef, format, parentRef, populatedSize);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int compareTo(Disk o) {
+ if (id == null)
+ return -1;
+ return (this == o) ? 0 : id.compareTo(o.id);
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/DiskSection.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/DiskSection.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/DiskSection.java
new file mode 100644
index 0000000..7c19370
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/DiskSection.java
@@ -0,0 +1,127 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
+
+/**
+ * A DiskSection describes meta-information about virtual disks in the OVF package. Virtual disks
+ * and their metadata are described outside the virtual hardware to facilitate sharing between
+ * virtual machines within an OVF package.
+ */
+@XmlRootElement(name = "DiskSection")
+@XmlType(propOrder = {
+ "disks"
+})
+public class DiskSection extends SectionType {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return builder().fromDiskSection(this);
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ }
+
+ public static class Builder<B extends Builder<B>> extends SectionType.Builder<B> {
+ private Set<Disk> disks = Sets.newLinkedHashSet();
+
+ /**
+ * @see DiskSection#getDisks
+ */
+ public B disk(Disk disk) {
+ this.disks.add(checkNotNull(disk, "disk"));
+ return self();
+ }
+
+ /**
+ * @see DiskSection#getDisks
+ */
+ public B disks(Iterable<Disk> disks) {
+ this.disks = ImmutableSet.<Disk>copyOf(checkNotNull(disks, "disks"));
+ return self();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiskSection build() {
+ return new DiskSection(this);
+ }
+
+ public B fromDiskSection(DiskSection in) {
+ return disks(in.getDisks()).info(in.getInfo());
+ }
+ }
+
+ @XmlElement(name = "Disk")
+ private Set<Disk> disks;
+
+ protected DiskSection(Builder<?> builder) {
+ super(builder);
+ this.disks = ImmutableSet.<Disk>copyOf(checkNotNull(builder.disks, "disks"));
+ }
+
+ protected DiskSection() {
+ // for JAXB
+ }
+
+ /**
+ * All disks referred to from Connection elements in all {@link VirtualHardwareSection} elements
+ * shall be defined in the DiskSection.
+ *
+ * @return
+ */
+ public Set<Disk> getDisks() {
+ return disks;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(super.hashCode(), disks);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null) return false;
+ if (getClass() != obj.getClass()) return false;
+
+ DiskSection other = (DiskSection) obj;
+ return super.equals(other) && Objects.equal(disks, other.disks);
+ }
+
+ @Override
+ protected MoreObjects.ToStringHelper string() {
+ return super.string().add("disks", disks);
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Item.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Item.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Item.java
new file mode 100644
index 0000000..7c9e07f
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Item.java
@@ -0,0 +1,193 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf;
+
+import static com.google.common.base.Objects.equal;
+
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import com.google.common.collect.Maps;
+
+/**
+ * Java class for anonymous complex type.
+ *
+ * <pre>
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="order" use="required" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" />
+ * <attribute name="startDelay" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
+ * <attribute name="waitingForGuest" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ * <attribute name="stopDelay" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
+ * <attribute name="startAction" type="{http://www.w3.org/2001/XMLSchema}string" default="powerOn" />
+ * <attribute name="stopAction" type="{http://www.w3.org/2001/XMLSchema}string" default="powerOff" />
+ * <anyAttribute processContents='lax'/>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ */
+@XmlType
+@XmlSeeAlso({
+ StartupSectionItem.class
+})
+public class Item {
+
+ // TODO Builder
+
+ @XmlAttribute(required = true)
+ protected String id;
+ @XmlAttribute(required = true)
+ @XmlSchemaType(name = "unsignedShort")
+ protected int order;
+ @XmlAttribute
+ @XmlSchemaType(name = "unsignedShort")
+ protected Integer startDelay;
+ @XmlAttribute
+ protected Boolean waitingForGuest;
+ @XmlAttribute
+ @XmlSchemaType(name = "unsignedShort")
+ protected Integer stopDelay;
+ @XmlAttribute
+ protected String startAction;
+ @XmlAttribute
+ protected String stopAction;
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = Maps.newHashMap();
+
+ /**
+ * Gets the value of the id property.
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Gets the value of the order property.
+ */
+ public int getOrder() {
+ return order;
+ }
+
+ /**
+ * Gets the value of the startDelay property.
+ */
+ public int getStartDelay() {
+ if (startDelay == null) {
+ return 0;
+ } else {
+ return startDelay;
+ }
+ }
+
+ /**
+ * Gets the value of the waitingForGuest property.
+ */
+ public boolean isWaitingForGuest() {
+ if (waitingForGuest == null) {
+ return false;
+ } else {
+ return waitingForGuest;
+ }
+ }
+
+ /**
+ * Gets the value of the stopDelay property.
+ */
+ public int getStopDelay() {
+ if (stopDelay == null) {
+ return 0;
+ } else {
+ return stopDelay;
+ }
+ }
+
+ /**
+ * Gets the value of the startAction property.
+ */
+ public String getStartAction() {
+ if (startAction == null) {
+ return "powerOn";
+ } else {
+ return startAction;
+ }
+ }
+
+ /**
+ * Gets the value of the stopAction property.
+ */
+ public String getStopAction() {
+ if (stopAction == null) {
+ return "powerOff";
+ } else {
+ return stopAction;
+ }
+ }
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ */
+ public Map<QName, String> getOtherAttributes() {
+ return otherAttributes;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, order, startDelay, waitingForGuest, stopDelay, startAction, stopAction);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Item that = Item.class.cast(obj);
+ return equal(this.id, that.id) &&
+ equal(this.order, that.order) &&
+ equal(this.startDelay, that.startDelay) &&
+ equal(this.waitingForGuest, that.waitingForGuest) &&
+ equal(this.stopDelay, that.stopDelay) &&
+ equal(this.startAction, that.startAction) &&
+ equal(this.stopAction, that.stopAction);
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper("")
+ .add("id", id)
+ .add("order", order)
+ .add("startDelay", startDelay)
+ .add("waitingForGuest", waitingForGuest)
+ .add("stopDelay", stopDelay)
+ .add("startAction", startAction)
+ .add("stopAction", stopAction)
+ .toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/MsgType.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/MsgType.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/MsgType.java
new file mode 100644
index 0000000..069d42a
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/MsgType.java
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf;
+
+import static com.google.common.base.Objects.equal;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+
+/**
+ * Type for localizable string.
+ *
+ * Default string value
+ *
+ * <pre>
+ * <complexType name="Msg_Type" />
+ * </pre>
+ */
+@XmlType(name = "Msg_Type")
+public class MsgType {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return builder().fromMsgType(this);
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ }
+
+ public abstract static class Builder<B extends Builder<B>> {
+
+ protected String value;
+ protected String msgid;
+
+ @SuppressWarnings("unchecked")
+ protected B self() {
+ return (B) this;
+ }
+
+ /**
+ * @see MsgType#getValue()
+ */
+ public B value(String value) {
+ this.value = value;
+ return self();
+ }
+
+ /**
+ * @see MsgType#getMsgid()
+ */
+ public B msgid(String msgid) {
+ this.msgid = msgid;
+ return self();
+ }
+
+ public MsgType build() {
+ return new MsgType(this);
+ }
+
+ public B fromMsgType(MsgType in) {
+ return value(in.getValue()).msgid(in.getMsgid());
+ }
+ }
+
+ @XmlValue
+ protected String value;
+ @XmlAttribute
+ protected String msgid;
+
+ private MsgType() {
+ // JAXB
+ }
+
+ private MsgType(Builder<?> builder) {
+ this.value = builder.value;
+ this.msgid = builder.msgid;
+ }
+
+ /**
+ * Gets the value of the value property.
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Gets the value of the msgid property.
+ */
+ public String getMsgid() {
+ if (msgid == null) {
+ return "";
+ } else {
+ return msgid;
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(value, msgid);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ MsgType that = MsgType.class.cast(obj);
+ return equal(this.value, that.value) &&
+ equal(this.msgid, that.msgid);
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper("")
+ .add("value", value).add("msgid", msgid).toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Network.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Network.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Network.java
new file mode 100644
index 0000000..0bf0a9d
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/Network.java
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "Network")
+public class Network {
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ protected String name;
+ protected String description;
+
+ /**
+ * @see Network#getName
+ */
+ public Builder name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * @see Network#getDescription
+ */
+ public Builder description(String description) {
+ this.description = description;
+ return this;
+ }
+
+ public Network build() {
+ return new Network(name, description);
+ }
+
+ public Builder fromNetwork(Network in) {
+ return name(in.getName()).description(in.getDescription());
+ }
+ }
+
+ private String name;
+ private String description;
+
+ protected Network(String name, String description) {
+ this.name = name;
+ this.description = description;
+ }
+
+ protected Network() {
+ // for JAXB
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((description == null) ? 0 : description.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Network other = (Network) obj;
+ if (description == null) {
+ if (other.description != null)
+ return false;
+ } else if (!description.equals(other.description))
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "[name=" + name + ", description=" + description + "]";
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/NetworkSection.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/NetworkSection.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/NetworkSection.java
new file mode 100644
index 0000000..e40f177
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/NetworkSection.java
@@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
+
+/**
+ * The NetworkSection element shall list all logical networks used in the OVF package.
+ */
+@XmlRootElement(name = "NetworkSection")
+@XmlType(name = "NetworkSection_Type")
+public class NetworkSection extends SectionType {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return builder().fromNetworkSection(this);
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ }
+
+ public static class Builder<B extends Builder<B>> extends SectionType.Builder<B> {
+ protected Set<Network> networks = Sets.newLinkedHashSet();
+
+ /**
+ * @see NetworkSection#getNetworks
+ */
+ public B network(Network network) {
+ this.networks.add(checkNotNull(network, "network"));
+ return self();
+ }
+
+ /**
+ * @see NetworkSection#getNetworks
+ */
+ public B networks(Iterable<Network> networks) {
+ this.networks = ImmutableSet.<Network> copyOf(checkNotNull(networks, "networks"));
+ return self();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public NetworkSection build() {
+ return new NetworkSection(this);
+ }
+
+ public B fromNetworkSection(NetworkSection in) {
+ return networks(in.getNetworks()).info(in.getInfo());
+ }
+ }
+
+ private Set<Network> networks;
+
+ private NetworkSection(Builder<?> builder) {
+ super(builder);
+ this.networks = ImmutableSet.copyOf(checkNotNull(networks, "networks"));
+ }
+
+ private NetworkSection() {
+ // for JAXB
+ }
+
+ /**
+ * All networks referred to from Connection elements in all {@link VirtualHardwareSection}
+ * elements shall be defined in the NetworkSection.
+ */
+ public Set<Network> getNetworks() {
+ return networks;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(super.hashCode(), networks);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ NetworkSection other = (NetworkSection) obj;
+ return super.equals(other)
+ && Objects.equal(networks, other.networks);
+ }
+
+ @Override
+ protected MoreObjects.ToStringHelper string() {
+ return super.string()
+ .add("networks", networks);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/OperatingSystemSection.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/OperatingSystemSection.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/OperatingSystemSection.java
new file mode 100644
index 0000000..b01bed7
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/OperatingSystemSection.java
@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf;
+
+import static com.google.common.base.Objects.equal;
+import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * An OperatingSystemSection specifies the operating system installed on a virtual machine.
+ */
+public class OperatingSystemSection extends SectionType {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return builder().fromOperatingSystemSection(this);
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ }
+
+ public static class Builder<B extends Builder<B>> extends SectionType.Builder<B> {
+
+ private int id;
+ private String description;
+ private String version;
+
+ /**
+ * @see OperatingSystemSection#getId()
+ */
+ public B id(int id) {
+ this.id = id;
+ return self();
+ }
+
+ /**
+ * @see OperatingSystemSection#getVersion()
+ */
+ public B version(String version) {
+ this.version = version;
+ return self();
+ }
+
+ /**
+ * @see OperatingSystemSection#getDescription
+ */
+ public B description(String description) {
+ this.description = description;
+ return self();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public OperatingSystemSection build() {
+ return new OperatingSystemSection(this);
+ }
+
+ public B fromOperatingSystemSection(OperatingSystemSection in) {
+ return fromSectionType(in)
+ .id(in.getId())
+ .version(in.getVersion())
+ .description(in.getDescription());
+ }
+ }
+
+ @XmlAttribute(namespace = OVF_NS, required = true)
+ protected int id;
+ @XmlAttribute(namespace = OVF_NS)
+ protected String version;
+ @XmlElement(name = "Description")
+ protected String description;
+
+ public OperatingSystemSection(Builder<?> builder) {
+ super(builder);
+ this.id = builder.id;
+ this.description = builder.description;
+ this.version = builder.version;
+ }
+
+ protected OperatingSystemSection() {
+ // For Builders and JAXB
+ }
+
+ /**
+ * Gets the OVF id
+ *
+ * @see org.jclouds.vcloud.director.v1_5.domain.cim.OSType#getCode()
+ */
+ public int getId() {
+ return id;
+ }
+
+ /**
+ * Gets the version
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * Gets the description or null
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(super.hashCode(), id, version, description);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null) return false;
+ if (getClass() != obj.getClass()) return false;
+
+ OperatingSystemSection that = (OperatingSystemSection) obj;
+ return super.equals(that)
+ && equal(this.id, that.id)
+ && equal(this.version, that.version)
+ && equal(this.description, that.description);
+ }
+
+ @Override
+ protected MoreObjects.ToStringHelper string() {
+ return super.string()
+ .add("id", id)
+ .add("version", version)
+ .add("description", description);
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/7ec7f077/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/ProductSection.java
----------------------------------------------------------------------
diff --git a/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/ProductSection.java b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/ProductSection.java
new file mode 100644
index 0000000..ac3bb26
--- /dev/null
+++ b/vcloud-director/src/main/java/org/jclouds/dmtf/ovf/ProductSection.java
@@ -0,0 +1,300 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.
+ */
+package org.jclouds.dmtf.ovf;
+
+import static com.google.common.base.Objects.equal;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.jclouds.dmtf.DMTFConstants.CIM_NS;
+
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jclouds.dmtf.cim.CimString;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
+
+/**
+ * The ProductSection element specifies product-information for an appliance, such as product name,
+ * version, and vendor.
+ */
+@XmlRootElement(name = "ProductSection")
+@XmlType(name = "ProductSection_Type")
+public class ProductSection extends SectionType {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return builder().fromProductSection(this);
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ }
+
+ public static class Builder<B extends Builder<B>> extends SectionType.Builder<B> {
+
+ private MsgType product;
+ private MsgType vendor;
+ private CimString version;
+ private CimString fullVersion;
+ private CimString productUrl;
+ private CimString vendorUrl;
+ private CimString appUrl;
+ protected Set<ProductSectionProperty> properties = Sets.newLinkedHashSet();
+
+ @Override
+ @SuppressWarnings("unchecked")
+ protected B self() {
+ return (B) this;
+ }
+
+ /**
+ * @see ProductSection#getProduct()
+ */
+ public B product(MsgType product) {
+ this.product = product;
+ return self();
+ }
+
+ /**
+ * @see ProductSection#getVendor()
+ */
+ public B vendor(MsgType vendor) {
+ this.vendor = vendor;
+ return self();
+ }
+
+ /**
+ * @see ProductSection#getVersion()
+ */
+ public B version(CimString version) {
+ this.version = version;
+ return self();
+ }
+
+ /**
+ * @see ProductSection#geFullVersion()
+ */
+ public B fullVersion(CimString fullVersion) {
+ this.fullVersion = fullVersion;
+ return self();
+ }
+
+ /**
+ * @see ProductSection#getProductUrl()
+ */
+ public B productUrl(CimString productUrl) {
+ this.productUrl = productUrl;
+ return self();
+ }
+
+ /**
+ * @see ProductSection#getProductUrl()
+ */
+ public B productUrl(String productUrl) {
+ this.productUrl = new CimString(productUrl);
+ return self();
+ }
+
+ /**
+ * @see ProductSection#getVendorUrl()
+ */
+ public B vendorUrl(CimString vendorUrl) {
+ this.vendorUrl = vendorUrl;
+ return self();
+ }
+
+ /**
+ * @see ProductSection#getAppUrl()
+ */
+ public B appUrl(CimString appUrl) {
+ this.appUrl = appUrl;
+ return self();
+ }
+
+ /**
+ * @see ProductSection#getProperties()
+ */
+ public B property(ProductSectionProperty property) {
+ this.properties.add(checkNotNull(property, "property"));
+ return self();
+ }
+
+ /**
+ * @see ProductSection#getProperties
+ */
+ public B properties(Iterable<ProductSectionProperty> properties) {
+ this.properties = ImmutableSet.copyOf(checkNotNull(properties, "properties"));
+ return self();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ProductSection build() {
+ return new ProductSection(this);
+ }
+
+ public B fromProductSection(ProductSection in) {
+ return fromSectionType(in)
+ .product(in.getProduct())
+ .vendor(in.getVendor())
+ .version(in.getVersion())
+ .fullVersion(in.getFullVersion())
+ .productUrl(in.getProductUrl())
+ .vendorUrl(in.getVendorUrl())
+ .appUrl(in.getAppUrl())
+ .properties(Sets.newLinkedHashSet(in.getProperties()));
+ }
+ }
+
+ private ProductSection(Builder<?> builder) {
+ super(builder);
+ this.product = builder.product;
+ this.vendor = builder.vendor;
+ this.version = builder.version;
+ this.fullVersion = builder.fullVersion;
+ this.productUrl = builder.productUrl;
+ this.vendorUrl = builder.vendorUrl;
+ this.appUrl = builder.appUrl;
+ this.properties = builder.properties != null ? ImmutableSet.copyOf(checkNotNull(builder.properties, "properties")) : ImmutableSet.<ProductSectionProperty>of();
+ }
+
+ private ProductSection() {
+ // For JAXB
+ }
+
+ @XmlElement(name = "Product")
+ private MsgType product;
+ @XmlElement(name = "Vendor")
+ private MsgType vendor;
+ @XmlElement(name = "Version", namespace = CIM_NS)
+ private CimString version;
+ @XmlElement(name = "FullVersion", namespace = CIM_NS)
+ private CimString fullVersion;
+ @XmlElement(name = "ProductUrl", namespace = CIM_NS)
+ private CimString productUrl;
+ @XmlElement(name = "VendorUrl", namespace = CIM_NS)
+ private CimString vendorUrl;
+ @XmlElement(name = "AppUrl", namespace = CIM_NS)
+ private CimString appUrl;
+ @XmlElement(name = "Property")
+ private Set<ProductSectionProperty> properties = Sets.newLinkedHashSet();
+
+ /**
+ * Name of product.
+ */
+ public MsgType getProduct() {
+ return product;
+ }
+
+ /**
+ * Name of product vendor.
+ */
+ public MsgType getVendor() {
+ return vendor;
+ }
+
+ /**
+ * Product version, short form.
+ */
+ public CimString getVersion() {
+ return version;
+ }
+
+ /**
+ * Product version, long form.
+ */
+ public CimString getFullVersion() {
+ return fullVersion;
+ }
+
+ /**
+ * URL resolving to product description.
+ */
+ public CimString getProductUrl() {
+ return productUrl;
+ }
+
+ /**
+ * URL resolving to vendor description.
+ */
+ public CimString getVendorUrl() {
+ return vendorUrl;
+ }
+
+ /**
+ * Experimental: URL resolving to deployed product instance.
+ */
+ public CimString getAppUrl() {
+ return appUrl;
+ }
+
+ // TODO Set<Icon>
+
+ /**
+ * Properties for application-level customization.
+ */
+ public Set<ProductSectionProperty> getProperties() {
+ return properties;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(super.hashCode(), product, vendor, version, fullVersion, productUrl, vendorUrl, appUrl, properties);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (!super.equals(obj)) return false;
+ if (getClass() != obj.getClass()) return false;
+
+ ProductSection that = ProductSection.class.cast(obj);
+ return super.equals(that) &&
+ equal(this.product, that.product) &&
+ equal(this.vendor, that.vendor) &&
+ equal(this.version, that.version) &&
+ equal(this.fullVersion, that.fullVersion) &&
+ equal(this.productUrl, that.productUrl) &&
+ equal(this.vendorUrl, that.vendorUrl) &&
+ equal(this.appUrl, that.appUrl) &&
+ equal(this.properties, that.properties);
+ }
+
+ @Override
+ protected MoreObjects.ToStringHelper string() {
+ return super.string()
+ .add("product", product)
+ .add("vendor", vendor)
+ .add("version", version)
+ .add("fullVersion", fullVersion)
+ .add("productUrl", productUrl)
+ .add("vendorUrl", vendorUrl)
+ .add("appUrl", appUrl)
+ .add("properties", properties);
+ }
+
+}