summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/lookup/LDAPPathSet.java
diff options
context:
space:
mode:
authorogattaz <olivier@gattaz.com>2014-06-05 16:51:07 +0200
committerogattaz <olivier@gattaz.com>2014-06-05 16:51:07 +0200
commit2fd193d7936084de91eae46e8c2763914d87ab71 (patch)
treeb136ed97e535f11d4b3433d16c26570c89430ce4 /src/main/java/com/c2kernel/lookup/LDAPPathSet.java
parent1225792532f77e6e8f4a9addfc0c0a6cf56e89b8 (diff)
parente73468fd08cc27aa31f76a27c916e45d5987c628 (diff)
Merge branch 'master' of ssh://dev.cccs.uwe.ac.uk:22/var/git/cristal-kernel
Diffstat (limited to 'src/main/java/com/c2kernel/lookup/LDAPPathSet.java')
-rw-r--r--src/main/java/com/c2kernel/lookup/LDAPPathSet.java72
1 files changed, 0 insertions, 72 deletions
diff --git a/src/main/java/com/c2kernel/lookup/LDAPPathSet.java b/src/main/java/com/c2kernel/lookup/LDAPPathSet.java
deleted file mode 100644
index d3cf7d9..0000000
--- a/src/main/java/com/c2kernel/lookup/LDAPPathSet.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package com.c2kernel.lookup;
-
-import java.util.Enumeration;
-
-import com.c2kernel.process.Gateway;
-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 Enumeration<Path> {
- LDAPSearchResults results;
- LDAPEntry nextEntry;
-
- public LDAPPathSet() { // empty
- results = null;
- }
-
- public LDAPPathSet(LDAPSearchResults results) {
- this.results = results;
- }
-
- @Override
- public boolean hasMoreElements() {
- 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 nextElement() {
- if (results == null) return null;
- try {
- if (nextEntry == null)
- nextEntry = results.next();
- Path nextPath = Gateway.getLDAPLookup().nodeToPath(nextEntry);
- nextEntry = null;
- return nextPath;
- } catch (Exception ex) {
- Logger.error("Error loading next path");
- Logger.error(ex);
- nextEntry = null;
- if (hasMoreElements()) {
- Logger.error("Skipping to next entry");
- return nextElement();
- }
- else
- return null;
- }
- }
-}