コード例 #1
0
 private void processDeleteMember(String groupName, String dukeid) throws Exception {
   boolean success = ldapConnectionWrapper.removeMemberFromGroup(dukeid,groupName);
   logger.debug("removeMemberFromGroup returned:"+success);
   if (!success) 
     throw new Exception("Unable to remove "+dukeid+" from the group: "+groupName);
   logger.info(connectorName + ": deleted " + dukeid + " to "+ groupName);
 }
コード例 #2
0
  private void processAddMember(String groupName, String dukeid) throws Exception {
//    here's an example in production
//    ismemberof: urn:mace:duke.edu:groups:siss:courses:TEST:102:01:1000:9999:students
//    educoursemember: Learner@urn:mace:duke.edu:courses:TEST:102,section=01,class=1000,term=9999
//    educourseoffering: urn:mace:duke.edu:courses:TEST:102,section=01,class=1000,term=9999
    boolean success = ldapConnectionWrapper.addMemberToGroup(dukeid,groupName);
    logger.info("addMemberToGroup returned"+success);
    if (!success) 
      throw new Exception("Unable to add "+dukeid+" to the group: "+groupName);
    logger.info(connectorName + ": added " + dukeid + " to "+ groupName);

  }
コード例 #3
0
  private void processRename(String oldGroupName, String newGroupName) throws Exception {
    // We are assuming they never rename a "Course" group.  If they did rename such a group
    // we would need to alter the educoursemember and educourseoffering fields.
    
    newGroupName = urnizeGroupName(newGroupName);

    Vector<String> failedList;
    failedList = ldapConnectionWrapper.renameGroup(oldGroupName,newGroupName);
    if (!failedList.isEmpty()) {
      logger.error("failed to change memberships for:"+failedList.toString());
      throw new Exception("Unable to rename the group: "+oldGroupName);
    } else {
      logger.info(connectorName + ": Actually renamed group " + oldGroupName + " to "+ newGroupName);
    }
  }