Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## fr.univrennes1.cri.util.ldapUtils
Class LDAPUtils

    java.lang.Object
      fr.univrennes1.cri.util.ldapUtils.LDAPUtils

public class LDAPUtils
extends java.lang.Object

Version:
  1.0 This class offers methods to access and modify LDAP entries.
  Creation date : 22 nov. 2005 Last modification :
Author:
  Thomas Bellembois

Field Summary
`static java.lang.String` | `SCOPE_OBJECT_LEVEL`
`static java.lang.String` | `SCOPE_OBJECT_LEVEL_ALT`
`static java.lang.String` | `SCOPE_ONE_LEVEL`
`static java.lang.String` | `SCOPE_ONE_LEVEL_ALT`
`static java.lang.String` | `SCOPE_SUBTREE_LEVEL`
`static java.lang.String` | `SCOPE_SUBTREE_LEVEL_ALT`

Constructor Summary
`LDAPUtils()` Constructor.

Method Summary
`boolean` | `connect(java.lang.String ldapUrl, java.lang.String ldapPort, java.lang.String ldapPrincipal, java.lang.String ldapCredential)` Connects to the LDAP
`boolean` | `disconnect()` Disconnects from the LDAP
`java.util.Vector` | `getEntries(java.lang.String LDAPFilter, java.lang.String ldapBaseDn, java.lang.String ldapMaxResults, java.lang.String[] attributesToRetrieve, java.lang.String _ldapScope)` Retrieves entries matching the given LDAP filter
`int` | `getNumberOfEntries(java.lang.String LDAPFilter, java.lang.String ldapBaseDn, java.lang.String _ldapScope)` Gets the number of entries matching the given LDAP filter
`static void` | `main(java.lang.String[] args)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SCOPE_SUBTREE_LEVEL

    public static final java.lang.String SCOPE_SUBTREE_LEVEL

See Also:
  Constant Field Values

### SCOPE_SUBTREE_LEVEL_ALT

    public static final java.lang.String SCOPE_SUBTREE_LEVEL_ALT

See Also:
  Constant Field Values

### SCOPE_ONE_LEVEL

    public static final java.lang.String SCOPE_ONE_LEVEL

See Also:
  Constant Field Values

### SCOPE_ONE_LEVEL_ALT

    public static final java.lang.String SCOPE_ONE_LEVEL_ALT

See Also:
  Constant Field Values

### SCOPE_OBJECT_LEVEL

    public static final java.lang.String SCOPE_OBJECT_LEVEL

See Also:
  Constant Field Values

### SCOPE_OBJECT_LEVEL_ALT

    public static final java.lang.String SCOPE_OBJECT_LEVEL_ALT

See Also:
  Constant Field Values

Constructor Detail

### LDAPUtils

    public LDAPUtils()

  Constructor.
  Must be called first.

Method Detail

### main

    public static void main(java.lang.String[] args)

### disconnect

    public boolean disconnect()

  Disconnects from the LDAP

  Returns:
    true if the deconnection is successfull

### connect

    public boolean connect(java.lang.String ldapUrl,
                           java.lang.String ldapPort,
                           java.lang.String ldapPrincipal,
                           java.lang.String ldapCredential)
                    throws fr.univrennes1.cri.util.exceptions.ConfigException

  Connects to the LDAP

  Parameters:
    `ldapUrl` - : LDAP URL - ex : ldap.univ.fr
    `ldapPort` - : LDAP port - ex : 389
    `ldapPrincipal` - : Principal name if required - leave empty if not
    `ldapCredential` - : Credential if required - leave empty if not
  Returns:
    true if the connection is successfull
  Throws:
    `fr.univrennes1.cri.util.exceptions.ConfigException`

### getNumberOfEntries

    public int getNumberOfEntries(java.lang.String LDAPFilter,
                                  java.lang.String ldapBaseDn,
                                  java.lang.String _ldapScope)
                           throws com.novell.ldap.LDAPException,
                                  fr.univrennes1.cri.util.exceptions.ConfigException

  Gets the number of entries matching the given LDAP filter

  Parameters:
    `LDAPFilter` - LDAP filter request
    `ldapBaseDn` - : LDAP baseDN - ex : ou=people,dc=univ,dc=fr
    `_ldapScope` - : LDAP scope, must be SCOPE_OBJECT_LEVEL, SCOPE_ONE_LEVEL or SCOPE_SUBTREE_LEVEL
  Returns:
    the number of entries as a int
  Throws:
    `com.novell.ldap.LDAPException`
    `fr.univrennes1.cri.util.exceptions.ConfigException`

### getEntries

    public java.util.Vector getEntries(java.lang.String LDAPFilter,
                                       java.lang.String ldapBaseDn,
                                       java.lang.String ldapMaxResults,
                                       java.lang.String[] attributesToRetrieve,
                                       java.lang.String _ldapScope)
                                throws com.novell.ldap.LDAPException,
                                       fr.univrennes1.cri.util.exceptions.ConfigException

  Retrieves entries matching the given LDAP filter

  Parameters:
    `LDAPFilter` - LDAP filter request
    `ldapBaseDn` - : LDAP baseDN - ex : ou=people,dc=univ,dc=fr
    `ldapMaxResults` - : maximum number of entries to retrieve - 0 for no limit
    `attributesToRetrieve` - : attributes to retrieve as an array of Strings - ex : [{"uid"},{"displayName"}]
    `_ldapScope` - : LDAP scope, must be SCOPE_OBJECT_LEVEL, SCOPE_ONE_LEVEL or SCOPE_SUBTREE_LEVEL
  Returns:
    the LDAP entries as a Vector of _LDAPEntry
  Throws:
    `com.novell.ldap.LDAPException`
    `fr.univrennes1.cri.util.exceptions.ConfigException`

Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD