nsmcp::LogService method resolveWindow (public)

 <instance of nsmcp::LogService[i]> resolveWindow context handle

Defined in /usr/local/ns/tcl/nsmcp/log-tools.tcl

Resolve a retained job's time bounds for its owner. Validate the caller and locate an owned job under the service mutex rather than accepting browser-supplied bounds.

Parameters:
context (required)
Authenticated request context carrying the principal, grants and selected server.
handle (required)
Retained job or conversation handle; ownership and expiry checks still apply.
Returns:
The retained window dictionary; unknown or unowned handles raise an error.

Testcases:
No testcase defined.
Source code:
:require $context
ns_mutex lock ${:mutex}
try {
    foreach key [nsv_array names ${:store}] {
        set record [nsv_get ${:store} $key]
        if {![:owned $context $record]} {
            continue
        }
        if {[dict exists $record windowHandle] && [dict get $record windowHandle] eq $handle} {
            return [dict get $record window]
        }
        if {$key eq $handle} {
            return -code error -errorcode {NSMCP RPC -32602} "This is a jobHandle; use its windowHandle for access_summary"
        }
        if {[dict exists $record mappings $handle]} {
            return -code error -errorcode {NSMCP RPC -32602} "This is a resultHandle; use it with log_results, not access_summary"
        }
    }
    return -code error -errorcode {NSMCP RPC -32602} "Unknown or expired windowHandle; start a new interval"
} finally {
    ns_mutex unlock ${:mutex}
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: