Package org.forgerock.openam.uma
Class UmaPolicy
- java.lang.Object
 - 
- org.forgerock.openam.uma.UmaPolicy
 
 
- 
public class UmaPolicy extends Object
Represents an UMA policy with operations to convert to and from underlying backend policies and JSON format.- Since:
 - 13.0.0
 
 
- 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.forgerock.json.JsonValueasJson()Converts theUmaPolicyto JSON.Set<org.forgerock.json.JsonValue>asUnderlyingPolicies(String policyOwnerName)Converts theUmaPolicyinto its underlying backend policies in JSON format.booleanequals(Object o)static UmaPolicyfromUnderlyingPolicies(ResourceSetDescription resourceSet, Collection<org.forgerock.json.resource.ResourceResponse> policies)Converts underlying backend policies into anUmaPolicy.StringgetId()Gets the ID of this UMA policy which is the unique resource set ID that this policy relates to.StringgetResourceServerId()Gets the Resource Server Id that the resource set was registered by.ResourceSetDescriptiongetResourceSet()StringgetRevision()Gets the revision of this UMA policy.Set<String>getScopes()Parses the unique set of scopes that are defined for all subject in this UMA policy.Set<String>getSubjects()Parses the unique set of subjects that have permissions defined in this UMA policy.Collection<String>getUnderlyingPolicyIds()inthashCode()static StringidOf(org.forgerock.json.JsonValue policy)Parses the unique resource set id, that the UMA policy relates to, from the UMA policy JSON.static UmaPolicyvalueOf(ResourceSetDescription resourceSet, org.forgerock.json.JsonValue policy)Parses the UMA policy JSON into aUmaPolicyinstance. 
 - 
 
- 
- 
Method Detail
- 
idOf
public static String idOf(org.forgerock.json.JsonValue policy) throws org.forgerock.json.resource.BadRequestException
Parses the unique resource set id, that the UMA policy relates to, from the UMA policy JSON.- Parameters:
 policy- The UMA policy in JSON format.- Returns:
 - The UMA policy ID.
 - Throws:
 org.forgerock.json.resource.BadRequestException
 
- 
valueOf
public static UmaPolicy valueOf(ResourceSetDescription resourceSet, org.forgerock.json.JsonValue policy) throws org.forgerock.json.resource.BadRequestException
Parses the UMA policy JSON into aUmaPolicyinstance.- Parameters:
 resourceSet- The resource set the policy relates to.policy- The UMA policy in JSON format.- Returns:
 - A 
UmaPolicyinstance. - Throws:
 org.forgerock.json.resource.BadRequestException- If the UMA policy JSON is not valid.
 
- 
fromUnderlyingPolicies
public static UmaPolicy fromUnderlyingPolicies(ResourceSetDescription resourceSet, Collection<org.forgerock.json.resource.ResourceResponse> policies) throws org.forgerock.json.resource.BadRequestException
Converts underlying backend policies into anUmaPolicy.- Parameters:
 resourceSet- The resource set the policy relates to.policies- The collection of underlying backend policies.- Returns:
 - A 
UmaPolicyinstance. - Throws:
 org.forgerock.json.resource.BadRequestException- If the underlying policies do not underpin a valid UMA policy.
 
- 
getId
public String getId()
Gets the ID of this UMA policy which is the unique resource set ID that this policy relates to.- Returns:
 - The ID.
 
 
- 
getRevision
public String getRevision()
Gets the revision of this UMA policy.- Returns:
 - The revision.
 
 
- 
asJson
public org.forgerock.json.JsonValue asJson()
Converts theUmaPolicyto JSON.- Returns:
 - The JSON representation of the UMA policy.
 
 
- 
getUnderlyingPolicyIds
public Collection<String> getUnderlyingPolicyIds()
 
- 
getScopes
public Set<String> getScopes()
Parses the unique set of scopes that are defined for all subject in this UMA policy.- Returns:
 - The set of defined scopes on the UMA policy.
 
 
- 
asUnderlyingPolicies
public Set<org.forgerock.json.JsonValue> asUnderlyingPolicies(String policyOwnerName)
Converts theUmaPolicyinto its underlying backend policies in JSON format.- Returns:
 - The set of underlying backend policies that represent this UMA policy.
 
 
- 
getSubjects
public Set<String> getSubjects()
Parses the unique set of subjects that have permissions defined in this UMA policy.- Returns:
 - The set of defined subjects on the UMA policy.
 
 
- 
getResourceServerId
public String getResourceServerId()
Gets the Resource Server Id that the resource set was registered by.- Returns:
 - The Resource Server Id.
 
 
- 
getResourceSet
public ResourceSetDescription getResourceSet()
 
 - 
 
 -