Netflix/denominator — pull request #175 by adriancole (2013-06-12 19:25:26+00:00)
Title: Add new WeightedResourceRecordSetApi and ported Route53 to use it

per issue #87 this adds a `WeightedResourceRecordSetApi` which supports the new `Weighted` profile.

`Weighted` has an integer value where `0` means always serve, and a positive number implies a fraction of traffic divided by the other participating members.

`WeightedResourceRecordSetApi` is the first api to implement `QualifiedResourceRecordSetApi`, a mutable interface for record sets with qualifiers such as `US-West`.

Besides the usual write operations, `WeightedResourceRecordSetApi` exposes metadata which helps reveal what the valid weights can be. This is important particularly as in most providers, the first positive weight is 1, but in UltraDNS, the first is 2.

```java
/**
* the set of {@link Weighted#weight() weights} that are valid for this
* provider. If present, {@code 0} implies always serve this record set.
*/
SortedSet supportedWeights();
```

Here's an example of how to create or replace a record set with the heaviest value:

```java

int heaviest = weightedApi(zone).supportedWeights().last();

weightedApi(zone).put(ResourceRecordSet.> builder()
.name("www.denominator.io.")
.type("CNAME")
.ttl(1800)
.qualifier("US-West")
.addProfile(Weighted.create(heaviest))
.add("www-west.denominator.io.")).build());
```java