NCP::Domain Constructor

The NCP::Domain constructor creates a blessed NCP::Domain object for the specified Network Manager domain.

Constructor

new NCP::Domain($domainName)

new NCP::Domain($domainName, %dbOptionsHash)

new NCP::Domain(%dbOptionsHash)

Parameters

$domainName
Specifies the name of the Network Manager domain for which you want to create a blessed domain instance object. In this case, the domain name is specified with plain text or plain text assigned to a variable. You can also specify the domain name using the explicit hash key "domain".
%dbOptionsHash
Specifies the hash that contains the database login options. One of these database login options is the domain name. More specifically, this hash takes the same database login options as the DBI_Factory::createDbHandle method.

Description

The NCP::Domain constructor creates a blessed NCP::Domain object for the specified Network Manager domain. Use the NCP::Domain object (for example, $domain->) to invoke the methods that the NCP::Domain module provides.

The NCP::Domain constructor provides a great deal of flexibility on how you obtain the database login options for the %dbOptionsHash parameter. For example, you can call the NCP::DBI_Factory::extractCmdLineOptions method to ensure that the database login options specified on the command line are provided in a common format. The return from the NCP::DBI_Factory::extractCmdLineOptions method (a reference to a hash that contains the extracted database login options and values in key/value format) is passed to the %dbOptionsHash parameter.

Notes

Connection to the NCIM topology database that resides in this domain will be attempted only when required.

To ensure that the NCP::Domain constructor can print appropriate messages to a log file, you must have previously specified a log handle (that is, a reference to a file object) by calling the setLogHandle method. Otherwise, the constructor sends these messages to STDOUT.

Example Usage

The following code fragment illustrates a typical call to the NCP::Domain constructor:

my $domain = new NCP::Domain("NEWDOMAIN");

Returns

Upon completion, the NCP::Domain constructor returns a new NCP::Domain object.

See Also