ad_get_node_id_from_host_node_map (private)

 ad_get_node_id_from_host_node_map hostname

Defined in packages/acs-tcl/tcl/security-procs.tcl

Obtain node_id from host_node_map

Parameters:
hostname (required)
Returns:
node_id (or 0, if the provided hostname is not mapped)

Partial Call Graph (max 5 caller/called nodes):
%3 security::get_register_subsite security::get_register_subsite (public) ad_get_node_id_from_host_node_map ad_get_node_id_from_host_node_map security::get_register_subsite->ad_get_node_id_from_host_node_map db_list_of_lists db_list_of_lists (public) ad_get_node_id_from_host_node_map->db_list_of_lists

Testcases:
No testcase defined.
Source code:
    #
    # Get all entries in one sweep, such that the result can be
    # cached, no matter which hostname is provided as input; the code
    # assumes that the host-node-map is always short. This allows us
    # as well to purge the entries without a pattern match.
    #
    set mapping [acs::misc_cache eval ad_get_host_node_map {
        db_list_of_lists get_node_host_names {select host, node_id from host_node_map}
    }]
    set p [lsearch -index 0 -exact $mapping $hostname]
    if {$p != -1} {
        set result [lindex $mapping $p 1]
    } else {
        set result 0
    }
    return $result
Generic XQL file:
packages/acs-tcl/tcl/security-procs.xql

PostgreSQL XQL file:
packages/acs-tcl/tcl/security-procs-postgresql.xql

Oracle XQL file:
packages/acs-tcl/tcl/security-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: