summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/lookup/ldap/LDAPPathSet.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-10-07 09:17:37 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-10-07 09:17:37 +0200
commiteb16b04d14b3bea6cd110f21361e049e35a37822 (patch)
treec3bf4ae024a42343ff3267be57f0be4c657efa0c /src/main/java/com/c2kernel/lookup/ldap/LDAPPathSet.java
parente7944d42d0e4e73c4fb4c6ce026bd624a5a71f1b (diff)
Repackage to org.cristalise
Diffstat (limited to 'src/main/java/com/c2kernel/lookup/ldap/LDAPPathSet.java')
-rw-r--r--src/main/java/com/c2kernel/lookup/ldap/LDAPPathSet.java81
1 files changed, 0 insertions, 81 deletions
diff --git a/src/main/java/com/c2kernel/lookup/ldap/LDAPPathSet.java b/src/main/java/com/c2kernel/lookup/ldap/LDAPPathSet.java
deleted file mode 100644
index 806976d..0000000
--- a/src/main/java/com/c2kernel/lookup/ldap/LDAPPathSet.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package com.c2kernel.lookup.ldap;
-
-import java.util.Iterator;
-
-import com.c2kernel.lookup.Path;
-import com.c2kernel.utils.Logger;
-import com.novell.ldap.LDAPEntry;
-import com.novell.ldap.LDAPException;
-import com.novell.ldap.LDAPSearchResults;
-
-/**************************************************************************
- *
- * $Revision: 1.6 $
- * $Date: 2005/12/01 14:23:14 $
- *
- * Copyright (C) 2003 CERN - European Organization for Nuclear Research
- * All rights reserved.
- **************************************************************************/
-
-
-
-public class LDAPPathSet implements Iterator<Path> {
- LDAPSearchResults results;
- LDAPEntry nextEntry;
- LDAPLookup ldap;
-
- public LDAPPathSet(LDAPLookup ldap) { // empty
- this.ldap = ldap;
- results = null;
- }
-
- public LDAPPathSet(LDAPSearchResults results, LDAPLookup ldap) {
- this.ldap = ldap;
- this.results = results;
- }
-
- @Override
- public boolean hasNext() {
- if (results == null) return false;
- if (nextEntry != null) return true;
- if (results.hasMore())
- try {
- nextEntry = results.next();
- return true;
- } catch (LDAPException ex) {
- if (ex.getResultCode()!=32) {// no results
- Logger.error(ex);
- Logger.error("Error loading LDAP result set: "+ex.getMessage());
- }
- }
- return false;
- }
-
- @Override
- public Path next() {
- if (results == null) return null;
- try {
- if (nextEntry == null)
- nextEntry = results.next();
- Path nextPath = ldap.nodeToPath(nextEntry);
- nextEntry = null;
- return nextPath;
- } catch (Exception ex) {
- Logger.error("Error loading next path");
- Logger.error(ex);
- nextEntry = null;
- if (hasNext()) {
- Logger.error("Skipping to next entry");
- return next();
- }
- else
- return null;
- }
- }
-
- @Override
- public void remove() {
- // do nothing
-
- }
-}