
com.microsoft.azure.management.dns.DnsManagementClientImpl Maven / Gradle / Ivy
/**
*
* Copyright (c) Microsoft and contributors. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
package com.microsoft.azure.management.dns;
import com.microsoft.windowsazure.core.ServiceClient;
import com.microsoft.windowsazure.credentials.SubscriptionCloudCredentials;
import com.microsoft.windowsazure.management.configuration.ManagementConfiguration;
import org.apache.http.impl.client.HttpClientBuilder;
import javax.inject.Inject;
import javax.inject.Named;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.concurrent.ExecutorService;
/**
* Client for managing DNS zones and record.
*/
public class DnsManagementClientImpl extends ServiceClient implements DnsManagementClient {
private String apiVersion;
/**
* Gets the API version.
* @return The ApiVersion value.
*/
public String getApiVersion() {
return this.apiVersion;
}
private URI baseUri;
/**
* Gets the URI used as the base for all cloud service requests.
* @return The BaseUri value.
*/
public URI getBaseUri() {
return this.baseUri;
}
private SubscriptionCloudCredentials credentials;
/**
* Gets subscription credentials which uniquely identify Microsoft Azure
* subscription. The subscription ID forms part of the URI for every
* service call.
* @return The Credentials value.
*/
public SubscriptionCloudCredentials getCredentials() {
return this.credentials;
}
private int longRunningOperationInitialTimeout;
/**
* Gets or sets the initial timeout for Long Running Operations.
* @return The LongRunningOperationInitialTimeout value.
*/
public int getLongRunningOperationInitialTimeout() {
return this.longRunningOperationInitialTimeout;
}
/**
* Gets or sets the initial timeout for Long Running Operations.
* @param longRunningOperationInitialTimeoutValue The
* LongRunningOperationInitialTimeout value.
*/
public void setLongRunningOperationInitialTimeout(final int longRunningOperationInitialTimeoutValue) {
this.longRunningOperationInitialTimeout = longRunningOperationInitialTimeoutValue;
}
private int longRunningOperationRetryTimeout;
/**
* Gets or sets the retry timeout for Long Running Operations.
* @return The LongRunningOperationRetryTimeout value.
*/
public int getLongRunningOperationRetryTimeout() {
return this.longRunningOperationRetryTimeout;
}
/**
* Gets or sets the retry timeout for Long Running Operations.
* @param longRunningOperationRetryTimeoutValue The
* LongRunningOperationRetryTimeout value.
*/
public void setLongRunningOperationRetryTimeout(final int longRunningOperationRetryTimeoutValue) {
this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeoutValue;
}
private RecordSetOperations recordSets;
/**
* Operations for managing the RecordSets in a DNS zone.
* @return The RecordSetsOperations value.
*/
public RecordSetOperations getRecordSetsOperations() {
return this.recordSets;
}
private ZoneOperations zones;
/**
* Operations for managing DNS zones.
* @return The ZonesOperations value.
*/
public ZoneOperations getZonesOperations() {
return this.zones;
}
/**
* Initializes a new instance of the DnsManagementClientImpl class.
*
* @param httpBuilder The HTTP client builder.
* @param executorService The executor service.
*/
public DnsManagementClientImpl(HttpClientBuilder httpBuilder, ExecutorService executorService) {
super(httpBuilder, executorService);
this.recordSets = new RecordSetOperationsImpl(this);
this.zones = new ZoneOperationsImpl(this);
this.apiVersion = "2015-05-04-preview";
this.longRunningOperationInitialTimeout = -1;
this.longRunningOperationRetryTimeout = -1;
}
/**
* Initializes a new instance of the DnsManagementClientImpl class.
*
* @param httpBuilder The HTTP client builder.
* @param executorService The executor service.
* @param credentials Required. Gets subscription credentials which uniquely
* identify Microsoft Azure subscription. The subscription ID forms part of
* the URI for every service call.
* @param baseUri Optional. Gets the URI used as the base for all cloud
* service requests.
*/
@Inject
public DnsManagementClientImpl(HttpClientBuilder httpBuilder, ExecutorService executorService, @Named(ManagementConfiguration.SUBSCRIPTION_CLOUD_CREDENTIALS) SubscriptionCloudCredentials credentials, @Named(ManagementConfiguration.URI) URI baseUri) {
this(httpBuilder, executorService);
if (credentials == null) {
throw new NullPointerException("credentials");
} else {
this.credentials = credentials;
}
if (baseUri == null) {
try {
this.baseUri = new URI("https://management.azure.com");
}
catch (URISyntaxException ex) {
}
} else {
this.baseUri = baseUri;
}
}
/**
* Initializes a new instance of the DnsManagementClientImpl class.
*
* @param httpBuilder The HTTP client builder.
* @param executorService The executor service.
* @param credentials Required. Gets subscription credentials which uniquely
* identify Microsoft Azure subscription. The subscription ID forms part of
* the URI for every service call.
* @throws URISyntaxException Thrown if there was an error parsing a URI in
* the response.
*/
public DnsManagementClientImpl(HttpClientBuilder httpBuilder, ExecutorService executorService, SubscriptionCloudCredentials credentials) throws URISyntaxException {
this(httpBuilder, executorService);
if (credentials == null) {
throw new NullPointerException("credentials");
}
this.credentials = credentials;
this.baseUri = new URI("https://management.azure.com");
}
/**
* Initializes a new instance of the DnsManagementClientImpl class.
*
* @param httpBuilder The HTTP client builder.
* @param executorService The executor service.
* @param credentials Required. Gets subscription credentials which uniquely
* identify Microsoft Azure subscription. The subscription ID forms part of
* the URI for every service call.
* @param baseUri Optional. Gets the URI used as the base for all cloud
* service requests.
* @param apiVersion Optional. Gets the API version.
* @param longRunningOperationInitialTimeout Required. Gets or sets the
* initial timeout for Long Running Operations.
* @param longRunningOperationRetryTimeout Required. Gets or sets the retry
* timeout for Long Running Operations.
*/
public DnsManagementClientImpl(HttpClientBuilder httpBuilder, ExecutorService executorService, SubscriptionCloudCredentials credentials, URI baseUri, String apiVersion, int longRunningOperationInitialTimeout, int longRunningOperationRetryTimeout) {
this(httpBuilder, executorService);
this.credentials = credentials;
this.baseUri = baseUri;
this.apiVersion = apiVersion;
this.longRunningOperationInitialTimeout = longRunningOperationInitialTimeout;
this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout;
}
/**
* Initializes a new instance of the DnsManagementClientImpl class.
*
* @param httpBuilder The HTTP client builder.
* @param executorService The executor service.
*/
protected DnsManagementClientImpl newInstance(HttpClientBuilder httpBuilder, ExecutorService executorService) {
return new DnsManagementClientImpl(httpBuilder, executorService, this.getCredentials(), this.getBaseUri(), this.getApiVersion(), this.getLongRunningOperationInitialTimeout(), this.getLongRunningOperationRetryTimeout());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy