use of com.iplanet.am.sdk.AMCallBack in project OpenAM by OpenRock.
the class CallBackHelper method preProcessModifyMemberShip.
/**
* Special method for pre processing memberShip modification for roles &
* groups.
*/
public Set preProcessModifyMemberShip(SSOToken token, String entryDN, String orgDN, Set members, int operation, int objectType) throws AMException {
Set implSet = getPrePostImpls(orgDN);
if (implSet != null && !implSet.isEmpty()) {
// Post processing impls present
// Iterate through the PrePost-Processing plugins and execute
Iterator itr = implSet.iterator();
while (itr.hasNext()) {
String className = (String) itr.next();
AMCallBack impl = getCallBackObject(className);
if (impl == null) {
continue;
}
try {
switch(operation) {
case DirectoryServicesImpl.ADD_MEMBER:
members = impl.preProcessAddUser(token, entryDN, members, objectType);
break;
case DirectoryServicesImpl.REMOVE_MEMBER:
members = impl.preProcessRemoveUser(token, entryDN, members, objectType);
break;
}
} catch (AMException ae) {
// Exception thrown by the external impl
debug.error("CallBackHelper.preProcessModifyMemberShip():" + " Preprocessing impl " + className + " exception " + "thrown by impl:", ae);
throw ae;
}
}
}
return members;
}
use of com.iplanet.am.sdk.AMCallBack in project OpenAM by OpenRock.
the class CallBackHelper method postProcess.
// TODO: Remove this. Use the Maps interface only
public void postProcess(SSOToken token, String entryDN, String orgDN, AttrSet oldAttrSet, AttrSet newAttrSet, int operation, int objectType, boolean softDelete) throws AMException {
// Use the external impls instantiated at the time of pre-processing
Set implSet = getPrePostImpls(orgDN);
if ((implSet != null) && (!implSet.isEmpty())) {
Map newAttrMap = CommonUtils.attrSetToMap(newAttrSet);
Map oldAttrMap = CommonUtils.attrSetToMap(oldAttrSet);
// Iterate through the Pre-Processing Impls and execute
Iterator itr = implSet.iterator();
while (itr.hasNext()) {
String className = (String) itr.next();
AMCallBack impl = getCallBackObject(className);
if (impl == null) {
continue;
}
try {
switch(operation) {
case CREATE:
impl.postProcessCreate(token, entryDN, newAttrMap, objectType);
break;
case MODIFY:
impl.postProcessModify(token, entryDN, oldAttrMap, newAttrMap, objectType);
break;
case DELETE:
impl.postProcessDelete(token, entryDN, oldAttrMap, softDelete, objectType);
break;
}
} catch (AMException ae) {
// Exception thrown by the external impl
debug.error("CallBackHelper.postProcess(): Preprocessing" + "impl " + impl.getClass().getName() + " exception thrown: ", ae);
}
}
}
}
Aggregations