|
|
@ -68,7 +68,6 @@ public class AccountSource { |
|
|
|
|
|
|
|
public void add(final List<Entry> usersToBeAdded) { |
|
|
|
for (final Entry entry : usersToBeAdded) { |
|
|
|
System.out.print("-> Füge Benutzer " + entry.getDN() + "..."); |
|
|
|
executorService.submit(new Runnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
@ -76,12 +75,12 @@ public class AccountSource { |
|
|
|
try { |
|
|
|
ldapResult = connection.add(entry); |
|
|
|
if (ldapResult.getResultCode().intValue() == 0) { |
|
|
|
System.out.print("Ok\n"); |
|
|
|
System.out.println("-> Benutzer cn=" + entry.getDN() + " hinzugefügt...Ok\n"); |
|
|
|
} else { |
|
|
|
System.out.print("Fehler (" + ldapResult.getResultCode() + ")\n"); |
|
|
|
System.out.println("Fehler beim Hinzufügen von Benutzer cn=" + entry.getDN() + " (" + ldapResult.getResultCode() + ")\n"); |
|
|
|
} |
|
|
|
} catch (LDAPException e) { |
|
|
|
System.out.print("Fehler (" + e.getMessage() + ")\n"); |
|
|
|
System.out.println("Fehler beim Hinzufügen von Benutzer cn=" + entry.getDN() + " (" + e.getMessage() + ")\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
@ -90,7 +89,6 @@ public class AccountSource { |
|
|
|
|
|
|
|
public void del(final Set<String> usersToBeDeleted) { |
|
|
|
for (final String user : usersToBeDeleted) { |
|
|
|
System.out.print("-> Lösche Benutzer cn=" + user + "," + this.baseDN + "..."); |
|
|
|
executorService.submit(new Runnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
@ -99,12 +97,12 @@ public class AccountSource { |
|
|
|
ldapResult = connection.delete("cn=" + user + "," + AccountSource.this.baseDN); |
|
|
|
|
|
|
|
if (ldapResult.getResultCode().intValue() == 0) { |
|
|
|
System.out.print("Ok\n"); |
|
|
|
System.out.print("-> Benutzer cn=" + user + "," + AccountSource.this.baseDN + " gelöscht...Ok\n"); |
|
|
|
} else { |
|
|
|
System.out.print("Fehler (" + ldapResult.getResultCode() + ")\n"); |
|
|
|
System.out.print("Fehler beim Löschen von Benutzer cn=" + user + " (" + ldapResult.getResultCode() + ")\n"); |
|
|
|
} |
|
|
|
} catch (LDAPException e) { |
|
|
|
System.out.print("Fehler (" + e.getMessage() + ")\n"); |
|
|
|
System.out.print("Fehler beim Löschen von Benutzer cn=" + user + " (" + e.getMessage() + ")\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|