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.
-
Constructor Summary
ConstructorDescriptionSharedAccessAuthorizationRule
(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 key
andsecondary key
is randomly generated.- Parameters:
keyName
- The name of the rule.accessRights
- The access rights.- Throws:
NullPointerException
- ifkeyName
oraccessRights
are null.IllegalArgumentException
- ifkeyName
are 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 key
is randomly generated.- Parameters:
keyName
- The name of the rule.primaryKey
- The primary key.accessRights
- The access rights.- Throws:
NullPointerException
- ifkeyName
,primaryKey
, oraccessRights
are null.IllegalArgumentException
- ifkeyName
,primaryKey
are 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
, oraccessRights
are null.IllegalArgumentException
- ifkeyName
,primaryKey
,secondaryKey
are empty strings.
-
-
Method Details
-
getAccessRights
Gets the access rights for the rule.- Specified by:
getAccessRights
in interfaceAuthorizationRule
- Returns:
- The access rights for the rule.
-
getClaimType
Gets the claim type.- Specified by:
getClaimType
in interfaceAuthorizationRule
- Returns:
- The claim type.
-
getClaimValue
Gets the claim value.- Specified by:
getClaimValue
in interfaceAuthorizationRule
- Returns:
- The claim value.
-
getCreatedAt
Gets the date time this rule was created.- Specified by:
getCreatedAt
in interfaceAuthorizationRule
- Returns:
- The date time this rule was created.
-
getKeyName
Gets the name of the authorization rule.- Specified by:
getKeyName
in interfaceAuthorizationRule
- Returns:
- name of the authoriation rule.
-
getModifiedAt
Gets the date time this rule was last modified.- Specified by:
getModifiedAt
in interfaceAuthorizationRule
- Returns:
- The date time this rule was last modified.
-
getPrimaryKey
Gets the primary key.- Specified by:
getPrimaryKey
in interfaceAuthorizationRule
- Returns:
- The primary key.
-
setPrimaryKey
Sets the primary key.- Parameters:
primaryKey
- The primary key to set.- Returns:
- The updated
SharedAccessAuthorizationRule
object. - Throws:
NullPointerException
- ifprimaryKey
is null.IllegalArgumentException
- ifprimaryKey
is an empty string.
-
getSecondaryKey
Gets the secondary key.- Specified by:
getSecondaryKey
in interfaceAuthorizationRule
- Returns:
- The secondary key.
-
setSecondaryKey
Sets the secondary key.- Parameters:
secondaryKey
- The secondary key to set.- Returns:
- The updated
SharedAccessAuthorizationRule
object. - Throws:
NullPointerException
- ifsecondary
is null.IllegalArgumentException
- ifsecondary
is an empty string.
-