getConfig2()
29
Description
Gets information for the specified configuration key in a specified configuration file. Flash
Media Server has six server configuration files: Server.xml, Users.xml, Logger.xml,
Adaptor.xml, Vhost.xml, and Application.xml.
Virtual host administrators can view configuration keys in the Vhost.xml file and
Application.xml files for their own virtual hosts.
You must be a server administrator to view most of the configuration keys for the Server.xml
and Adaptor.xml files.
For a description of the XML configuration files, see
Managing Flash Media Server
.
Examples
The following examples get XML data from various configuration files:
tSocket = new NetConnection();
tSocket.connect("rtmp://localhost/admin", "user", "password");
// find key in Server.xml
key = "Server/LicenseInfo";
tSocket.call("getConfig2", new onGetConfig(), key, "/");
// find key in Adaptor.xml
key = "HostPortList/HostPort";
scope = "Adaptor:_defaultRoot_";
tSocket.call("getConfig2", new onGetConfig(), key, scope);
// find key in Vhost.xml
key = "AppsDir";
scope = "Adaptor:_defaultRoot_/VHost:_defaultVHost_";
tSocket.call("getConfig2", new onGetConfig(), key, scope);
// find key in Application.xml for app "foo"
key = "Process/Scope";
scope = "Adaptor:_defaultRoot_/VHost:_defaultVHost_/App:foo";
tSocket.call("getConfig2", new onGetConfig(), key, scope);
// find key in default Application.xml
key = "Process/Scope";
scope = "Adaptor:_defaultRoot_/VHost:_defaultVHost_/App";
TIP
It is possible to have more than one XML tag with the same name at the same level in the
XML tree. In the configuration file, you should distinguish such tags by using a name
attribute in the XML tag (for example, if you have more than one
VirtualHost
tag:
<VirtualHost name="www.redpin.com"></VirtualHost>)
. When you call the
getConfig
command and specify the configuration subkeys, you can indicate which tag you want
by specifying the tag name, followed by a colon and the correct
name
attribute, for
example,
Admin/Adaptor:_defaultRoot_/VirtualHost:www.redpin.com
.