Chapter 11 Name Server Lookup : tibemsLookupContext

tibemsLookupContext
Type
Purpose
Retrieve objects from the server’s naming directory.
Remarks
The context object establishes communication with an EMS server or an LDAP server, authenticates the user, and submits name queries.
Name queries can retrieve connection factories and destinations.
 
tibemsLookupContext_Create
Function
Purpose
Create a new EMS lookup context object.
C Declaration
tibems_status tibemsLookupContext_Create(
    tibemsLookupContext* context,
    const char* brokerURL,
    const char* username,
    const char* password );
 
tibems_status tibemsLookupContext_CreateSSL(
    tibemsLookupContext* context,
    const char* brokerURL,
    const char* username,
    const char* password,
    tibemsSSLParams sslParams,
    const char* pk_password );
COBOL Call
CALL "tibemsLookupContext_Create"
USING BY REFERENCE context,
BY REFERENCE brokerURL,
BY REFERENCE username,
BY REFERENCE password,
RETURNING tibems-status
END-CALL.
 
CALL "tibemsLookupContext_CreateSSL"
USING BY REFERENCE context,
BY REFERENCE brokerURL,
BY REFERENCE username,
BY REFERENCE password,
BY VALUE sslParams,
BY REFERENCE pk-password,
RETURNING tibems-status
END-CALL.
 
context and sslParams have usage pointer.
Parameters
 
Remarks
The first call produces a lookup context that communicates with server without encryption. The second call produces a lookup context that communicates using an SSL connection.
If the server permits anonymous lookup, you may supply null values for the username and password parameters.
See Also
tibemsLookupContext_CreateExternal on page 325
tibemsLookupContext_CreateExternal
Function
Purpose
Create a new LDAP lookup context object.
C Declaration
tibems_status tibemsLookupContext_CreateExternal(
    tibemsLookupContext* context,
    tibemsLookupParams lookupParams );
COBOL Call
CALL "tibemsLookupContext_CreateExternal"
USING BY REFERENCE context,
BY VALUE lookupParams,
RETURNING tibems-status
END-CALL.
 
context and lookupParams have usage pointer.
Parameters
 
See Also
tibemsLookupContext_Create on page 323
tibemsLookupParams on page 329
tibemsLookupParams_Create on page 330
tibemsLookupParams_Destroy on page 331
tibemsLookupContext_Destroy
Function
Purpose
Destroy a lookup context and reclaim resources.
C Declaration
tibems_status tibemsLookupContext_Destroy(
    tibemsLookupContext context );
COBOL Call
CALL "tibemsLookupContext_Destroy"
USING BY VALUE context,
RETURNING tibems-status
END-CALL.
 
context has usage pointer.
Parameters
 
tibemsLookupContext_Lookup
Function
Purpose
Lookup an object in the naming server.
C Declaration
tibems_status tibemsLookupContext_Lookup(
    tibemsLookupContext context,
    const char* name,
    void** object);
 
tibems_status tibemsLookupContext_LookupDestination(
    tibemsLookupContext context,
    const char* name,
    tibemsDestination* destination);
 
tibems_status tibemsLookupContext_LookupConnectionFactory(
    tibemsLookupContext context,
    const char* name,
    tibemsConnectionFactory* factory);
COBOL Call
CALL "tibemsLookupContext_Lookup"
USING BY VALUE context,
BY REFERENCE name,
BY REFERENCE object,
RETURNING tibems-status
END-CALL.
 
CALL "tibemsLookupContext_LookupDestination"
USING BY VALUE context,
BY REFERENCE name,
BY REFERENCE destination,
RETURNING tibems-status
END-CALL.
 
CALL "tibemsLookupContext_LookupConnectionFactory"
USING BY VALUE context,
BY REFERENCE name,
BY REFERENCE factory,
RETURNING tibems-status
END-CALL.
 
context, object, destination and factory have usage pointer.
Parameters
 
Remarks
These calls look up names in either the name server portion of an EMS server, or in an LDAP server.
The first call looks up a generic object; the calling program must cast the result to the expect type. The other calls restrict lookup to either destinations or connection factories.
If the server does not find the name, this call returns TIBEMS_NOT_FOUND.
If the server finds both a topic and a queue with the same name, this call returns TIBEMS_ILLEGAL_STATE.
The calling program must destroy the resulting object when it is no longer needed.