My friend has already posted about exporting and importing policies in OES 11g through command line. However, if you wish to do the same operation using OES 11g API, here is what you need to do:
// @ To retrieve the Context Factory Instance.
JpsContextFactory ctxFact = JpsContextFactory.getContextFactory();
// @ To retrieve the JPS context from jps-config.xml.
JpsContext ctx = ctxFact.getContext(“default”);
// @ To identify Policy Store Instance.
PolicyStore ps = ctx.getServiceInstance(PolicyStore.class);
// @ To backup policy data into an xml.
JpsUtilityFactory.getBackupRestorePolicyUtil().backupAllPolicyData(“default”, path);
Pre-requisites for export operation: The system-jazn-data.xml (available at $WL_DOMAIN/config/fmwconfig) has to be copied to an export location. This file will be overwritten by the above code snippet. The system-jazn-data.xml file located at $WL_DOMAIN/config/fmwconfig will contain all the system policies. The above code snippet will export all the application policies into the same XML which can then be used for import.
// @ To retrieve the Context Factory Instance.
JpsContextFactory ctxFact = JpsContextFactory.getContextFactory();
// @ To retrieve the JPS context from jps-config.xml.
JpsContext ctx = ctxFact.getContext(“default”);
// @ To identify Policy Store Instance.
PolicyStore ps = ctx.getServiceInstance(PolicyStore.class);
// To restore the policies to target OES server
JpsUtilityFactory.getBackupRestorePolicyUtil().restoreAllPolicyData(path, jpsContext);
I am engulfed in Oracle Identity & Access Management domain. I have expertise on providing the optimized solutions for user provisioning, web access management, Single Sign-On and federation capabilities etc., I am also well versed with complex integrations within Identity Management and other product domains. I have expertise on building demos and implementation experience on products Oracle Access Manager, Oracle Adaptive Access Manager, Oracle Entitlement Server, Oracle Virtual Directory, Oracle Internet Directory etc., Look @ my blog: http://talkidentity.blogspot.com