Browse Source

Fixing output

main
Christian Pape 2 days ago
committed by Dustin Frisch
parent
commit
26c09a6e31
No known key found for this signature in database GPG Key ID: B4C3BF012D9B26BE
  1. 14
      src/main/java/de/hsfulda/informatik/AccountSource.java

14
src/main/java/de/hsfulda/informatik/AccountSource.java

@ -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");
}
}
});

Loading…
Cancel
Save