public abstract class ServiceClient extends Object
| Modifier and Type | Field and Description |
|---|---|
protected StorageCredentials |
credentials
Holds the StorageCredentials associated with this Service Client.
|
protected URI |
endpoint
Holds the base URI for the Service Client.
|
protected RetryPolicyFactory |
retryPolicyFactory
Holds the default retry policy for requests made via the service client to set.
|
protected int |
timeoutInMs
Holds the default server and client timeout for requests made by the service client.
|
| Constructor and Description |
|---|
ServiceClient(URI baseUri)
Creates an instance of the
ServiceClient class using the specified service endpoint. |
ServiceClient(URI baseUri,
StorageCredentials credentials)
Creates an instance of the
ServiceClient class using the specified service endpoint and account
credentials. |
| Modifier and Type | Method and Description |
|---|---|
ServiceProperties |
downloadServiceProperties()
Retrieves the current ServiceProperties for the given storage service.
|
ServiceProperties |
downloadServiceProperties(RequestOptions options,
OperationContext opContext)
Retrieves the current ServiceProperties for the given storage service.
|
StorageCredentials |
getCredentials()
Returns the storage credentials associated with this service client.
|
URI |
getEndpoint()
Returns the base URI for this service client.
|
RetryPolicyFactory |
getRetryPolicyFactory()
Returns the retry policy currently in effect for this Blob service client.
|
int |
getTimeoutInMs()
Returns the timeout value for requests made to the service.
|
boolean |
isUsePathStyleUris() |
protected void |
setBaseURI(URI baseUri)
Sets the base URI for the service client.
|
protected void |
setCredentials(StorageCredentials credentials)
Sets the credentials to use with this service client.
|
void |
setRetryPolicyFactory(RetryPolicyFactory retryPolicyFactory)
Sets the RetryPolicyFactory object to use when making service requests.
|
void |
setTimeoutInMs(int timeoutInMs)
Sets the timeout to use when making requests to the storage service.
|
void |
uploadServiceProperties(ServiceProperties properties)
Uploads a new configuration to the storage service.
|
void |
uploadServiceProperties(ServiceProperties properties,
RequestOptions options,
OperationContext opContext)
Uploads a new configuration to the storage service.
|
protected URI endpoint
protected StorageCredentials credentials
protected RetryPolicyFactory retryPolicyFactory
protected int timeoutInMs
public ServiceClient(URI baseUri)
ServiceClient class using the specified service endpoint.baseUri - A java.net.URI object that represents the service endpoint used to create the client.public ServiceClient(URI baseUri, StorageCredentials credentials)
ServiceClient class using the specified service endpoint and account
credentials.baseUri - A java.net.URI object that represents the service endpoint used to create the client.credentials - A StorageCredentials object that represents the account credentials.public final ServiceProperties downloadServiceProperties() throws StorageException
StorageException - If a storage service error occurred.public final ServiceProperties downloadServiceProperties(RequestOptions options, OperationContext opContext) throws StorageException
options - A RequestOptions object that specifies any additional options for the request. Specifying
null will use the default request options from the associated service client (
CloudBlobClientCloudQueueClient).opContext - An OperationContext object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.StorageException - If a storage service error occurred.public final StorageCredentials getCredentials()
StorageCredentials object that represents the storage credentials associated with this client.public final URI getEndpoint()
java.net.URI object that represents the base URI for the service client.public final RetryPolicyFactory getRetryPolicyFactory()
RetryPolicyFactory object that represents the current retry policy.RetryPolicy,
RetryExponentialRetry,
RetryLinearRetry,
RetryNoRetrypublic final int getTimeoutInMs()
setTimeoutInMs(int).public final boolean isUsePathStyleUris()
protected final void setBaseURI(URI baseUri)
baseUri - A java.net.URI object that represents the base URI being assigned to the service client.protected final void setCredentials(StorageCredentials credentials)
credentials - A Credentials object that represents the credentials being assigned for the service
client.public void setRetryPolicyFactory(RetryPolicyFactory retryPolicyFactory)
retryPolicyFactory - the RetryPolicyFactory object to use when making service requests.public final void setTimeoutInMs(int timeoutInMs)
The server timeout interval begins at the time that the complete request has been received by the service, and
the server begins processing the response. If the timeout interval elapses before the response is returned to the
client, the operation times out. The timeout interval resets with each retry, if the request is retried.
The default timeout interval for a request made via the service client is 90 seconds. You can change this value
on the service client by setting this property, so that all subsequent requests made via the service client will
use the new timeout interval. You can also change this value for an individual request, by setting the
RequestOptions.timeoutIntervalInMs property.
If you are downloading a large blob, you should increase the value of the timeout beyond the default value.
timeoutInMs - The timeout, in milliseconds, to use when making requests to the storage service.@DoesServiceRequest public void uploadServiceProperties(ServiceProperties properties) throws StorageException
properties - The ServiceProperties to upload.StorageException - If a storage service error occurred.@DoesServiceRequest public void uploadServiceProperties(ServiceProperties properties, RequestOptions options, OperationContext opContext) throws StorageException
properties - The ServiceProperties to upload.options - A RequestOptions object that specifies any additional options for the request. Specifying
null will use the default request options from the associated service client (
CloudBlobClientCloudQueueClient).opContext - An OperationContext object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.StorageException - If a storage service error occurred./**
* Copyright Microsoft Corporation
*
* 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.
*/