Runtime components : Service components : LDAP Access Service : Tasks : Working with response models
  
Working with response models
For each LDAP request type supported by the LDAP Access Service, there is a subclass of LDAPResponse that encapsulates the data returned by the request. Each response model wraps the native data object returned by LDAP, and also provides its own data object to support externalization and accessibility. The LDAP response models are provided mainly for the purpose of externalization. Since the objects returned by JNDI already have access methods for them, these methods have not been duplicated in the LDAP Access Service response models. If working with these response models directly, a call should be made to getLDAPReturnObject() to get the native JDNI. Working with this object requires knowledge of the JNDI API. For more information, see the documentation from Sun for JDK 1.5.
The following table shows the associations between LDAP request types, supporting LDAPResponse subclasses, and Java packages.
LDAP request types, supporting response subclasses, and Java packages
list | listbindings
Supporting subclass : LDAPListResponse
Contains: javax.naming.NamingEnumeration
lookup
Supporting subclass : LDAPLookupResponse
Contains: java.lang.Object
search
Supporting subclass : LDAPSearchResponse
Contains: javax.naming.NamingEnumeration
create
Supporting subclass : LDAPCreateResponse
Contains: javax.naming.directory.DirContext
destroy
Supporting subclass : LDAPDestroyResponse
Contains: N/A
modify
Supporting subclass : LDAPModifyResponse
Contains: N/A
getattributes
Supporting subclass : LDAPGetAttributesResponse
Contains: javax.naming.directory.Attributes
If the LDAP Access Service output data has been externalized, then the LDAPResponse object is not used directly. However, for applications that handle their own response data, the LDAP return object should be obtained by makint he following call:
responseModel.getLDAPReturnObject()
Cast the object returned by this method to the appropriate class for the request type. For example, for a search request that uses the following:
NamingEnumeration results=(NamingEnumeration) searchResponseModel.getLDAPReturnObject();
Consult the JDK 1.5 documentation for information on the LDAP objects wrapped within the response models.
Go up to
Tasks