1717package com .google .gcloud .dns ;
1818
1919import static com .google .common .base .Preconditions .checkArgument ;
20+ import static com .google .gcloud .RetryHelper .RetryHelperException ;
2021import static com .google .gcloud .RetryHelper .runWithRetries ;
2122
2223import com .google .api .services .dns .model .Change ;
2324import com .google .api .services .dns .model .ManagedZone ;
24- import com .google .api .services .dns .model .Project ;
2525import com .google .api .services .dns .model .ResourceRecordSet ;
2626import com .google .common .base .Function ;
2727import com .google .common .collect .ImmutableList ;
@@ -121,7 +121,8 @@ private static Page<Zone> listZones(final DnsOptions serviceOptions,
121121 // this differs from the other list operations since zone is functional and requires dns service
122122 Function <ManagedZone , Zone > pbToZoneFunction = new Function <ManagedZone , Zone >() {
123123 @ Override
124- public Zone apply (ManagedZone zonePb ) {
124+ public Zone apply (
125+ com .google .api .services .dns .model .ManagedZone zonePb ) {
125126 return Zone .fromPb (serviceOptions .service (), zonePb );
126127 }
127128 };
@@ -141,7 +142,7 @@ public DnsRpc.ListResult<ManagedZone> call() {
141142 ? ImmutableList .<Zone >of () : Iterables .transform (result .results (), pbToZoneFunction );
142143 return new PageImpl <>(new ZonePageFetcher (serviceOptions , cursor , optionsMap ),
143144 cursor , zones );
144- } catch (RetryHelper . RetryHelperException e ) {
145+ } catch (RetryHelperException e ) {
145146 throw DnsException .translateAndThrow (e );
146147 }
147148 }
@@ -168,10 +169,10 @@ public DnsRpc.ListResult<Change> call() {
168169 Iterable <ChangeRequest > changes = result .results () == null
169170 ? ImmutableList .<ChangeRequest >of ()
170171 : Iterables .transform (result .results (),
171- ChangeRequest .fromPbFunction (serviceOptions .service (), zoneName ));
172+ ChangeRequest .fromPbFunction (serviceOptions .service (), zoneName ));
172173 return new PageImpl <>(new ChangeRequestPageFetcher (zoneName , serviceOptions , cursor ,
173174 optionsMap ), cursor , changes );
174- } catch (RetryHelper . RetryHelperException e ) {
175+ } catch (RetryHelperException e ) {
175176 throw DnsException .translateAndThrow (e );
176177 }
177178 }
@@ -200,7 +201,7 @@ public DnsRpc.ListResult<ResourceRecordSet> call() {
200201 : Iterables .transform (result .results (), RecordSet .FROM_PB_FUNCTION );
201202 return new PageImpl <>(new DnsRecordPageFetcher (zoneName , serviceOptions , cursor , optionsMap ),
202203 cursor , recordSets );
203- } catch (RetryHelper . RetryHelperException e ) {
204+ } catch (RetryHelperException e ) {
204205 throw DnsException .translateAndThrow (e );
205206 }
206207 }
@@ -209,10 +210,10 @@ public DnsRpc.ListResult<ResourceRecordSet> call() {
209210 public Zone create (final ZoneInfo zoneInfo , Dns .ZoneOption ... options ) {
210211 final Map <DnsRpc .Option , ?> optionsMap = optionMap (options );
211212 try {
212- ManagedZone answer = runWithRetries (
213- new Callable <ManagedZone >() {
213+ com . google . api . services . dns . model . ManagedZone answer = runWithRetries (
214+ new Callable <com . google . api . services . dns . model . ManagedZone >() {
214215 @ Override
215- public ManagedZone call () {
216+ public com . google . api . services . dns . model . ManagedZone call () {
216217 return dnsRpc .create (zoneInfo .toPb (), optionsMap );
217218 }
218219 }, options ().retryParams (), EXCEPTION_HANDLER );
@@ -226,10 +227,10 @@ public ManagedZone call() {
226227 public Zone getZone (final String zoneName , Dns .ZoneOption ... options ) {
227228 final Map <DnsRpc .Option , ?> optionsMap = optionMap (options );
228229 try {
229- ManagedZone answer = runWithRetries (
230- new Callable <ManagedZone >() {
230+ com . google . api . services . dns . model . ManagedZone answer = runWithRetries (
231+ new Callable <com . google . api . services . dns . model . ManagedZone >() {
231232 @ Override
232- public ManagedZone call () {
233+ public com . google . api . services . dns . model . ManagedZone call () {
233234 return dnsRpc .getZone (zoneName , optionsMap );
234235 }
235236 }, options ().retryParams (), EXCEPTION_HANDLER );
@@ -257,10 +258,10 @@ public Boolean call() {
257258 public ProjectInfo getProject (Dns .ProjectOption ... fields ) {
258259 final Map <DnsRpc .Option , ?> optionsMap = optionMap (fields );
259260 try {
260- Project answer = runWithRetries (
261- new Callable <Project >() {
261+ com . google . api . services . dns . model . Project answer = runWithRetries (
262+ new Callable <com . google . api . services . dns . model . Project >() {
262263 @ Override
263- public Project call () {
264+ public com . google . api . services . dns . model . Project call () {
264265 return dnsRpc .getProject (optionsMap );
265266 }
266267 }, options ().retryParams (), EXCEPTION_HANDLER );
@@ -275,13 +276,14 @@ public ChangeRequest applyChangeRequest(final String zoneName,
275276 final ChangeRequestInfo changeRequest , ChangeRequestOption ... options ) {
276277 final Map <DnsRpc .Option , ?> optionsMap = optionMap (options );
277278 try {
278- Change answer = runWithRetries (
279- new Callable <Change >() {
280- @ Override
281- public Change call () {
282- return dnsRpc .applyChangeRequest (zoneName , changeRequest .toPb (), optionsMap );
283- }
284- }, options ().retryParams (), EXCEPTION_HANDLER );
279+ com .google .api .services .dns .model .Change answer =
280+ runWithRetries (
281+ new Callable <com .google .api .services .dns .model .Change >() {
282+ @ Override
283+ public com .google .api .services .dns .model .Change call () {
284+ return dnsRpc .applyChangeRequest (zoneName , changeRequest .toPb (), optionsMap );
285+ }
286+ }, options ().retryParams (), EXCEPTION_HANDLER );
285287 return answer == null ? null : ChangeRequest .fromPb (this , zoneName , answer ); // not null
286288 } catch (RetryHelper .RetryHelperException ex ) {
287289 throw DnsException .translateAndThrow (ex );
@@ -293,13 +295,14 @@ public ChangeRequest getChangeRequest(final String zoneName, final String change
293295 Dns .ChangeRequestOption ... options ) {
294296 final Map <DnsRpc .Option , ?> optionsMap = optionMap (options );
295297 try {
296- Change answer = runWithRetries (
297- new Callable <Change >() {
298- @ Override
299- public Change call () {
300- return dnsRpc .getChangeRequest (zoneName , changeRequestId , optionsMap );
301- }
302- }, options ().retryParams (), EXCEPTION_HANDLER );
298+ com .google .api .services .dns .model .Change answer =
299+ runWithRetries (
300+ new Callable <com .google .api .services .dns .model .Change >() {
301+ @ Override
302+ public com .google .api .services .dns .model .Change call () {
303+ return dnsRpc .getChangeRequest (zoneName , changeRequestId , optionsMap );
304+ }
305+ }, options ().retryParams (), EXCEPTION_HANDLER );
303306 return answer == null ? null : ChangeRequest .fromPb (this , zoneName , answer );
304307 } catch (RetryHelper .RetryHelperException ex ) {
305308 throw DnsException .translateAndThrow (ex );
0 commit comments