QueueSasPermission Class
- java.
lang. Object - com.
azure. storage. queue. sas. QueueSasPermission
- com.
public final class QueueSasPermission
Constructs a string representing the permissions granted by an Azure Service SAS to a queue. Setting a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the values are set, this should be serialized with toString() and set as the permissions field on setPermissions(QueueSasPermission permissions).
It is possible to construct the permissions string without this class, but the order of the permissions is particular and this class guarantees correctness.
Constructor Summary
Constructor | Description |
---|---|
QueueSasPermission() |
Initializes a QueueSasPermission object with all fields set to false. |
Method Summary
Modifier and Type | Method and Description |
---|---|
boolean |
hasAddPermission()
Gets the add permission status. |
boolean |
hasProcessPermission()
Gets the process permission status. |
boolean |
hasReadPermission()
Gets the read permissions status. |
boolean |
hasUpdatePermission()
Gets the update permission status. |
static
Queue |
parse(String permissionString)
Creates a QueueSasPermission from the specified permissions string. |
Queue |
setAddPermission(boolean hasAddPermission)
Sets the add permission status. |
Queue |
setProcessPermission(boolean hasProcessPermission)
Sets the process permission status. |
Queue |
setReadPermission(boolean hasReadPermission)
Sets the read permission status. |
Queue |
setUpdatePermission(boolean hasUpdatePermission)
Sets the update permission status. |
String |
toString()
Converts the given permissions to a String. |
Methods inherited from java.lang.Object
Constructor Details
QueueSasPermission
public QueueSasPermission()
Initializes a QueueSasPermission object with all fields set to false.
Method Details
hasAddPermission
public boolean hasAddPermission()
Gets the add permission status.
Returns:
true
if SAS has permission to add messages to the queue. false
, otherwise.hasProcessPermission
public boolean hasProcessPermission()
Gets the process permission status.
Returns:
true
if SAS has permission to get and delete messages from the queue. false
, otherwise.hasReadPermission
public boolean hasReadPermission()
Gets the read permissions status.
Returns:
true
if SAS has permission to read metadata, properties, message count, peek at messages.
false
, otherwise.hasUpdatePermission
public boolean hasUpdatePermission()
Gets the update permission status.
Returns:
true
if SAS has permission to update messages in the queue. false
, otherwise.parse
public static QueueSasPermission parse(String permissionString)
Creates a QueueSasPermission from the specified permissions string. This method will throw an IllegalArgumentException if it encounters a character that does not correspond to a valid permission.
Parameters:
String
which represents the QueueSasPermission
.
Returns:
QueueSasPermission
generated from the given String
.setAddPermission
public QueueSasPermission setAddPermission(boolean hasAddPermission)
Sets the add permission status.
Parameters:
true
if SAS has permission to add messages to the queue. false
,
otherwise.
Returns:
setProcessPermission
public QueueSasPermission setProcessPermission(boolean hasProcessPermission)
Sets the process permission status.
Parameters:
true
if SAS has permission to get and delete messages from the queue.
false
, otherwise.
Returns:
setReadPermission
public QueueSasPermission setReadPermission(boolean hasReadPermission)
Sets the read permission status.
Parameters:
true
if SAS has permission to read metadata, properties, message count, peek at
messages. false
, otherwise.
Returns:
setUpdatePermission
public QueueSasPermission setUpdatePermission(boolean hasUpdatePermission)
Sets the update permission status.
Note: Use setProcessPermission(boolean hasProcessPermission) to get a particular message in the queue to update.
Parameters:
true
if SAS has permission to update messages in the queue. false
,
otherwise.
Returns:
toString
public String toString()
Converts the given permissions to a String. Using this method will guarantee the permissions are in an order accepted by the service.
Overrides:
QueueSasPermission.toString()Returns: