Class SharedAccessAuthorizationRule
java.lang.Object
com.azure.messaging.servicebus.administration.models.SharedAccessAuthorizationRule
- All Implemented Interfaces:
AuthorizationRule
A shared access key for accessing Service Bus entities.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSharedAccessAuthorizationRule(String keyName, String primaryKey, String secondaryKey, List<AccessRights> accessRights) Creates an instance with the given key name, primary key, secondary key, and access rights.SharedAccessAuthorizationRule(String keyName, String primaryKey, List<AccessRights> accessRights) Creates an instance with the given key name, primary key, secondary key, and access rights.SharedAccessAuthorizationRule(String keyName, List<AccessRights> accessRights) Creates an instance with the given key name and access rights. -
Method Summary
Modifier and TypeMethodDescriptionGets the access rights for the rule.Gets the claim type.Gets the claim value.Gets the date time this rule was created.Gets the name of the authorization rule.Gets the date time this rule was last modified.Gets the primary key.Gets the secondary key.setPrimaryKey(String primaryKey) Sets the primary key.setSecondaryKey(String secondaryKey) Sets the secondary key.
-
Constructor Details
-
SharedAccessAuthorizationRule
Creates an instance with the given key name and access rights. Theprimary keyandsecondary keyis randomly generated.- Parameters:
keyName- The name of the rule.accessRights- The access rights.- Throws:
NullPointerException- ifkeyNameoraccessRightsare null.IllegalArgumentException- ifkeyNameare empty strings.
-
SharedAccessAuthorizationRule
public SharedAccessAuthorizationRule(String keyName, String primaryKey, List<AccessRights> accessRights) Creates an instance with the given key name, primary key, secondary key, and access rights. Thesecondary keyis randomly generated.- Parameters:
keyName- The name of the rule.primaryKey- The primary key.accessRights- The access rights.- Throws:
NullPointerException- ifkeyName,primaryKey, oraccessRightsare null.IllegalArgumentException- ifkeyName,primaryKeyare empty strings.
-
SharedAccessAuthorizationRule
public SharedAccessAuthorizationRule(String keyName, String primaryKey, String secondaryKey, List<AccessRights> accessRights) Creates an instance with the given key name, primary key, secondary key, and access rights.- Parameters:
keyName- The name of the rule.primaryKey- The primary key.secondaryKey- The secondary key.accessRights- The access rights.- Throws:
NullPointerException- ifkeyName,primaryKey,secondaryKey, oraccessRightsare null.IllegalArgumentException- ifkeyName,primaryKey,secondaryKeyare empty strings.
-
-
Method Details
-
getAccessRights
Gets the access rights for the rule.- Specified by:
getAccessRightsin interfaceAuthorizationRule- Returns:
- The access rights for the rule.
-
getClaimType
Gets the claim type.- Specified by:
getClaimTypein interfaceAuthorizationRule- Returns:
- The claim type.
-
getClaimValue
Gets the claim value.- Specified by:
getClaimValuein interfaceAuthorizationRule- Returns:
- The claim value.
-
getCreatedAt
Gets the date time this rule was created.- Specified by:
getCreatedAtin interfaceAuthorizationRule- Returns:
- The date time this rule was created.
-
getKeyName
Gets the name of the authorization rule.- Specified by:
getKeyNamein interfaceAuthorizationRule- Returns:
- name of the authorization rule.
-
getModifiedAt
Gets the date time this rule was last modified.- Specified by:
getModifiedAtin interfaceAuthorizationRule- Returns:
- The date time this rule was last modified.
-
getPrimaryKey
Gets the primary key.- Specified by:
getPrimaryKeyin interfaceAuthorizationRule- Returns:
- The primary key.
-
setPrimaryKey
Sets the primary key.- Parameters:
primaryKey- The primary key to set.- Returns:
- The updated
SharedAccessAuthorizationRuleobject. - Throws:
NullPointerException- ifprimaryKeyis null.IllegalArgumentException- ifprimaryKeyis an empty string.
-
getSecondaryKey
Gets the secondary key.- Specified by:
getSecondaryKeyin interfaceAuthorizationRule- Returns:
- The secondary key.
-
setSecondaryKey
Sets the secondary key.- Parameters:
secondaryKey- The secondary key to set.- Returns:
- The updated
SharedAccessAuthorizationRuleobject. - Throws:
NullPointerException- ifsecondaryis null.IllegalArgumentException- ifsecondaryis an empty string.
-