use of com.sun.identity.policy.PolicyManager in project OpenAM by OpenRock.
the class ResavePoliciesStep method initialize.
public void initialize() throws UpgradeException {
DEBUG.message("Initializing ResavePoliciesStep");
if (VersionUtils.isCurrentVersionEqualTo(UpgradeUtils.ELEVEN_VERSION_NUMBER)) {
try {
for (String realm : getRealmNames()) {
PolicyManager pm = new PolicyManager(getAdminToken(), realm);
Set<String> policyNames = pm.getPolicyNames();
if (policyNames != null && !policyNames.isEmpty()) {
policyMap.put(realm, new HashSet<String>(policyNames));
}
}
if (DEBUG.messageEnabled()) {
DEBUG.message("Discovered following policies:\n" + policyMap);
}
} catch (Exception ex) {
DEBUG.error("Error while trying to retrieve policy names", ex);
throw new UpgradeException(ex);
}
}
}
Aggregations