public final class AccountSasSignatureValues extends Object
AccountSasQueryParameters exist because
the former is mutable and a logical representation while the latter is immutable and used to generate actual REST
requests.
Please see here for more conceptual information on SAS:
Please see here for further descriptions of the parameters, including which are required:
Please see here for additional samples.
| Constructor and Description |
|---|
AccountSasSignatureValues()
Initializes an
AccountSasSignatureValues object with the version number set to the default and all other
values empty. |
| Modifier and Type | Method and Description |
|---|---|
static String |
generateAccountSas(SharedKeyCredential sharedKeyCredential,
AccountSasService accountSASService,
AccountSasResourceType accountSASResourceType,
AccountSasPermission accountSASPermission,
OffsetDateTime expiryTime,
OffsetDateTime startTime,
String version,
IpRange ipRange,
SasProtocol sasProtocol)
Shared method between service clients to generate an account SAS.
|
AccountSasQueryParameters |
generateSasQueryParameters(SharedKeyCredential sharedKeyCredentials)
Generates a
AccountSasQueryParameters object which contains all SAS query parameters needed to make an
actual REST request. |
OffsetDateTime |
getExpiryTime() |
IpRange |
getIpRange() |
String |
getPermissions() |
SasProtocol |
getProtocol() |
String |
getResourceTypes() |
String |
getServices() |
OffsetDateTime |
getStartTime() |
String |
getVersion() |
AccountSasSignatureValues |
setExpiryTime(OffsetDateTime expiryTime)
Sets the time after which the SAS will no longer work.
|
AccountSasSignatureValues |
setIpRange(IpRange ipRange)
Sets the
IpRange which determines the IP ranges that are allowed to use the SAS. |
AccountSasSignatureValues |
setPermissions(String permissions)
Sets the operations the SAS user may perform.
|
AccountSasSignatureValues |
setProtocol(SasProtocol protocol)
Sets the
SasProtocol which determines the HTTP protocol that will be used. |
AccountSasSignatureValues |
setResourceTypes(String resourceTypes)
Sets the resource types accessible with this SAS.
|
AccountSasSignatureValues |
setServices(String services)
Sets the services accessible with this SAS.
|
AccountSasSignatureValues |
setStartTime(OffsetDateTime startTime)
Sets when the SAS will take effect.
|
AccountSasSignatureValues |
setVersion(String version)
Sets the service version that is targeted.
|
public AccountSasSignatureValues()
AccountSasSignatureValues object with the version number set to the default and all other
values empty.public static String generateAccountSas(SharedKeyCredential sharedKeyCredential, AccountSasService accountSASService, AccountSasResourceType accountSASResourceType, AccountSasPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, IpRange ipRange, SasProtocol sasProtocol)
sharedKeyCredential - The SharedKeyCredential shared key credential for the account SASaccountSASService - The AccountSasService services for the account SASaccountSASResourceType - An optional AccountSasResourceType resources for the account SASaccountSASPermission - The AccountSasPermission permission for the account SASexpiryTime - The OffsetDateTime expiry time for the account SASstartTime - The OffsetDateTime start time for the account SASversion - The String version for the account SASipRange - An optional IpRange ip address range for the SASsasProtocol - An optional SasProtocol protocol for the SASNullPointerException - If any of sharedKeyCredentials, services, resourceTypes,
expiryTime, permissions or versions is nullpublic String getVersion()
null or empty the service version targeted by the
library will be used.public AccountSasSignatureValues setVersion(String version)
null or empty to target the version used by the
library.version - Target version to setpublic SasProtocol getProtocol()
SasProtocol which determines the HTTP protocol that will be used.public AccountSasSignatureValues setProtocol(SasProtocol protocol)
SasProtocol which determines the HTTP protocol that will be used.protocol - Protocol to setpublic OffsetDateTime getStartTime()
public AccountSasSignatureValues setStartTime(OffsetDateTime startTime)
startTime - Start time to setpublic OffsetDateTime getExpiryTime()
public AccountSasSignatureValues setExpiryTime(OffsetDateTime expiryTime)
expiryTime - Expiry time to setpublic String getPermissions()
AccountSasPermission to help determine
which permissions are allowed.public AccountSasSignatureValues setPermissions(String permissions)
AccountSasPermission for help constructing
the permissions string.permissions - Permissions string to setpublic IpRange getIpRange()
IpRange which determines the IP ranges that are allowed to use the SAS.public AccountSasSignatureValues setIpRange(IpRange ipRange)
IpRange which determines the IP ranges that are allowed to use the SAS.ipRange - Allowed IP range to setpublic String getServices()
AccountSasService to help determine which
services are accessible.public AccountSasSignatureValues setServices(String services)
AccountSasService to construct this value.services - Allowed services string to setpublic String getResourceTypes()
AccountSasResourceType to help
determine the resource types that are accessible.public AccountSasSignatureValues setResourceTypes(String resourceTypes)
AccountSasResourceType to construct
this value.resourceTypes - Allowed resource types string to setpublic AccountSasQueryParameters generateSasQueryParameters(SharedKeyCredential sharedKeyCredentials)
AccountSasQueryParameters object which contains all SAS query parameters needed to make an
actual REST request.sharedKeyCredentials - Credentials for the storage account and corresponding primary or secondary key.AccountSasQueryParametersRuntimeException - If the HMAC-SHA256 signature for sharedKeyCredentials fails to generate.NullPointerException - If any of sharedKeyCredentials, services, resourceTypes,
expiryTime, permissions or versions is nullCopyright © 2019 Microsoft Corporation. All rights reserved.