@Override public void modifyMemberShip(SSOToken token,IdType type,String name,Set<String> members,IdType membersType,int operation) throws IdRepoException {
  if (DEBUG.messageEnabled()) {
    DEBUG.message("modifymembership invoked");
  }
  if (members == null || members.isEmpty()) {
    throw newIdRepoException(IdRepoErrorCode.ILLEGAL_ARGUMENTS);
  }
  if (type.equals(IdType.USER)) {
    throw newIdRepoException(IdRepoErrorCode.MEMBERSHIP_TO_USERS_AND_AGENTS_NOT_ALLOWED);
  }
  if (!membersType.equals(IdType.USER)) {
    throw newIdRepoException(IdRepoErrorCode.MEMBERSHIPS_FOR_NOT_USERS_NOT_ALLOWED,CLASS_NAME);
  }
  String dn=getDN(type,name);
  Set<String> memberDNs=new HashSet<>(members.size());
  for (  String member : members) {
    memberDNs.add(getDN(membersType,member));
  }
  if (type.equals(IdType.GROUP)) {
    modifyGroupMembership(dn,memberDNs,operation);
  }
 else   if (type.equals(IdType.ROLE)) {
    modifyRoleMembership(dn,memberDNs,operation);
  }
 else {
    throw newIdRepoException(IdRepoErrorCode.MEMBERSHIP_CANNOT_BE_MODIFIED,CLASS_NAME,type.getName());
  }
}

@ Override public void modifyMemberShip ( SSOToken token , IdType type , String name , Set < String > members , IdType membersType , int operation ) throws IdRepoException { if ( DEBUG . messageEnabled ( ) ) { DEBUG . message ( "modifymembership invoked" ) ; } if ( members == null || members . isEmpty ( ) ) { throw newIdRepoException ( IdRepoErrorCode . ILLEGAL_ARGUMENTS ) ; } if ( type . equals ( IdType . USER ) ) { throw newIdRepoException ( IdRepoErrorCode . MEMBERSHIP_TO_USERS_AND_AGENTS_NOT_ALLOWED ) ; } if ( ! membersType . equals ( IdType . USER ) ) { throw newIdRepoException ( IdRepoErrorCode . MEMBERSHIPS_FOR_NOT_USERS_NOT_ALLOWED , CLASS_NAME ) ; } String dn = getDN ( type , name ) ; Set < String > memberDNs = new HashSet < > ( members . size ( ) ) ; for ( String member : members ) { memberDNs . add ( getDN ( membersType , member ) ) ; } if ( type . equals ( IdType . GROUP ) ) { modifyGroupMembership ( dn , memberDNs , operation ) ; } else if ( type . equals ( IdType . ROLE ) ) { modifyRoleMembership ( dn , memberDNs , operation ) ; } else { throw newIdRepoException ( IdRepoErrorCode . MEMBERSHIP_CANNOT_BE_MODIFIED , CLASS_NAME , type . getName ( ) ) ; } }
adds or removes members to the provided group / role .
