public void doFail() {
}
public void updateApplicationPolicyConfiguration(Map<String, ComponentPermissions> contextIdToPermissionsMap) throws PolicyContextException, ClassNotFoundException, LoginException {
PolicyConfigurationFactory policyConfigurationFactory;
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(classLoader);
policyConfigurationFactory = PolicyConfigurationFactory.getPolicyConfigurationFactory();
} finally {
Thread.currentThread().setContextClassLoader(oldClassLoader);
}
//Remove those contextId that we want to update, is this required ?
for (String contextId : contextIdToPermissionsMap.keySet()) {
contextIdToPolicyConfigurationMap.remove(contextId);
}
if (principalRoleMapper != null) {
principalRoleMapper.uninstall(contextIdToPermissionsMap.keySet());
}
//
for (Map.Entry<String, ComponentPermissions> entry : contextIdToPermissionsMap.entrySet()) {
String contextID = entry.getKey();
ComponentPermissions componentPermissions = entry.getValue();
//Clean existing PolicyConfiguration and set its state to "OPEN"
PolicyConfiguration policyConfiguration = policyConfigurationFactory.getPolicyConfiguration(contextID, true);
contextIdToPolicyConfigurationMap.put(contextID, policyConfiguration);
policyConfiguration.addToExcludedPolicy(componentPermissions.getExcludedPermissions());
policyConfiguration.addToUncheckedPolicy(componentPermissions.getUncheckedPermissions());
for (Map.Entry<String, PermissionCollection> roleEntry : componentPermissions.getRolePermissions().entrySet()) {
String roleName = roleEntry.getKey();