http://git-wip-us.apache.org/repos/asf/stratos/blob/1d88fdf4/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/SnapshotPolicy.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/SnapshotPolicy.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/SnapshotPolicy.java deleted file mode 100644 index a460247..0000000 --- a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/SnapshotPolicy.java +++ /dev/null @@ -1,217 +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.cloudstack.domain; - -import static com.google.common.base.Preconditions.checkNotNull; - -import java.beans.ConstructorProperties; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.base.MoreObjects; -import com.google.common.base.MoreObjects.ToStringHelper; -import com.google.common.base.Objects; - -/** - * Class SnapshotPolicy - */ -public class SnapshotPolicy { - - public static Builder<?> builder() { - return new ConcreteBuilder(); - } - - public Builder<?> toBuilder() { - return new ConcreteBuilder().fromSnapshotPolicy(this); - } - - public abstract static class Builder<T extends Builder<T>> { - protected abstract T self(); - - protected String id; - protected Snapshot.Interval interval; - protected long numberToRetain; - protected String schedule; - protected String timezone; - protected String volumeId; - - /** - * @see SnapshotPolicy#getId() - */ - public T id(String id) { - this.id = id; - return self(); - } - - /** - * @see SnapshotPolicy#getInterval() - */ - public T interval(Snapshot.Interval interval) { - this.interval = interval; - return self(); - } - - /** - * @see SnapshotPolicy#getNumberToRetain() - */ - public T numberToRetain(long numberToRetain) { - this.numberToRetain = numberToRetain; - return self(); - } - - /** - * @see SnapshotPolicy#getSchedule() - */ - public T schedule(String schedule) { - this.schedule = schedule; - return self(); - } - - /** - * @see SnapshotPolicy#getTimezone() - */ - public T timezone(String timezone) { - this.timezone = timezone; - return self(); - } - - /** - * @see SnapshotPolicy#getVolumeId() - */ - public T volumeId(String volumeId) { - this.volumeId = volumeId; - return self(); - } - - public SnapshotPolicy build() { - return new SnapshotPolicy(id, interval, numberToRetain, schedule, timezone, volumeId); - } - - public T fromSnapshotPolicy(SnapshotPolicy in) { - return this - .id(in.getId()) - .interval(in.getInterval()) - .numberToRetain(in.getNumberToRetain()) - .schedule(in.getSchedule()) - .timezone(in.getTimezone()) - .volumeId(in.getVolumeId()); - } - } - - private static class ConcreteBuilder extends Builder<ConcreteBuilder> { - @Override - protected ConcreteBuilder self() { - return this; - } - } - - private final String id; - private final Snapshot.Interval interval; - private final long numberToRetain; - private final String schedule; - private final String timezone; - private final String volumeId; - - @ConstructorProperties({ - "id", "intervaltype", "maxsnaps", "schedule", "timezone", "volumeid" - }) - protected SnapshotPolicy(String id, @Nullable Snapshot.Interval interval, long numberToRetain, @Nullable String schedule, - @Nullable String timezone, @Nullable String volumeId) { - this.id = checkNotNull(id, "id"); - this.interval = interval; - this.numberToRetain = numberToRetain; - this.schedule = schedule; - this.timezone = timezone; - this.volumeId = volumeId; - } - - /** - * @return the ID of the snapshot policy - */ - public String getId() { - return this.id; - } - - /** - * @return valid types are hourly, daily, weekly, monthly, template, and none. - */ - @Nullable - public Snapshot.Interval getInterval() { - return this.interval; - } - - /** - * @return maximum number of snapshots retained - */ - public long getNumberToRetain() { - return this.numberToRetain; - } - - /** - * @return time the snapshot is scheduled to be taken. - */ - @Nullable - public String getSchedule() { - return this.schedule; - } - - /** - * @return the time zone of the snapshot policy - */ - @Nullable - public String getTimezone() { - return this.timezone; - } - - /** - * @return ID of the disk volume - */ - @Nullable - public String getVolumeId() { - return this.volumeId; - } - - @Override - public int hashCode() { - return Objects.hashCode(id, interval, numberToRetain, schedule, timezone, volumeId); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) return true; - if (obj == null || getClass() != obj.getClass()) return false; - SnapshotPolicy that = SnapshotPolicy.class.cast(obj); - return Objects.equal(this.id, that.id) - && Objects.equal(this.interval, that.interval) - && Objects.equal(this.numberToRetain, that.numberToRetain) - && Objects.equal(this.schedule, that.schedule) - && Objects.equal(this.timezone, that.timezone) - && Objects.equal(this.volumeId, that.volumeId); - } - - protected ToStringHelper string() { - return MoreObjects.toStringHelper(this) - .add("id", id).add("interval", interval).add("numberToRetain", numberToRetain).add("schedule", schedule).add("timezone", timezone) - .add("volumeId", volumeId); - } - - @Override - public String toString() { - return string().toString(); - } - -}
http://git-wip-us.apache.org/repos/asf/stratos/blob/1d88fdf4/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/SnapshotPolicySchedule.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/SnapshotPolicySchedule.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/SnapshotPolicySchedule.java deleted file mode 100644 index 888eaf6..0000000 --- a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/SnapshotPolicySchedule.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.cloudstack.domain; - -import java.beans.ConstructorProperties; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.base.MoreObjects; -import com.google.common.base.MoreObjects.ToStringHelper; -import com.google.common.base.Objects; - -/** - * Describes the schedule of a snapshot policy. - * - * @see org.jclouds.cloudstack.util.SnapshotPolicySchedules - */ -public class SnapshotPolicySchedule { - - public static Builder<?> builder() { - return new ConcreteBuilder(); - } - - public Builder<?> toBuilder() { - return new ConcreteBuilder().fromSnapshotPolicySchedule(this); - } - - public abstract static class Builder<T extends Builder<T>> { - protected abstract T self(); - - protected Snapshot.Interval interval; - protected String time; - - /** - * @see SnapshotPolicySchedule#getInterval() - */ - public T interval(Snapshot.Interval interval) { - this.interval = interval; - return self(); - } - - /** - * @see SnapshotPolicySchedule#getTime() - */ - public T time(String time) { - this.time = time; - return self(); - } - - public SnapshotPolicySchedule build() { - return new SnapshotPolicySchedule(interval, time); - } - - public T fromSnapshotPolicySchedule(SnapshotPolicySchedule in) { - return this - .interval(in.getInterval()) - .time(in.getTime()); - } - } - - private static class ConcreteBuilder extends Builder<ConcreteBuilder> { - @Override - protected ConcreteBuilder self() { - return this; - } - } - - private final Snapshot.Interval interval; - private final String time; - - @ConstructorProperties({ - "interval", "time" - }) - protected SnapshotPolicySchedule(@Nullable Snapshot.Interval interval, @Nullable String time) { - this.interval = interval; - this.time = time; - } - - @Nullable - public Snapshot.Interval getInterval() { - return this.interval; - } - - @Nullable - public String getTime() { - return this.time; - } - - @Override - public int hashCode() { - return Objects.hashCode(interval, time); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) return true; - if (obj == null || getClass() != obj.getClass()) return false; - SnapshotPolicySchedule that = SnapshotPolicySchedule.class.cast(obj); - return Objects.equal(this.interval, that.interval) - && Objects.equal(this.time, that.time); - } - - protected ToStringHelper string() { - return MoreObjects.toStringHelper(this) - .add("interval", interval).add("time", time); - } - - @Override - public String toString() { - return string().toString(); - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/1d88fdf4/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/SshKeyPair.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/SshKeyPair.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/SshKeyPair.java deleted file mode 100644 index 9eaaac9..0000000 --- a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/SshKeyPair.java +++ /dev/null @@ -1,144 +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.cloudstack.domain; - -import static com.google.common.base.Preconditions.checkNotNull; - -import java.beans.ConstructorProperties; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.base.MoreObjects; -import com.google.common.base.MoreObjects.ToStringHelper; -import com.google.common.base.Objects; - -/** - * Class SshKeyPair - */ -public class SshKeyPair { - - public static Builder<?> builder() { - return new ConcreteBuilder(); - } - - public Builder<?> toBuilder() { - return new ConcreteBuilder().fromSshKeyPair(this); - } - - public abstract static class Builder<T extends Builder<T>> { - protected abstract T self(); - - protected String fingerprint; - protected String name; - protected String privateKey; - - /** - * @see SshKeyPair#getFingerprint() - */ - public T fingerprint(String fingerprint) { - this.fingerprint = fingerprint; - return self(); - } - - /** - * @see SshKeyPair#getName() - */ - public T name(String name) { - this.name = name; - return self(); - } - - /** - * @see SshKeyPair#getPrivateKey() - */ - public T privateKey(String privateKey) { - this.privateKey = privateKey; - return self(); - } - - public SshKeyPair build() { - return new SshKeyPair(fingerprint, name, privateKey); - } - - public T fromSshKeyPair(SshKeyPair in) { - return this - .fingerprint(in.getFingerprint()) - .name(in.getName()) - .privateKey(in.getPrivateKey()); - } - } - - private static class ConcreteBuilder extends Builder<ConcreteBuilder> { - @Override - protected ConcreteBuilder self() { - return this; - } - } - - private final String fingerprint; - private final String name; - private final String privateKey; - - @ConstructorProperties({ - "fingerprint", "name", "privatekey" - }) - protected SshKeyPair(@Nullable String fingerprint, String name, @Nullable String privateKey) { - this.fingerprint = fingerprint; - this.name = checkNotNull(name, "name"); - this.privateKey = privateKey; - } - - @Nullable - public String getFingerprint() { - return this.fingerprint; - } - - public String getName() { - return this.name; - } - - @Nullable - public String getPrivateKey() { - return this.privateKey; - } - - @Override - public int hashCode() { - return Objects.hashCode(fingerprint, name, privateKey); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) return true; - if (obj == null || getClass() != obj.getClass()) return false; - SshKeyPair that = SshKeyPair.class.cast(obj); - return Objects.equal(this.fingerprint, that.fingerprint) - && Objects.equal(this.name, that.name) - && Objects.equal(this.privateKey, that.privateKey); - } - - protected ToStringHelper string() { - return MoreObjects.toStringHelper(this) - .add("fingerprint", fingerprint).add("name", name).add("privateKey", privateKey); - } - - @Override - public String toString() { - return string().toString(); - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/1d88fdf4/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/StoragePool.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/StoragePool.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/StoragePool.java deleted file mode 100644 index c134e70..0000000 --- a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/StoragePool.java +++ /dev/null @@ -1,483 +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.cloudstack.domain; - -import static com.google.common.base.Preconditions.checkNotNull; - -import java.beans.ConstructorProperties; -import java.util.Date; -import java.util.Set; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.base.CaseFormat; -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; - -/** - * Represents a storage pool in CloudStack - */ -public class StoragePool implements Comparable<StoragePool> { - - public enum State { - UP, - PREPARE_FOR_MAINTENANCE, - ERROR_IN_MAINTENANCE, - CANCEL_MAINTENANCE, - MAINTENANCE, - REMOVED, - UNRECOGNIZED; - - @Override - public String toString() { - return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name()); - } - - public static State fromValue(String type) { - try { - return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type"))); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - - public enum Type { - FILESYSTEM, - NETWORK_FILESYSTEM, - ISCSI_LUN, - ISCSI, - ISO, - LVM, - CLVM, - SHARED_MOUNT_POINT, - VMFS, - PRE_SETUP, - EXT, - OCFS2, - UNRECOGNIZED; - - @Override - public String toString() { - return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name()); - } - - public static Type fromValue(String type) { - try { - return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type"))); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - - public static Builder<?> builder() { - return new ConcreteBuilder(); - } - - public Builder<?> toBuilder() { - return new ConcreteBuilder().fromStoragePool(this); - } - - public abstract static class Builder<T extends Builder<T>> { - protected abstract T self(); - - protected String id; - protected String name; - protected String path; - protected ImmutableSet.Builder<String> tags = ImmutableSet.<String>builder(); - protected StoragePool.State state; - protected StoragePool.Type type; - protected String zoneId; - protected String zoneName; - protected String podId; - protected String podName; - protected String clusterId; - protected String clusterName; - protected Date created; - protected long diskSizeAllocated; - protected long diskSizeTotal; - protected String ipAddress; - protected String jobId; - protected String jobStatus; - - /** - * @see StoragePool#getId() - */ - public T id(String id) { - this.id = id; - return self(); - } - - /** - * @see StoragePool#getName() - */ - public T name(String name) { - this.name = name; - return self(); - } - - /** - * @see StoragePool#getPath() - */ - public T path(String path) { - this.path = path; - return self(); - } - - /** - * @see DiskOffering#getTags() - */ - public T tags(Iterable<String> tags) { - this.tags = ImmutableSet.<String>builder().addAll(tags); - return self(); - } - - /** - * @see DiskOffering#getTags() - */ - public T tag(String tag) { - this.tags.add(tag); - return self(); - } - - /** - * @see StoragePool#getState() - */ - public T state(StoragePool.State state) { - this.state = state; - return self(); - } - - /** - * @see StoragePool#getType() - */ - public T type(StoragePool.Type type) { - this.type = type; - return self(); - } - - /** - * @see StoragePool#getZoneId() - */ - public T zoneId(String zoneId) { - this.zoneId = zoneId; - return self(); - } - - /** - * @see StoragePool#getZoneName() - */ - public T zoneName(String zoneName) { - this.zoneName = zoneName; - return self(); - } - - /** - * @see StoragePool#getPodId() - */ - public T podId(String podId) { - this.podId = podId; - return self(); - } - - /** - * @see StoragePool#getPodName() - */ - public T podName(String podName) { - this.podName = podName; - return self(); - } - - /** - * @see StoragePool#getClusterId() - */ - public T clusterId(String clusterId) { - this.clusterId = clusterId; - return self(); - } - - /** - * @see StoragePool#getClusterName() - */ - public T clusterName(String clusterName) { - this.clusterName = clusterName; - return self(); - } - - /** - * @see StoragePool#getCreated() - */ - public T created(Date created) { - this.created = created; - return self(); - } - - /** - * @see StoragePool#getDiskSizeAllocated() - */ - public T diskSizeAllocated(long diskSizeAllocated) { - this.diskSizeAllocated = diskSizeAllocated; - return self(); - } - - /** - * @see StoragePool#getDiskSizeTotal() - */ - public T diskSizeTotal(long diskSizeTotal) { - this.diskSizeTotal = diskSizeTotal; - return self(); - } - - /** - * @see StoragePool#getIpAddress() - */ - public T ipAddress(String ipAddress) { - this.ipAddress = ipAddress; - return self(); - } - - /** - * @see StoragePool#getJobId() - */ - public T jobId(String jobId) { - this.jobId = jobId; - return self(); - } - - /** - * @see StoragePool#getJobStatus() - */ - public T jobStatus(String jobStatus) { - this.jobStatus = jobStatus; - return self(); - } - - public StoragePool build() { - return new StoragePool(id, name, path, tags.build(), state, type, zoneId, zoneName, podId, podName, clusterId, clusterName, created, diskSizeAllocated, diskSizeTotal, ipAddress, jobId, jobStatus); - } - - public T fromStoragePool(StoragePool in) { - return this - .id(in.getId()) - .name(in.getName()) - .path(in.getPath()) - .tags(in.getTags()) - .state(in.getState()) - .type(in.getType()) - .zoneId(in.getZoneId()) - .zoneName(in.getZoneName()) - .podId(in.getPodId()) - .podName(in.getPodName()) - .clusterId(in.getClusterId()) - .clusterName(in.getClusterName()) - .created(in.getCreated()) - .diskSizeAllocated(in.getDiskSizeAllocated()) - .diskSizeTotal(in.getDiskSizeTotal()) - .ipAddress(in.getIpAddress()) - .jobId(in.getJobId()) - .jobStatus(in.getJobStatus()); - } - } - - private static class ConcreteBuilder extends Builder<ConcreteBuilder> { - @Override - protected ConcreteBuilder self() { - return this; - } - } - - private final String id; - private final String name; - private final String path; - private final Set<String> tags; - private final StoragePool.State state; - private final StoragePool.Type type; - private final String zoneId; - private final String zoneName; - private final String podId; - private final String podName; - private final String clusterId; - private final String clusterName; - private final Date created; - private final long diskSizeAllocated; - private final long diskSizeTotal; - private final String ipAddress; - private final String jobId; - private final String jobStatus; - - @ConstructorProperties({ - "id", "name", "path", "tags", "state", "type", "zoneid", "zonename", "podid", "podname", "clusterid", "clustername", "created", "disksizeallocated", "disksizetotal", "ipaddress", "jobid", "jobstatus" - }) - protected StoragePool(String id, @Nullable String name, @Nullable String path, @Nullable Iterable<String> tags, - @Nullable StoragePool.State state, @Nullable StoragePool.Type type, @Nullable String zoneId, - @Nullable String zoneName, @Nullable String podId, @Nullable String podName, @Nullable String clusterId, - @Nullable String clusterName, @Nullable Date created, long diskSizeAllocated, long diskSizeTotal, - @Nullable String ipAddress, @Nullable String jobId, @Nullable String jobStatus) { - this.id = checkNotNull(id, "id"); - this.name = name; - this.path = path; - this.tags = tags != null ? ImmutableSet.copyOf(tags) : ImmutableSet.<String> of(); - this.state = state; - this.type = type; - this.zoneId = zoneId; - this.zoneName = zoneName; - this.podId = podId; - this.podName = podName; - this.clusterId = clusterId; - this.clusterName = clusterName; - this.created = created; - this.diskSizeAllocated = diskSizeAllocated; - this.diskSizeTotal = diskSizeTotal; - this.ipAddress = ipAddress; - this.jobId = jobId; - this.jobStatus = jobStatus; - } - - public String getId() { - return this.id; - } - - @Nullable - public String getName() { - return this.name; - } - - @Nullable - public String getPath() { - return this.path; - } - - public Set<String> getTags() { - return this.tags; - } - - @Nullable - public StoragePool.State getState() { - return this.state; - } - - @Nullable - public StoragePool.Type getType() { - return this.type; - } - - @Nullable - public String getZoneId() { - return this.zoneId; - } - - @Nullable - public String getZoneName() { - return this.zoneName; - } - - @Nullable - public String getPodId() { - return this.podId; - } - - @Nullable - public String getPodName() { - return this.podName; - } - - @Nullable - public String getClusterId() { - return this.clusterId; - } - - @Nullable - public String getClusterName() { - return this.clusterName; - } - - @Nullable - public Date getCreated() { - return this.created; - } - - public long getDiskSizeAllocated() { - return this.diskSizeAllocated; - } - - public long getDiskSizeTotal() { - return this.diskSizeTotal; - } - - @Nullable - public String getIpAddress() { - return this.ipAddress; - } - - @Nullable - public String getJobId() { - return this.jobId; - } - - @Nullable - public String getJobStatus() { - return this.jobStatus; - } - - @Override - public int hashCode() { - return Objects.hashCode(id, name, path, tags, state, type, zoneId, zoneName, podId, podName, clusterId, clusterName, created, diskSizeAllocated, diskSizeTotal, ipAddress, jobId, jobStatus); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) return true; - if (obj == null || getClass() != obj.getClass()) return false; - StoragePool that = StoragePool.class.cast(obj); - return Objects.equal(this.id, that.id) - && Objects.equal(this.name, that.name) - && Objects.equal(this.path, that.path) - && Objects.equal(this.tags, that.tags) - && Objects.equal(this.state, that.state) - && Objects.equal(this.type, that.type) - && Objects.equal(this.zoneId, that.zoneId) - && Objects.equal(this.zoneName, that.zoneName) - && Objects.equal(this.podId, that.podId) - && Objects.equal(this.podName, that.podName) - && Objects.equal(this.clusterId, that.clusterId) - && Objects.equal(this.clusterName, that.clusterName) - && Objects.equal(this.created, that.created) - && Objects.equal(this.diskSizeAllocated, that.diskSizeAllocated) - && Objects.equal(this.diskSizeTotal, that.diskSizeTotal) - && Objects.equal(this.ipAddress, that.ipAddress) - && Objects.equal(this.jobId, that.jobId) - && Objects.equal(this.jobStatus, that.jobStatus); - } - - protected ToStringHelper string() { - return MoreObjects.toStringHelper(this) - .add("id", id).add("name", name).add("path", path).add("tags", tags).add("state", state).add("type", type).add("zoneId", zoneId).add("zoneName", zoneName).add("podId", podId).add("podName", podName).add("clusterId", clusterId).add("clusterName", clusterName).add("created", created).add("diskSizeAllocated", diskSizeAllocated).add("diskSizeTotal", diskSizeTotal).add("ipAddress", ipAddress).add("jobId", jobId).add("jobStatus", jobStatus); - } - - @Override - public String toString() { - return string().toString(); - } - - @Override - public int compareTo(StoragePool other) { - return this.id.compareTo(other.id); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/1d88fdf4/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/StorageType.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/StorageType.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/StorageType.java deleted file mode 100644 index 5eb622b..0000000 --- a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/StorageType.java +++ /dev/null @@ -1,45 +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.cloudstack.domain; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.CaseFormat; - -/** - * @see OfferingApi#listServiceOfferings - */ -public enum StorageType { - LOCAL, - - SHARED, - - UNRECOGNIZED; - - @Override - public String toString() { - return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name()); - } - - public static StorageType fromValue(String type) { - try { - return valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type"))); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/1d88fdf4/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/SystemVmType.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/SystemVmType.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/SystemVmType.java deleted file mode 100644 index 465e12a..0000000 --- a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/SystemVmType.java +++ /dev/null @@ -1,44 +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.cloudstack.domain; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.CaseFormat; - -public enum SystemVmType { - DOMAIN_ROUTER, - - CONSOLE_PROXY, - - SECONDARY_STORAGE_VM, - - UNRECOGNIZED; - - @Override - public String toString() { - return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name()).toLowerCase(); - } - - public static SystemVmType fromValue(String type) { - try { - return valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type"))); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/1d88fdf4/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/Template.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/Template.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/Template.java deleted file mode 100644 index 8019579..0000000 --- a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/Template.java +++ /dev/null @@ -1,869 +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.cloudstack.domain; - -import static com.google.common.base.Preconditions.checkNotNull; - -import java.beans.ConstructorProperties; -import java.util.Date; - -import com.google.common.base.Strings; -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.base.MoreObjects; -import com.google.common.base.MoreObjects.ToStringHelper; -import com.google.common.base.Objects; - -public class Template implements Comparable<Template> { - public enum Status { - - /** - * status of download is not known. Example - When the job for downloading doesn't exist - * during progress check. - */ - UNKNOWN, - /** - * the download has been cancelled/aborted. - */ - ABANDONED, - /** - * the download has reached an error state. Example - there is not route to ssvm agent - */ - DOWNLOAD_ERROR, - /** - * the download hasn't started. - */ - NOT_DOWNLOADED, - /** - * the download is in progress - */ - DOWNLOAD_IN_PROGRESS, - /** - * the resource has been downloaded on secondary storage. - */ - DOWNLOADED, - - // These states are specifically used for extraction of resources out of CS(ironically shown - // as download template in the UI, API - extractTemplate ). Some of the generic states (like - // abandoned, unknown) above are used for the extraction tasks as well. - - /** - * the resource has been uploaded - */ - UPLOADED, - /** - * the resource upload work hasn't started yet - */ - NOT_UPLOADED, - /** - * the resource upload has reached error. - */ - UPLOAD_ERROR, - /** - * the resource upload is in progress. - */ - UPLOAD_IN_PROGRESS, UNRECOGNIZED; - - public static Status fromValue(String state) { - // Statuses are in free text form. These are the ones in CloudStack 3.0.4 source - // https://github.com/CloudStack/CloudStack/blob/e2e76c70ec51bfb35d755371f6c33856cef8a277/server/src/com/cloud/api/ApiResponseHelper.java#L1968 - if (Strings.isNullOrEmpty(state)) { return UNKNOWN; } - else if (state.equals("Processing")) { return DOWNLOAD_IN_PROGRESS; } - else if (state.endsWith("% Downloaded")) { return DOWNLOAD_IN_PROGRESS; } - else if (state.equals("Installing Template")) { return DOWNLOAD_IN_PROGRESS; } - else if (state.equals("Installing ISO")) { return DOWNLOAD_IN_PROGRESS; } - else if (state.equals("Download Complete")) { return DOWNLOADED; } - try { - return valueOf(checkNotNull(state, "state")); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - - } - - public static enum Type { - - USER, BUILTIN, UNRECOGNIZED; - - //TODO do we need camel case routines (e.g. see enums in VirtualMachine) ? - public static Type fromValue(String type) { - try { - return valueOf(checkNotNull(type, "type")); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - - public enum Format { - - VHD, QCOW2, OVA, UNRECOGNIZED; - - public static Format fromValue(String format) { - try { - return valueOf(checkNotNull(format, "format")); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - - public static Builder<?> builder() { - return new ConcreteBuilder(); - } - - public Builder<?> toBuilder() { - return new ConcreteBuilder().fromTemplate(this); - } - - public abstract static class Builder<T extends Builder<T>> { - protected abstract T self(); - - protected String id; - protected String displayText; - protected String domain; - protected String domainId; - protected String account; - protected String accountId; - protected String zone; - protected String zoneId; - protected String OSType; - protected String OSTypeId; - protected String name; - protected Template.Type type; - protected Template.Status status; - protected Template.Format format; - protected String hypervisor; - protected Long size; - protected Date created; - protected Date removed; - protected boolean crossZones; - protected boolean bootable; - protected boolean extractable; - protected boolean featured; - protected boolean isPublic; - protected boolean ready; - protected boolean passwordEnabled; - protected String jobId; - protected String jobStatus; - protected String checksum; - protected String hostId; - protected String hostName; - protected String sourceTemplateId; - protected String templateTag; - - /** - * @see Template#getId() - */ - public T id(String id) { - this.id = id; - return self(); - } - - /** - * @see Template#getDisplayText() - */ - public T displayText(String displayText) { - this.displayText = displayText; - return self(); - } - - /** - * @see Template#getDomain() - */ - public T domain(String domain) { - this.domain = domain; - return self(); - } - - /** - * @see Template#getDomainId() - */ - public T domainId(String domainId) { - this.domainId = domainId; - return self(); - } - - /** - * @see Template#getAccount() - */ - public T account(String account) { - this.account = account; - return self(); - } - - /** - * @see Template#getAccountId() - */ - public T accountId(String accountId) { - this.accountId = accountId; - return self(); - } - - /** - * @see Template#getZone() - */ - public T zone(String zone) { - this.zone = zone; - return self(); - } - - /** - * @see Template#getZoneId() - */ - public T zoneId(String zoneId) { - this.zoneId = zoneId; - return self(); - } - - /** - * @see Template#getOSType() - */ - public T OSType(String OSType) { - this.OSType = OSType; - return self(); - } - - /** - * @see Template#getOSTypeId() - */ - public T OSTypeId(String OSTypeId) { - this.OSTypeId = OSTypeId; - return self(); - } - - /** - * @see Template#getName() - */ - public T name(String name) { - this.name = name; - return self(); - } - - /** - * @see Template#getType() - */ - public T type(Template.Type type) { - this.type = type; - return self(); - } - - /** - * @see Template#getStatus() - */ - public T status(Template.Status status) { - this.status = status; - return self(); - } - - /** - * @see Template#getFormat() - */ - public T format(Template.Format format) { - this.format = format; - return self(); - } - - /** - * @see Template#getHypervisor() - */ - public T hypervisor(String hypervisor) { - this.hypervisor = hypervisor; - return self(); - } - - /** - * @see Template#getSize() - */ - public T size(Long size) { - this.size = size; - return self(); - } - - /** - * @see Template#getCreated() - */ - public T created(Date created) { - this.created = created; - return self(); - } - - /** - * @see Template#getRemoved() - */ - public T removed(Date removed) { - this.removed = removed; - return self(); - } - - /** - * @see Template#isCrossZones() - */ - public T crossZones(boolean crossZones) { - this.crossZones = crossZones; - return self(); - } - - /** - * @see Template#isBootable() - */ - public T bootable(boolean bootable) { - this.bootable = bootable; - return self(); - } - - /** - * @see Template#isExtractable() - */ - public T extractable(boolean extractable) { - this.extractable = extractable; - return self(); - } - - /** - * @see Template#isFeatured() - */ - public T featured(boolean featured) { - this.featured = featured; - return self(); - } - - /** - * @see Template#ispublic() - */ - public T isPublic(boolean isPublic) { - this.isPublic = isPublic; - return self(); - } - - /** - * @see Template#isReady() - */ - public T ready(boolean ready) { - this.ready = ready; - return self(); - } - - /** - * @see Template#isPasswordEnabled() - */ - public T passwordEnabled(boolean passwordEnabled) { - this.passwordEnabled = passwordEnabled; - return self(); - } - - /** - * @see Template#getJobId() - */ - public T jobId(String jobId) { - this.jobId = jobId; - return self(); - } - - /** - * @see Template#getJobStatus() - */ - public T jobStatus(String jobStatus) { - this.jobStatus = jobStatus; - return self(); - } - - /** - * @see Template#getChecksum() - */ - public T checksum(String checksum) { - this.checksum = checksum; - return self(); - } - - /** - * @see Template#getHostId() - */ - public T hostId(String hostId) { - this.hostId = hostId; - return self(); - } - - /** - * @see Template#getHostName() - */ - public T hostName(String hostName) { - this.hostName = hostName; - return self(); - } - - /** - * @see Template#getSourceTemplateId() - */ - public T sourceTemplateId(String sourceTemplateId) { - this.sourceTemplateId = sourceTemplateId; - return self(); - } - - /** - * @see Template#getTemplateTag() - */ - public T templateTag(String templateTag) { - this.templateTag = templateTag; - return self(); - } - - public Template build() { - return new Template(id, displayText, domain, domainId, account, accountId, zone, zoneId, OSType, OSTypeId, name, type, status, format, hypervisor, size, created, removed, crossZones, bootable, extractable, featured, isPublic, ready, passwordEnabled, jobId, jobStatus, checksum, hostId, hostName, sourceTemplateId, templateTag); - } - - public T fromTemplate(Template in) { - return this - .id(in.getId()) - .displayText(in.getDisplayText()) - .domain(in.getDomain()) - .domainId(in.getDomainId()) - .account(in.getAccount()) - .accountId(in.getAccountId()) - .zone(in.getZone()) - .zoneId(in.getZoneId()) - .OSType(in.getOSType()) - .OSTypeId(in.getOSTypeId()) - .name(in.getName()) - .type(in.getType()) - .status(in.getStatus()) - .format(in.getFormat()) - .hypervisor(in.getHypervisor()) - .size(in.getSize()) - .created(in.getCreated()) - .removed(in.getRemoved()) - .crossZones(in.isCrossZones()) - .bootable(in.isBootable()) - .extractable(in.isExtractable()) - .featured(in.isFeatured()) - .isPublic(in.ispublic()) - .ready(in.isReady()) - .passwordEnabled(in.isPasswordEnabled()) - .jobId(in.getJobId()) - .jobStatus(in.getJobStatus()) - .checksum(in.getChecksum()) - .hostId(in.getHostId()) - .hostName(in.getHostName()) - .sourceTemplateId(in.getSourceTemplateId()) - .templateTag(in.getTemplateTag()); - } - } - - private static class ConcreteBuilder extends Builder<ConcreteBuilder> { - @Override - protected ConcreteBuilder self() { - return this; - } - } - - private final String id; - private final String displayText; - private final String domain; - private final String domainId; - private final String account; - private final String accountId; - private final String zone; - private final String zoneId; - private final String OSType; - private final String OSTypeId; - private final String name; - private final Template.Type type; - private final Template.Status status; - private final Template.Format format; - private final String hypervisor; - private final Long size; - private final Date created; - private final Date removed; - private final boolean crossZones; - private final boolean bootable; - private final boolean extractable; - private final boolean featured; - private final boolean ispublic; - private final boolean ready; - private final boolean passwordEnabled; - private final String jobId; - private final String jobStatus; - private final String checksum; - private final String hostId; - private final String hostName; - private final String sourceTemplateId; - private final String templateTag; - - @ConstructorProperties({ - "id", "displaytext", "domain", "domainid", "account", "accountid", "zonename", "zoneid", "ostypename", "ostypeid", - "name", "templatetype", "status", "format", "hypervisor", "size", "created", "removed", "crossZones", "bootable", - "isextractable", "isfeatured", "ispublic", "isready", "passwordenabled", "jobid", "jobstatus", "checksum", "hostId", - "hostname", "sourcetemplateid", "templatetag" - }) - protected Template(String id, @Nullable String displayText, @Nullable String domain, @Nullable String domainId, - @Nullable String account, @Nullable String accountId, @Nullable String zone, @Nullable String zoneId, - @Nullable String OSType, @Nullable String OSTypeId, @Nullable String name, @Nullable Template.Type type, - @Nullable Template.Status status, @Nullable Template.Format format, @Nullable String hypervisor, - @Nullable Long size, @Nullable Date created, @Nullable Date removed, boolean crossZones, - boolean bootable, boolean extractable, boolean featured, boolean ispublic, boolean ready, boolean passwordEnabled, - @Nullable String jobId, @Nullable String jobStatus, @Nullable String checksum, @Nullable String hostId, - @Nullable String hostName, @Nullable String sourceTemplateId, @Nullable String templateTag) { - this.id = checkNotNull(id, "id"); - this.displayText = displayText; - this.domain = domain; - this.domainId = domainId; - this.account = account; - this.accountId = accountId; - this.zone = zone; - this.zoneId = zoneId; - this.OSType = OSType; - this.OSTypeId = OSTypeId; - this.name = name; - this.type = type; - this.status = status; - this.format = format; - this.hypervisor = hypervisor; - this.size = size; - this.created = created; - this.removed = removed; - this.crossZones = crossZones; - this.bootable = bootable; - this.extractable = extractable; - this.featured = featured; - this.ispublic = ispublic; - this.ready = ready; - this.passwordEnabled = passwordEnabled; - this.jobId = jobId; - this.jobStatus = jobStatus; - this.checksum = checksum; - this.hostId = hostId; - this.hostName = hostName; - this.sourceTemplateId = sourceTemplateId; - this.templateTag = templateTag; - } - - /** - * @return Template id - */ - public String getId() { - return this.id; - } - - /** - * @return the display text of the template - */ - @Nullable - public String getDisplayText() { - return this.displayText; - } - - /** - * @return the name of the domain to which the template beLongs - */ - @Nullable - public String getDomain() { - return this.domain; - } - - /** - * @return the ID of the domain to which the template beLongs - */ - @Nullable - public String getDomainId() { - return this.domainId; - } - - /** - * @return the name of the account to which the template beLongs - */ - @Nullable - public String getAccount() { - return this.account; - } - - /** - * @return the ID of the account to which the template beLongs - */ - @Nullable - public String getAccountId() { - return this.accountId; - } - - /** - * @return the name of the zone to which the template beLongs - */ - @Nullable - public String getZone() { - return this.zone; - } - - /** - * @return the ID of the zone to which the template beLongs - */ - @Nullable - public String getZoneId() { - return this.zoneId; - } - - /** - * @return the name of the OS type to which the template beLongs - */ - @Nullable - public String getOSType() { - return this.OSType; - } - - /** - * @return the ID of the OS type to which the template beLongs - */ - @Nullable - public String getOSTypeId() { - return this.OSTypeId; - } - - /** - * @return Template name - */ - @Nullable - public String getName() { - return this.name; - } - - /** - * @return the type of the template - */ - @Nullable - public Template.Type getType() { - return this.type; - } - - /** - * Retrieve the status of the template. - * - * <p>Note that in CloudStack 2.2.x through to at least 3.0.4, the possible status values are - * not well defined by CloudStack. CloudStack returns a plain-text English string for UI - * display, which jclouds attempts to parse into an enumeration, but the mapping is incomplete. - * This method should be reliable for the common cases, but it is possible (particularly for - * error statuses) that this method will return UNRECOGNIZED.</p> - * - * @return status of the template - */ - @Nullable - public Template.Status getStatus() { - return this.status; - } - - /** - * @return the format of the template. - */ - @Nullable - public Template.Format getFormat() { - return this.format; - } - - /** - * @return the hypervisor on which the template runs - */ - @Nullable - public String getHypervisor() { - return this.hypervisor; - } - - /** - * @return the size of the template in kilobytes - */ - @Nullable - public Long getSize() { - return this.size; - } - - /** - * @return the date this template was created - */ - @Nullable - public Date getCreated() { - return this.created; - } - - /** - * @return the date this template was removed - */ - @Nullable - public Date getRemoved() { - return this.removed; - } - - /** - * @return true if the template is managed across all Zones, false otherwise - */ - public boolean isCrossZones() { - return this.crossZones; - } - - /** - * @return true if the ISO is bootable, false otherwise - */ - public boolean isBootable() { - return this.bootable; - } - - /** - * @return true if the template is extractable, false otherwise - */ - public boolean isExtractable() { - return this.extractable; - } - - /** - * @return true if this template is a featured template, false otherwise - */ - public boolean isFeatured() { - return this.featured; - } - - public boolean ispublic() { - return this.ispublic; - } - - /** - * @return true if the template is ready to be deployed from, false otherwise - */ - public boolean isReady() { - return this.ready; - } - - /** - * @return true if the reset password feature is enabled, false otherwise - */ - public boolean isPasswordEnabled() { - return this.passwordEnabled; - } - - /** - * @return shows the current pending asynchronous job ID, or null if current - * pending jobs are acting on the template - */ - @Nullable - public String getJobId() { - return this.jobId; - } - - /** - * @return shows the current pending asynchronous job status - */ - @Nullable - public String getJobStatus() { - return this.jobStatus; - } - - /** - * @return checksum of the template - */ - @Nullable - public String getChecksum() { - return this.checksum; - } - - /** - * @return the ID of the secondary storage host for the template - */ - @Nullable - public String getHostId() { - return this.hostId; - } - - /** - * @return the name of the secondary storage host for the template - */ - @Nullable - public String getHostName() { - return this.hostName; - } - - /** - * @return the template ID of the parent template if present - */ - @Nullable - public String getSourceTemplateId() { - return this.sourceTemplateId; - } - - /** - * @return the tag of this template - */ - @Nullable - public String getTemplateTag() { - return this.templateTag; - } - - @Override - public int hashCode() { - return Objects.hashCode(id, displayText, domain, domainId, account, accountId, zone, zoneId, OSType, OSTypeId, name, type, status, format, hypervisor, size, created, removed, crossZones, bootable, extractable, featured, ispublic, ready, passwordEnabled, jobId, jobStatus, checksum, hostId, hostName, sourceTemplateId, templateTag); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) return true; - if (obj == null || getClass() != obj.getClass()) return false; - Template that = Template.class.cast(obj); - return Objects.equal(this.id, that.id) - && Objects.equal(this.displayText, that.displayText) - && Objects.equal(this.domain, that.domain) - && Objects.equal(this.domainId, that.domainId) - && Objects.equal(this.account, that.account) - && Objects.equal(this.accountId, that.accountId) - && Objects.equal(this.zone, that.zone) - && Objects.equal(this.zoneId, that.zoneId) - && Objects.equal(this.OSType, that.OSType) - && Objects.equal(this.OSTypeId, that.OSTypeId) - && Objects.equal(this.name, that.name) - && Objects.equal(this.type, that.type) - && Objects.equal(this.status, that.status) - && Objects.equal(this.format, that.format) - && Objects.equal(this.hypervisor, that.hypervisor) - && Objects.equal(this.size, that.size) - && Objects.equal(this.created, that.created) - && Objects.equal(this.removed, that.removed) - && Objects.equal(this.crossZones, that.crossZones) - && Objects.equal(this.bootable, that.bootable) - && Objects.equal(this.extractable, that.extractable) - && Objects.equal(this.featured, that.featured) - && Objects.equal(this.ispublic, that.ispublic) - && Objects.equal(this.ready, that.ready) - && Objects.equal(this.passwordEnabled, that.passwordEnabled) - && Objects.equal(this.jobId, that.jobId) - && Objects.equal(this.jobStatus, that.jobStatus) - && Objects.equal(this.checksum, that.checksum) - && Objects.equal(this.hostId, that.hostId) - && Objects.equal(this.hostName, that.hostName) - && Objects.equal(this.sourceTemplateId, that.sourceTemplateId) - && Objects.equal(this.templateTag, that.templateTag); - } - - protected ToStringHelper string() { - return MoreObjects.toStringHelper(this) - .add("id", id).add("displayText", displayText).add("domain", domain).add("domainId", domainId).add("account", account).add("accountId", accountId).add("zone", zone).add("zoneId", zoneId).add("OSType", OSType).add("OSTypeId", OSTypeId).add("name", name).add("type", type).add("status", status).add("format", format).add("hypervisor", hypervisor).add("size", size).add("created", created).add("removed", removed).add("crossZones", crossZones).add("bootable", bootable).add("extractable", extractable).add("featured", featured).add("ispublic", ispublic).add("ready", ready).add("passwordEnabled", passwordEnabled).add("jobId", jobId).add("jobStatus", jobStatus).add("checksum", checksum).add("hostId", hostId).add("hostName", hostName).add("sourceTemplateId", sourceTemplateId).add("templateTag", templateTag); - } - - @Override - public String toString() { - return string().toString(); - } - - - @Override - public int compareTo(Template o) { - return id.compareTo(o.getId()); - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/1d88fdf4/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/TemplateExtraction.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/TemplateExtraction.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/TemplateExtraction.java deleted file mode 100644 index 4a603fa..0000000 --- a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/TemplateExtraction.java +++ /dev/null @@ -1,368 +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.cloudstack.domain; - -import static com.google.common.base.Preconditions.checkNotNull; - -import java.beans.ConstructorProperties; -import java.util.Date; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.base.MoreObjects; -import com.google.common.base.MoreObjects.ToStringHelper; -import com.google.common.base.Objects; - -public class TemplateExtraction implements Comparable<TemplateExtraction> { - - public static Builder<?> builder() { - return new ConcreteBuilder(); - } - - public Builder<?> toBuilder() { - return new ConcreteBuilder().fromTemplateExtraction(this); - } - - public abstract static class Builder<T extends Builder<T>> { - protected abstract T self(); - - protected String id; - protected String accountId; - protected Date created; - protected String extractId; - protected ExtractMode extractMode; - protected String name; - protected String state; - protected String status; - protected String storageType; - protected int uploadPercentage; - protected String url; - protected String zoneId; - protected String zoneName; - - /** - * @see TemplateExtraction#getId() - */ - public T id(String id) { - this.id = id; - return self(); - } - - /** - * @see TemplateExtraction#getAccountId() - */ - public T accountId(String accountId) { - this.accountId = accountId; - return self(); - } - - /** - * @see TemplateExtraction#getCreated() - */ - public T created(Date created) { - this.created = created; - return self(); - } - - /** - * @see TemplateExtraction#getExtractId() - */ - public T extractId(String extractId) { - this.extractId = extractId; - return self(); - } - - /** - * @see TemplateExtraction#getExtractMode() - */ - public T extractMode(ExtractMode extractMode) { - this.extractMode = extractMode; - return self(); - } - - /** - * @see TemplateExtraction#getName() - */ - public T name(String name) { - this.name = name; - return self(); - } - - /** - * @see TemplateExtraction#getState() - */ - public T state(String state) { - this.state = state; - return self(); - } - - /** - * @see TemplateExtraction#getStatus() - */ - public T status(String status) { - this.status = status; - return self(); - } - - /** - * @see TemplateExtraction#getStorageType() - */ - public T storageType(String storageType) { - this.storageType = storageType; - return self(); - } - - /** - * @see TemplateExtraction#getUploadPercentage() - */ - public T uploadPercentage(int uploadPercentage) { - this.uploadPercentage = uploadPercentage; - return self(); - } - - /** - * @see TemplateExtraction#getUrl() - */ - public T url(String url) { - this.url = url; - return self(); - } - - /** - * @see TemplateExtraction#getZoneId() - */ - public T zoneId(String zoneId) { - this.zoneId = zoneId; - return self(); - } - - /** - * @see TemplateExtraction#getZoneName() - */ - public T zoneName(String zoneName) { - this.zoneName = zoneName; - return self(); - } - - public TemplateExtraction build() { - return new TemplateExtraction(id, accountId, created, extractId, extractMode, name, state, status, storageType, uploadPercentage, url, zoneId, zoneName); - } - - public T fromTemplateExtraction(TemplateExtraction in) { - return this - .id(in.getId()) - .accountId(in.getAccountId()) - .created(in.getCreated()) - .extractId(in.getExtractId()) - .extractMode(in.getExtractMode()) - .name(in.getName()) - .state(in.getState()) - .status(in.getStatus()) - .storageType(in.getStorageType()) - .uploadPercentage(in.getUploadPercentage()) - .url(in.getUrl()) - .zoneId(in.getZoneId()) - .zoneName(in.getZoneName()); - } - } - - private static class ConcreteBuilder extends Builder<ConcreteBuilder> { - @Override - protected ConcreteBuilder self() { - return this; - } - } - - private final String id; - private final String accountId; - private final Date created; - private final String extractId; - private final ExtractMode extractMode; - private final String name; - private final String state; - private final String status; - private final String storageType; - private final int uploadPercentage; - private final String url; - private final String zoneId; - private final String zoneName; - - @ConstructorProperties({ - "id", "accountid", "created", "extractId", "extractMode", "name", "state", "status", "storagetype", "uploadpercentage", "url", "zoneid", "zonename" - }) - protected TemplateExtraction(String id, @Nullable String accountId, @Nullable Date created, @Nullable String extractId, - @Nullable ExtractMode extractMode, @Nullable String name, @Nullable String state, @Nullable String status, - @Nullable String storageType, int uploadPercentage, @Nullable String url, @Nullable String zoneId, - @Nullable String zoneName) { - this.id = checkNotNull(id, "id"); - this.accountId = accountId; - this.created = created; - this.extractId = extractId; - this.extractMode = extractMode; - this.name = name; - this.state = state; - this.status = status; - this.storageType = storageType; - this.uploadPercentage = uploadPercentage; - this.url = url; - this.zoneId = zoneId; - this.zoneName = zoneName; - } - - /** - * @return the id of extracted object - */ - public String getId() { - return this.id; - } - - /** - * @return the account id to which the extracted object belongs - */ - @Nullable - public String getAccountId() { - return this.accountId; - } - - /** - * @return the time and date the object was created - */ - @Nullable - public Date getCreated() { - return this.created; - } - - /** - * @return the upload id of extracted object - */ - @Nullable - public String getExtractId() { - return this.extractId; - } - - /** - * @return the mode of extraction - upload or download - */ - @Nullable - public ExtractMode getExtractMode() { - return this.extractMode; - } - - /** - * @return the name of the extracted object - */ - @Nullable - public String getName() { - return this.name; - } - - /** - * @return the state of the extracted object - */ - @Nullable - public String getState() { - return this.state; - } - - /** - * @return the status of the extraction - */ - @Nullable - public String getStatus() { - return this.status; - } - - /** - * @return type of the storage - */ - @Nullable - public String getStorageType() { - return this.storageType; - } - - /** - * @return the percentage of the entity uploaded to the specified location - */ - public int getUploadPercentage() { - return this.uploadPercentage; - } - - /** - * @return if mode = upload then url of the uploaded entity. if mode = download the url from which the entity can be downloaded - */ - @Nullable - public String getUrl() { - return this.url; - } - - /** - * @return zone ID the object was extracted from - */ - @Nullable - public String getZoneId() { - return this.zoneId; - } - - /** - * @return zone name the object was extracted from - */ - @Nullable - public String getZoneName() { - return this.zoneName; - } - - @Override - public int hashCode() { - return Objects.hashCode(id, accountId, created, extractId, extractMode, name, state, status, storageType, uploadPercentage, url, zoneId, zoneName); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) return true; - if (obj == null || getClass() != obj.getClass()) return false; - TemplateExtraction that = TemplateExtraction.class.cast(obj); - return Objects.equal(this.id, that.id) - && Objects.equal(this.accountId, that.accountId) - && Objects.equal(this.created, that.created) - && Objects.equal(this.extractId, that.extractId) - && Objects.equal(this.extractMode, that.extractMode) - && Objects.equal(this.name, that.name) - && Objects.equal(this.state, that.state) - && Objects.equal(this.status, that.status) - && Objects.equal(this.storageType, that.storageType) - && Objects.equal(this.uploadPercentage, that.uploadPercentage) - && Objects.equal(this.url, that.url) - && Objects.equal(this.zoneId, that.zoneId) - && Objects.equal(this.zoneName, that.zoneName); - } - - protected ToStringHelper string() { - return MoreObjects.toStringHelper(this) - .add("id", id).add("accountId", accountId).add("created", created).add("extractId", extractId).add("extractMode", extractMode).add("name", name).add("state", state).add("status", status).add("storageType", storageType).add("uploadPercentage", uploadPercentage).add("url", url).add("zoneId", zoneId).add("zoneName", zoneName); - } - - @Override - public String toString() { - return string().toString(); - } - - @Override - public int compareTo(TemplateExtraction other) { - return id.compareTo(other.id); - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/1d88fdf4/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/TemplateFilter.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/TemplateFilter.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/TemplateFilter.java deleted file mode 100644 index 72a95fc..0000000 --- a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/TemplateFilter.java +++ /dev/null @@ -1,64 +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.cloudstack.domain; - -import com.google.common.base.CaseFormat; - -/** - * @see TemplateApi#listTemplates - */ -public enum TemplateFilter { - /** - * templates that are featured and are public - */ - FEATURED, - /** - * templates that have been registered/created by the owner - */ - SELF, - /** - * templates that have been registered/created by the owner that can be used - * to deploy a new VM - */ - SELF_EXECUTABLE, - /** - * templates that have been registered/created by the owner that can be used - * to deploy a new VM - 3.x filter value. - */ - SELFEXECUTABLE, - /** - * templates that have been granted to the calling user by another user - */ - SHAREDEXECUTABLE, - /** - * all templates that can be used to deploy a new VM - */ - EXECUTABLE, - /** - * templates that are public - */ - COMMUNITY, - /** - * All templates - */ - ALL; - - @Override - public String toString() { - return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name()); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/1d88fdf4/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/TemplateMetadata.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/TemplateMetadata.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/TemplateMetadata.java deleted file mode 100644 index 17b845c..0000000 --- a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/domain/TemplateMetadata.java +++ /dev/null @@ -1,236 +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.cloudstack.domain; - -import static com.google.common.base.Preconditions.checkNotNull; - -import java.beans.ConstructorProperties; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.base.MoreObjects; -import com.google.common.base.MoreObjects.ToStringHelper; -import com.google.common.base.Objects; - -/** - * Class TemplateMetadata - */ -public class TemplateMetadata { - - public static Builder<?> builder() { - return new ConcreteBuilder(); - } - - public Builder<?> toBuilder() { - return new ConcreteBuilder().fromTemplateMetadata(this); - } - - public abstract static class Builder<T extends Builder<T>> { - protected abstract T self(); - - protected String name; - protected String osTypeId; - protected String displayText; - protected String snapshotId; - protected String volumeId; - protected String virtualMachineId; - protected Boolean passwordEnabled; - - /** - * @see TemplateMetadata#getName() - */ - public T name(String name) { - this.name = name; - return self(); - } - - /** - * @see TemplateMetadata#getOsTypeId() - */ - public T osTypeId(String osTypeId) { - this.osTypeId = osTypeId; - return self(); - } - - /** - * @see TemplateMetadata#getDisplayText() - */ - public T displayText(String displayText) { - this.displayText = displayText; - return self(); - } - - /** - * @see TemplateMetadata#getSnapshotId() - */ - public T snapshotId(String snapshotId) { - this.snapshotId = snapshotId; - return self(); - } - - /** - * @see TemplateMetadata#getVolumeId() - */ - public T volumeId(String volumeId) { - this.volumeId = volumeId; - return self(); - } - - /** - * @see TemplateMetadata#getVirtualMachineId() - */ - public T virtualMachineId(String virtualMachineId) { - this.virtualMachineId = virtualMachineId; - return self(); - } - - /** - * @see TemplateMetadata#isPasswordEnabled() - */ - public T passwordEnabled(Boolean passwordEnabled) { - this.passwordEnabled = passwordEnabled; - return self(); - } - - public TemplateMetadata build() { - return new TemplateMetadata(name, osTypeId, displayText, snapshotId, volumeId, virtualMachineId, passwordEnabled); - } - - public T fromTemplateMetadata(TemplateMetadata in) { - return this - .name(in.getName()) - .osTypeId(in.getOsTypeId()) - .displayText(in.getDisplayText()) - .snapshotId(in.getSnapshotId()) - .volumeId(in.getVolumeId()) - .virtualMachineId(in.getVirtualMachineId()) - .passwordEnabled(in.isPasswordEnabled()); - } - } - - private static class ConcreteBuilder extends Builder<ConcreteBuilder> { - @Override - protected ConcreteBuilder self() { - return this; - } - } - - private final String name; - private final String osTypeId; - private final String displayText; - private final String snapshotId; - private final String volumeId; - private final String virtualMachineId; - private final Boolean passwordEnabled; - - @ConstructorProperties({ - "name", "osTypeId", "displayText", "snapshotId", "volumeId", "virtualMachineId", "passwordEnabled" - }) - protected TemplateMetadata(String name, @Nullable String osTypeId, @Nullable String displayText, @Nullable String snapshotId, - @Nullable String volumeId, String virtualMachineId, Boolean passwordEnabled) { - this.name = checkNotNull(name, "name"); - this.osTypeId = osTypeId; - this.displayText = displayText; - this.snapshotId = snapshotId; - this.volumeId = volumeId; - this.virtualMachineId = virtualMachineId; - this.passwordEnabled = passwordEnabled; - } - - /** - * @return the name of the template - */ - public String getName() { - return this.name; - } - - /** - * @return the ID of the OS Type that best represents the OS of this template. - */ - @Nullable - public String getOsTypeId() { - return this.osTypeId; - } - - /** - * @return the display text of the template. This is usually used for display purposes. - */ - @Nullable - public String getDisplayText() { - return this.displayText; - } - - /** - * @return the ID of the snapshot the template is being created from - */ - @Nullable - public String getSnapshotId() { - return this.snapshotId; - } - - /** - * @return the ID of the disk volume the template is being created from - */ - @Nullable - public String getVolumeId() { - return this.volumeId; - } - - /** - * @return Optional, VM ID - */ - @Nullable - public String getVirtualMachineId() { - return this.virtualMachineId; - } - - @Nullable - public Boolean isPasswordEnabled() { - return this.passwordEnabled; - } - - @Override - public int hashCode() { - return Objects.hashCode(name, osTypeId, displayText, snapshotId, volumeId, virtualMachineId, passwordEnabled); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) return true; - if (obj == null || getClass() != obj.getClass()) return false; - TemplateMetadata that = TemplateMetadata.class.cast(obj); - return Objects.equal(this.name, that.name) - && Objects.equal(this.osTypeId, that.osTypeId) - && Objects.equal(this.displayText, that.displayText) - && Objects.equal(this.snapshotId, that.snapshotId) - && Objects.equal(this.volumeId, that.volumeId) - && Objects.equal(this.virtualMachineId, that.virtualMachineId) - && Objects.equal(this.passwordEnabled, that.passwordEnabled); - } - - protected ToStringHelper string() { - return MoreObjects.toStringHelper(this) - .add("name", name).add("osTypeId", osTypeId).add("displayText", displayText).add("snapshotId", snapshotId) - .add("volumeId", volumeId).add("virtualMachineId", virtualMachineId).add("passwordEnabled", passwordEnabled); - } - - @Override - public String toString() { - return string().toString(); - } - -}
