com.hp.ucmdb.discovery.library.clients.ldap
Class LdapClient

java.lang.Object
  extended by com.hp.ucmdb.discovery.library.clients.BaseClient
      extended by com.hp.ucmdb.discovery.library.clients.query.QueryClient
          extended by com.hp.ucmdb.discovery.library.clients.ldap.LdapClient

public class LdapClient
extends QueryClient

This class represents LDAP client that handles all search communications.


Field Summary
static java.lang.String LDAP_CONNECT_TIMEOUT
           
static java.lang.String LDAP_DEFAULT_CONTEXT_FACTORY
           
static java.lang.Integer LDAP_DEFAULT_PORT
           
static java.lang.String LDAP_PROTOCOL_NAME
           
static int OBJECT_SCOPE
           
static int ONELEVEL_SCOPE
           
static java.lang.String PROP_AUTHENTICATION_TYPE
           
static java.lang.String PROP_INITIAL_CONTEXT_FACTORY
           
static java.lang.String PROP_PASSWORD
           
static java.lang.String PROP_PORT_NUMBER
           
static java.lang.String PROP_PROVIDER_URL
           
static java.lang.String PROP_TIMEOUT
           
static java.lang.String PROP_USERNAME
           
static int SUBTREE_SCOPE
           
 
Fields inherited from class com.hp.ucmdb.discovery.library.clients.BaseClient
CREDENTIALS_ID, ENCODING
 
Constructor Summary
LdapClient(ClientsFrameworkImpl framework, java.util.Properties props)
           
 
Method Summary
 Query createQuery(java.lang.String objName, java.lang.String[] attrIds)
           
 Query createQuery(java.lang.String objName, java.lang.String filter, java.lang.String[] attrIds)
           
 ResultSet executeQuery(Query query)
          Submits a query and returns the result set.
 ResultSet executeQuery(java.lang.String query)
          Submits a query and returns the result set.
 ResultSet executeQuery(java.lang.String name, java.lang.String filter, java.lang.String[] attributeIds)
          Searches in the named context or object for entries that satisfy the given search filter.
 ResultSet getAttributes(java.lang.String name, java.lang.String[] attrIds)
          Retrieves selected attributes associated with a named object.
 javax.naming.Context getContext()
           
 java.lang.Integer getPort()
          Get port number for this client connection.
 ResultSet getRootDseResultSet()
          Get rootDse for initial context.
 
Methods inherited from class com.hp.ucmdb.discovery.library.clients.BaseClient
close, getClientType, getCredentialId, getIpAddress, getProperty, getShellCmdSeperator, getSudoCommands, getSudoPaths, getTimeout, getUserName, isConnected, supportsSudo
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LDAP_PROTOCOL_NAME

public static final java.lang.String LDAP_PROTOCOL_NAME
See Also:
Constant Field Values

LDAP_DEFAULT_PORT

public static final java.lang.Integer LDAP_DEFAULT_PORT

LDAP_DEFAULT_CONTEXT_FACTORY

public static final java.lang.String LDAP_DEFAULT_CONTEXT_FACTORY
See Also:
Constant Field Values

LDAP_CONNECT_TIMEOUT

public static final java.lang.String LDAP_CONNECT_TIMEOUT
See Also:
Constant Field Values

PROP_PROVIDER_URL

public static final java.lang.String PROP_PROVIDER_URL
See Also:
Constant Field Values

PROP_PORT_NUMBER

public static final java.lang.String PROP_PORT_NUMBER
See Also:
Constant Field Values

PROP_INITIAL_CONTEXT_FACTORY

public static final java.lang.String PROP_INITIAL_CONTEXT_FACTORY
See Also:
Constant Field Values

PROP_AUTHENTICATION_TYPE

public static final java.lang.String PROP_AUTHENTICATION_TYPE
See Also:
Constant Field Values

PROP_TIMEOUT

public static final java.lang.String PROP_TIMEOUT
See Also:
Constant Field Values

PROP_USERNAME

public static final java.lang.String PROP_USERNAME
See Also:
Constant Field Values

PROP_PASSWORD

public static final java.lang.String PROP_PASSWORD
See Also:
Constant Field Values

OBJECT_SCOPE

public static final int OBJECT_SCOPE
See Also:
Constant Field Values

ONELEVEL_SCOPE

public static final int ONELEVEL_SCOPE
See Also:
Constant Field Values

SUBTREE_SCOPE

public static final int SUBTREE_SCOPE
See Also:
Constant Field Values
Constructor Detail

LdapClient

public LdapClient(ClientsFrameworkImpl framework,
                  java.util.Properties props)
           throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getRootDseResultSet

public ResultSet getRootDseResultSet()
                              throws java.lang.Exception
Get rootDse for initial context.

Throws:
java.lang.Exception

executeQuery

public ResultSet executeQuery(java.lang.String query)
                       throws java.lang.Exception
Description copied from class: QueryClient
Submits a query and returns the result set.

Overrides:
executeQuery in class QueryClient
Parameters:
query - The query to execute
Returns:
A ResultSet with database-oriented API @see ResultSet
Throws:
java.lang.Exception
See Also:
ResultSet

getContext

public javax.naming.Context getContext()
Returns:
an initial DirContext

executeQuery

public ResultSet executeQuery(java.lang.String name,
                              java.lang.String filter,
                              java.lang.String[] attributeIds)
                       throws java.lang.Exception
Searches in the named context or object for entries that satisfy the given search filter.

Parameters:
name - - the name of the context or object to search
filter - - the filter expression to use for the search; may not be null
attributeIds - - the attributes to return. null indicates that all attributes are to be returned; an empty array indicates that none are to be returned.
Returns:
a non-null ResultSet
Throws:
java.lang.Exception

getAttributes

public ResultSet getAttributes(java.lang.String name,
                               java.lang.String[] attrIds)
                        throws java.lang.Exception
Retrieves selected attributes associated with a named object.

Parameters:
name - - the name of the object from which to retrieve attributes
attrIds - - the identifiers of the attributes to retrieve. null indicates that all attributes should be retrieved; an empty array indicates that none should be retrieved.
Returns:
the requested attributes or empty result set
Throws:
java.lang.Exception

executeQuery

public ResultSet executeQuery(Query query)
                       throws java.lang.Exception
Description copied from class: QueryClient
Submits a query and returns the result set.

Overrides:
executeQuery in class QueryClient
Parameters:
query - The query to execute
Returns:
A ResultSet with database-oriented API @see ResultSet
Throws:
java.lang.Exception
See Also:
ResultSet

getPort

public java.lang.Integer getPort()
Get port number for this client connection.

Returns:
port number

createQuery

public Query createQuery(java.lang.String objName,
                         java.lang.String filter,
                         java.lang.String[] attrIds)

createQuery

public Query createQuery(java.lang.String objName,
                         java.lang.String[] attrIds)


Documentation Feedback
Copyright 2010 Hewlett-Packard Development Company, L.P.