1717package com .google .gcloud .dns ;
1818
1919import static com .google .common .base .Preconditions .checkArgument ;
20- import static com .google .gcloud .RetryHelper .RetryHelperException ;
2120import static com .google .gcloud .RetryHelper .runWithRetries ;
2221
2322import com .google .api .services .dns .model .Change ;
2423import 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,8 +121,7 @@ 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 (
125- com .google .api .services .dns .model .ManagedZone zonePb ) {
124+ public Zone apply (ManagedZone zonePb ) {
126125 return Zone .fromPb (serviceOptions .service (), zonePb );
127126 }
128127 };
@@ -142,7 +141,7 @@ public DnsRpc.ListResult<ManagedZone> call() {
142141 ? ImmutableList .<Zone >of () : Iterables .transform (result .results (), pbToZoneFunction );
143142 return new PageImpl <>(new ZonePageFetcher (serviceOptions , cursor , optionsMap ),
144143 cursor , zones );
145- } catch (RetryHelperException e ) {
144+ } catch (RetryHelper . RetryHelperException e ) {
146145 throw DnsException .translateAndThrow (e );
147146 }
148147 }
@@ -169,10 +168,10 @@ public DnsRpc.ListResult<Change> call() {
169168 Iterable <ChangeRequest > changes = result .results () == null
170169 ? ImmutableList .<ChangeRequest >of ()
171170 : Iterables .transform (result .results (),
172- ChangeRequest .fromPbFunction (serviceOptions .service (), zoneName ));
171+ ChangeRequest .fromPbFunction (serviceOptions .service (), zoneName ));
173172 return new PageImpl <>(new ChangeRequestPageFetcher (zoneName , serviceOptions , cursor ,
174173 optionsMap ), cursor , changes );
175- } catch (RetryHelperException e ) {
174+ } catch (RetryHelper . RetryHelperException e ) {
176175 throw DnsException .translateAndThrow (e );
177176 }
178177 }
@@ -201,7 +200,7 @@ public DnsRpc.ListResult<ResourceRecordSet> call() {
201200 : Iterables .transform (result .results (), RecordSet .FROM_PB_FUNCTION );
202201 return new PageImpl <>(new DnsRecordPageFetcher (zoneName , serviceOptions , cursor , optionsMap ),
203202 cursor , recordSets );
204- } catch (RetryHelperException e ) {
203+ } catch (RetryHelper . RetryHelperException e ) {
205204 throw DnsException .translateAndThrow (e );
206205 }
207206 }
@@ -210,10 +209,10 @@ public DnsRpc.ListResult<ResourceRecordSet> call() {
210209 public Zone create (final ZoneInfo zoneInfo , Dns .ZoneOption ... options ) {
211210 final Map <DnsRpc .Option , ?> optionsMap = optionMap (options );
212211 try {
213- com . google . api . services . dns . model . ManagedZone answer = runWithRetries (
214- new Callable <com . google . api . services . dns . model . ManagedZone >() {
212+ ManagedZone answer = runWithRetries (
213+ new Callable <ManagedZone >() {
215214 @ Override
216- public com . google . api . services . dns . model . ManagedZone call () {
215+ public ManagedZone call () {
217216 return dnsRpc .create (zoneInfo .toPb (), optionsMap );
218217 }
219218 }, options ().retryParams (), EXCEPTION_HANDLER );
@@ -227,10 +226,10 @@ public com.google.api.services.dns.model.ManagedZone call() {
227226 public Zone getZone (final String zoneName , Dns .ZoneOption ... options ) {
228227 final Map <DnsRpc .Option , ?> optionsMap = optionMap (options );
229228 try {
230- com . google . api . services . dns . model . ManagedZone answer = runWithRetries (
231- new Callable <com . google . api . services . dns . model . ManagedZone >() {
229+ ManagedZone answer = runWithRetries (
230+ new Callable <ManagedZone >() {
232231 @ Override
233- public com . google . api . services . dns . model . ManagedZone call () {
232+ public ManagedZone call () {
234233 return dnsRpc .getZone (zoneName , optionsMap );
235234 }
236235 }, options ().retryParams (), EXCEPTION_HANDLER );
@@ -258,10 +257,10 @@ public Boolean call() {
258257 public ProjectInfo getProject (Dns .ProjectOption ... fields ) {
259258 final Map <DnsRpc .Option , ?> optionsMap = optionMap (fields );
260259 try {
261- com . google . api . services . dns . model . Project answer = runWithRetries (
262- new Callable <com . google . api . services . dns . model . Project >() {
260+ Project answer = runWithRetries (
261+ new Callable <Project >() {
263262 @ Override
264- public com . google . api . services . dns . model . Project call () {
263+ public Project call () {
265264 return dnsRpc .getProject (optionsMap );
266265 }
267266 }, options ().retryParams (), EXCEPTION_HANDLER );
@@ -276,14 +275,13 @@ public ChangeRequest applyChangeRequest(final String zoneName,
276275 final ChangeRequestInfo changeRequest , ChangeRequestOption ... options ) {
277276 final Map <DnsRpc .Option , ?> optionsMap = optionMap (options );
278277 try {
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 );
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 );
287285 return answer == null ? null : ChangeRequest .fromPb (this , zoneName , answer ); // not null
288286 } catch (RetryHelper .RetryHelperException ex ) {
289287 throw DnsException .translateAndThrow (ex );
@@ -295,14 +293,13 @@ public ChangeRequest getChangeRequest(final String zoneName, final String change
295293 Dns .ChangeRequestOption ... options ) {
296294 final Map <DnsRpc .Option , ?> optionsMap = optionMap (options );
297295 try {
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 );
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 );
306303 return answer == null ? null : ChangeRequest .fromPb (this , zoneName , answer );
307304 } catch (RetryHelper .RetryHelperException ex ) {
308305 throw DnsException .translateAndThrow (ex );
0 commit comments