Skip to content

Commit bf1361c

Browse files
committed
Added DnsServiceOptions and necessary dependencies.
1 parent 81cedc4 commit bf1361c

4 files changed

Lines changed: 137 additions & 0 deletions

File tree

gcloud-java-dns/src/main/java/com/google/gcloud/dns/DnsService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import com.google.common.base.Joiner;
2020
import com.google.common.collect.Sets;
21+
import com.google.gcloud.Service;
2122
import com.google.gcloud.spi.DnsServiceRpc;
2223

2324
import java.io.Serializable;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright 2016 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.gcloud.dns;
18+
19+
import com.google.gcloud.ServiceFactory;
20+
21+
/**
22+
* An interface for DnsService factories.
23+
*/
24+
public interface DnsServiceFactory extends ServiceFactory<DnsService, DnsServiceOptions> {
25+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* Copyright 2015 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.gcloud.dns;
18+
19+
import com.google.gcloud.ServiceOptions;
20+
import com.google.gcloud.spi.DnsServiceRpc;
21+
import com.google.gcloud.spi.DnsServiceRpcFactory;
22+
23+
import java.util.Set;
24+
25+
public class DnsServiceOptions
26+
extends ServiceOptions<DnsService, DnsServiceRpc, DnsServiceOptions> {
27+
28+
private static final long serialVersionUID = -5311219368450107146L;
29+
30+
// TODO(mderka) Finish implementation. Created issue #595.
31+
32+
public static class DefaultDnsServiceFactory implements DnsServiceFactory {
33+
private static final DnsServiceFactory INSTANCE = new DefaultDnsServiceFactory();
34+
35+
@Override
36+
public DnsService create(DnsServiceOptions options) {
37+
// TODO(mderka) Implement. Created issue #595.
38+
return null;
39+
}
40+
}
41+
42+
public static class Builder extends ServiceOptions.Builder<DnsService, DnsServiceRpc,
43+
DnsServiceOptions, Builder> {
44+
45+
private Builder() {
46+
}
47+
48+
private Builder(DnsServiceOptions options) {
49+
super(options);
50+
}
51+
52+
@Override
53+
public DnsServiceOptions build() {
54+
return new DnsServiceOptions(this);
55+
}
56+
}
57+
58+
private DnsServiceOptions(Builder builder) {
59+
super(DnsServiceFactory.class, DnsServiceRpcFactory.class, builder);
60+
}
61+
62+
@Override
63+
protected DnsServiceFactory defaultServiceFactory() {
64+
return DefaultDnsServiceFactory.INSTANCE;
65+
}
66+
67+
@Override
68+
protected DnsServiceRpcFactory defaultRpcFactory() {
69+
return null;
70+
}
71+
72+
@Override
73+
protected Set<String> scopes() {
74+
return null;
75+
}
76+
77+
@Override
78+
public Builder toBuilder() {
79+
return new Builder(this);
80+
}
81+
82+
public static Builder builder() {
83+
return new Builder();
84+
}
85+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright 2016 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.gcloud.spi;
18+
19+
import com.google.gcloud.dns.DnsServiceOptions;
20+
21+
/**
22+
* An interface for DnsServiceRpc factory. Implementation will be loaded via {@link
23+
* java.util.ServiceLoader}.
24+
*/
25+
public interface DnsServiceRpcFactory extends ServiceRpcFactory<DnsServiceRpc, DnsServiceOptions> {
26+
}

0 commit comments

Comments
 (0)