jclouds-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds-labs-openstack] JCLOUDS-215 - Adds Webhook and Execution support to autoscale (#48)
Date Thu, 07 Nov 2013 22:29:45 GMT
> +    * The capability Link for the webhook can be called with a POST request to execute
the webhook anonymously.
> +    * @return the links to this ScalingPolicy.
> +    * @see ScalingPolicyResponse.Builder#links(String)
> +    */
> +   public ImmutableList<Link> getLinks() {
> +      return this.links;
> +   }
> +   
> +   public URI getAnonymousExecutionURI() {
> +      // TODO: Add Relation.CAPABILITY to openstack Link
> +      for (Link l : this.links) {
> +         if (l.getRelation() == Relation.UNRECOGNIZED) {
> +            return l.getHref();
> +         }
> +      }
> +      return null;

We try to avoid returning `null` to express absence. Could this method be refactored to return
an `Optional<URI>`?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/48/files#r7512902
Mime
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message