Class XACMLReaderWriter
- java.lang.Object
-
- com.sun.identity.entitlement.xacml3.XACMLReaderWriter
-
public class XACMLReaderWriter extends Object
Facade for reading and writing XACML and translating between XACML PolicySets and AM Privilege types.
-
-
Field Summary
Fields Modifier and Type Field Description static intINVALID_XMLstatic intJSON_PARSE_ERROR
-
Constructor Summary
Constructors Constructor Description XACMLReaderWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrivilegeSetfromXACML(PolicySet policySet)Translate provided XACML PolicySet into OpenAM Privileges, ReferralPrivileges, Applications and ResourceTypes.PrivilegeSetread(InputStream xacml)Reads a sequence of XACML policies as OpenAM Privileges.PolicySettoXACML(String realm, PrivilegeSet privilegeSet)Translate provided OpenAM Privilege and ReferralPrivilege objects into XACML PolicySet.
-
-
-
Field Detail
-
JSON_PARSE_ERROR
public static final int JSON_PARSE_ERROR
- See Also:
- Constant Field Values
-
INVALID_XML
public static final int INVALID_XML
- See Also:
- Constant Field Values
-
-
Method Detail
-
read
public PrivilegeSet read(InputStream xacml) throws EntitlementException
Reads a sequence of XACML policies as OpenAM Privileges.- Parameters:
xacml- Non null stream to read.- Returns:
- The XACML policies translated to OpenAM privileges.
- Throws:
EntitlementException- If there was any unexpected error.
-
fromXACML
public PrivilegeSet fromXACML(PolicySet policySet) throws EntitlementException
Translate provided XACML PolicySet into OpenAM Privileges, ReferralPrivileges, Applications and ResourceTypes. XACML export file doesn't map Application and Resource Type completely and hence dummy ResourceType Ids are assigned to ResourceTypes created and same is used for linking Application, Privilege to the ResourceType. From a policySet instance:
- An application is created for every unique application name found in the Policy instances.
- One ResourceType instance (with dummy uuid) per Policy is created.
- One instance of Privilege per Policy instance is created.
- Parameters:
policySet- The set of policies to translate- Returns:
- OpenAM Privileges, ReferralPrivileges, Applications and ResourceTypes.
- Throws:
EntitlementException- If there was any unexpected error.
-
toXACML
public PolicySet toXACML(String realm, PrivilegeSet privilegeSet) throws EntitlementException
Translate provided OpenAM Privilege and ReferralPrivilege objects into XACML PolicySet.- Parameters:
realm- The realm to which the provided privileges belong.,privilegeSet- The Privileges and ReferralPrivileges to translate.- Returns:
- XACML PolicySet
- Throws:
EntitlementException- If there was any unexpected error.
-
-