ADAPT::select

Description

The ADAPT::select command sets or returns the internal-virtual attribute

Syntax

ADAPT::select
ADAPT::select request
ADAPT::select response
ADAPT::select <name>
ADAPT::select request <name>
ADAPT::select response <name>

#v12 introduces optional context parameter, where <ctx> represents a context handle
ADAPT::select [<ctx>]
ADAPT::select [<ctx>] request
ADAPT::select [<ctx>] response
ADAPT::select [<ctx>] <name>
ADAPT::select [<ctx>] request <name>
ADAPT::select [<ctx>] response <name>

Notes: The request-adapt side cannot modify attributes on the response-adapt side until the connection has been established with the server.

ADAPT::select [<ctx>]

  • Get the internal-virtual attribute for the current side

ADAPT::select [<ctx>] request

  • Get the internal-virtual attribute for the request-adapt side

ADAPT::select [<ctx>] response

  • Get the internal-virtual attribute for the response-adapt side

ADAPT::select [<ctx>] <name>

  • Sets the internal-virtual attribute for the current side

ADAPT::select [<ctx>] request <name>

  • Sets the internal-virtual attribute for request-adapt side

ADAPT::select [<ctx>] response <name>

  • Sets the internal-virtual attribute for response-adapt

Examples

when HTTP_REQUEST {
    log local0. “Event HTTP_REQUEST"
    # Disable the static configs (templates for dynamic)
    ADAPT::enable request false
    ADAPT::enable response false
    # Create the first dynamic context on the clientside and configure it.
    set req_ctx1 [ADAPT::context_create req_ctx1]
    ADAPT::select $req_ctx1 /Common/ivs-req1-example
    ADAPT::enable $req_ctx1 true
    # Create the first dynamic context on the serverside and configure it (pending).
    set rsp_ctx1 [ADAPT::context_create response rsp_ctx1]
    ADAPT::select $rsp_ctx1 /Common/ivs-rsp1-example
    ADAPT::enable $rsp_ctx1 true
}
when ADAPT_REQUEST_RESULT {
    set ctx [ADAPT::context_current]
    set ctx_name [ADAPT::context_name $ctx]
    log local0. "Event ADAPT_REQUEST_RESULT in context $ctx_name"
    if {$ctx == $req_ctx1} {
        # Create the second dynamic context on the clientside and configure it.
        set req_ctx2 [ADAPT::context_create req_ctx2]
        ADAPT::select $req_ctx2 /Common/ivs-req2-example
        ADAPT::enable $req_ctx2 true
        # Create the second dynamic context on the serverside and configure it.
        set rsp_ctx2 [ADAPT::context_create response demo_rsp_ctx2]
        ADAPT::select $rsp_ctx2 /Common/ivs-rsp2-example
        ADAPT::enable $rsp_ctx2 true
    }
}