Class XACMLExportImport
- java.lang.Object
-
- com.sun.identity.entitlement.xacml3.XACMLExportImport
-
public class XACMLExportImport extends Object
Utility for handling the Export and subsequent Import of Policies into the OpenAM Entitlements framework.- Since:
- 12.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXACMLExportImport.PrivilegeManagerFactoryFactory to allow PrivilegeManager to be mocked in tests
-
Constructor Summary
Constructors Constructor Description XACMLExportImport(XACMLExportImport.PrivilegeManagerFactory privilegeManagerFactory, XACMLReaderWriter xacmlReaderWriter, PrivilegeValidator privilegeValidator, SearchFilterFactory searchFilterFactory, Debug debug, ApplicationServiceFactory applicationServiceFactory, ResourceTypeService resourceTypeService)Creates an instance of the XACMLExportImport with dependencies provided.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PolicySetexportXACML(String realm, Subject admin, List<String> filters)Performs an export of all Policies found in the Privilege Manager that match the provided filters.List<ImportStep>importXacml(String realm, InputStream xacml, Subject admin, boolean dryRun)Performs the Import based on the given Stream.
-
-
-
Field Detail
-
PREFIX
public static final String PREFIX
-
-
Constructor Detail
-
XACMLExportImport
@Inject public XACMLExportImport(XACMLExportImport.PrivilegeManagerFactory privilegeManagerFactory, XACMLReaderWriter xacmlReaderWriter, PrivilegeValidator privilegeValidator, SearchFilterFactory searchFilterFactory, @Named("Entitlement") Debug debug, ApplicationServiceFactory applicationServiceFactory, ResourceTypeService resourceTypeService)
Creates an instance of the XACMLExportImport with dependencies provided.- Parameters:
privilegeManagerFactory- Non null, required to create PrivilegeManager instances.xacmlReaderWriter- Non null, required for translating privileges to/from XACML XML.privilegeValidator- Non null, required for validation of imported privileges.searchFilterFactory- Non null, required for SearchFilter operations.debug- Non null.applicationServiceFactory- Application service factory responsible for creating the application service.resourceTypeService- Resource type service responsible for creating resource types.
-
-
Method Detail
-
importXacml
public List<ImportStep> importXacml(String realm, InputStream xacml, Subject admin, boolean dryRun) throws EntitlementException
Performs the Import based on the given Stream. The stream must contain XML in XACML.- Parameters:
realm- Non null Realm to populate with the Policies.xacml- Non null stream to read.admin- Non null admin Subject.dryRun- boolean flag, indicating import steps should be reported but not applied.- Returns:
- The sequence steps that could or have been used to carry out the import.
- Throws:
EntitlementException- If there was any unexpected error.
-
exportXACML
public PolicySet exportXACML(String realm, Subject admin, List<String> filters) throws EntitlementException
Performs an export of all Policies found in the Privilege Manager that match the provided filters.- Parameters:
realm- Non null realm.admin- Non null admin subject to authenticate as.filters- Non null, but maybe empty filters to select Privileges against.- Returns:
- A non null but possibly empty collection of Policies.
- Throws:
EntitlementException- If there was any problem with the generation of Policies.
-
-