http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/Image.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/Image.java b/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/Image.java deleted file mode 100644 index 6304c43..0000000 --- a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/Image.java +++ /dev/null @@ -1,496 +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.ec2.domain; - -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.Map; -import java.util.Set; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.collect.Iterables; -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; - -/** - * - * @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-ItemType-DescribeImagesResponseItemType.html" - * /> - * @author Adrian Cole - */ -public class Image implements Comparable<Image> { - - private final String region; - private final Architecture architecture; - @Nullable - private final String name; - @Nullable - private final String description; - private final String imageId; - private final String imageLocation; - private final String imageOwnerId; - private final ImageState imageState; - private final String rawState; - private final ImageType imageType; - private final boolean isPublic; - @Nullable - private final String kernelId; - @Nullable - private final String platform; - private final Set<String> productCodes = Sets.newHashSet(); - @Nullable - private final String ramdiskId; - private final RootDeviceType rootDeviceType; - @Nullable - private final String rootDeviceName; - private final Map<String, EbsBlockDevice> ebsBlockDevices = Maps.newHashMap(); - private final Map<String, String> tags = Maps.newLinkedHashMap(); - private final VirtualizationType virtualizationType; - - public VirtualizationType getVirtualizationType() { - return virtualizationType; - } - - private final Hypervisor hypervisor; - - public Hypervisor getHypervisor() { - return hypervisor; - } - - public Image(String region, Architecture architecture, @Nullable String name, @Nullable String description, - String imageId, String imageLocation, String imageOwnerId, ImageState imageState, String rawState, - ImageType imageType, boolean isPublic, Iterable<String> productCodes, @Nullable String kernelId, - @Nullable String platform, @Nullable String ramdiskId, RootDeviceType rootDeviceType, - @Nullable String rootDeviceName, Map<String, EbsBlockDevice> ebsBlockDevices, - Map<String, String> tags, VirtualizationType virtualizationType, Hypervisor hypervisor) { - this.region = checkNotNull(region, "region"); - this.architecture = architecture; - this.imageId = checkNotNull(imageId, "imageId"); - this.name = name; - this.description = description; - this.rootDeviceName = rootDeviceName; - this.imageLocation = checkNotNull(imageLocation, "imageLocation"); - this.imageOwnerId = checkNotNull(imageOwnerId, "imageOwnerId"); - this.imageState = checkNotNull(imageState, "imageState"); - this.rawState = checkNotNull(rawState, "rawState"); - this.imageType = checkNotNull(imageType, "imageType"); - this.isPublic = isPublic; - this.kernelId = kernelId; - this.platform = platform; - Iterables.addAll(this.productCodes, checkNotNull(productCodes, "productCodes")); - this.ramdiskId = ramdiskId; - this.rootDeviceType = checkNotNull(rootDeviceType, "rootDeviceType"); - this.ebsBlockDevices.putAll(checkNotNull(ebsBlockDevices, "ebsBlockDevices")); - this.tags.putAll(checkNotNull(tags, "tags")); - this.virtualizationType = checkNotNull(virtualizationType, "virtualizationType"); - this.hypervisor = checkNotNull(hypervisor, "hypervisor"); - } - - public static enum ImageState { - /** - * the image is successfully registered and available for launching - */ - AVAILABLE, - /** - * the image is deregistered and no longer available for launching - */ - DEREGISTERED, UNRECOGNIZED; - public String value() { - return name().toLowerCase(); - } - - public static ImageState fromValue(String v) { - try { - return valueOf(v.toUpperCase()); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - - public static enum Architecture { - I386, X86_64, UNRECOGNIZED; - public String value() { - return name().toLowerCase(); - } - - public static Architecture fromValue(String v) { - try { - return valueOf(v.toUpperCase()); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - - public static enum ImageType { - - MACHINE, KERNEL, RAMDISK, UNRECOGNIZED; - public String value() { - return name().toLowerCase(); - } - - public static ImageType fromValue(String v) { - try { - return valueOf(v.toUpperCase()); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - - } - - public static class EbsBlockDevice { - @Nullable - private final String snapshotId; - private final long volumeSize; - private final boolean deleteOnTermination; - - public EbsBlockDevice(@Nullable String snapshotId, long volumeSize, boolean deleteOnTermination) { - this.snapshotId = snapshotId; - this.volumeSize = volumeSize; - this.deleteOnTermination = deleteOnTermination; - } - - public String getSnapshotId() { - return snapshotId; - } - - public long getVolumeSize() { - return volumeSize; - } - - public boolean isDeleteOnTermination() { - return deleteOnTermination; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + (deleteOnTermination ? 1231 : 1237); - result = prime * result + ((snapshotId == null) ? 0 : snapshotId.hashCode()); - result = prime * result + (int) (volumeSize ^ (volumeSize >>> 32)); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - EbsBlockDevice other = (EbsBlockDevice) obj; - if (deleteOnTermination != other.deleteOnTermination) - return false; - if (snapshotId == null) { - if (other.snapshotId != null) - return false; - } else if (!snapshotId.equals(other.snapshotId)) - return false; - if (volumeSize != other.volumeSize) - return false; - return true; - } - - @Override - public String toString() { - return "EbsBlockDevice [deleteOnTermination=" + deleteOnTermination + ", snapshotId=" + snapshotId - + ", volumeSize=" + volumeSize + "]"; - } - - } - - /** - * To be removed in jclouds 1.6 <h4>Warning</h4> - * - * Especially on EC2 clones that may not support regions, this value is fragile. Consider - * alternate means to determine context. - */ - @Deprecated - public String getRegion() { - return region; - } - - /** - * The architecture of the image (i386 or x86_64). - */ - public Architecture getArchitecture() { - return architecture; - } - - /** - * The ID of the AMI. - */ - public String getId() { - return imageId; - } - - /** - * The location of the AMI. - */ - public String getImageLocation() { - return imageLocation; - } - - /** - * AWS Access Key ID of the image owner. - */ - public String getImageOwnerId() { - return imageOwnerId; - } - - /** - * Current state of the AMI. If the operation returns available, the image is successfully - * registered and avail able for launching. If the operation returns deregistered, the image is - * deregistered and no longer available for launching. - */ - public ImageState getImageState() { - return imageState; - } - - /** - * raw form of {@link #getImageState()} as taken directly from the api response xml document/ - */ - public String getRawState() { - return rawState; - } - - /** - * The type of image (machine, kernel, or ramdisk). - */ - public ImageType getImageType() { - return imageType; - } - - /** - * Returns true if this image has public launch permissions. Returns false if it only has - * implicit and explicit launch permissions. - */ - public boolean isPublic() { - return isPublic; - } - - /** - * The kernel associated with the image, if any. Only applicable for machine images. - */ - public String getKernelId() { - return kernelId; - } - - /** - * The operating platform of the instance. - */ - public String getPlatform() { - return platform; - } - - /** - * Product codes of the AMI. - */ - public Set<String> getProductCodes() { - return productCodes; - } - - /** - * The RAM disk associated with the image, if any. Only applicable for machine images. - */ - public String getRamdiskId() { - return ramdiskId; - } - - /** - * {@inheritDoc} - */ - public int compareTo(Image o) { - return (this == o) ? 0 : getId().compareTo(o.getId()); - } - - /** - * - * @return The root device type used by the AMI. The AMI can use an Amazon EBS or instance store - * root device. - */ - public RootDeviceType getRootDeviceType() { - return rootDeviceType; - } - - public String getName() { - return name; - } - - public String getDescription() { - return description; - } - - public String getRootDeviceName() { - return rootDeviceName; - } - - public Map<String, EbsBlockDevice> getEbsBlockDevices() { - return ebsBlockDevices; - } - - public Map<String, String> getTags() { - return tags; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((architecture == null) ? 0 : architecture.hashCode()); - result = prime * result + ((description == null) ? 0 : description.hashCode()); - result = prime * result + ((ebsBlockDevices == null) ? 0 : ebsBlockDevices.hashCode()); - result = prime * result + ((tags == null) ? 0 : tags.hashCode()); - result = prime * result + ((imageId == null) ? 0 : imageId.hashCode()); - result = prime * result + ((imageLocation == null) ? 0 : imageLocation.hashCode()); - result = prime * result + ((imageOwnerId == null) ? 0 : imageOwnerId.hashCode()); - result = prime * result + ((imageType == null) ? 0 : imageType.hashCode()); - result = prime * result + (isPublic ? 1231 : 1237); - result = prime * result + ((kernelId == null) ? 0 : kernelId.hashCode()); - result = prime * result + ((name == null) ? 0 : name.hashCode()); - result = prime * result + ((platform == null) ? 0 : platform.hashCode()); - result = prime * result + ((productCodes == null) ? 0 : productCodes.hashCode()); - result = prime * result + ((ramdiskId == null) ? 0 : ramdiskId.hashCode()); - result = prime * result + ((region == null) ? 0 : region.hashCode()); - result = prime * result + ((rootDeviceName == null) ? 0 : rootDeviceName.hashCode()); - result = prime * result + ((rootDeviceType == null) ? 0 : rootDeviceType.hashCode()); - result = prime * result + ((virtualizationType == null) ? 0 : virtualizationType.hashCode()); - result = prime * result + ((hypervisor == null) ? 0 : hypervisor.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - Image other = (Image) obj; - if (architecture == null) { - if (other.architecture != null) - return false; - } else if (!architecture.equals(other.architecture)) - return false; - if (description == null) { - if (other.description != null) - return false; - } else if (!description.equals(other.description)) - return false; - if (ebsBlockDevices == null) { - if (other.ebsBlockDevices != null) - return false; - } else if (!ebsBlockDevices.equals(other.ebsBlockDevices)) - return false; - if (tags == null) { - if (other.tags != null) - return false; - } else if (!tags.equals(other.tags)) - return false; - if (imageId == null) { - if (other.imageId != null) - return false; - } else if (!imageId.equals(other.imageId)) - return false; - if (imageLocation == null) { - if (other.imageLocation != null) - return false; - } else if (!imageLocation.equals(other.imageLocation)) - return false; - if (imageOwnerId == null) { - if (other.imageOwnerId != null) - return false; - } else if (!imageOwnerId.equals(other.imageOwnerId)) - return false; - if (imageType == null) { - if (other.imageType != null) - return false; - } else if (!imageType.equals(other.imageType)) - return false; - if (isPublic != other.isPublic) - return false; - if (kernelId == null) { - if (other.kernelId != null) - return false; - } else if (!kernelId.equals(other.kernelId)) - return false; - if (name == null) { - if (other.name != null) - return false; - } else if (!name.equals(other.name)) - return false; - if (platform == null) { - if (other.platform != null) - return false; - } else if (!platform.equals(other.platform)) - return false; - if (productCodes == null) { - if (other.productCodes != null) - return false; - } else if (!productCodes.equals(other.productCodes)) - return false; - if (ramdiskId == null) { - if (other.ramdiskId != null) - return false; - } else if (!ramdiskId.equals(other.ramdiskId)) - return false; - if (region == null) { - if (other.region != null) - return false; - } else if (!region.equals(other.region)) - return false; - if (rootDeviceName == null) { - if (other.rootDeviceName != null) - return false; - } else if (!rootDeviceName.equals(other.rootDeviceName)) - return false; - if (rootDeviceType == null) { - if (other.rootDeviceType != null) - return false; - } else if (!rootDeviceType.equals(other.rootDeviceType)) - return false; - if (virtualizationType == null) { - if (other.virtualizationType != null) - return false; - } else if (!virtualizationType.equals(other.virtualizationType)) - return false; - if (hypervisor == null) { - if (other.hypervisor != null) - return false; - } else if (!hypervisor.equals(other.hypervisor)) - return false; - return true; - } - - @Override - public String toString() { - return "Image [architecture=" + architecture + ", description=" + description + ", ebsBlockDevices=" - + ebsBlockDevices + ", imageId=" + imageId + ", imageLocation=" + imageLocation + ", imageOwnerId=" - + imageOwnerId + ", imageState=" + rawState + ", imageType=" + imageType + ", isPublic=" + isPublic - + ", kernelId=" + kernelId + ", name=" + name + ", platform=" + platform + ", productCodes=" - + productCodes + ", ramdiskId=" + ramdiskId + ", region=" + region + ", rootDeviceName=" - + rootDeviceName + ", rootDeviceType=" + rootDeviceType + ", virtualizationType=" + virtualizationType - + ", hypervisor=" + hypervisor + ", tags=" + tags + "]"; - } - -}
http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/ImageAttribute.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/ImageAttribute.java b/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/ImageAttribute.java deleted file mode 100644 index 263f1df..0000000 --- a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/ImageAttribute.java +++ /dev/null @@ -1,98 +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.ec2.domain; - -/** - * - * An attribute of an AMI. - * - * @author Adrian Cole - * @see EC2AsyncClient#modifyImageAttribute - * @see EC2AsyncClient#resetImageAttribute - * @see EC2AsyncClient#describeImageAttribute - * - */ -public enum ImageAttribute { - - /** - * the product code associated with the AMI. - */ - PRODUCT_CODES, - - /** - * the ID of the RAM disk associated with the AMI. - */ - RAMDISK, - - /** - * the ID of the kernel associated with the AMI. - */ - KERNEL, - /** - * the launch permissions of the AMI. - */ - LAUNCH_PERMISSION, - /** - * the operating system platform. - */ - PLATFORM, - /** - * the mapping that defines native device names to use when exposing virtual devices. - */ - BLOCK_DEVICE_MAPPING, UNRECOGNIZED; - public String value() { - switch (this) { - case PRODUCT_CODES: - return "productCodes"; - case RAMDISK: - return "ramdisk"; - case KERNEL: - return "kernel"; - case LAUNCH_PERMISSION: - return "launchPermission"; - case PLATFORM: - return "platform"; - case BLOCK_DEVICE_MAPPING: - return "blockDeviceMapping"; - default: - throw new IllegalArgumentException("unmapped attribute: " + super.name()); - } - } - - @Override - public String toString() { - return value(); - } - - public static ImageAttribute fromValue(String attribute) { - if ("productCodes".equals(attribute)) - return PRODUCT_CODES; - else if ("ramdisk".equals(attribute)) - return RAMDISK; - else if ("kernel".equals(attribute)) - return KERNEL; - else if ("launchPermission".equals(attribute)) - return LAUNCH_PERMISSION; - else if ("platform".equals(attribute)) - return PLATFORM; - else if ("blockDeviceMapping".equals(attribute)) - return BLOCK_DEVICE_MAPPING; - else - return UNRECOGNIZED; - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/InstanceState.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/InstanceState.java b/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/InstanceState.java deleted file mode 100644 index 137e492..0000000 --- a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/InstanceState.java +++ /dev/null @@ -1,97 +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.ec2.domain; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.CaseFormat; - -/** - * - * The current state of the instance.. - * - * @author Adrian Cole - * @see EC2AsyncClient#describeInstances - * @see EC2AsyncClient#runInstances - * @see EC2AsyncClient#terminateInstances - * - */ -public enum InstanceState { - - /** - * the instance is in the process of being launched - */ - PENDING, - - /** - * the instance launched (although the boot process might not be completed) - */ - RUNNING, - - /** - * the instance started shutting down - */ - SHUTTING_DOWN, - /** - * the instance terminated - */ - TERMINATED, - /** - * the instance is stopping - */ - STOPPING, - /** - * the instance is stopped - */ - STOPPED, UNRECOGNIZED; - - public String value() { - return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name()); - } - - @Override - public String toString() { - return value(); - } - - public static InstanceState fromValue(String state) { - try { - return valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(state, "state"))); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - - public static InstanceState fromValue(int v) { - switch (v) { - case 0: - return PENDING; - case 16: - return RUNNING; - case 32: - return SHUTTING_DOWN; - case 48: - return TERMINATED; - case 64: - return STOPPING; - case 80: - return STOPPED; - default: - return UNRECOGNIZED; - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/InstanceStateChange.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/InstanceStateChange.java b/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/InstanceStateChange.java deleted file mode 100644 index cae6583..0000000 --- a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/InstanceStateChange.java +++ /dev/null @@ -1,119 +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.ec2.domain; - -import static com.google.common.base.Preconditions.checkNotNull; - - -/** - * - * @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-ItemType-TerminateInstancesResponseInfoType.html" - * /> - * @author Adrian Cole - */ -public class InstanceStateChange implements Comparable<InstanceStateChange> { - - private final String region; - private final String instanceId; - private final InstanceState currentState; - private final InstanceState previousState; - - public int compareTo(InstanceStateChange o) { - return (this == o) ? 0 : getInstanceId().compareTo(o.getInstanceId()); - } - - public InstanceStateChange(String region, String instanceId, InstanceState currentState, - InstanceState previousState) { - this.region = checkNotNull(region, "region"); - this.instanceId = instanceId; - this.currentState = currentState; - this.previousState = previousState; - } - - /** - * To be removed in jclouds 1.6 <h4>Warning</h4> - * - * Especially on EC2 clones that may not support regions, this value is fragile. Consider - * alternate means to determine context. - */ - @Deprecated - public String getRegion() { - return region; - } - - public String getInstanceId() { - return instanceId; - } - - public InstanceState getCurrentState() { - return currentState; - } - - public InstanceState getPreviousState() { - return previousState; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((instanceId == null) ? 0 : instanceId.hashCode()); - result = prime * result + ((previousState == null) ? 0 : previousState.hashCode()); - result = prime * result + ((region == null) ? 0 : region.hashCode()); - result = prime * result + ((currentState == null) ? 0 : currentState.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - InstanceStateChange other = (InstanceStateChange) obj; - if (instanceId == null) { - if (other.instanceId != null) - return false; - } else if (!instanceId.equals(other.instanceId)) - return false; - if (previousState == null) { - if (other.previousState != null) - return false; - } else if (!previousState.equals(other.previousState)) - return false; - if (region == null) { - if (other.region != null) - return false; - } else if (!region.equals(other.region)) - return false; - if (currentState == null) { - if (other.currentState != null) - return false; - } else if (!currentState.equals(other.currentState)) - return false; - return true; - } - - @Override - public String toString() { - return "InstanceStateChange [currentState=" + currentState + ", instanceId=" + instanceId - + ", previousState=" + previousState + ", region=" + region + "]"; - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/InstanceType.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/InstanceType.java b/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/InstanceType.java deleted file mode 100644 index b57811c..0000000 --- a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/InstanceType.java +++ /dev/null @@ -1,388 +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.ec2.domain; - -/** - * - * The type of the instance. Description accurate as of 8-15-2009 release. - * - * @author Adrian Cole - * @see EC2AsyncClient#describeInstances - * @see EC2AsyncClient#runInstances - * @see EC2AsyncClient#terminateInstances - * - */ -public class InstanceType { - - /** - * Micro Instance - * <ul> - * <li>613 MB of memory</li> - * <li>up to 2 ECUs (for short periodic bursts)</li> - * <li>No instance storage (EBS storage only)</li> - * <li>32-bit or 64-bit platform</li> - * </ul> - */ - public static final String T1_MICRO = "t1.micro"; - - /** - * Small Instance - * <ul> - * <li>1.7 GB memory</li> - * <li>1 EC2 Compute Unit (1 virtual core with 1 EC2 Compute Unit)</li> - * <li>160 GB instance storage (150 GB plus 10 GB root partition)</li> - * <li>32-bit or 64-bit platform</li> - * <li>I/O Performance: Moderate</li> - * </ul> - */ - public static final String M1_SMALL = "m1.small"; - - /** - * Medium Instance - * <ul> - * <li>3.75 GB memory</li> - * <li>2 EC2 Compute Unit (1 virtual core with 2 EC2 Compute Unit)</li> - * <li>410 GB instance storage</li> - * <li>32-bit or 64-bit platform</li> - * <li>I/O Performance: Moderate</li> - * </ul> - */ - public static final String M1_MEDIUM = "m1.medium"; - - /** - * Large Instance - * <ul> - * <li>7.5 GB memory</li> - * <li>4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each)</li> - * <li>850 GB instance storage (2x420 GB plus 10 GB root partition)</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String M1_LARGE = "m1.large"; - - /** - * Extra Large Instance - * <ul> - * <li>15 GB memory</li> - * <li>8 EC2 Compute Units (4 virtual cores with 2 EC2 Compute Units each)</li> - * <li>1690 GB instance storage (4x420 GB plus 10 GB root partition)</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String M1_XLARGE = "m1.xlarge"; - - /** - * High-Memory Extra Large Instance - * <ul> - * <li>17.1 GB of memory</li> - * <li>6.5 EC2 Compute Units (2 virtual cores with 3.25 EC2 Compute Units - * each)</li> - * <li>420 GB of instance storage</li> - * <li>64-bit platform</li> - * <li>I/O Performance: Moderate</li> - * </ul> - */ - public static final String M2_XLARGE = "m2.xlarge"; - - /** - * High-Memory Double Extra Large Instance - * <ul> - * <li>34.2 GB of memory</li> - * <li>13 EC2 Compute Units (4 virtual cores with 3.25 EC2 Compute Units - * each)</li> - * <li>850 GB of instance storage</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String M2_2XLARGE = "m2.2xlarge"; - - /** - * High-Memory Quadruple Extra Large Instance - * <ul> - * <li>68.4 GB of memory</li> - * <li>26 EC2 Compute Units (8 virtual cores with 3.25 EC2 Compute Units - * each)</li> - * <li>1690 GB of instance storage</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String M2_4XLARGE = "m2.4xlarge"; - - /** - * M3 Medium Instance - * <ul> - * <li>3.75 GiB memory</li> - * <li>3 EC2 Compute Units (1 virtual core with 3 EC2 Compute Units)</li> - * <li>1 SSD-based volume with 4 GiB of instance storage</li> - * <li>32-bit or 64-bit platform</li> - * <li>I/O Performance: Moderate</li> - * </ul> - */ - public static final String M3_MEDIUM = "m3.medium"; - - /** - * M3 Large Instance - * <ul> - * <li>7 GiB memory</li> - * <li>6.5 EC2 Compute Units (2 virtual cores with 3.25 EC2 Compute Units each)</li> - * <li>1 SSD-based volume with 32 GiB of instance storage</li> - * <li>32-bit or 64-bit platform</li> - * <li>I/O Performance: Moderate</li> - * </ul> - */ - public static final String M3_LARGE = "m3.large"; - - /** - * M3 Extra Large Instance - * <ul> - * <li>15 GiB memory</li> - * <li>13 EC2 Compute Units (4 virtual cores with 3.25 EC2 Compute Units each)</li> - * <li>EBS storage only</li> - * <li>64-bit platform</li> - * <li>I/O Performance: Moderate</li> - * </ul> - */ - public static final String M3_XLARGE = "m3.xlarge"; - - /** - * M3 Double Extra Large Instance - * <ul> - * <li>30 GiB memory</li> - * <li>26 EC2 Compute Units (8 virtual cores with 3.25 EC2 Compute Units each)</li> - * <li>EBS storage only</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String M3_2XLARGE = "m3.2xlarge"; - - /** - * High-CPU Medium Instance - * <ul> - * <li>1.7 GB of memory</li> - * <li>5 EC2 Compute Units (2 virtual cores with 2.5 EC2 Compute Units each)</li> - * <li>350 GB of instance storage</li> - * <li>32-bit platform</li> - * <li>I/O Performance: Moderate</li> - * </ul> - */ - public static final String C1_MEDIUM = "c1.medium"; - - /** - * High-CPU Extra Large Instance - * <ul> - * <li>7 GB of memory</li> - * <li>20 EC2 Compute Units (8 virtual cores with 2.5 EC2 Compute Units each) - * </li> - * <li>1690 GB of instance storage</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String C1_XLARGE = "c1.xlarge"; - - /** - * Cluster Compute Instance - * <ul> - * <li>22 GB of memory</li> - * <li>33.5 EC2 Compute Units (2 x Intel Xeon X5570, quad-core "Nehalem" - * architecture)</li> - * <li>1690 GB of 64-bit storage (2 x 840 GB, plus 10 GB root partition)</li> - * <li>10 Gbps Ethernet</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String CG1_4XLARGE = "cg1.4xlarge"; - - /** - * Cluster Compute Instance - * <ul> - * <li>23 GB of memory</li> - * <li>33.5 EC2 Compute Units (2 x Intel Xeon X5570, quad-core "Nehalem" - * architecture)</li> - * <li>1690 GB of 64-bit storage (2 x 840 GB, plus 10 GB root partition)</li> - * <li>10 Gbps Ethernet</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String CC1_4XLARGE = "cc1.4xlarge"; - - /** - * Cluster Compute Eight Extra Large specifications - * <ul> - * <li>60.5 GB of memory</li> - * <li>88 EC2 Compute Units (Eight-core 2 x Intel Xeon)</li> - * <li>3370 GB of 64-bit storage (4 x 840 GB, plus 10 GB root partition)</li> - * <li>10 Gbps Ethernet</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String CC2_8XLARGE = "cc2.8xlarge"; - - /** - * High I/O Quadruple Extra Large specifications - * <ul> - * <li>60.5 GB of memory</li> - * <li>35 EC2 Compute Units (16 virtual cores)</li> - * <li>2 SSD-based volumes each with 1024 GB of instance storage</li> - * <li>64-bit platform</li> - * <li>I/O Performance: Very High (10 Gigabit Ethernet)</li> - * <li>Storage I/O Performance: Very High**</li> - * </ul> - */ - public static final String HI1_4XLARGE = "hi1.4xlarge"; - - /** - * High Storage Eight Extra Large - * <ul> - * <li>117 GiB of memory</li> - * <li>35 EC2 Compute Units (16 virtual cores*)</li> - * <li>24 hard disk drives each with 2 TB of instance storage</li> - * <li>64-bit platform</li> - * <li>I/O Performance: Very High (10 Gigabit Ethernet)</li> - * <li>Storage I/O Performance: Very High**</li> - * </ul> - */ - public static final String HS1_8XLARGE = "hs1.8xlarge"; - - /** - * GPU Instance Double Extra Large - * <ul> - * <li>15 GiB of memory</li> - * <li>26 EC2 Compute Units (8 virtual cores*), 1xNVIDIA GRID GPU (Kepler GK104)</li> - * <li>60 GB instance storage</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String G2_2XLARGE = "g2.2xlarge"; - - /** - * C3 High-CPU Large - * <ul> - * <li>3.75 GiB of memory</li> - * <li>7 EC2 Compute Units (2 virtual cores)</li> - * <li>2 SSD-based volumes each with 16 GiB of instance storage</li> - * <li>64-bit platform</li> - * <li>I/O Performance: Moderate</li> - * </ul> - */ - public static final String C3_LARGE = "c3.large"; - - /** - * C3 High-CPU Extra Large - * <ul> - * <li>7 GiB of memory</li> - * <li>14 EC2 Compute Units (4 virtual cores)</li> - * <li>2 SSD-based volumes each with 40 GiB of instance storage</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String C3_XLARGE = "c3.xlarge"; - - /** - * C3 High-CPU Double Extra Large - * <ul> - * <li>15 GiB of memory</li> - * <li>28 EC2 Compute Units (8 virtual cores)</li> - * <li>2 SSD-based volumes each with 80 GiB of instance storage</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String C3_2XLARGE = "c3.2xlarge"; - - /** - * C3 High-CPU Quadruple Extra Large - * <ul> - * <li>30 GiB of memory</li> - * <li>55 EC2 Compute Units (16 virtual cores)</li> - * <li>2 SSD-based volumes each with 160 GiB of instance storage</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String C3_4XLARGE = "c3.4xlarge"; - - /** - * C3 High-CPU Octuple Extra Large - * <ul> - * <li>60 GiB of memory</li> - * <li>108 EC2 Compute Units (32 virtual cores)</li> - * <li>2 SSD-based volumes each with 320 GiB of instance storage</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String C3_8XLARGE = "c3.8xlarge"; - - /** - * I2 Extra Large - * <ul> - * <li>30.5 GiB of memory</li> - * <li>14 EC2 Compute Units (4 virtual cores)</li> - * <li>1 SSD-based volume with 800 GiB of instance storage</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String I2_XLARGE = "i2.xlarge"; - - /** - * I2 Double Extra Large - * <ul> - * <li>61 GiB of memory</li> - * <li>27 EC2 Compute Units (8 virtual cores)</li> - * <li>2 SSD-based volumes each with 800 GiB of instance storage</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String I2_2XLARGE = "i2.2xlarge"; - - /** - * I2 Quadruple Extra Large - * <ul> - * <li>122 GiB of memory</li> - * <li>53 EC2 Compute Units (16 virtual cores)</li> - * <li>4 SSD-based volumes each with 800 GiB of instance storage</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String I2_4XLARGE = "i2.4xlarge"; - - /** - * I2 Octuple Extra Large - * <ul> - * <li>244 GiB of memory</li> - * <li>104 EC2 Compute Units (32 virtual cores)</li> - * <li>8 SSD-based volumes each with 800 GiB of instance storage</li> - * <li>64-bit platform</li> - * <li>I/O Performance: High</li> - * </ul> - */ - public static final String I2_8XLARGE = "i2.8xlarge"; -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/KeyPair.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/KeyPair.java b/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/KeyPair.java deleted file mode 100644 index 03cf5e8..0000000 --- a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/KeyPair.java +++ /dev/null @@ -1,206 +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.ec2.domain; - -import static com.google.common.base.Preconditions.checkNotNull; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.ssh.SshKeys; - -/** - * - * @see <a href= - * "http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-CreateKeyPair.html" - * /> - * @author Adrian Cole - */ -public class KeyPair implements Comparable<KeyPair> { - @Override - public String toString() { - return "[region=" + region + ", keyName=" + keyName + ", fingerprint=" + fingerprint + ", sha1OfPrivateKey=" - + sha1OfPrivateKey + ", keyMaterial?=" + (keyMaterial != null) + "]"; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String region; - private String keyName; - private String fingerprint; - private String sha1OfPrivateKey; - private String keyMaterial; - - public Builder region(String region) { - this.region = region; - return this; - } - - public Builder keyName(String keyName) { - this.keyName = keyName; - return this; - } - - public Builder sha1OfPrivateKey(String sha1OfPrivateKey) { - this.sha1OfPrivateKey = sha1OfPrivateKey; - return this; - } - - public Builder keyMaterial(String keyMaterial) { - this.keyMaterial = keyMaterial; - return this; - } - - public Builder fingerprint(String fingerprint) { - this.fingerprint = fingerprint; - return this; - } - - public KeyPair build() { - if (fingerprint == null && keyMaterial != null) - fingerprint(SshKeys.fingerprintPrivateKey(keyMaterial)); - return new KeyPair(region, keyName, sha1OfPrivateKey, keyMaterial, fingerprint); - } - - public static Builder fromKeyPair(KeyPair in) { - return new Builder().region(in.getRegion()).keyName(in.getKeyName()).sha1OfPrivateKey(in.getSha1OfPrivateKey()) - .keyMaterial(in.getKeyMaterial()); - } - } - - private final String region; - private final String keyName; - private final String sha1OfPrivateKey; - @Nullable - private final String keyMaterial; - @Nullable - private final String fingerprint; - - public KeyPair(String region, String keyName, String sha1OfPrivateKey, @Nullable String keyMaterial, - @Nullable String fingerprint) { - this.region = checkNotNull(region, "region"); - this.keyName = checkNotNull(keyName, "keyName"); - this.sha1OfPrivateKey = checkNotNull(sha1OfPrivateKey, "sha1OfPrivateKey"); - this.keyMaterial = keyMaterial;// nullable on list - this.fingerprint = fingerprint;// nullable on list - } - - /** - * To be removed in jclouds 1.6 <h4>Warning</h4> - * - * Especially on EC2 clones that may not support regions, this value is fragile. Consider - * alternate means to determine context. - */ - @Deprecated - public String getRegion() { - return region; - } - - /** - * {@inheritDoc} - */ - public int compareTo(KeyPair o) { - return (this == o) ? 0 : getKeyName().compareTo(o.getKeyName()); - } - - /** - * A SHA-1 digest of the DER encoded private key. - * - * @see SshKeys#sha1 - */ - public String getSha1OfPrivateKey() { - return sha1OfPrivateKey; - } - - /** - * fingerprint per the following <a - * href="http://tools.ietf.org/html/draft-friedl-secsh-fingerprint-00" >spec</a> - * - * @see SshKeys#fingerprint - */ - public String getFingerprint() { - return fingerprint; - } - - /** - * An unencrypted PEM encoded RSA private key. - */ - public String getKeyMaterial() { - return keyMaterial; - } - - /** - * The key pair name provided in the original request. - */ - public String getKeyName() { - return keyName; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((fingerprint == null) ? 0 : fingerprint.hashCode()); - result = prime * result + ((keyMaterial == null) ? 0 : keyMaterial.hashCode()); - result = prime * result + ((keyName == null) ? 0 : keyName.hashCode()); - result = prime * result + ((region == null) ? 0 : region.hashCode()); - result = prime * result + ((sha1OfPrivateKey == null) ? 0 : sha1OfPrivateKey.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - KeyPair other = (KeyPair) obj; - if (fingerprint == null) { - if (other.fingerprint != null) - return false; - } else if (!fingerprint.equals(other.fingerprint)) - return false; - if (keyMaterial == null) { - if (other.keyMaterial != null) - return false; - } else if (!keyMaterial.equals(other.keyMaterial)) - return false; - if (keyName == null) { - if (other.keyName != null) - return false; - } else if (!keyName.equals(other.keyName)) - return false; - if (region == null) { - if (other.region != null) - return false; - } else if (!region.equals(other.region)) - return false; - if (sha1OfPrivateKey == null) { - if (other.sha1OfPrivateKey != null) - return false; - } else if (!sha1OfPrivateKey.equals(other.sha1OfPrivateKey)) - return false; - return true; - } - - public Builder toBuilder() { - return Builder.fromKeyPair(this); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/PasswordData.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/PasswordData.java b/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/PasswordData.java deleted file mode 100644 index 9465928..0000000 --- a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/PasswordData.java +++ /dev/null @@ -1,153 +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.ec2.domain; - -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.Date; - -import com.google.common.base.Objects; - -/** - * The encrypted administrator password for an instance running Windows. - * - * <h4>Note</h4> - * - * The Windows password is only generated the first time an AMI is launched. It is not generated for - * rebundled AMIs or after the password is changed on an instance. - * - * The password is encrypted using the key pair that you provided. - * - * @see <a - * href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-GetPasswordData.html" - * >doc</a> - * - * @author Richard Downer - */ -public class PasswordData { - - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromPasswordData(this); - } - - public static class Builder { - - protected String instanceId; - protected Date timestamp; - protected String passwordData; - - /** - * @see PasswordData#getInstanceId() - */ - public Builder instanceId(String instanceId) { - this.instanceId = instanceId; - return this; - } - - /** - * @see PasswordData#getTimestamp() - */ - public Builder timestamp(Date timestamp) { - this.timestamp = timestamp; - return this; - } - - /** - * @see PasswordData#getPasswordData() - */ - public Builder passwordData(String passwordData) { - this.passwordData = passwordData; - return this; - } - - public PasswordData build() { - return new PasswordData(instanceId, timestamp, passwordData); - } - - public Builder fromPasswordData(PasswordData in) { - return this.instanceId(in.getInstanceId()).timestamp(in.getTimestamp()).passwordData(in.getPasswordData()); - } - } - - protected final String instanceId; - protected final Date timestamp; - protected final String passwordData; - - protected PasswordData(String instanceId, Date timestamp, String passwordData) { - this.instanceId = checkNotNull(instanceId, "instanceId"); - this.timestamp = checkNotNull(timestamp, "timestamp"); - this.passwordData = checkNotNull(passwordData, "passwordData"); - } - - /** - * The ID of the instance. - */ - public String getInstanceId() { - return instanceId; - } - - /** - * The time the data was last updated. - */ - public Date getTimestamp() { - return timestamp; - } - - /** - * The password of the instance. - */ - public String getPasswordData() { - return passwordData; - } - - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return Objects.hashCode(instanceId); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - PasswordData other = PasswordData.class.cast(obj); - return Objects.equal(this.instanceId, other.instanceId); - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return Objects.toStringHelper(this).omitNullValues().add("instanceId", instanceId).add("timestamp", timestamp) - .add("passwordData", passwordData).toString(); - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/Permission.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/Permission.java b/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/Permission.java deleted file mode 100644 index 611b19d..0000000 --- a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/Permission.java +++ /dev/null @@ -1,93 +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.ec2.domain; - -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.Set; - -import com.google.common.collect.Iterables; -import com.google.common.collect.Sets; - -/** - * - * @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-ItemType-LaunchPermissionItemType.html" - * /> - * @author Adrian Cole - */ -public class Permission { - private final Set<String> groups = Sets.newHashSet(); - private final Set<String> userIds = Sets.newHashSet(); - - public Permission(Iterable<String> userIds, Iterable<String> groups) { - Iterables.addAll(this.userIds, checkNotNull(userIds, "userIds")); - Iterables.addAll(this.groups, checkNotNull(groups, "groups")); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((groups == null) ? 0 : groups.hashCode()); - result = prime * result + ((userIds == null) ? 0 : userIds.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - Permission other = (Permission) obj; - if (groups == null) { - if (other.groups != null) - return false; - } else if (!groups.equals(other.groups)) - return false; - if (userIds == null) { - if (other.userIds != null) - return false; - } else if (!userIds.equals(other.userIds)) - return false; - return true; - } - - /** - * - * @return Name of the group. Currently supports \"all.\" - */ - public Set<String> getGroups() { - return groups; - } - - /** - * - * @return AWS Access Key ID. - */ - public Set<String> getUserIds() { - return userIds; - } - - @Override - public String toString() { - return "LaunchPermission [groups=" + groups + ", userIds=" + userIds + "]"; - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/PublicIpInstanceIdPair.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/PublicIpInstanceIdPair.java b/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/PublicIpInstanceIdPair.java deleted file mode 100644 index f0f0270..0000000 --- a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/PublicIpInstanceIdPair.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.ec2.domain; - -import static com.google.common.base.Preconditions.checkNotNull; - -import org.jclouds.javax.annotation.Nullable; - -/** - * - * @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-ItemType-DescribeAddressesResponseInfoType.html" - * /> - * @author Adrian Cole - */ -public class PublicIpInstanceIdPair implements Comparable<PublicIpInstanceIdPair> { - - private final String region; - @Nullable - private final String instanceId; - private final String publicIp; - - public PublicIpInstanceIdPair(String region, String publicIp, @Nullable String instanceId) { - this.region = checkNotNull(region, "region"); - this.instanceId = instanceId; - this.publicIp = checkNotNull(publicIp, "publicIp"); - } - - /** - * To be removed in jclouds 1.6 <h4>Warning</h4> - * - * Especially on EC2 clones that may not support regions, this value is fragile. Consider - * alternate means to determine context. - */ - @Deprecated - public String getRegion() { - return region; - } - - /** - * {@inheritDoc} - */ - public int compareTo(PublicIpInstanceIdPair o) { - return (this == o) ? 0 : getPublicIp().compareTo(o.getPublicIp()); - } - - /** - * The ID of the instance. - */ - public String getInstanceId() { - return instanceId; - } - - /** - * The public IP address. - */ - public String getPublicIp() { - return publicIp; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((instanceId == null) ? 0 : instanceId.hashCode()); - result = prime * result + ((publicIp == null) ? 0 : publicIp.hashCode()); - result = prime * result + ((region == null) ? 0 : region.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - PublicIpInstanceIdPair other = (PublicIpInstanceIdPair) obj; - if (instanceId == null) { - if (other.instanceId != null) - return false; - } else if (!instanceId.equals(other.instanceId)) - return false; - if (publicIp == null) { - if (other.publicIp != null) - return false; - } else if (!publicIp.equals(other.publicIp)) - return false; - if (region == null) { - if (other.region != null) - return false; - } else if (!region.equals(other.region)) - return false; - return true; - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/Reservation.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/Reservation.java b/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/Reservation.java deleted file mode 100644 index 85db98e..0000000 --- a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/Reservation.java +++ /dev/null @@ -1,228 +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.ec2.domain; - -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.Set; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.base.Objects; -import com.google.common.collect.ComparisonChain; -import com.google.common.collect.ForwardingSet; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Ordering; - -/** - * - * @see <a href= - * "http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-ItemType-ReservationInfoType.html" - * /> - * @author Adrian Cole - */ -public class Reservation<T extends RunningInstance> extends ForwardingSet<T> implements Comparable<Reservation<T>> { - - public static <T extends RunningInstance> Builder<T> builder() { - return new Builder<T>(); - } - - public Builder<T> toBuilder() { - return Reservation.<T> builder().fromReservation(this); - } - - public static class Builder<T extends RunningInstance> { - private String region; - private String ownerId; - private String requesterId; - private String reservationId; - - private ImmutableSet.Builder<T> instances = ImmutableSet.<T> builder(); - private ImmutableSet.Builder<String> groupNames = ImmutableSet.<String> builder(); - - /** - * @see Reservation#getRegion() - */ - public Builder<T> region(String region) { - this.region = region; - return this; - } - - /** - * @see Reservation#getOwnerId() - */ - public Builder<T> ownerId(String ownerId) { - this.ownerId = ownerId; - return this; - } - - /** - * @see Reservation#getRequesterId() - */ - public Builder<T> requesterId(String requesterId) { - this.requesterId = requesterId; - return this; - } - - /** - * @see Reservation#getReservationId() - */ - public Builder<T> reservationId(String reservationId) { - this.reservationId = reservationId; - return this; - } - - /** - * @see Reservation#iterator - */ - public Builder<T> instance(T instance) { - this.instances.add(checkNotNull(instance, "instance")); - return this; - } - - /** - * @see Reservation#iterator - */ - public Builder<T> instances(Set<T> instances) { - this.instances.addAll(checkNotNull(instances, "instances")); - return this; - } - - /** - * @see Reservation#getGroupNames() - */ - public Builder<T> groupName(String groupName) { - this.groupNames.add(checkNotNull(groupName, "groupName")); - return this; - } - - /** - * @see Reservation#getGroupNames() - */ - public Builder<T> groupNames(Iterable<String> groupNames) { - this.groupNames = ImmutableSet.<String> builder().addAll(checkNotNull(groupNames, "groupNames")); - return this; - } - - public Reservation<T> build() { - return new Reservation<T>(region, groupNames.build(), instances.build(), ownerId, requesterId, reservationId); - } - - public Builder<T> fromReservation(Reservation<T> in) { - return region(in.region).ownerId(in.ownerId).requesterId(in.requesterId).reservationId(in.reservationId) - .instances(in).groupNames(in.groupNames); - } - } - - private final String region; - private final ImmutableSet<String> groupNames; - private final ImmutableSet<T> instances; - @Nullable - private final String ownerId; - @Nullable - private final String requesterId; - @Nullable - private final String reservationId; - - public Reservation(String region, Iterable<String> groupNames, Iterable<T> instances, @Nullable String ownerId, - @Nullable String requesterId, @Nullable String reservationId) { - this.region = checkNotNull(region, "region"); - this.groupNames = ImmutableSet.copyOf(checkNotNull(groupNames, "groupNames")); - this.instances = ImmutableSet.copyOf(checkNotNull(instances, "instances")); - this.ownerId = ownerId; - this.requesterId = requesterId; - this.reservationId = reservationId; - } - - @Override - protected Set<T> delegate() { - return instances; - } - - /** - * To be removed in jclouds 1.6 <h4>Warning</h4> - * - * Especially on EC2 clones that may not support regions, this value is fragile. Consider - * alternate means to determine context. - */ - @Deprecated - public String getRegion() { - return region; - } - - /** - * Names of the security groups. - */ - public Set<String> getGroupNames() { - return groupNames; - } - - /** - * AWS Access Key ID of the user who owns the reservation. - */ - public String getOwnerId() { - return ownerId; - } - - /** - * The ID of the requester that launched the instances on your behalf (for example, AWS - * Management Console or Auto Scaling). - */ - public String getRequesterId() { - return requesterId; - } - - /** - * Unique ID of the reservation. - */ - public String getReservationId() { - return reservationId; - } - - @Override - public int hashCode() { - return Objects.hashCode(region, reservationId, super.hashCode()); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null || getClass() != obj.getClass()) - return false; - @SuppressWarnings("unchecked") - Reservation<T> that = Reservation.class.cast(obj); - return super.equals(that) && Objects.equal(this.region, that.region) - && Objects.equal(this.reservationId, that.reservationId); - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return Objects.toStringHelper(this).omitNullValues().add("region", region).add("reservationId", reservationId) - .add("requesterId", requesterId).add("instances", instances).add("groupNames", groupNames).toString(); - } - - @Override - public int compareTo(Reservation<T> other) { - return ComparisonChain.start().compare(region, other.region) - .compare(reservationId, other.reservationId, Ordering.natural().nullsLast()).result(); - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/ReservedInstancesOffering.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/ReservedInstancesOffering.java b/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/ReservedInstancesOffering.java deleted file mode 100644 index 779fe9c..0000000 --- a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/ReservedInstancesOffering.java +++ /dev/null @@ -1,182 +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.ec2.domain; - -/** - * - * @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-CreateVolume.html" - * /> - * @author Adrian Cole - */ -public class ReservedInstancesOffering implements Comparable<ReservedInstancesOffering> { - private final String region; - private final String availabilityZone; - private final long duration; - private final float fixedPrice; - private final String instanceType; - private final String productDescription; - private final String id; - private final float usagePrice; - - public ReservedInstancesOffering(String region, String availabilityZone, long duration, float fixedPrice, String instanceType, - String productDescription, String reservedInstancesOfferingId, float usagePrice) { - this.region = region; - this.availabilityZone = availabilityZone; - this.duration = duration; - this.fixedPrice = fixedPrice; - this.instanceType = instanceType; - this.productDescription = productDescription; - this.id = reservedInstancesOfferingId; - this.usagePrice = usagePrice; - } - - /** - * To be removed in jclouds 1.6 <h4>Warning</h4> - * - * Especially on EC2 clones that may not support regions, this value is fragile. Consider - * alternate means to determine context. - */ - @Deprecated - public String getRegion() { - return region; - } - - /** - * @return The Availability Zone in which the Reserved Instance can be used. - */ - public String getAvailabilityZone() { - return availabilityZone; - } - - /** - * - * @return The duration of the Reserved Instance, in seconds - */ - public long getDuration() { - return duration; - } - - /** - * - * @return The purchase price of the Reserved Instance. - */ - public float getFixedPrice() { - return fixedPrice; - } - - /** - * - * @return The instance type on which the Reserved Instance can be used. - */ - public String getInstanceType() { - return instanceType; - } - - /** - * - * @return The Reserved Instance description. - */ - public String getProductDescription() { - return productDescription; - } - - /** - * @return The ID of the Reserved Instance offering. - */ - public String getId() { - return id; - } - - /** - * - * @return The usage price of the Reserved Instance, per hour. - */ - public float getUsagePrice() { - return usagePrice; - } - - @Override - public int compareTo(ReservedInstancesOffering o) { - return id.compareTo(o.id); - } - - @Override - public String toString() { - return "[availabilityZone=" + availabilityZone + ", duration=" + duration - + ", fixedPrice=" + fixedPrice + ", id=" + id + ", instanceType=" + instanceType + ", productDescription=" - + productDescription + ", region=" + region + ", usagePrice=" + usagePrice + "]"; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((availabilityZone == null) ? 0 : availabilityZone.hashCode()); - result = prime * result + (int) (duration ^ (duration >>> 32)); - result = prime * result + Float.floatToIntBits(fixedPrice); - result = prime * result + ((id == null) ? 0 : id.hashCode()); - result = prime * result + ((instanceType == null) ? 0 : instanceType.hashCode()); - result = prime * result + ((productDescription == null) ? 0 : productDescription.hashCode()); - result = prime * result + ((region == null) ? 0 : region.hashCode()); - result = prime * result + Float.floatToIntBits(usagePrice); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - ReservedInstancesOffering other = (ReservedInstancesOffering) obj; - if (availabilityZone == null) { - if (other.availabilityZone != null) - return false; - } else if (!availabilityZone.equals(other.availabilityZone)) - return false; - if (duration != other.duration) - return false; - if (Float.floatToIntBits(fixedPrice) != Float.floatToIntBits(other.fixedPrice)) - return false; - if (id == null) { - if (other.id != null) - return false; - } else if (!id.equals(other.id)) - return false; - if (instanceType == null) { - if (other.instanceType != null) - return false; - } else if (!instanceType.equals(other.instanceType)) - return false; - if (productDescription == null) { - if (other.productDescription != null) - return false; - } else if (!productDescription.equals(other.productDescription)) - return false; - if (region == null) { - if (other.region != null) - return false; - } else if (!region.equals(other.region)) - return false; - if (Float.floatToIntBits(usagePrice) != Float.floatToIntBits(other.usagePrice)) - return false; - return true; - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/RootDeviceType.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/RootDeviceType.java b/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/RootDeviceType.java deleted file mode 100644 index 687d842..0000000 --- a/dependencies/jclouds/apis/ec2/1.7.1-stratos/src/main/java/org/jclouds/ec2/domain/RootDeviceType.java +++ /dev/null @@ -1,48 +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.ec2.domain; - -import com.google.common.base.CaseFormat; - -/** - * The root device type used by the AMI. The AMI can use an Amazon EBS or instance store root - * device. - * - * @author Adrian Cole - */ -public enum RootDeviceType { - - INSTANCE_STORE, - - EBS, UNRECOGNIZED; - - public String value() { - return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name()); - } - - public String toString() { - return value(); - } - - public static RootDeviceType fromValue(String v) { - try { - return valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, v)); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } -}
