You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2014/03/31 09:13:59 UTC
[46/52] [partial] Moving jclouds dependencies to accurate parent
directories
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerCreated.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerCreated.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerCreated.java
new file mode 100644
index 0000000..dcaf6fc
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerCreated.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.openstack.nova.v2_0.domain;
+
+import java.beans.ConstructorProperties;
+import java.util.Set;
+
+import org.jclouds.javax.annotation.Nullable;
+import org.jclouds.openstack.v2_0.domain.Link;
+import org.jclouds.openstack.v2_0.domain.Resource;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+import com.google.common.base.Optional;
+
+/**
+ * Server Resource with administrative password returned by ServerApi#CreateServer calls
+ *
+ * @author Adam Lowe
+ * @see <a href=
+ "http://docs.openstack.org/api/openstack-compute/1.1/content/Get_Server_Details-d1e2623.html"
+ />
+*/
+public class ServerCreated extends Resource {
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public Builder toBuilder() {
+ return builder().fromServerCreated(this);
+ }
+
+ public static final class Builder extends Resource.Builder<Builder> {
+ protected String adminPass;
+ protected String diskConfig;
+
+ /**
+ * @see ServerCreated#getAdminPass()
+ */
+ public Builder adminPass(String adminPass) {
+ this.adminPass = adminPass;
+ return self();
+ }
+
+ /**
+ * @see ServerCreated#getDiskConfig()
+ */
+ public Builder diskConfig(String diskConfig) {
+ this.diskConfig = diskConfig;
+ return self();
+ }
+
+ public ServerCreated build() {
+ return new ServerCreated(id, name, links, adminPass, diskConfig);
+ }
+
+ public Builder fromServerCreated(ServerCreated in) {
+ return super.fromResource(in).adminPass(in.getAdminPass().orNull()).diskConfig(in.getDiskConfig().orNull());
+ }
+
+ @Override
+ protected Builder self() {
+ return this;
+ }
+ }
+
+ private final Optional<String> adminPass;
+ private final Optional<String> diskConfig;
+
+ @ConstructorProperties({
+ "id", "name", "links", "adminPass", "OS-DCF:diskConfig"
+ })
+ protected ServerCreated(String id, @Nullable String name, Set<Link> links, @Nullable String adminPass,
+ @Nullable String diskConfig) {
+ super(id, name, links);
+ this.adminPass = Optional.fromNullable(adminPass);
+ this.diskConfig = Optional.fromNullable(diskConfig);
+ }
+
+ /**
+ * present unless the nova install was configured with the option {@code enable_instance_password=false}
+ */
+ public Optional<String> getAdminPass() {
+ return this.adminPass;
+ }
+
+ /**
+ * @see CreateServerOptions#getDiskConfig()
+ */
+ public Optional<String> getDiskConfig() {
+ return this.diskConfig;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(adminPass, diskConfig);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ ServerCreated that = ServerCreated.class.cast(obj);
+ return super.equals(that) && Objects.equal(this.adminPass, that.adminPass)
+ && Objects.equal(this.diskConfig, that.diskConfig);
+ }
+
+ @Override
+ protected ToStringHelper string() {
+ return super.string().add("adminPass", adminPass.orNull()).add("diskConfig", diskConfig.orNull());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerExtendedAttributes.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerExtendedAttributes.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerExtendedAttributes.java
new file mode 100644
index 0000000..1390660
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerExtendedAttributes.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.openstack.nova.v2_0.domain;
+
+import java.beans.ConstructorProperties;
+
+import javax.inject.Named;
+
+import org.jclouds.javax.annotation.Nullable;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+
+/**
+ * Additional attributes delivered by Extended Server Attributes extension (alias "OS-EXT-SRV-ATTR")
+ *
+ * @author Adam Lowe
+ * @see <a href=
+ "http://nova.openstack.org/api/nova.api.openstack.compute.contrib.extended_server_attributes.html"
+ />
+ * @see org.jclouds.openstack.nova.v2_0.features.ExtensionApi#getExtensionByAlias
+ * @see org.jclouds.openstack.nova.v2_0.extensions.ExtensionNamespaces#EXTENDED_STATUS
+*/
+public class ServerExtendedAttributes {
+
+ public static String PREFIX;
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return new ConcreteBuilder().fromServerExtendedAttributes(this);
+ }
+
+ public abstract static class Builder<T extends Builder<T>> {
+ protected abstract T self();
+
+ protected String instanceName;
+ protected String hostName;
+ protected String hypervisorHostName;
+
+ /**
+ * @see ServerExtendedAttributes#getInstanceName()
+ */
+ public T instanceName(String instanceName) {
+ this.instanceName = instanceName;
+ return self();
+ }
+
+ /**
+ * @see ServerExtendedAttributes#getHostName()
+ */
+ public T hostName(String hostName) {
+ this.hostName = hostName;
+ return self();
+ }
+
+ /**
+ * @see ServerExtendedAttributes#getHypervisorHostName()
+ */
+ public T hypervisorHostName(String hypervisorHostName) {
+ this.hypervisorHostName = hypervisorHostName;
+ return self();
+ }
+
+ public ServerExtendedAttributes build() {
+ return new ServerExtendedAttributes(instanceName, hostName, hypervisorHostName);
+ }
+
+ public T fromServerExtendedAttributes(ServerExtendedAttributes in) {
+ return this
+ .instanceName(in.getInstanceName())
+ .hostName(in.getHostName())
+ .hypervisorHostName(in.getHypervisorHostName());
+ }
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ @Override
+ protected ConcreteBuilder self() {
+ return this;
+ }
+ }
+
+ @Named("OS-EXT-SRV-ATTR:instance_name")
+ private final String instanceName;
+ @Named("OS-EXT-SRV-ATTR:host")
+ private final String hostName;
+ @Named("OS-EXT-SRV-ATTR:hypervisor_hostname")
+ private final String hypervisorHostName;
+
+ @ConstructorProperties({
+ "OS-EXT-SRV-ATTR:instance_name", "OS-EXT-SRV-ATTR:host", "OS-EXT-SRV-ATTR:hypervisor_hostname"
+ })
+ protected ServerExtendedAttributes(@Nullable String instanceName, @Nullable String hostName, @Nullable String hypervisorHostName) {
+ this.instanceName = instanceName;
+ this.hostName = hostName;
+ this.hypervisorHostName = hypervisorHostName;
+ }
+
+ @Nullable
+ public String getInstanceName() {
+ return this.instanceName;
+ }
+
+ @Nullable
+ public String getHostName() {
+ return this.hostName;
+ }
+
+ @Nullable
+ public String getHypervisorHostName() {
+ return this.hypervisorHostName;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(instanceName, hostName, hypervisorHostName);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ ServerExtendedAttributes that = ServerExtendedAttributes.class.cast(obj);
+ return Objects.equal(this.instanceName, that.instanceName)
+ && Objects.equal(this.hostName, that.hostName)
+ && Objects.equal(this.hypervisorHostName, that.hypervisorHostName);
+ }
+
+ protected ToStringHelper string() {
+ return Objects.toStringHelper(this)
+ .add("instanceName", instanceName).add("hostName", hostName).add("hypervisorHostName", hypervisorHostName);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerExtendedStatus.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerExtendedStatus.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerExtendedStatus.java
new file mode 100644
index 0000000..33dcb75
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerExtendedStatus.java
@@ -0,0 +1,155 @@
+/*
+ * 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.openstack.nova.v2_0.domain;
+
+import java.beans.ConstructorProperties;
+
+import javax.inject.Named;
+
+import org.jclouds.javax.annotation.Nullable;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+
+/**
+ * Additional attributes delivered by Extended Server Status extension (alias "OS-EXT-STS")
+ *
+ * @author Adam Lowe
+ * @see <a href=
+ "http://nova.openstack.org/api/nova.api.openstack.compute.contrib.extended_status.html"
+ />
+ * @see org.jclouds.openstack.nova.v2_0.features.ExtensionApi#getExtensionByAlias
+ * @see org.jclouds.openstack.nova.v1_1.extensions.ExtensionNamespaces#EXTENDED_STATUS (extended status?)
+*/
+public class ServerExtendedStatus {
+
+ public static String PREFIX;
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return new ConcreteBuilder().fromServerExtendedStatus(this);
+ }
+
+ public abstract static class Builder<T extends Builder<T>> {
+ protected abstract T self();
+
+ protected String taskState;
+ protected String vmState;
+ protected int powerState;
+
+ /**
+ * @see ServerExtendedStatus#getTaskState()
+ */
+ public T taskState(String taskState) {
+ this.taskState = taskState;
+ return self();
+ }
+
+ /**
+ * @see ServerExtendedStatus#getVmState()
+ */
+ public T vmState(String vmState) {
+ this.vmState = vmState;
+ return self();
+ }
+
+ /**
+ * @see ServerExtendedStatus#getPowerState()
+ */
+ public T powerState(int powerState) {
+ this.powerState = powerState;
+ return self();
+ }
+
+ public ServerExtendedStatus build() {
+ return new ServerExtendedStatus(taskState, vmState, powerState);
+ }
+
+ public T fromServerExtendedStatus(ServerExtendedStatus in) {
+ return this
+ .taskState(in.getTaskState())
+ .vmState(in.getVmState())
+ .powerState(in.getPowerState());
+ }
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ @Override
+ protected ConcreteBuilder self() {
+ return this;
+ }
+ }
+
+ @Named("OS-EXT-STS:task_state")
+ private final String taskState;
+ @Named("OS-EXT-STS:vm_state")
+ private final String vmState;
+ @Named("OS-EXT-STS:power_state")
+ private final int powerState;
+
+ @ConstructorProperties({
+ "OS-EXT-STS:task_state", "OS-EXT-STS:vm_state", "OS-EXT-STS:power_state"
+ })
+ protected ServerExtendedStatus(@Nullable String taskState, @Nullable String vmState, int powerState) {
+ this.taskState = taskState;
+ this.vmState = vmState;
+ this.powerState = powerState;
+ }
+
+ @Nullable
+ public String getTaskState() {
+ return this.taskState;
+ }
+
+ @Nullable
+ public String getVmState() {
+ return this.vmState;
+ }
+
+ public int getPowerState() {
+ return this.powerState;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(taskState, vmState, powerState);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ ServerExtendedStatus that = ServerExtendedStatus.class.cast(obj);
+ return Objects.equal(this.taskState, that.taskState)
+ && Objects.equal(this.vmState, that.vmState)
+ && Objects.equal(this.powerState, that.powerState);
+ }
+
+ protected ToStringHelper string() {
+ return Objects.toStringHelper(this)
+ .add("taskState", taskState).add("vmState", vmState).add("powerState", powerState);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerWithSecurityGroups.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerWithSecurityGroups.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerWithSecurityGroups.java
new file mode 100644
index 0000000..3d7a9b9
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerWithSecurityGroups.java
@@ -0,0 +1,128 @@
+/*
+ * 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.openstack.nova.v2_0.domain;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.beans.ConstructorProperties;
+import java.util.Date;
+import java.util.Map;
+import java.util.Set;
+
+import javax.inject.Named;
+
+import org.jclouds.javax.annotation.Nullable;
+import org.jclouds.openstack.v2_0.domain.Link;
+import org.jclouds.openstack.v2_0.domain.Resource;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Multimap;
+
+/**
+ * Extended server returned by ServerWithSecurityGroupsApi
+ *
+ * @author Adam Lowe
+ * @see <a href=
+"http://docs.openstack.org/api/openstack-compute/1.1/content/Get_Server_Details-d1e2623.html"
+/>
+*/
+public class ServerWithSecurityGroups extends Server {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return new ConcreteBuilder().fromServerWithSecurityGroups(this);
+ }
+
+ public abstract static class Builder<T extends Builder<T>> extends Server.Builder<T> {
+ protected Set<String> securityGroupNames = ImmutableSet.of();
+
+ /**
+ * @see ServerWithSecurityGroups#getSecurityGroupNames()
+ */
+ public T securityGroupNames(Set<String> securityGroupNames) {
+ this.securityGroupNames = ImmutableSet.copyOf(checkNotNull(securityGroupNames, "securityGroupNames"));
+ return self();
+ }
+
+ public T securityGroupNames(String... in) {
+ return securityGroupNames(ImmutableSet.copyOf(in));
+ }
+
+ public ServerWithSecurityGroups build() {
+ return new ServerWithSecurityGroups(id, name, links, uuid, tenantId, userId, updated, created, hostId,
+ accessIPv4, accessIPv6, status, image, flavor, keyName, configDrive, addresses,
+ metadata, extendedStatus, extendedAttributes, diskConfig, securityGroupNames);
+ }
+
+ public T fromServerWithSecurityGroups(ServerWithSecurityGroups in) {
+ return super.fromServer(in)
+ .securityGroupNames(in.getSecurityGroupNames());
+ }
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ @Override
+ protected ConcreteBuilder self() {
+ return this;
+ }
+ }
+
+ @Named("security_groups")
+ private final Set<String> securityGroupNames;
+
+ @ConstructorProperties({
+ "id", "name", "links", "uuid", "tenant_id", "user_id", "updated", "created", "hostId", "accessIPv4", "accessIPv6", "status", "image", "flavor", "key_name", "config_drive", "addresses", "metadata", "extendedStatus", "extendedAttributes", "OS-DCF:diskConfig", "security_groups"
+ })
+ protected ServerWithSecurityGroups(String id, @Nullable String name, Set<Link> links, @Nullable String uuid,
+ String tenantId, String userId, Date updated, Date created, @Nullable String hostId,
+ @Nullable String accessIPv4, @Nullable String accessIPv6, Server.Status status, Resource image,
+ Resource flavor, @Nullable String keyName, @Nullable String configDrive,
+ Multimap<String, Address> addresses, Map<String, String> metadata,
+ @Nullable ServerExtendedStatus extendedStatus, @Nullable ServerExtendedAttributes extendedAttributes,
+ @Nullable String diskConfig, Set<String> securityGroupNames) {
+ super(id, name, links, uuid, tenantId, userId, updated, created, hostId, accessIPv4, accessIPv6, status, image, flavor, keyName, configDrive, addresses, metadata, extendedStatus, extendedAttributes, diskConfig);
+ this.securityGroupNames = ImmutableSet.copyOf(checkNotNull(securityGroupNames, "securityGroupNames"));
+ }
+
+ public Set<String> getSecurityGroupNames() {
+ return this.securityGroupNames;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(securityGroupNames);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ ServerWithSecurityGroups that = ServerWithSecurityGroups.class.cast(obj);
+ return super.equals(that) && Objects.equal(this.securityGroupNames, that.securityGroupNames);
+ }
+
+ protected ToStringHelper string() {
+ return super.string()
+ .add("securityGroupNames", securityGroupNames);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/SimpleServerUsage.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/SimpleServerUsage.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/SimpleServerUsage.java
new file mode 100644
index 0000000..eba8531
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/SimpleServerUsage.java
@@ -0,0 +1,312 @@
+/*
+ * 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.openstack.nova.v2_0.domain;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.beans.ConstructorProperties;
+import java.util.Date;
+
+import javax.inject.Named;
+
+import org.jclouds.javax.annotation.Nullable;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+
+/**
+ * Information the SimpleTenantUsage extension return data about each Server
+ *
+ * @author Adam Lowe
+*/
+public class SimpleServerUsage {
+
+ /**
+ */
+ public static enum Status {
+
+ UNRECOGNIZED, ACTIVE;
+
+ public String value() {
+ return name();
+ }
+
+ public static Status fromValue(String v) {
+ try {
+ return valueOf(v.toUpperCase());
+ } catch (IllegalArgumentException e) {
+ return UNRECOGNIZED;
+ }
+ }
+
+ }
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return new ConcreteBuilder().fromSimpleServerUsage(this);
+ }
+
+ public abstract static class Builder<T extends Builder<T>> {
+ protected abstract T self();
+
+ protected String instanceName;
+ protected double hours;
+ protected double flavorMemoryMb;
+ protected double flavorLocalGb;
+ protected double flavorVcpus;
+ protected String tenantId;
+ protected String flavorName;
+ protected Date instanceCreated;
+ protected Date instanceTerminated;
+ protected SimpleServerUsage.Status instanceStatus;
+ protected long uptime;
+
+ /**
+ * @see SimpleServerUsage#getInstanceName()
+ */
+ public T instanceName(String instanceName) {
+ this.instanceName = instanceName;
+ return self();
+ }
+
+ /**
+ * @see SimpleServerUsage#getHours()
+ */
+ public T hours(double hours) {
+ this.hours = hours;
+ return self();
+ }
+
+ /**
+ * @see SimpleServerUsage#getFlavorMemoryMb()
+ */
+ public T flavorMemoryMb(double flavorMemoryMb) {
+ this.flavorMemoryMb = flavorMemoryMb;
+ return self();
+ }
+
+ /**
+ * @see SimpleServerUsage#getFlavorLocalGb()
+ */
+ public T flavorLocalGb(double flavorLocalGb) {
+ this.flavorLocalGb = flavorLocalGb;
+ return self();
+ }
+
+ /**
+ * @see SimpleServerUsage#getFlavorVcpus()
+ */
+ public T flavorVcpus(double flavorVcpus) {
+ this.flavorVcpus = flavorVcpus;
+ return self();
+ }
+
+ /**
+ * @see SimpleServerUsage#getTenantId()
+ */
+ public T tenantId(String tenantId) {
+ this.tenantId = tenantId;
+ return self();
+ }
+
+ /**
+ * @see SimpleServerUsage#getFlavorName()
+ */
+ public T flavorName(String flavorName) {
+ this.flavorName = flavorName;
+ return self();
+ }
+
+ /**
+ * @see SimpleServerUsage#getInstanceCreated()
+ */
+ public T instanceCreated(Date instanceCreated) {
+ this.instanceCreated = instanceCreated;
+ return self();
+ }
+
+ /**
+ * @see SimpleServerUsage#getInstanceTerminated()
+ */
+ public T instanceTerminated(Date instanceTerminated) {
+ this.instanceTerminated = instanceTerminated;
+ return self();
+ }
+
+ /**
+ * @see SimpleServerUsage#getInstanceStatus()
+ */
+ public T instanceStatus(SimpleServerUsage.Status instanceStatus) {
+ this.instanceStatus = instanceStatus;
+ return self();
+ }
+
+ /**
+ * @see SimpleServerUsage#getUptime()
+ */
+ public T uptime(long uptime) {
+ this.uptime = uptime;
+ return self();
+ }
+
+ public SimpleServerUsage build() {
+ return new SimpleServerUsage(instanceName, hours, flavorMemoryMb, flavorLocalGb, flavorVcpus, tenantId, flavorName, instanceCreated, instanceTerminated, instanceStatus, uptime);
+ }
+
+ public T fromSimpleServerUsage(SimpleServerUsage in) {
+ return this
+ .instanceName(in.getInstanceName())
+ .hours(in.getHours())
+ .flavorMemoryMb(in.getFlavorMemoryMb())
+ .flavorLocalGb(in.getFlavorLocalGb())
+ .flavorVcpus(in.getFlavorVcpus())
+ .tenantId(in.getTenantId())
+ .flavorName(in.getFlavorName())
+ .instanceCreated(in.getInstanceCreated())
+ .instanceTerminated(in.getInstanceTerminated())
+ .instanceStatus(in.getInstanceStatus())
+ .uptime(in.getUptime());
+ }
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ @Override
+ protected ConcreteBuilder self() {
+ return this;
+ }
+ }
+
+ @Named("name")
+ private final String instanceName;
+ private final double hours;
+ @Named("memory_mb")
+ private final double flavorMemoryMb;
+ @Named("local_gb")
+ private final double flavorLocalGb;
+ @Named("vcpus")
+ private final double flavorVcpus;
+ @Named("tenant_id")
+ private final String tenantId;
+ @Named("flavor")
+ private final String flavorName;
+ @Named("started_at")
+ private final Date instanceCreated;
+ @Named("ended_at")
+ private final Date instanceTerminated;
+ @Named("state")
+ private final SimpleServerUsage.Status instanceStatus;
+ private final long uptime;
+
+ @ConstructorProperties({
+ "name", "hours", "memory_mb", "local_gb", "vcpus", "tenant_id", "flavor", "started_at", "ended_at", "state", "uptime"
+ })
+ protected SimpleServerUsage(String instanceName, double hours, double flavorMemoryMb, double flavorLocalGb, double flavorVcpus, String tenantId, String flavorName, Date instanceCreated, @Nullable Date instanceTerminated, SimpleServerUsage.Status instanceStatus, long uptime) {
+ this.instanceName = checkNotNull(instanceName, "instanceName");
+ this.hours = hours;
+ this.flavorMemoryMb = flavorMemoryMb;
+ this.flavorLocalGb = flavorLocalGb;
+ this.flavorVcpus = flavorVcpus;
+ this.tenantId = checkNotNull(tenantId, "tenantId");
+ this.flavorName = checkNotNull(flavorName, "flavorName");
+ this.instanceCreated = checkNotNull(instanceCreated, "instanceCreated");
+ this.instanceTerminated = instanceTerminated;
+ this.instanceStatus = checkNotNull(instanceStatus, "instanceStatus");
+ this.uptime = uptime;
+ }
+
+ public String getInstanceName() {
+ return this.instanceName;
+ }
+
+ public double getHours() {
+ return this.hours;
+ }
+
+ public double getFlavorMemoryMb() {
+ return this.flavorMemoryMb;
+ }
+
+ public double getFlavorLocalGb() {
+ return this.flavorLocalGb;
+ }
+
+ public double getFlavorVcpus() {
+ return this.flavorVcpus;
+ }
+
+ public String getTenantId() {
+ return this.tenantId;
+ }
+
+ public String getFlavorName() {
+ return this.flavorName;
+ }
+
+ public Date getInstanceCreated() {
+ return this.instanceCreated;
+ }
+
+ @Nullable
+ public Date getInstanceTerminated() {
+ return this.instanceTerminated;
+ }
+
+ public SimpleServerUsage.Status getInstanceStatus() {
+ return this.instanceStatus;
+ }
+
+ public long getUptime() {
+ return this.uptime;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(instanceName, hours, flavorMemoryMb, flavorLocalGb, flavorVcpus, tenantId, flavorName, instanceCreated, instanceTerminated, instanceStatus, uptime);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ SimpleServerUsage that = SimpleServerUsage.class.cast(obj);
+ return Objects.equal(this.instanceName, that.instanceName)
+ && Objects.equal(this.hours, that.hours)
+ && Objects.equal(this.flavorMemoryMb, that.flavorMemoryMb)
+ && Objects.equal(this.flavorLocalGb, that.flavorLocalGb)
+ && Objects.equal(this.flavorVcpus, that.flavorVcpus)
+ && Objects.equal(this.tenantId, that.tenantId)
+ && Objects.equal(this.flavorName, that.flavorName)
+ && Objects.equal(this.instanceCreated, that.instanceCreated)
+ && Objects.equal(this.instanceTerminated, that.instanceTerminated)
+ && Objects.equal(this.instanceStatus, that.instanceStatus)
+ && Objects.equal(this.uptime, that.uptime);
+ }
+
+ protected ToStringHelper string() {
+ return Objects.toStringHelper(this)
+ .add("instanceName", instanceName).add("hours", hours).add("flavorMemoryMb", flavorMemoryMb).add("flavorLocalGb", flavorLocalGb).add("flavorVcpus", flavorVcpus).add("tenantId", tenantId).add("flavorName", flavorName).add("instanceCreated", instanceCreated).add("instanceTerminated", instanceTerminated).add("instanceStatus", instanceStatus).add("uptime", uptime);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/SimpleTenantUsage.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/SimpleTenantUsage.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/SimpleTenantUsage.java
new file mode 100644
index 0000000..61cec18
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/SimpleTenantUsage.java
@@ -0,0 +1,245 @@
+/*
+ * 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.openstack.nova.v2_0.domain;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.beans.ConstructorProperties;
+import java.util.Date;
+import java.util.Set;
+
+import javax.inject.Named;
+
+import org.jclouds.javax.annotation.Nullable;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Information the SimpleTenantUsage extension returns data about each tenant
+ *
+ * @author Adam Lowe
+*/
+public class SimpleTenantUsage {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return new ConcreteBuilder().fromSimpleTenantUsage(this);
+ }
+
+ public abstract static class Builder<T extends Builder<T>> {
+ protected abstract T self();
+
+ protected String tenantId;
+ protected double totalLocalGbUsage;
+ protected double totalVcpusUsage;
+ protected double totalMemoryMbUsage;
+ protected double totalHours;
+ protected Date start;
+ protected Date stop;
+ protected Set<SimpleServerUsage> serverUsages = ImmutableSet.of();
+
+ /**
+ * @see SimpleTenantUsage#getTenantId()
+ */
+ public T tenantId(String tenantId) {
+ this.tenantId = tenantId;
+ return self();
+ }
+
+ /**
+ * @see SimpleTenantUsage#getTotalLocalGbUsage()
+ */
+ public T totalLocalGbUsage(double totalLocalGbUsage) {
+ this.totalLocalGbUsage = totalLocalGbUsage;
+ return self();
+ }
+
+ /**
+ * @see SimpleTenantUsage#getTotalVcpusUsage()
+ */
+ public T totalVcpusUsage(double totalVcpusUsage) {
+ this.totalVcpusUsage = totalVcpusUsage;
+ return self();
+ }
+
+ /**
+ * @see SimpleTenantUsage#getTotalMemoryMbUsage()
+ */
+ public T totalMemoryMbUsage(double totalMemoryMbUsage) {
+ this.totalMemoryMbUsage = totalMemoryMbUsage;
+ return self();
+ }
+
+ /**
+ * @see SimpleTenantUsage#getTotalHours()
+ */
+ public T totalHours(double totalHours) {
+ this.totalHours = totalHours;
+ return self();
+ }
+
+ /**
+ * @see SimpleTenantUsage#getStart()
+ */
+ public T start(Date start) {
+ this.start = start;
+ return self();
+ }
+
+ /**
+ * @see SimpleTenantUsage#getStop()
+ */
+ public T stop(Date stop) {
+ this.stop = stop;
+ return self();
+ }
+
+ /**
+ * @see SimpleTenantUsage#getServerUsages()
+ */
+ public T serverUsages(Set<SimpleServerUsage> serverUsages) {
+ this.serverUsages = ImmutableSet.copyOf(checkNotNull(serverUsages, "serverUsages"));
+ return self();
+ }
+
+ public T serverUsages(SimpleServerUsage... in) {
+ return serverUsages(ImmutableSet.copyOf(in));
+ }
+
+ public SimpleTenantUsage build() {
+ return new SimpleTenantUsage(tenantId, totalLocalGbUsage, totalVcpusUsage, totalMemoryMbUsage, totalHours, start, stop, serverUsages);
+ }
+
+ public T fromSimpleTenantUsage(SimpleTenantUsage in) {
+ return this
+ .tenantId(in.getTenantId())
+ .totalLocalGbUsage(in.getTotalLocalGbUsage())
+ .totalVcpusUsage(in.getTotalVcpusUsage())
+ .totalMemoryMbUsage(in.getTotalMemoryMbUsage())
+ .totalHours(in.getTotalHours())
+ .start(in.getStart())
+ .stop(in.getStop())
+ .serverUsages(in.getServerUsages());
+ }
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ @Override
+ protected ConcreteBuilder self() {
+ return this;
+ }
+ }
+
+ @Named("tenant_id")
+ private final String tenantId;
+ @Named("total_local_gb_usage")
+ private final double totalLocalGbUsage;
+ @Named("total_vcpus_usage")
+ private final double totalVcpusUsage;
+ @Named("total_memory_mb_usage")
+ private final double totalMemoryMbUsage;
+ @Named("total_hours")
+ private final double totalHours;
+ private final Date start;
+ private final Date stop;
+ @Named("server_usages")
+ private final Set<SimpleServerUsage> serverUsages;
+
+ @ConstructorProperties({
+ "tenant_id", "total_local_gb_usage", "total_vcpus_usage", "total_memory_mb_usage", "total_hours", "start", "stop", "server_usages"
+ })
+ protected SimpleTenantUsage(String tenantId, double totalLocalGbUsage, double totalVcpusUsage, double totalMemoryMbUsage, double totalHours, @Nullable Date start, @Nullable Date stop, @Nullable Set<SimpleServerUsage> serverUsages) {
+ this.tenantId = checkNotNull(tenantId, "tenantId");
+ this.totalLocalGbUsage = totalLocalGbUsage;
+ this.totalVcpusUsage = totalVcpusUsage;
+ this.totalMemoryMbUsage = totalMemoryMbUsage;
+ this.totalHours = totalHours;
+ this.start = start;
+ this.stop = stop;
+ this.serverUsages = serverUsages == null ? ImmutableSet.<SimpleServerUsage>of() : ImmutableSet.copyOf(serverUsages);
+ }
+
+ public String getTenantId() {
+ return this.tenantId;
+ }
+
+ public double getTotalLocalGbUsage() {
+ return this.totalLocalGbUsage;
+ }
+
+ public double getTotalVcpusUsage() {
+ return this.totalVcpusUsage;
+ }
+
+ public double getTotalMemoryMbUsage() {
+ return this.totalMemoryMbUsage;
+ }
+
+ public double getTotalHours() {
+ return this.totalHours;
+ }
+
+ @Nullable
+ public Date getStart() {
+ return this.start;
+ }
+
+ @Nullable
+ public Date getStop() {
+ return this.stop;
+ }
+
+ public Set<SimpleServerUsage> getServerUsages() {
+ return this.serverUsages;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(tenantId, totalLocalGbUsage, totalVcpusUsage, totalMemoryMbUsage, totalHours, start, stop, serverUsages);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ SimpleTenantUsage that = SimpleTenantUsage.class.cast(obj);
+ return Objects.equal(this.tenantId, that.tenantId)
+ && Objects.equal(this.totalLocalGbUsage, that.totalLocalGbUsage)
+ && Objects.equal(this.totalVcpusUsage, that.totalVcpusUsage)
+ && Objects.equal(this.totalMemoryMbUsage, that.totalMemoryMbUsage)
+ && Objects.equal(this.totalHours, that.totalHours)
+ && Objects.equal(this.start, that.start)
+ && Objects.equal(this.stop, that.stop)
+ && Objects.equal(this.serverUsages, that.serverUsages);
+ }
+
+ protected ToStringHelper string() {
+ return Objects.toStringHelper(this)
+ .add("tenantId", tenantId).add("totalLocalGbUsage", totalLocalGbUsage).add("totalVcpusUsage", totalVcpusUsage).add("totalMemoryMbUsage", totalMemoryMbUsage).add("totalHours", totalHours).add("start", start).add("stop", stop).add("serverUsages", serverUsages);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/TenantIdAndName.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/TenantIdAndName.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/TenantIdAndName.java
new file mode 100644
index 0000000..c90f40e
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/TenantIdAndName.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.openstack.nova.v2_0.domain;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.beans.ConstructorProperties;
+
+import javax.inject.Named;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+
+/**
+ * Class TenantIdAndName
+ *
+ * @author Adrian Cole
+*/
+public class TenantIdAndName {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return new ConcreteBuilder().fromTenantIdAndName(this);
+ }
+
+ public abstract static class Builder<T extends Builder<T>> {
+ protected abstract T self();
+
+ protected String tenantId;
+ protected String name;
+
+ /**
+ * @see TenantIdAndName#getTenantId()
+ */
+ public T tenantId(String tenantId) {
+ this.tenantId = tenantId;
+ return self();
+ }
+
+ /**
+ * @see TenantIdAndName#getName()
+ */
+ public T name(String name) {
+ this.name = name;
+ return self();
+ }
+
+ public TenantIdAndName build() {
+ return new TenantIdAndName(tenantId, name);
+ }
+
+ public T fromTenantIdAndName(TenantIdAndName in) {
+ return this
+ .tenantId(in.getTenantId())
+ .name(in.getName());
+ }
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ @Override
+ protected ConcreteBuilder self() {
+ return this;
+ }
+ }
+
+ @Named("tenant_id")
+ private final String tenantId;
+ private final String name;
+
+ @ConstructorProperties({
+ "tenant_id", "name"
+ })
+ protected TenantIdAndName(String tenantId, String name) {
+ this.tenantId = checkNotNull(tenantId, "tenantId");
+ this.name = checkNotNull(name, "name");
+ }
+
+ public String getTenantId() {
+ return this.tenantId;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(tenantId, name);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ TenantIdAndName that = TenantIdAndName.class.cast(obj);
+ return Objects.equal(this.tenantId, that.tenantId)
+ && Objects.equal(this.name, that.name);
+ }
+
+ protected ToStringHelper string() {
+ return Objects.toStringHelper(this)
+ .add("tenantId", tenantId).add("name", name);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VirtualInterface.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VirtualInterface.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VirtualInterface.java
new file mode 100644
index 0000000..b77f242
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VirtualInterface.java
@@ -0,0 +1,128 @@
+/*
+ * 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.openstack.nova.v2_0.domain;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.beans.ConstructorProperties;
+
+import javax.inject.Named;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+
+/**
+ * Represents a Virtual Interface (VIF)
+ *
+ * @author Adam Lowe
+ * @see org.jclouds.openstack.nova.v2_0.extensions.VirtualInterfaceApi
+*/
+public class VirtualInterface {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return new ConcreteBuilder().fromVirtualInterface(this);
+ }
+
+ public abstract static class Builder<T extends Builder<T>> {
+ protected abstract T self();
+
+ protected String id;
+ protected String macAddress;
+
+ /**
+ * @see VirtualInterface#getId()
+ */
+ public T id(String id) {
+ this.id = id;
+ return self();
+ }
+
+ /**
+ * @see VirtualInterface#getMacAddress()
+ */
+ public T macAddress(String macAddress) {
+ this.macAddress = macAddress;
+ return self();
+ }
+
+ public VirtualInterface build() {
+ return new VirtualInterface(id, macAddress);
+ }
+
+ public T fromVirtualInterface(VirtualInterface in) {
+ return this
+ .id(in.getId())
+ .macAddress(in.getMacAddress());
+ }
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ @Override
+ protected ConcreteBuilder self() {
+ return this;
+ }
+ }
+
+ private final String id;
+ @Named("mac_address")
+ private final String macAddress;
+
+ @ConstructorProperties({
+ "id", "mac_address"
+ })
+ protected VirtualInterface(String id, String macAddress) {
+ this.id = checkNotNull(id, "id");
+ this.macAddress = checkNotNull(macAddress, "macAddress");
+ }
+
+ public String getId() {
+ return this.id;
+ }
+
+ public String getMacAddress() {
+ return this.macAddress;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, macAddress);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ VirtualInterface that = VirtualInterface.class.cast(obj);
+ return Objects.equal(this.id, that.id)
+ && Objects.equal(this.macAddress, that.macAddress);
+ }
+
+ protected ToStringHelper string() {
+ return Objects.toStringHelper(this)
+ .add("id", id).add("macAddress", macAddress);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/Volume.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/Volume.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/Volume.java
new file mode 100644
index 0000000..7fecfb2
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/Volume.java
@@ -0,0 +1,346 @@
+/*
+ * 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.openstack.nova.v2_0.domain;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.beans.ConstructorProperties;
+import java.util.Date;
+import java.util.Map;
+import java.util.Set;
+
+import javax.inject.Named;
+
+import org.jclouds.javax.annotation.Nullable;
+
+import com.google.common.base.CaseFormat;
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * An OpenStack Nova Volume
+*/
+public class Volume {
+
+ /**
+ */
+ public static enum Status {
+ CREATING, AVAILABLE, IN_USE, DELETING, ERROR, UNRECOGNIZED;
+ public String value() {
+ return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name());
+ }
+
+ @Override
+ public String toString() {
+ return value();
+ }
+
+ public static Status fromValue(String status) {
+ try {
+ return valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(status, "status")));
+ } catch (IllegalArgumentException e) {
+ return UNRECOGNIZED;
+ }
+ }
+ }
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return new ConcreteBuilder().fromVolume(this);
+ }
+
+ public abstract static class Builder<T extends Builder<T>> {
+ protected abstract T self();
+
+ protected String id;
+ protected Volume.Status status;
+ protected int size;
+ protected String zone;
+ protected Date created;
+ protected Set<VolumeAttachment> attachments = ImmutableSet.of();
+ protected String volumeType;
+ protected String snapshotId;
+ protected String name;
+ protected String description;
+ protected Map<String, String> metadata = ImmutableMap.of();
+
+ /**
+ * @see Volume#getId()
+ */
+ public T id(String id) {
+ this.id = id;
+ return self();
+ }
+
+ /**
+ * @see Volume#getStatus()
+ */
+ public T status(Volume.Status status) {
+ this.status = status;
+ return self();
+ }
+
+ /**
+ * @see Volume#getSize()
+ */
+ public T size(int size) {
+ this.size = size;
+ return self();
+ }
+
+ /**
+ * @see Volume#getZone()
+ */
+ public T zone(String zone) {
+ this.zone = zone;
+ return self();
+ }
+
+ /**
+ * @see Volume#getCreated()
+ */
+ public T created(Date created) {
+ this.created = created;
+ return self();
+ }
+
+ /**
+ * @see Volume#getAttachments()
+ */
+ public T attachments(Set<VolumeAttachment> attachments) {
+ this.attachments = ImmutableSet.copyOf(checkNotNull(attachments, "attachments"));
+ return self();
+ }
+
+ public T attachments(VolumeAttachment... in) {
+ return attachments(ImmutableSet.copyOf(in));
+ }
+
+ /**
+ * @see Volume#getVolumeType()
+ */
+ public T volumeType(String volumeType) {
+ this.volumeType = volumeType;
+ return self();
+ }
+
+ /**
+ * @see Volume#getSnapshotId()
+ */
+ public T snapshotId(String snapshotId) {
+ this.snapshotId = snapshotId;
+ return self();
+ }
+
+ /**
+ * @see Volume#getName()
+ */
+ public T name(String name) {
+ this.name = name;
+ return self();
+ }
+
+ /**
+ * @see Volume#getDescription()
+ */
+ public T description(String description) {
+ this.description = description;
+ return self();
+ }
+
+ /**
+ * @see Volume#getMetadata()
+ */
+ public T metadata(Map<String, String> metadata) {
+ this.metadata = ImmutableMap.copyOf(checkNotNull(metadata, "metadata"));
+ return self();
+ }
+
+ public Volume build() {
+ return new Volume(id, status, size, zone, created, attachments, volumeType, snapshotId, name, description, metadata);
+ }
+
+ public T fromVolume(Volume in) {
+ return this
+ .id(in.getId())
+ .status(in.getStatus())
+ .size(in.getSize())
+ .zone(in.getZone())
+ .created(in.getCreated())
+ .attachments(in.getAttachments())
+ .volumeType(in.getVolumeType())
+ .snapshotId(in.getSnapshotId())
+ .name(in.getName())
+ .description(in.getDescription())
+ .metadata(in.getMetadata());
+ }
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ @Override
+ protected ConcreteBuilder self() {
+ return this;
+ }
+ }
+
+ private final String id;
+ private final Volume.Status status;
+ private final int size;
+ @Named("availabilityZone")
+ private final String zone;
+ @Named("createdAt")
+ private final Date created;
+ private final Set<VolumeAttachment> attachments;
+ private final String volumeType;
+ private final String snapshotId;
+ @Named("displayName")
+ private final String name;
+ @Named("displayDescription")
+ private final String description;
+ private final Map<String, String> metadata;
+
+ @ConstructorProperties({
+ "id", "status", "size", "availabilityZone", "createdAt", "attachments", "volumeType", "snapshotId", "displayName", "displayDescription", "metadata"
+ })
+ protected Volume(String id, Volume.Status status, int size, String zone, Date created, @Nullable Set<VolumeAttachment> attachments, @Nullable String volumeType, @Nullable String snapshotId, @Nullable String name, @Nullable String description, @Nullable Map<String, String> metadata) {
+ this.id = checkNotNull(id, "id");
+ this.status = checkNotNull(status, "status");
+ this.size = size;
+ this.zone = checkNotNull(zone, "zone");
+ this.created = checkNotNull(created, "created");
+ this.attachments = attachments == null ? ImmutableSet.<VolumeAttachment>of() : ImmutableSet.copyOf(attachments);
+ this.volumeType = volumeType;
+ this.snapshotId = snapshotId;
+ this.name = name;
+ this.description = description;
+ this.metadata = metadata == null ? ImmutableMap.<String, String>of() : ImmutableMap.copyOf(metadata);
+ }
+
+ /**
+ * @return the id of this volume
+ */
+ public String getId() {
+ return this.id;
+ }
+
+ /**
+ * @return the status of this volume
+ */
+ public Volume.Status getStatus() {
+ return this.status;
+ }
+
+ /**
+ * @return the size in GB of this volume
+ */
+ public int getSize() {
+ return this.size;
+ }
+
+ /**
+ * @return the availabilityZone containing this volume
+ */
+ public String getZone() {
+ return this.zone;
+ }
+
+ /**
+ * @return the time this volume was created
+ */
+ public Date getCreated() {
+ return this.created;
+ }
+
+ /**
+ * @return the set of attachments (to Servers)
+ */
+ public Set<VolumeAttachment> getAttachments() {
+ return this.attachments;
+ }
+
+ /**
+ * @return the type of this volume
+ */
+ @Nullable
+ public String getVolumeType() {
+ return this.volumeType;
+ }
+
+ @Nullable
+ public String getSnapshotId() {
+ return this.snapshotId;
+ }
+
+ /**
+ * @return the name of this volume - as displayed in the openstack console
+ */
+ @Nullable
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * @return the description of this volume - as displayed in the openstack console
+ */
+ @Nullable
+ public String getDescription() {
+ return this.description;
+ }
+
+ public Map<String, String> getMetadata() {
+ return this.metadata;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, status, size, zone, created, attachments, volumeType, snapshotId, name, description, metadata);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ Volume that = Volume.class.cast(obj);
+ return Objects.equal(this.id, that.id)
+ && Objects.equal(this.status, that.status)
+ && Objects.equal(this.size, that.size)
+ && Objects.equal(this.zone, that.zone)
+ && Objects.equal(this.created, that.created)
+ && Objects.equal(this.attachments, that.attachments)
+ && Objects.equal(this.volumeType, that.volumeType)
+ && Objects.equal(this.snapshotId, that.snapshotId)
+ && Objects.equal(this.name, that.name)
+ && Objects.equal(this.description, that.description)
+ && Objects.equal(this.metadata, that.metadata);
+ }
+
+ protected ToStringHelper string() {
+ return Objects.toStringHelper(this)
+ .add("id", id).add("status", status).add("size", size).add("zone", zone).add("created", created).add("attachments", attachments).add("volumeType", volumeType).add("snapshotId", snapshotId).add("name", name).add("description", description).add("metadata", metadata);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeAttachment.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeAttachment.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeAttachment.java
new file mode 100644
index 0000000..894f85b
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeAttachment.java
@@ -0,0 +1,172 @@
+/*
+ * 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.openstack.nova.v2_0.domain;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.beans.ConstructorProperties;
+
+import org.jclouds.javax.annotation.Nullable;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+
+/**
+ * An OpenStack Nova Volume Attachment (describes how Volumes are attached to Servers)
+*/
+public class VolumeAttachment {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return new ConcreteBuilder().fromVolumeAttachment(this);
+ }
+
+ public abstract static class Builder<T extends Builder<T>> {
+ protected abstract T self();
+
+ protected String id;
+ protected String volumeId;
+ protected String serverId;
+ protected String device;
+
+ /**
+ * @see VolumeAttachment#getId()
+ */
+ public T id(String id) {
+ this.id = id;
+ return self();
+ }
+
+ /**
+ * @see VolumeAttachment#getVolumeId()
+ */
+ public T volumeId(String volumeId) {
+ this.volumeId = volumeId;
+ return self();
+ }
+
+ /**
+ * @see VolumeAttachment#getServerId()
+ */
+ public T serverId(String serverId) {
+ this.serverId = serverId;
+ return self();
+ }
+
+ /**
+ * @see VolumeAttachment#getDevice()
+ */
+ public T device(String device) {
+ this.device = device;
+ return self();
+ }
+
+ public VolumeAttachment build() {
+ return new VolumeAttachment(id, volumeId, serverId, device);
+ }
+
+ public T fromVolumeAttachment(VolumeAttachment in) {
+ return this
+ .id(in.getId())
+ .volumeId(in.getVolumeId())
+ .serverId(in.getServerId())
+ .device(in.getDevice());
+ }
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ @Override
+ protected ConcreteBuilder self() {
+ return this;
+ }
+ }
+
+ private final String id;
+ private final String volumeId;
+ private final String serverId;
+ private final String device;
+
+ @ConstructorProperties({
+ "id", "volumeId", "serverId", "device"
+ })
+ protected VolumeAttachment(String id, String volumeId, @Nullable String serverId, @Nullable String device) {
+ this.id = checkNotNull(id, "id");
+ this.volumeId = checkNotNull(volumeId, "volumeId");
+ this.serverId = serverId;
+ this.device = device;
+ }
+
+ /**
+ * @return the attachment id (typically the same as #getVolumeId())
+ */
+ public String getId() {
+ return this.id;
+ }
+
+ /**
+ * @return the id of the volume attached
+ */
+ public String getVolumeId() {
+ return this.volumeId;
+ }
+
+ /**
+ * @return the id of the server the volume is attached to
+ */
+ @Nullable
+ public String getServerId() {
+ return this.serverId;
+ }
+
+ /**
+ * @return the device name (e.g. "/dev/vdc")
+ */
+ @Nullable
+ public String getDevice() {
+ return this.device;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, volumeId, serverId, device);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ VolumeAttachment that = VolumeAttachment.class.cast(obj);
+ return Objects.equal(this.id, that.id)
+ && Objects.equal(this.volumeId, that.volumeId)
+ && Objects.equal(this.serverId, that.serverId)
+ && Objects.equal(this.device, that.device);
+ }
+
+ protected ToStringHelper string() {
+ return Objects.toStringHelper(this)
+ .add("id", id).add("volumeId", volumeId).add("serverId", serverId).add("device", device);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeSnapshot.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeSnapshot.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeSnapshot.java
new file mode 100644
index 0000000..bbd45a4
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeSnapshot.java
@@ -0,0 +1,239 @@
+/*
+ * 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.openstack.nova.v2_0.domain;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.beans.ConstructorProperties;
+import java.util.Date;
+
+import javax.inject.Named;
+
+import org.jclouds.javax.annotation.Nullable;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+
+/**
+ * An OpenStack Nova Volume Snapshot
+*/
+public class VolumeSnapshot {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return new ConcreteBuilder().fromVolumeSnapshot(this);
+ }
+
+ public abstract static class Builder<T extends Builder<T>> {
+ protected abstract T self();
+
+ protected String id;
+ protected String volumeId;
+ protected Volume.Status status;
+ protected int size;
+ protected Date created;
+ protected String name;
+ protected String description;
+
+ /**
+ * @see VolumeSnapshot#getId()
+ */
+ public T id(String id) {
+ this.id = id;
+ return self();
+ }
+
+ /**
+ * @see VolumeSnapshot#getVolumeId()
+ */
+ public T volumeId(String volumeId) {
+ this.volumeId = volumeId;
+ return self();
+ }
+
+ /**
+ * @see VolumeSnapshot#getStatus()
+ */
+ public T status(Volume.Status status) {
+ this.status = status;
+ return self();
+ }
+
+ /**
+ * @see VolumeSnapshot#getSize()
+ */
+ public T size(int size) {
+ this.size = size;
+ return self();
+ }
+
+ /**
+ * @see VolumeSnapshot#getCreated()
+ */
+ public T created(Date created) {
+ this.created = created;
+ return self();
+ }
+
+ /**
+ * @see VolumeSnapshot#getName()
+ */
+ public T name(String name) {
+ this.name = name;
+ return self();
+ }
+
+ /**
+ * @see VolumeSnapshot#getDescription()
+ */
+ public T description(String description) {
+ this.description = description;
+ return self();
+ }
+
+ public VolumeSnapshot build() {
+ return new VolumeSnapshot(id, volumeId, status, size, created, name, description);
+ }
+
+ public T fromVolumeSnapshot(VolumeSnapshot in) {
+ return this
+ .id(in.getId())
+ .volumeId(in.getVolumeId())
+ .status(in.getStatus())
+ .size(in.getSize())
+ .created(in.getCreated())
+ .name(in.getName())
+ .description(in.getDescription());
+ }
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ @Override
+ protected ConcreteBuilder self() {
+ return this;
+ }
+ }
+
+ private final String id;
+ private final String volumeId;
+ private final Volume.Status status;
+ private final int size;
+ @Named("createdAt")
+ private final Date created;
+ @Named("displayName")
+ private final String name;
+ @Named("displayDescription")
+ private final String description;
+
+ @ConstructorProperties({
+ "id", "volumeId", "status", "size", "createdAt", "displayName", "displayDescription"
+ })
+ protected VolumeSnapshot(String id, String volumeId, Volume.Status status, int size, @Nullable Date created, @Nullable String name, @Nullable String description) {
+ this.id = checkNotNull(id, "id");
+ this.volumeId = checkNotNull(volumeId, "volumeId");
+ this.status = checkNotNull(status, "status");
+ this.size = size;
+ this.created = created;
+ this.name = name;
+ this.description = description;
+ }
+
+ /**
+ * @return the id of this snapshot
+ */
+ public String getId() {
+ return this.id;
+ }
+
+ /**
+ * @return the id of the Volume this snapshot was taken from
+ */
+ public String getVolumeId() {
+ return this.volumeId;
+ }
+
+ /**
+ * @return the status of this snapshot
+ */
+ public Volume.Status getStatus() {
+ return this.status;
+ }
+
+ /**
+ * @return the size in GB of the volume this snapshot was taken from
+ */
+ public int getSize() {
+ return this.size;
+ }
+
+ /**
+ * @return the data the snapshot was taken
+ */
+ @Nullable
+ public Date getCreated() {
+ return this.created;
+ }
+
+ /**
+ * @return the name of this snapshot - as displayed in the openstack console
+ */
+ @Nullable
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * @return the description of this snapshot - as displayed in the openstack console
+ */
+ @Nullable
+ public String getDescription() {
+ return this.description;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, volumeId, status, size, created, name, description);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ VolumeSnapshot that = VolumeSnapshot.class.cast(obj);
+ return Objects.equal(this.id, that.id)
+ && Objects.equal(this.volumeId, that.volumeId)
+ && Objects.equal(this.status, that.status)
+ && Objects.equal(this.size, that.size)
+ && Objects.equal(this.created, that.created)
+ && Objects.equal(this.name, that.name)
+ && Objects.equal(this.description, that.description);
+ }
+
+ protected ToStringHelper string() {
+ return Objects.toStringHelper(this)
+ .add("id", id).add("volumeId", volumeId).add("status", status).add("size", size).add("created", created).add("name", name).add("description", description);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeType.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeType.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeType.java
new file mode 100644
index 0000000..43a0aba
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeType.java
@@ -0,0 +1,192 @@
+/*
+ * 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.openstack.nova.v2_0.domain;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.beans.ConstructorProperties;
+import java.util.Date;
+import java.util.Map;
+
+import javax.inject.Named;
+
+import org.jclouds.javax.annotation.Nullable;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableMap;
+
+/**
+ * Volume Type used in the Volume Type Extension for Nova
+ *
+ * @see org.jclouds.openstack.nova.v2_0.extensions.VolumeTypeApi
+*/
+public class VolumeType {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return new ConcreteBuilder().fromVolumeType(this);
+ }
+
+ public abstract static class Builder<T extends Builder<T>> {
+ protected abstract T self();
+
+ protected String id;
+ protected String name;
+ protected Date created;
+ protected Date updated;
+ protected Map<String, String> extraSpecs = ImmutableMap.of();
+
+ /**
+ * @see VolumeType#getId()
+ */
+ public T id(String id) {
+ this.id = id;
+ return self();
+ }
+
+ /**
+ * @see VolumeType#getName()
+ */
+ public T name(String name) {
+ this.name = name;
+ return self();
+ }
+
+ /**
+ * @see VolumeType#getCreated()
+ */
+ public T created(Date created) {
+ this.created = created;
+ return self();
+ }
+
+ /**
+ * @see VolumeType#getUpdated()
+ */
+ public T updated(Date updated) {
+ this.updated = updated;
+ return self();
+ }
+
+ /**
+ * @see VolumeType#getExtraSpecs()
+ */
+ public T extraSpecs(Map<String, String> extraSpecs) {
+ this.extraSpecs = ImmutableMap.copyOf(checkNotNull(extraSpecs, "extraSpecs"));
+ return self();
+ }
+
+ public VolumeType build() {
+ return new VolumeType(id, name, created, updated, extraSpecs);
+ }
+
+ public T fromVolumeType(VolumeType in) {
+ return this
+ .id(in.getId())
+ .name(in.getName())
+ .created(in.getCreated())
+ .updated(in.getUpdated().orNull())
+ .extraSpecs(in.getExtraSpecs());
+ }
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ @Override
+ protected ConcreteBuilder self() {
+ return this;
+ }
+ }
+
+ private final String id;
+ private final String name;
+ @Named("created_at")
+ private final Date created;
+ @Named("updated_at")
+ private final Optional<Date> updated;
+ @Named("extra_specs")
+ private final Map<String, String> extraSpecs;
+
+ @ConstructorProperties({
+ "id", "name", "created_at", "updated_at", "extra_specs"
+ })
+ protected VolumeType(String id, String name, Date created, @Nullable Date updated, Map<String, String> extraSpecs) {
+ this.id = checkNotNull(id, "id");
+ this.name = checkNotNull(name, "name");
+ this.created = checkNotNull(created, "created");
+ this.updated = Optional.fromNullable(updated);
+ this.extraSpecs = ImmutableMap.copyOf(checkNotNull(extraSpecs, "extraSpecs"));
+ }
+
+ public String getId() {
+ return this.id;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * The Date the VolumeType was created
+ */
+ public Date getCreated() {
+ return this.created;
+ }
+
+ /**
+ * The Date the VolumeType as last updated - absent if no updates have taken place
+ */
+ public Optional<Date> getUpdated() {
+ return this.updated;
+ }
+
+ public Map<String, String> getExtraSpecs() {
+ return this.extraSpecs;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, name, created, updated, extraSpecs);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ VolumeType that = VolumeType.class.cast(obj);
+ return Objects.equal(this.id, that.id)
+ && Objects.equal(this.name, that.name)
+ && Objects.equal(this.created, that.created)
+ && Objects.equal(this.updated, that.updated)
+ && Objects.equal(this.extraSpecs, that.extraSpecs);
+ }
+
+ protected ToStringHelper string() {
+ return Objects.toStringHelper(this)
+ .add("id", id).add("name", name).add("created", created).add("updated", updated).add("extraSpecs", extraSpecs);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/AvailabilityZone.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/AvailabilityZone.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/AvailabilityZone.java
new file mode 100644
index 0000000..6946961
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/AvailabilityZone.java
@@ -0,0 +1,73 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.domain.zonescoped;
+
+import com.google.common.base.Objects;
+import com.google.gson.annotations.SerializedName;
+
+import java.beans.ConstructorProperties;
+
+/**
+ * @author Inbar Stolberg
+ */
+public class AvailabilityZone {
+
+ @SerializedName("zoneName")
+ private final String name;
+ private final ZoneState state;
+
+ @ConstructorProperties({"zoneName" , "zoneState"})
+ protected AvailabilityZone(String name, ZoneState state) {
+ this.name = name;
+ this.state = state;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public ZoneState getState() {
+ return state;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(name, state);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this != obj) return false;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ AvailabilityZone that = AvailabilityZone.class.cast(obj);
+ return Objects.equal(this.name, that.name) && Objects.equal(this.state, that.state);
+ }
+
+ protected Objects.ToStringHelper string() {
+ return Objects.toStringHelper(this)
+ .add("name", name)
+ .add("state", state);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/FlavorInZone.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/FlavorInZone.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/FlavorInZone.java
new file mode 100644
index 0000000..5836ac2
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/FlavorInZone.java
@@ -0,0 +1,46 @@
+/*
+ * 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.openstack.nova.v2_0.domain.zonescoped;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.jclouds.openstack.nova.v2_0.domain.Flavor;
+
+/**
+ * @author Adrian Cole
+ */
+public class FlavorInZone extends ZoneAndId {
+ protected final Flavor image;
+
+ public FlavorInZone(Flavor image, String zoneId) {
+ super(zoneId, checkNotNull(image, "image").getId());
+ this.image = image;
+ }
+
+ public Flavor getFlavor() {
+ return image;
+ }
+
+ // superclass hashCode/equals are good enough, and help us use ZoneAndId and FlavorInZone
+ // interchangeably as Map keys
+
+ @Override
+ public String toString() {
+ return "[image=" + image + ", zoneId=" + zoneId + "]";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ImageInZone.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ImageInZone.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ImageInZone.java
new file mode 100644
index 0000000..b7d03f4
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ImageInZone.java
@@ -0,0 +1,46 @@
+/*
+ * 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.openstack.nova.v2_0.domain.zonescoped;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.jclouds.openstack.nova.v2_0.domain.Image;
+
+/**
+ * @author Adrian Cole
+ */
+public class ImageInZone extends ZoneAndId {
+ protected final Image image;
+
+ public ImageInZone(Image image, String zoneId) {
+ super(zoneId, checkNotNull(image, "image").getId());
+ this.image = image;
+ }
+
+ public Image getImage() {
+ return image;
+ }
+
+ // superclass hashCode/equals are good enough, and help us use ZoneAndId and ImageInZone
+ // interchangeably as Map keys
+
+ @Override
+ public String toString() {
+ return "[image=" + image + ", zoneId=" + zoneId + "]";
+ }
+
+}