util::join_location (public)

 util::join_location [ -noabbrev ] [ -proto proto ] \
    [ -hostname hostname ] [ -port port ]

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

Join hostname and port and use IP-literal notation when necessary. The function is the inverse function of util::split_location.

Switches:
-noabbrev (optional, boolean)
when specified, the location is joined as requested. Otherwise, default ports are omitted from the result.
-proto (optional)
-hostname (optional)
-port (optional)
Returns:
location consisting of hostname and optionally port
Author:
Gustaf Neumann
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_util__split_and_join_location util__split_and_join_location (test acs-tcl) util::join_location util::join_location test_util__split_and_join_location->util::join_location Class ::acs::Cluster Class ::acs::Cluster (public) Class ::acs::Cluster->util::join_location acs::Cluster instproc current_server_locations acs::Cluster instproc current_server_locations (protected) acs::Cluster instproc current_server_locations->util::join_location acs::Cluster instproc external_location acs::Cluster instproc external_location (protected) acs::Cluster instproc external_location->util::join_location acs::Cluster instproc map_inaddr_any acs::Cluster instproc map_inaddr_any (protected) acs::Cluster instproc map_inaddr_any->util::join_location acs::Cluster instproc qualified_location acs::Cluster instproc qualified_location (public) acs::Cluster instproc qualified_location->util::join_location

Testcases:
util__split_and_join_location
Source code:
    set result ""
    if {$proto ne ""} {
        append result $proto://
        #
        # When the specified port is equal to the default port, omit
        # it from the result.
        #
        if {!$noabbrev_p
            && $port ne ""
            && $port eq [dict get {http 80 https 443 udp "" smtp ""$proto]
        } {
            set port ""
        }
    }
    if {[string match *:* $hostname]} {
        append result "\[$hostname\]"
    } else {
        append result $hostname
    }
    if {$port ne ""} {
        append result :$port
    }
    return $result
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/utilities-procs.xql

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