Skip to content

Commit d14d83a

Browse files
committed
---
yaml --- r: 2847 b: refs/heads/dns-alpha c: e17bedb h: refs/heads/master i: 2845: 8c2b4cd 2843: 63e33b4 2839: 18467a0 2831: ce20c3a 2815: 50411a6
1 parent fd77587 commit d14d83a

2 files changed

Lines changed: 22 additions & 8 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ refs/tags/v0.0.10: 207ebd2a3472fddee69fe1298eb90429e3306efd
1111
refs/tags/v0.0.11: ffbfba48a6426ff63c08ff2117e58681f251fbf2
1212
refs/tags/v0.0.12: 2fd8066e891fb3dfea69b65f6bf6461db79342b9
1313
refs/heads/compute-alpha: b1274b5bdf4eea955f3588b56378a5ae4ba59cef
14-
refs/heads/dns-alpha: 762483b94f6c95aa3f860803ead53a962f41d336
14+
refs/heads/dns-alpha: e17bedb4640e6d5c434670eb03a4ea6b2f9028c9

branches/dns-alpha/gcloud-java-dns/src/main/java/com/google/gcloud/dns/DnsOptions.java

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package com.google.gcloud.dns;
1818

19-
import com.google.common.collect.Sets;
19+
import com.google.common.collect.ImmutableSet;
2020
import com.google.gcloud.ServiceOptions;
2121
import com.google.gcloud.spi.DnsRpc;
2222
import com.google.gcloud.spi.DnsRpcFactory;
@@ -26,16 +26,28 @@
2626
public class DnsOptions
2727
extends ServiceOptions<Dns, DnsRpc, DnsOptions> {
2828

29-
private static final long serialVersionUID = -5311219368450107146L;
30-
31-
// TODO(mderka) Finish implementation. Created issue #595.
29+
private static final long serialVersionUID = -519128051411747771L;
30+
private static final String GC_DNS_RW = "https://www.googleapis.com/auth/ndev.clouddns.readwrite";
31+
private static final String GC_DNS_R = "https://www.googleapis.com/auth/ndev.clouddns.readonly";
32+
private static final Set<String> SCOPES = ImmutableSet.of(GC_DNS_RW, GC_DNS_R);
3233

3334
public static class DefaultDnsFactory implements DnsFactory {
3435
private static final DnsFactory INSTANCE = new DefaultDnsFactory();
3536

3637
@Override
3738
public Dns create(DnsOptions options) {
38-
// TODO(mderka) Implement. Created issue #595.
39+
// TODO(mderka) Implement when DnsImpl is available. Created issue #595.
40+
return null;
41+
}
42+
}
43+
44+
public static class DefaultDnsRpcFactory implements DnsRpcFactory {
45+
46+
private static final DnsRpcFactory INSTANCE = new DefaultDnsRpcFactory();
47+
48+
@Override
49+
public DnsRpc create(DnsOptions options) {
50+
// TODO(mderka) Implement when DefaultDnsRpc is available. Created issue #595.
3951
return null;
4052
}
4153
}
@@ -60,22 +72,24 @@ private DnsOptions(Builder builder) {
6072
super(DnsFactory.class, DnsRpcFactory.class, builder);
6173
}
6274

75+
@SuppressWarnings("unchecked")
6376
@Override
6477
protected DnsFactory defaultServiceFactory() {
6578
return DefaultDnsFactory.INSTANCE;
6679
}
6780

81+
@SuppressWarnings("unchecked")
6882
@Override
6983
protected DnsRpcFactory defaultRpcFactory() {
7084
return null;
7185
}
7286

7387
@Override
7488
protected Set<String> scopes() {
75-
// TODO(mderka) Verify.
76-
return Sets.newHashSet("ndev.clouddns.readwrite");
89+
return SCOPES;
7790
}
7891

92+
@SuppressWarnings("unchecked")
7993
@Override
8094
public Builder toBuilder() {
8195
return new Builder(this);

0 commit comments

Comments
 (0)