Package com.google.cloud.dns
Class ChangeRequest
- java.lang.Object
-
- com.google.cloud.dns.ChangeRequestInfo
-
- com.google.cloud.dns.ChangeRequest
-
- All Implemented Interfaces:
Serializable
public class ChangeRequest extends ChangeRequestInfo
An immutable class representing an atomic update to a collection ofRecordSet
s within aZone
.- See Also:
- Google Cloud DNS documentation, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ChangeRequest.Builder
A builder forChangeRequest
s.-
Nested classes/interfaces inherited from class com.google.cloud.dns.ChangeRequestInfo
ChangeRequestInfo.Status
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangeRequest
applyTo(String zoneName, Dns.ChangeRequestOption... options)
Applies this change request to the zone identified byzoneName
.boolean
equals(Object obj)
Dns
getDns()
Returns the change request'sDns
object used to issue requests.String
getZone()
Returns the name of theZone
associated with this change request.int
hashCode()
boolean
isDone()
Returnstrue
if the change request has been completed.ChangeRequest
reload(Dns.ChangeRequestOption... options)
Retrieves the up-to-date information about the change request from Google Cloud DNS.ChangeRequest.Builder
toBuilder()
Creates a builder populated with values of thisChangeRequestInfo
.-
Methods inherited from class com.google.cloud.dns.ChangeRequestInfo
getAdditions, getDeletions, getGeneratedId, getStartTimeMillis, getStatus, newBuilder, status, toString
-
-
-
-
Method Detail
-
getDns
public Dns getDns()
Returns the change request'sDns
object used to issue requests.
-
applyTo
public ChangeRequest applyTo(String zoneName, Dns.ChangeRequestOption... options)
Applies this change request to the zone identified byzoneName
.- Throws:
DnsException
- upon failure or if zone is not found
-
reload
public ChangeRequest reload(Dns.ChangeRequestOption... options)
Retrieves the up-to-date information about the change request from Google Cloud DNS. Parameteroptions
can be used to restrict the fields to be included in the updated object the same way as inDns.getChangeRequest(String, String, Dns.ChangeRequestOption...)
. Ifoptions
are provided, any field other than generatedId which is not included in theoptions
will benull
regardless of whether they are initialized or not inthis
instance.- Returns:
- an object with the updated information or
null
if it does not exist - Throws:
DnsException
- upon failure of the API call or if the associated zone was not found
-
isDone
public boolean isDone()
Returnstrue
if the change request has been completed. If the status is notChangeRequestInfo.Status.DONE
already, the method makes an API call to Google Cloud DNS to update the change request first.- Throws:
DnsException
- upon failure of the API call or if the associated zone was not found
-
toBuilder
public ChangeRequest.Builder toBuilder()
Description copied from class:ChangeRequestInfo
Creates a builder populated with values of thisChangeRequestInfo
.- Overrides:
toBuilder
in classChangeRequestInfo
-
equals
public final boolean equals(Object obj)
- Overrides:
equals
in classChangeRequestInfo
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classChangeRequestInfo
-
-