public void addMemberships(String universalId,Set membership) throws AMConsoleException {
  if ((membership == null) || membership.isEmpty()) {
    throw new AMConsoleException("entities.membership.add.no.selection.message");
  }
  SSOToken ssoToken=getUserSSOToken();
  String currentId="";
  try {
    AMIdentity amid=IdUtils.getIdentity(ssoToken,universalId);
    String[] params=new String[2];
    params[1]=universalId;
    for (Iterator iter=membership.iterator(); iter.hasNext(); ) {
      String id=(String)iter.next();
      AMIdentity amidentity=IdUtils.getIdentity(ssoToken,id);
      currentId=id;
      params[0]=id;
      logEvent("ATTEMPT_ADD_IDENTITY_MEMBER",params);
      amidentity.addMember(amid);
      logEvent("SUCCEED_ADD_IDENTITY_MEMBER",params);
    }
  }
 catch (  SSOException e) {
    String[] paramsEx={currentId,universalId,getErrorString(e)};
    logEvent("SSO_EXCEPTION_ADD_IDENTITY_MEMBER",paramsEx);
    debug.warning("EntitiesModelImpl.addMemberships",e);
    throw new AMConsoleException(getErrorString(e));
  }
catch (  IdRepoException e) {
    String[] paramsEx={currentId,universalId,getErrorString(e)};
    logEvent("IDM_EXCEPTION_ADD_IDENTITY_MEMBER",paramsEx);
    debug.warning("EntitiesModelImpl.addMemberships",e);
    throw new AMConsoleException(getErrorString(e));
  }
}

public void addMemberships ( String universalId , Set membership ) throws AMConsoleException { if ( ( membership == null ) || membership . isEmpty ( ) ) { throw new AMConsoleException ( "entities.membership.add.no.selection.message" ) ; } SSOToken ssoToken = getUserSSOToken ( ) ; String currentId = "" ; try { AMIdentity amid = IdUtils . getIdentity ( ssoToken , universalId ) ; String [ ] params = new String [ 2 ] ; params [ 1 ] = universalId ; for ( Iterator iter = membership . iterator ( ) ; iter . hasNext ( ) ; ) { String id = ( String ) iter . next ( ) ; AMIdentity amidentity = IdUtils . getIdentity ( ssoToken , id ) ; currentId = id ; params [ 0 ] = id ; logEvent ( "ATTEMPT_ADD_IDENTITY_MEMBER" , params ) ; amidentity . addMember ( amid ) ; logEvent ( "SUCCEED_ADD_IDENTITY_MEMBER" , params ) ; } } catch ( SSOException e ) { String [ ] paramsEx = { currentId , universalId , getErrorString ( e ) } ; logEvent ( "SSO_EXCEPTION_ADD_IDENTITY_MEMBER" , paramsEx ) ; debug . warning ( "EntitiesModelImpl.addMemberships" , e ) ; throw new AMConsoleException ( getErrorString ( e ) ) ; } catch ( IdRepoException e ) { String [ ] paramsEx = { currentId , universalId , getErrorString ( e ) } ; logEvent ( "IDM_EXCEPTION_ADD_IDENTITY_MEMBER" , paramsEx ) ; debug . warning ( "EntitiesModelImpl.addMemberships" , e ) ; throw new AMConsoleException ( getErrorString ( e ) ) ; } }
adds an entity to a set of membership .
