Collapse All Expand All

.NET Framework Class Library
LdapLookupContext Class See Also

[TIBCO.EMS .NET client library 6.0 documentation]

Lookup up an EMS administered object by name in an LDAP server.

Namespace: TIBCO.EMS
Assembly: TIBCO.EMS (in TIBCO.EMS.dll)

# Syntax

    public Object Lookup(
    	string name
    )

    Public Function Lookup ( _
    	name As String _
    ) As Object

    public:
    virtual Object^ Lookup(
    	String^ name
    ) sealed

#### Parameters

name
  Type: System..::.String
  Lookup the object with this name.

#### Implements

ILookupContext..::.Lookup(String)

# Remarks

This is an implementation of ILookupContext.Lookup. The administered objects can be either EMS connection factories, topics, queues stored in a third-party LDAP server.
Note: Lookup of XA connection factories is not supported.

When looking up administered ssl connection factory object, because of certain differences in the .NET ssl implementation and java/c ssl implementation certain paramaters do not hold any relavance in the .NET world and are ignored.

The following values are supported.

- SSL Expected hostname is converted to targethostName
- SSL client identity (only pkcs12 file)
- SSL password for the private key in the pkcs12 file
- SSL trace
- SSL trusted

The following (not complete) is the list of values ignored when constructing the ssl connection factory object.

- ssl verify host
- ssl vendor
- ssl verify host name
- ssl issuer certs

The following shows how to create and LDAP lookup context object and lookup an object in an LDAP server:

| Copy Code
--- | ---
                Hashtable props = new Hashtable();
                  props.Add(LdapLookupConsts.LDAP_SERVER_URL", "ldap://adc1.na.tibco.com:10389");
                  props.Add(LdapLookupConsts.LDAP_BASE_DN", "ou=People,dc=users");
                  props.Add(LdapLookupConsts.LDAP_PRINCIPAL", "cn=Manager');
                  props.Add(LdapLookupConsts.LDAP_CREDENTIAL", "password");
                  props.Add(LdapLookupConsts.LDAP_SEARCH_SCOPE, "subtree");
                  props.Add(LdapLookupConsts.LDAP_CONN_TYPE", "ldaps");
                LookupContextFactory lookupCtxFactory = new LookupContextFactory();
                ILookupContext searcher = lookupCtxFactory.Create(LookupContextFactory.LDAP_CONTEXT, props);
                TIBCO.EMS.Queue queue = (TIBCO.EMS.Queue)searcher.Lookup("theQueueName");

# Exceptions

Exception | Condition
--- | ---
System..::.NullReferenceException | If the name is null.
TIBCO.EMS..::.ConfigurationException | If any of the configuration parameters are missing.
TIBCO.EMS..::.NamingException | Any other error while establishing a connection to the ldap server or during lookup.

# See Also

LdapLookupContext Class
TIBCO.EMS Namespace