You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ad...@apache.org on 2014/10/25 20:39:48 UTC
[1/2] git commit: JCLOUDS-750 Use AutoValue to decruft value types
and remove guava dependency from them.
Repository: jclouds-labs
Updated Branches:
refs/heads/master 53d85b62a -> 9a75c9bc1
JCLOUDS-750 Use AutoValue to decruft value types and remove guava dependency from them.
Project: http://git-wip-us.apache.org/repos/asf/jclouds-labs/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/9a75c9bc
Tree: http://git-wip-us.apache.org/repos/asf/jclouds-labs/tree/9a75c9bc
Diff: http://git-wip-us.apache.org/repos/asf/jclouds-labs/diff/9a75c9bc
Branch: refs/heads/master
Commit: 9a75c9bc17dd0af36bd22981fac8f3b7c168bf13
Parents: f7d9dcd
Author: Adrian Cole <ad...@gmail.com>
Authored: Fri Oct 24 21:11:11 2014 -0700
Committer: Adrian Cole <ad...@apache.org>
Committed: Sat Oct 25 11:39:41 2014 -0700
----------------------------------------------------------------------
azurecompute/README.md | 2 +-
.../azurecompute/domain/CloudService.java | 114 ++----------
.../jclouds/azurecompute/domain/Deployment.java | 137 ++-------------
.../azurecompute/domain/DeploymentParams.java | 169 +++---------------
.../org/jclouds/azurecompute/domain/Disk.java | 175 +++----------------
.../org/jclouds/azurecompute/domain/Error.java | 53 +-----
.../jclouds/azurecompute/domain/Location.java | 63 +------
.../jclouds/azurecompute/domain/OSImage.java | 120 ++-----------
.../azurecompute/domain/OSImageParams.java | 67 +------
.../jclouds/azurecompute/domain/Operation.java | 68 +------
10 files changed, 121 insertions(+), 847 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/9a75c9bc/azurecompute/README.md
----------------------------------------------------------------------
diff --git a/azurecompute/README.md b/azurecompute/README.md
index 472a32f..b38c672 100644
--- a/azurecompute/README.md
+++ b/azurecompute/README.md
@@ -1,6 +1,6 @@
=== Annotation processing
In order for value object and service loader auto-generation, you will need to enable annotation processing in your IDE.
-
+If you notice any inconsistencies in your IDE after you enable annotation processing, try rerunning "Make Project".
=== Setting up test credentials
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/9a75c9bc/azurecompute/src/main/java/org/jclouds/azurecompute/domain/CloudService.java
----------------------------------------------------------------------
diff --git a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/CloudService.java b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/CloudService.java
index bc29be7..be61725 100644
--- a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/CloudService.java
+++ b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/CloudService.java
@@ -16,16 +16,12 @@
*/
package org.jclouds.azurecompute.domain;
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-
import java.util.Date;
import java.util.Map;
import org.jclouds.javax.annotation.Nullable;
-import com.google.common.base.Objects;
+import com.google.auto.value.AutoValue;
/**
* System properties for the specified cloud service. These properties include the service name and
@@ -34,7 +30,8 @@ import com.google.common.base.Objects;
*
* @see <a href="http://msdn.microsoft.com/en-us/library/gg441293" >api</a>
*/
-public final class CloudService {
+@AutoValue
+public abstract class CloudService {
public enum Status {
CREATING, CREATED, DELETING, DELETED, CHANGING, RESOLVING_DNS,
UNRECOGNIZED;
@@ -47,50 +44,34 @@ public final class CloudService {
* <p/>For example, if the service name is MyService you could access the access the service by
* calling: http://MyService.cloudapp.net
*/
- public String name() {
- return name;
- }
+ public abstract String name();
/**
* The geo-location of the cloud service in Windows Azure, if the cloud service is not
* associated with an affinity group. If a location has been specified, the AffinityGroup element
* is not returned.
*/
- @Nullable public String location() {
- return location;
- }
+ @Nullable public abstract String location();
/**
* The affinity group with which this cloud service is associated, if any. If the service is
* associated with an affinity group, the Location element is not returned.
*/
- @Nullable public String affinityGroup() {
- return affinityGroup;
- }
+ @Nullable public abstract String affinityGroup();
/**
* The name can be up to 100 characters in length. The name can be used identify the storage account for your
* tracking purposes.
*/
- public String label() {
- return label;
- }
+ public abstract String label();
- @Nullable public String description() {
- return description;
- }
+ @Nullable public abstract String description();
- public Status status() {
- return status;
- }
+ public abstract Status status();
- public Date created() {
- return created;
- }
+ public abstract Date created();
- public Date lastModified() {
- return lastModified;
- }
+ public abstract Date lastModified();
/**
* Represents the name of an extended cloud service property. Each extended property must have
@@ -101,78 +82,11 @@ public final class CloudService {
* underscores are valid in the Name, and the name must start with a letter. Each extended
* property value has a maximum length of 255 characters.
*/
- public Map<String, String> extendedProperties() {
- return extendedProperties;
- }
+ public abstract Map<String, String> extendedProperties();
public static CloudService create(String name, String location, String affinityGroup, String label,
String description, Status status, Date created, Date lastModified, Map<String, String> extendedProperties) {
- return new CloudService(name, location, affinityGroup, label, description, status, created, lastModified,
- extendedProperties);
- }
-
- // TODO: Remove from here down with @AutoValue.
- private CloudService(String name, String location, String affinityGroup, String label, String description,
- Status status, Date created, Date lastModified, Map<String, String> extendedProperties) {
- this.name = checkNotNull(name, "name");
- this.location = location;
- this.affinityGroup = affinityGroup;
- this.label = checkNotNull(label, "label");
- this.description = description;
- this.status = checkNotNull(status, "status");
- this.created = checkNotNull(created, "created");
- this.lastModified = checkNotNull(lastModified, "lastModified");
- this.extendedProperties = checkNotNull(extendedProperties, "extendedProperties");
- }
-
- private final String name;
- private final String location;
- private final String affinityGroup;
- private final String label;
- private final String description;
- private final Status status;
- private final Date created;
- private final Date lastModified;
- private final Map<String, String> extendedProperties;
-
- @Override
- public boolean equals(Object object) {
- if (this == object) {
- return true;
- }
- if (object instanceof CloudService) {
- CloudService that = CloudService.class.cast(object);
- return equal(name, that.name)
- && equal(location, that.location)
- && equal(affinityGroup, that.affinityGroup)
- && equal(label, that.label)
- && equal(description, that.description)
- && equal(status, that.status)
- && equal(created, that.created)
- && equal(lastModified, that.lastModified)
- && equal(extendedProperties, that.extendedProperties);
- } else {
- return false;
- }
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(name, location, affinityGroup, label, description, status, created, lastModified,
- extendedProperties);
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("name", name)
- .add("location", location)
- .add("affinityGroup", affinityGroup)
- .add("label", label)
- .add("description", description)
- .add("status", status)
- .add("created", created)
- .add("lastModified", lastModified)
- .add("extendedProperties", extendedProperties).toString();
+ return new AutoValue_CloudService(name, location, affinityGroup, label, description, status, created,
+ lastModified, extendedProperties);
}
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/9a75c9bc/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Deployment.java
----------------------------------------------------------------------
diff --git a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Deployment.java b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Deployment.java
index 580c59d..fa4d033 100644
--- a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Deployment.java
+++ b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Deployment.java
@@ -16,15 +16,12 @@
*/
package org.jclouds.azurecompute.domain;
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-
import org.jclouds.javax.annotation.Nullable;
-import com.google.common.base.Objects;
+import com.google.auto.value.AutoValue;
-public final class Deployment {
+@AutoValue
+public abstract class Deployment {
public enum Slot {
PRODUCTION, STAGING,
@@ -47,42 +44,28 @@ public final class Deployment {
}
/** The user-supplied name for this deployment. */
- public String name() {
- return name;
- }
+ public abstract String name();
/** The environment to which the cloud service is deployed. */
- public Slot slot() {
- return slot;
- }
+ public abstract Slot slot();
- public Status status() {
- return status;
- }
+ public abstract Status status();
/**
* The user-supplied name of the deployment returned as a base-64 encoded
* string. This name can be used identify the deployment for your tracking
* purposes.
*/
- public String label() {
- return label;
- }
+ public abstract String label();
/** Specifies the name for the virtual machine. The name must be unique within Windows Azure. */
- public String virtualMachineName() {
- return virtualMachineName;
- }
+ public abstract String virtualMachineName();
/** The name of the specific role instance (if any). */
- @Nullable public String instanceName() {
- return instanceName;
- }
+ @Nullable public abstract String instanceName();
/** The current status of this instance. */
- public InstanceStatus instanceStatus() {
- return instanceStatus;
- }
+ public abstract InstanceStatus instanceStatus();
/**
* The instance state is returned as an English human-readable string that,
@@ -92,9 +75,7 @@ public final class Deployment {
* For example, when the instance is first being initialized a
* "Preparing Windows for first use." could be returned.
*/
- @Nullable public String instanceStateDetails() {
- return instanceStateDetails;
- }
+ @Nullable public abstract String instanceStateDetails();
/**
* Error code of the latest role or VM start
@@ -115,102 +96,18 @@ public final class Deployment {
* For web and worker roles this field returns an error code that can be provided to Windows Azure support to assist
* in resolution of errors. Typically this field will be empty.
*/
- @Nullable public String instanceErrorCode() {
- return instanceErrorCode;
- }
+ @Nullable public abstract String instanceErrorCode();
- public RoleSize instanceSize() {
- return instanceSize;
- }
+ public abstract RoleSize instanceSize();
- public String privateIpAddress() {
- return privateIpAddress;
- }
+ public abstract String privateIpAddress();
- public String publicIpAddress() {
- return publicIpAddress;
- }
+ public abstract String publicIpAddress();
public static Deployment create(String name, Slot slot, Status status, String label, String virtualMachineName,
String instanceName, InstanceStatus instanceStatus, String instanceStateDetails, String instanceErrorCode,
RoleSize instanceSize, String privateIpAddress, String publicIpAddress) {
- return new Deployment(name, slot, status, label, virtualMachineName, instanceName, instanceStatus, instanceStateDetails,
- instanceErrorCode, instanceSize, privateIpAddress, publicIpAddress);
- }
-
- // TODO: Remove from here down with @AutoValue.
- private Deployment(String name, Slot slot, Status status, String label, String virtualMachineName, String instanceName,
- InstanceStatus instanceStatus, String instanceStateDetails, String instanceErrorCode, RoleSize instanceSize,
- String privateIpAddress, String publicIpAddress) {
- this.name = checkNotNull(name, "name");
- this.slot = checkNotNull(slot, "slot");
- this.status = checkNotNull(status, "status");
- this.label = checkNotNull(label, "label");
- this.virtualMachineName = checkNotNull(virtualMachineName, "virtualMachineName");
- this.instanceName = instanceName;
- this.instanceStatus = checkNotNull(instanceStatus, "instanceStatus");
- this.instanceStateDetails = instanceStateDetails;
- this.instanceErrorCode = instanceErrorCode;
- this.instanceSize = checkNotNull(instanceSize, "instanceSize");
- this.privateIpAddress = checkNotNull(privateIpAddress, "privateIpAddress");
- this.publicIpAddress = checkNotNull(publicIpAddress, "publicIpAddress");
- }
-
- private final String name;
- private final Slot slot;
- private final Status status;
- private final String label;
- private final String virtualMachineName;
- private final String instanceName;
- private final InstanceStatus instanceStatus;
- private final String instanceStateDetails;
- private final String instanceErrorCode;
- private final RoleSize instanceSize;
- private final String privateIpAddress;
- private final String publicIpAddress;
-
- @Override
- public boolean equals(Object object) {
- if (this == object) {
- return true;
- }
- if (object instanceof Deployment) {
- Deployment that = Deployment.class.cast(object);
- return equal(name, that.name)
- && equal(slot, that.slot)
- && equal(label, that.label)
- && equal(virtualMachineName, that.virtualMachineName)
- && equal(instanceName, that.instanceName)
- && equal(instanceStatus, that.instanceStatus)
- && equal(instanceStateDetails, that.instanceStateDetails)
- && equal(instanceErrorCode, that.instanceErrorCode)
- && equal(instanceSize, that.instanceSize)
- && equal(privateIpAddress, that.privateIpAddress)
- && equal(publicIpAddress, that.publicIpAddress);
- } else {
- return false;
- }
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(name, slot, label, virtualMachineName, instanceName, instanceStatus, instanceStateDetails,
- instanceErrorCode, instanceSize, privateIpAddress, publicIpAddress);
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("name", name)
- .add("slot", slot)
- .add("label", label)
- .add("virtualMachineName", virtualMachineName)
- .add("instanceName", instanceName)
- .add("instanceStatus", instanceStatus)
- .add("instanceStateDetails", instanceStateDetails)
- .add("instanceErrorCode", instanceErrorCode)
- .add("instanceSize", instanceSize)
- .add("privateIpAddress", privateIpAddress)
- .add("publicIpAddress", publicIpAddress).toString();
+ return new AutoValue_Deployment(name, slot, status, label, virtualMachineName, instanceName, instanceStatus,
+ instanceStateDetails, instanceErrorCode, instanceSize, privateIpAddress, publicIpAddress);
}
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/9a75c9bc/azurecompute/src/main/java/org/jclouds/azurecompute/domain/DeploymentParams.java
----------------------------------------------------------------------
diff --git a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/DeploymentParams.java b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/DeploymentParams.java
index e75fa19..6ccc5e8 100644
--- a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/DeploymentParams.java
+++ b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/DeploymentParams.java
@@ -16,15 +16,11 @@
*/
package org.jclouds.azurecompute.domain;
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-
import java.net.URI;
import java.util.Collection;
import java.util.List;
-import com.google.common.base.Objects;
+import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
@@ -34,122 +30,64 @@ import com.google.common.collect.Lists;
* Warning : the OSType must be the one of the source image used to create the VM
*/
// TODO: check which can be null.
-public final class DeploymentParams {
-
- public static final class ExternalEndpoint {
+@AutoValue
+public abstract class DeploymentParams {
+ @AutoValue
+ public abstract static class ExternalEndpoint {
- public String name() {
- return name;
- }
+ public abstract String name();
/** Either {@code tcp} or {@code udp}. */
- public String protocol() {
- return protocol;
- }
+ public abstract String protocol();
- public int port() {
- return port;
- }
+ public abstract int port();
- public int localPort() {
- return localPort;
- }
+ public abstract int localPort();
public static ExternalEndpoint inboundTcpToLocalPort(int port, int localPort) {
- return new ExternalEndpoint(String.format("tcp %s:%s", port, localPort), "tcp", port, localPort);
+ return new AutoValue_DeploymentParams_ExternalEndpoint(String.format("tcp %s:%s", port, localPort), "tcp",
+ port, localPort);
}
public static ExternalEndpoint inboundUdpToLocalPort(int port, int localPort) {
- return new ExternalEndpoint(String.format("udp %s:%s", port, localPort), "udp", port, localPort);
- }
-
- // TODO: Remove from here down with @AutoValue.
- private ExternalEndpoint(String name, String protocol, int port, int localPort) {
- this.name = checkNotNull(name, "name");
- this.protocol = checkNotNull(protocol, "protocol");
- this.port = port;
- this.localPort = localPort;
- }
-
- private final String name;
- private final String protocol;
- private final int port;
- private final int localPort;
-
- @Override public int hashCode() {
- return Objects.hashCode(name, protocol, localPort, port);
+ return new AutoValue_DeploymentParams_ExternalEndpoint(String.format("udp %s:%s", port, localPort), "udp",
+ port, localPort);
}
- @Override public boolean equals(Object object) {
- if (this == object) {
- return true;
- }
- if (object instanceof ExternalEndpoint) {
- ExternalEndpoint that = ExternalEndpoint.class.cast(object);
- return equal(name, that.name)
- && equal(protocol, that.protocol)
- && equal(localPort, that.localPort)
- && equal(port, that.port);
- } else {
- return false;
- }
- }
-
- @Override public String toString() {
- return toStringHelper(this)
- .add("name", name)
- .add("protocol", protocol)
- .add("port", port)
- .add("localPort", localPort).toString();
+ ExternalEndpoint() { // For AutoValue only!
}
}
/** The user-supplied name for this deployment. */
- public String name() {
- return name;
- }
+ public abstract String name();
+
+ /** The size of the virtual machine to allocate. The default value is Small. */
+ public abstract RoleSize size();
/**
* Specifies the name of a user to be created in the sudoers group of the
* virtual machine. User names are ASCII character strings 1 to 32
* characters in length.
*/
- public String username() {
- return username;
- }
-
- /** The size of the virtual machine to allocate. The default value is Small. */
- public RoleSize size() {
- return size;
- }
+ public abstract String username();
/**
* Specifies the associated password for the user name.
* Passwords are ASCII character strings 6 to 72 characters in
* length.
*/
- public String password() {
- return password;
- }
+ public abstract String password();
/** {@link OSImage#name() name} of the user or platform image. */
- public String sourceImageName() {
- return sourceImageName;
- }
+ public abstract String sourceImageName();
/** Indicates the {@link OSImage#mediaLink() location} when {@link #sourceImageName() source} is a platform image. */
- public URI mediaLink() {
- return mediaLink;
- }
+ public abstract URI mediaLink();
/** {@link OSImage#os() Os type} of the {@link #sourceImageName() source image}. */
- public OSImage.Type os() {
- return os;
- }
+ public abstract OSImage.Type os();
- public List<ExternalEndpoint> externalEndpoints() {
- return externalEndpoints;
- }
+ public abstract List<ExternalEndpoint> externalEndpoints();
public Builder toBuilder() {
return builder().fromDeploymentParams(this);
@@ -233,63 +171,6 @@ public final class DeploymentParams {
private static DeploymentParams create(String name, RoleSize size, String username, String password, String sourceImageName,
URI mediaLink, OSImage.Type os, List<ExternalEndpoint> externalEndpoints) {
- return new DeploymentParams(name, size, username, password, sourceImageName, mediaLink, os, externalEndpoints);
- }
-
- // TODO: Remove from here down with @AutoValue.
- private DeploymentParams(String name, RoleSize size, String username, String password, String sourceImageName, URI mediaLink,
- OSImage.Type os, List<ExternalEndpoint> externalEndpoints) {
- this.name = checkNotNull(name, "name");
- this.size = checkNotNull(size, "size");
- this.username = checkNotNull(username, "username");
- this.password = checkNotNull(password, "password");
- this.sourceImageName = checkNotNull(sourceImageName, "sourceImageName");
- this.mediaLink = checkNotNull(mediaLink, "mediaLink");
- this.os = checkNotNull(os, "os");
- this.externalEndpoints = checkNotNull(externalEndpoints, "externalEndpoints");
- }
-
- private final String name;
- private final RoleSize size;
- private final String username;
- private final String password;
- private final String sourceImageName;
- private final URI mediaLink;
- private final OSImage.Type os;
- private final List<ExternalEndpoint> externalEndpoints;
-
- @Override public int hashCode() {
- return Objects.hashCode(name, sourceImageName, username, password, mediaLink, size, os, externalEndpoints);
- }
-
- @Override public boolean equals(Object object) {
- if (this == object) {
- return true;
- }
- if (object instanceof DeploymentParams) {
- DeploymentParams that = DeploymentParams.class.cast(object);
- return equal(name, that.name)
- && equal(size, that.size)
- && equal(username, that.username)
- && equal(password, that.password)
- && equal(sourceImageName, that.sourceImageName)
- && equal(mediaLink, that.mediaLink)
- && equal(os, that.os)
- && equal(externalEndpoints, that.externalEndpoints);
- } else {
- return false;
- }
- }
-
- @Override public String toString() {
- return toStringHelper(this)
- .add("name", name)
- .add("size", size)
- .add("username", username)
- .add("password", password)
- .add("sourceImageName", sourceImageName)
- .add("mediaLink", mediaLink)
- .add("os", os)
- .add("externalEndpoints", externalEndpoints).toString();
+ return new AutoValue_DeploymentParams(name, size, username, password, sourceImageName, mediaLink, os, externalEndpoints);
}
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/9a75c9bc/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Disk.java
----------------------------------------------------------------------
diff --git a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Disk.java b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Disk.java
index 888e9af..6c67ac4 100644
--- a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Disk.java
+++ b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Disk.java
@@ -16,118 +16,58 @@
*/
package org.jclouds.azurecompute.domain;
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-
import java.net.URI;
import org.jclouds.javax.annotation.Nullable;
-import com.google.common.base.Objects;
+import com.google.auto.value.AutoValue;
/**
* A disk in the image repository.
*
* @see <a href="http://msdn.microsoft.com/en-us/library/jj157176" >api</a>
*/
-public final class Disk {
- public static final class Attachment {
+@AutoValue
+public abstract class Disk {
+ @AutoValue
+ public abstract static class Attachment {
/** The deployment in which the disk is being used. */
- public String deployment() {
- return deployment;
- }
+ public abstract String deployment();
/** The cloud service in which the disk is being used. */
- public String hostedService() {
- return hostedService;
- }
+ public abstract String hostedService();
/** The virtual machine that the disk is attached to. */
- public String virtualMachine() {
- return virtualMachine;
- }
+ public abstract String virtualMachine();
public static Attachment create(String hostedService, String deployment, String virtualMachine) {
- return new Attachment(hostedService, deployment, virtualMachine);
- }
-
- // TODO: Remove from here down with @AutoValue.
- private Attachment(String hostedService, String deployment, String virtualMachine) {
- this.hostedService = checkNotNull(hostedService, "hostedService");
- this.deployment = checkNotNull(deployment, "deployment");
- this.virtualMachine = checkNotNull(virtualMachine, "virtualMachine");
- }
-
- private final String hostedService;
- private final String deployment;
- private final String virtualMachine;
-
- @Override
- public int hashCode() {
- return Objects.hashCode(hostedService, deployment, virtualMachine);
+ return new AutoValue_Disk_Attachment(hostedService, deployment, virtualMachine);
}
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- Attachment other = (Attachment) obj;
- return equal(this.hostedService, other.hostedService) &&
- equal(this.deployment, other.deployment) &&
- equal(this.virtualMachine, other.virtualMachine);
- }
-
- @Override
- public String toString() {
- return Objects.toStringHelper(this)
- .add("hostedService", hostedService)
- .add("deployment", deployment)
- .add("virtualMachine", virtualMachine).toString();
- }
-
}
/**
* The name of the disk. This is the name that is used when creating one or more virtual machines
* using the disk.
*/
- public String name() {
- return name;
- }
+ public abstract String name();
/**
* The geo-location of the disk in Windows Azure, if the disk is not
* associated with an affinity group. If a location has been specified, the AffinityGroup element
* is not returned.
*/
- @Nullable public String location() {
- return location;
- }
+ @Nullable public abstract String location();
/**
* The affinity group with which this disk is associated, if any. If the service is
* associated with an affinity group, the Location element is not returned.
*/
- @Nullable public String affinityGroup() {
- return affinityGroup;
- }
+ @Nullable public abstract String affinityGroup();
- @Nullable public String description() {
- return description;
- }
+ @Nullable public abstract String description();
/** The operating system type of the OS image, or null if a data disk. */
- @Nullable public OSImage.Type os() {
- return os;
- }
+ @Nullable public abstract OSImage.Type os();
/**
* The location of the blob in the blob store in which the media for the image is located. The
@@ -138,99 +78,26 @@ public final class Disk {
*
* http://example.blob.core.windows.net/disks/myimage.vhd
*/
- @Nullable public URI mediaLink() {
- return mediaLink;
- }
+ @Nullable public abstract URI mediaLink();
- @Nullable public Integer logicalSizeInGB() {
- return logicalSizeInGB;
- }
+ @Nullable public abstract Integer logicalSizeInGB();
/**
* Contains properties that specify a virtual machine that currently using the disk. A disk
* cannot be deleted as long as it is attached to a virtual machine.
*/
- @Nullable public Attachment attachedTo() {
- return attachedTo;
- }
+ @Nullable public abstract Attachment attachedTo();
/**
* The name of the OS Image from which the disk was created. This property is populated
* automatically when a disk is created from an OS image by calling the Add Role, Create
* Deployment, or Provision Disk operations.
*/
- @Nullable public String sourceImage() {
- return sourceImage;
- }
+ @Nullable public abstract String sourceImage();
- public static Disk create(String name, String location, String affinityGroup, String description,
- OSImage.Type os, URI mediaLink, Integer logicalSizeInGB, Attachment attachedTo, String sourceImage) {
- return new Disk(name, location, affinityGroup, description, os, mediaLink, logicalSizeInGB, attachedTo,
+ public static Disk create(String name, String location, String affinityGroup, String description, OSImage.Type os,
+ URI mediaLink, Integer logicalSizeInGB, Attachment attachedTo, String sourceImage) {
+ return new AutoValue_Disk(name, location, affinityGroup, description, os, mediaLink, logicalSizeInGB, attachedTo,
sourceImage);
}
-
- // TODO: Remove from here down with @AutoValue.
- private Disk(String name, String location, String affinityGroup, String description, OSImage.Type os, URI mediaLink,
- Integer logicalSizeInGB, Attachment attachedTo, String sourceImage) {
- this.name = checkNotNull(name, "name");
- this.location = location;
- this.affinityGroup = affinityGroup;
- this.description = description;
- this.os = os;
- this.mediaLink = mediaLink;
- this.logicalSizeInGB = checkNotNull(logicalSizeInGB, "logicalSizeInGB of %s", name);
- this.attachedTo = attachedTo;
- this.sourceImage = sourceImage;
- }
-
- private final String name;
- private final String location;
- private final String affinityGroup;
- private final String description;
- private final OSImage.Type os;
- private final URI mediaLink;
- private final Integer logicalSizeInGB;
- private final Attachment attachedTo;
- private final String sourceImage;
-
- @Override
- public boolean equals(Object object) {
- if (this == object) {
- return true;
- }
- if (object instanceof Disk) {
- Disk that = Disk.class.cast(object);
- return equal(name, that.name) &&
- equal(location, that.location) &&
- equal(affinityGroup, that.affinityGroup) &&
- equal(description, that.description) &&
- equal(os, that.os) &&
- equal(mediaLink, that.mediaLink) &&
- equal(logicalSizeInGB, that.logicalSizeInGB) &&
- equal(attachedTo, that.attachedTo) &&
- equal(sourceImage, that.sourceImage);
- } else {
- return false;
- }
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(name, location, affinityGroup, description, os, mediaLink, logicalSizeInGB,
- attachedTo, sourceImage);
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("name", name)
- .add("location", location)
- .add("affinityGroup", affinityGroup)
- .add("description", description)
- .add("os", os)
- .add("mediaLink", mediaLink)
- .add("logicalSizeInGB", logicalSizeInGB)
- .add("attachedTo", attachedTo)
- .add("sourceImage", sourceImage).toString();
- }
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/9a75c9bc/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Error.java
----------------------------------------------------------------------
diff --git a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Error.java b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Error.java
index 1b529d0..beafd2a 100644
--- a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Error.java
+++ b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Error.java
@@ -16,16 +16,13 @@
*/
package org.jclouds.azurecompute.domain;
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.google.common.base.Objects;
+import com.google.auto.value.AutoValue;
/**
* @see <a href="http://msdn.microsoft.com/en-us/library/ee460801" >api</a>
*/
-public final class Error {
+@AutoValue
+public abstract class Error {
public static enum Code {
MISSING_OR_INCORRECT_VERSION_HEADER,
INVALID_XML_REQUEST,
@@ -43,50 +40,12 @@ public final class Error {
}
/** Error code */
- public Code getCode() {
- return code;
- }
+ public abstract Code code();
/** User message */
- public String message() {
- return message;
- }
+ public abstract String message();
public static Error create(Code code, String message) {
- return new Error(code, message);
- }
-
- // TODO: Remove from here down with @AutoValue.
- private Error(Code code, String message) {
- this.code = checkNotNull(code, "code");
- this.message = checkNotNull(message, "message");
- }
-
- private final Code code;
- private final String message;
-
- @Override
- public int hashCode() {
- return Objects.hashCode(code, message);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- Error other = (Error) obj;
- return equal(this.code, other.code) && equal(this.message, other.message);
- }
-
- @Override
- public String toString() {
- return toStringHelper(this).add("code", code).add("message", message).toString();
+ return new AutoValue_Error(code, message);
}
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/9a75c9bc/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Location.java
----------------------------------------------------------------------
diff --git a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Location.java b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Location.java
index 0949d46..230cf9a 100644
--- a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Location.java
+++ b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Location.java
@@ -16,73 +16,24 @@
*/
package org.jclouds.azurecompute.domain;
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-
import java.util.List;
-import com.google.common.base.Objects;
+import com.google.auto.value.AutoValue;
/** A data center location that is valid for your subscription. */
-public final class Location {
+@AutoValue
+public abstract class Location {
/** The name of the data center location. Ex. {@code West Europe}. */
- public String name() {
- return name;
- }
+ public abstract String name();
/** The localized name of the data center location. */
- public String displayName() {
- return displayName;
- }
+ public abstract String displayName();
/** Indicates the services available at this location. Ex. {@code Compute}. */
- public List<String> availableServices() {
- return availableServices;
- }
+ public abstract List<String> availableServices();
public static Location create(String name, String displayName, List<String> availableServices) {
- return new Location(name, displayName, availableServices);
- }
-
- // TODO: Remove from here down with @AutoValue.
- private Location(String name, String displayName, List<String> availableServices) {
- this.name = checkNotNull(name, "name");
- this.displayName = checkNotNull(displayName, "displayName");
- this.availableServices = checkNotNull(availableServices, "availableServices");
- }
-
- private final String name;
- private final String displayName;
- private final List<String> availableServices;
-
- @Override
- public int hashCode() {
- return Objects.hashCode(name, displayName, availableServices);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- Location other = (Location) obj;
- return equal(this.name, other.name) &&
- equal(this.displayName, other.displayName) &&
- equal(this.availableServices, other.availableServices);
- }
-
- @Override
- public String toString() {
- return Objects.toStringHelper(this)
- .add("name", name)
- .add("displayName", displayName)
- .add("availableServices", availableServices).toString();
+ return new AutoValue_Location(name, displayName, availableServices);
}
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/9a75c9bc/azurecompute/src/main/java/org/jclouds/azurecompute/domain/OSImage.java
----------------------------------------------------------------------
diff --git a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/OSImage.java b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/OSImage.java
index 5d1947c..cff6504 100644
--- a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/OSImage.java
+++ b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/OSImage.java
@@ -16,65 +16,48 @@
*/
package org.jclouds.azurecompute.domain;
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-
import java.net.URI;
import java.util.List;
import org.jclouds.javax.annotation.Nullable;
-import com.google.common.base.Objects;
+import com.google.auto.value.AutoValue;
/**
* OS image from the image repository
*
* @see <a href="http://msdn.microsoft.com/en-us/library/jj157191" >api</a>
*/
-public final class OSImage {
+@AutoValue
+public abstract class OSImage {
public enum Type {
LINUX, WINDOWS;
}
- public String name() {
- return name;
- }
+ public abstract String name();
/** The geo-locations of the image, if the image is not associated with an affinity group. */
- public List<String> locations() {
- return locations;
- }
+ public abstract List<String> locations();
/** The affinity group with which this image is associated, if any. */
- @Nullable public String affinityGroup() {
- return affinityGroup;
- }
+ @Nullable public abstract String affinityGroup();
/**
* The name can be up to 100 characters in length. The name can be used identify the storage account for your
* tracking purposes.
*/
- public String label() {
- return label;
- }
+ public abstract String label();
- @Nullable public String description() {
- return description;
- }
+ @Nullable public abstract String description();
/**
* The repository classification of image. All user images have the category "User", but
* categories for other images could be, for example "Canonical"
*/
- @Nullable public String category() {
- return category;
- }
+ @Nullable public abstract String category();
/** The operating system type of the OS image. */
- public Type os() {
- return os;
- }
+ public abstract Type os();
/**
* The locations of the blob in the blob store in which the media for the image is located. The
@@ -85,92 +68,17 @@ public final class OSImage {
*
* http://example.blob.core.windows.net/disks/myimage.vhd
*/
- @Nullable public URI mediaLink() {
- return mediaLink;
- }
+ @Nullable public abstract URI mediaLink();
- public int logicalSizeInGB() {
- return logicalSizeInGB;
- }
+ public abstract int logicalSizeInGB();
/** The eulas for the image, if available. */
// Not URI as some providers put non-uri data in, such as riverbed.
- public List<String> eula() {
- return eula;
- }
+ public abstract List<String> eula();
public static OSImage create(String name, List<String> locations, String affinityGroup, String label,
String description, String category, Type os, URI mediaLink, int logicalSizeInGB, List<String> eula) {
- return new OSImage(name, locations, affinityGroup, label, description, category, os, mediaLink, logicalSizeInGB,
- eula);
- }
-
- // TODO: Remove from here down with @AutoValue.
- private OSImage(String name, List<String> locations, String affinityGroup, String label, String description,
- String category, Type os, URI mediaLink, int logicalSizeInGB, List<String> eula) {
- this.name = checkNotNull(name, "name");
- this.locations = locations;
- this.affinityGroup = affinityGroup;
- this.label = checkNotNull(label, "label");
- this.description = description;
- this.category = category;
- this.os = checkNotNull(os, "os");
- this.mediaLink = mediaLink;
- this.logicalSizeInGB = logicalSizeInGB;
- this.eula = checkNotNull(eula, "eula");
- }
-
- private final String name;
- private final List<String> locations;
- private final String affinityGroup;
- private final String label;
- private final String category;
- private final String description;
- private final Type os;
- private final URI mediaLink;
- private final int logicalSizeInGB;
- private final List<String> eula;
-
- @Override
- public boolean equals(Object object) {
- if (this == object) {
- return true;
- }
- if (object instanceof OSImage) {
- OSImage that = OSImage.class.cast(object);
- return equal(name, that.name)
- && equal(locations, that.locations)
- && equal(affinityGroup, that.affinityGroup)
- && equal(label, that.label)
- && equal(description, that.description)
- && equal(category, that.category)
- && equal(os, that.os)
- && equal(mediaLink, that.mediaLink)
- && equal(logicalSizeInGB, that.logicalSizeInGB)
- && equal(eula, that.eula);
- } else {
- return false;
- }
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(name, locations, affinityGroup, label, description, category, os, mediaLink,
+ return new AutoValue_OSImage(name, locations, affinityGroup, label, description, category, os, mediaLink,
logicalSizeInGB, eula);
}
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("name", name)
- .add("locations", locations)
- .add("affinityGroup", affinityGroup)
- .add("label", label)
- .add("description", description)
- .add("category", category)
- .add("os", os)
- .add("mediaLink", mediaLink)
- .add("logicalSizeInGB", logicalSizeInGB)
- .add("eula", eula).toString();
- }
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/9a75c9bc/azurecompute/src/main/java/org/jclouds/azurecompute/domain/OSImageParams.java
----------------------------------------------------------------------
diff --git a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/OSImageParams.java b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/OSImageParams.java
index 8f3c237..1b3906a 100644
--- a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/OSImageParams.java
+++ b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/OSImageParams.java
@@ -16,36 +16,25 @@
*/
package org.jclouds.azurecompute.domain;
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-
import java.net.URI;
-import com.google.common.base.Objects;
+import com.google.auto.value.AutoValue;
/** To create a new operating system image. */
-public final class OSImageParams {
+@AutoValue
+public abstract class OSImageParams {
/** Specifies a name that is used to identify the image when you create a Virtual Machine. */
- public String name() {
- return name;
- }
+ public abstract String name();
/** Specifies the friendly name of the image. */
- public String label() {
- return label;
- }
+ public abstract String label();
/** Specifies the location of the vhd file for the image. */
- public URI mediaLink() {
- return mediaLink;
- }
+ public abstract URI mediaLink();
/** {@link OSImage#os() Os type} of the image. */
- public OSImage.Type os() {
- return os;
- }
+ public abstract OSImage.Type os();
public Builder toBuilder() {
return builder().fromImageParams(this);
@@ -94,46 +83,6 @@ public final class OSImageParams {
}
private static OSImageParams create(String name, String label, URI mediaLink, OSImage.Type os) {
- return new OSImageParams(name, label, mediaLink, os);
- }
-
- // TODO: Remove from here down with @AutoValue.
- private OSImageParams(String name, String label, URI mediaLink, OSImage.Type os) {
- this.name = checkNotNull(name, "name");
- this.label = checkNotNull(label, "label");
- this.mediaLink = checkNotNull(mediaLink, "mediaLink");
- this.os = checkNotNull(os, "os");
- }
-
- private final String name;
- private final String label;
- private final URI mediaLink;
- private final OSImage.Type os;
-
- @Override public int hashCode() {
- return Objects.hashCode(name, label, mediaLink, os);
- }
-
- @Override public boolean equals(Object object) {
- if (this == object) {
- return true;
- }
- if (object instanceof OSImageParams) {
- OSImageParams that = OSImageParams.class.cast(object);
- return equal(name, that.name)
- && equal(label, that.label)
- && equal(mediaLink, that.mediaLink)
- && equal(os, that.os);
- } else {
- return false;
- }
- }
-
- @Override public String toString() {
- return toStringHelper(this)
- .add("name", name)
- .add("label", label)
- .add("mediaLink", mediaLink)
- .add("os", os).toString();
+ return new AutoValue_OSImageParams(name, label, mediaLink, os);
}
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/9a75c9bc/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Operation.java
----------------------------------------------------------------------
diff --git a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Operation.java b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Operation.java
index 0c0b02a..73e7e9a 100644
--- a/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Operation.java
+++ b/azurecompute/src/main/java/org/jclouds/azurecompute/domain/Operation.java
@@ -16,12 +16,9 @@
*/
package org.jclouds.azurecompute.domain;
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-
import org.jclouds.javax.annotation.Nullable;
-import com.google.common.base.Objects;
+import com.google.auto.value.AutoValue;
/**
*
@@ -29,72 +26,23 @@ import com.google.common.base.Objects;
*
* @see <a href="http://msdn.microsoft.com/en-us/library/ee460783" >api</a>
*/
-public final class Operation {
+@AutoValue
+public abstract class Operation {
public enum Status {
IN_PROGRESS, SUCCEEDED, FAILED,
UNRECOGNIZED;
}
- public String id() {
- return id;
- }
+ public abstract String id();
- public Status status() {
- return status;
- }
+ public abstract Status status();
- @Nullable public Integer httpStatusCode() {
- return httpStatusCode;
- }
+ @Nullable public abstract Integer httpStatusCode();
/** Present when the operation {@link Status#FAILED failed}. */
- @Nullable public Error error() {
- return error;
- }
+ @Nullable public abstract Error error();
public static Operation create(String id, Status status, Integer httpStatusCode, Error error) {
- return new Operation(id, status, httpStatusCode, error);
- }
-
- // TODO: Remove from here down with @AutoValue.
- private Operation(String id, Status status, Integer httpStatusCode, Error error) {
- this.id = checkNotNull(id, "id");
- this.status = checkNotNull(status, "status");
- this.httpStatusCode = httpStatusCode;
- this.error = error;
- }
-
- private final String id;
- private final Status status;
- private final Integer httpStatusCode;
- private final Error error;
-
- @Override
- public int hashCode() {
- return Objects.hashCode(id, status, httpStatusCode, error);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Operation other = (Operation) obj;
- return equal(this.id, other.id) &&
- equal(this.status, other.status) &&
- equal(this.httpStatusCode, other.httpStatusCode) &&
- equal(this.error, other.error);
- }
-
- @Override
- public String toString() {
- return Objects.toStringHelper(this)
- .add("id", id)
- .add("status", status)
- .add("httpStatusCode", httpStatusCode)
- .add("error", error).toString();
+ return new AutoValue_Operation(id, status, httpStatusCode, error);
}
}
[2/2] git commit: JCLOUDS-750 use AutoService to replace error-prone
ProviderMetadata manifests.
Posted by ad...@apache.org.
JCLOUDS-750 use AutoService to replace error-prone ProviderMetadata manifests.
Project: http://git-wip-us.apache.org/repos/asf/jclouds-labs/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/f7d9dcdf
Tree: http://git-wip-us.apache.org/repos/asf/jclouds-labs/tree/f7d9dcdf
Diff: http://git-wip-us.apache.org/repos/asf/jclouds-labs/diff/f7d9dcdf
Branch: refs/heads/master
Commit: f7d9dcdfb60023c99841c9fd59ec78db8e20a372
Parents: 53d85b6
Author: Adrian Cole <ad...@gmail.com>
Authored: Fri Oct 24 20:29:34 2014 -0700
Committer: Adrian Cole <ad...@apache.org>
Committed: Sat Oct 25 11:39:41 2014 -0700
----------------------------------------------------------------------
azurecompute/README.md | 3 +++
azurecompute/pom.xml | 6 ++++++
.../org/jclouds/azurecompute/AzureComputeProviderMetadata.java | 6 +++---
.../META-INF/services/org.jclouds.providers.ProviderMetadata | 1 -
4 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f7d9dcdf/azurecompute/README.md
----------------------------------------------------------------------
diff --git a/azurecompute/README.md b/azurecompute/README.md
index b1a9f61..472a32f 100644
--- a/azurecompute/README.md
+++ b/azurecompute/README.md
@@ -1,3 +1,6 @@
+=== Annotation processing
+In order for value object and service loader auto-generation, you will need to enable annotation processing in your IDE.
+
=== Setting up test credentials
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f7d9dcdf/azurecompute/pom.xml
----------------------------------------------------------------------
diff --git a/azurecompute/pom.xml b/azurecompute/pom.xml
index 22431e8..b53be03 100644
--- a/azurecompute/pom.xml
+++ b/azurecompute/pom.xml
@@ -68,6 +68,12 @@
<version>${project.parent.version}</version>
</dependency>
<dependency>
+ <groupId>com.google.auto.value</groupId>
+ <artifactId>auto-value</artifactId>
+ <version>1.0-rc2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.jclouds</groupId>
<artifactId>jclouds-compute</artifactId>
<version>${project.parent.version}</version>
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f7d9dcdf/azurecompute/src/main/java/org/jclouds/azurecompute/AzureComputeProviderMetadata.java
----------------------------------------------------------------------
diff --git a/azurecompute/src/main/java/org/jclouds/azurecompute/AzureComputeProviderMetadata.java b/azurecompute/src/main/java/org/jclouds/azurecompute/AzureComputeProviderMetadata.java
index 9c811ce..e9bb875 100644
--- a/azurecompute/src/main/java/org/jclouds/azurecompute/AzureComputeProviderMetadata.java
+++ b/azurecompute/src/main/java/org/jclouds/azurecompute/AzureComputeProviderMetadata.java
@@ -24,9 +24,9 @@ import java.util.Properties;
import org.jclouds.providers.ProviderMetadata;
import org.jclouds.providers.internal.BaseProviderMetadata;
-/**
- * Implementation of {@link ProviderMetadata} for Microsoft Azure Service Management Service.
- */
+import com.google.auto.service.AutoService;
+
+@AutoService(ProviderMetadata.class)
public class AzureComputeProviderMetadata extends BaseProviderMetadata {
public static Builder builder() {
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f7d9dcdf/azurecompute/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
----------------------------------------------------------------------
diff --git a/azurecompute/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/azurecompute/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
deleted file mode 100644
index 05b8f1f..0000000
--- a/azurecompute/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
+++ /dev/null
@@ -1 +0,0 @@
-org.jclouds.azurecompute.AzureComputeProviderMetadata