NCP::Domain module synopsis

The NCP::Domain module synopsis shows how to make calls to the constructor and domain operation methods that this module provides.

The comments provided in the synopsis serve as a quick reference as to the purpose of the constructor and domain operation methods. The reference (man) pages for the constructor and each method provide the details.

# Declare the module with the use directive.

use NCP::Domain;

# Call the NCP::Domain constructor. This call to the NCP::Domain
# constructor specifies the name of the Network Manager domain with
# the string "NEWDOMAIN". The NCP::Domain constructor returns
# to $domain a new NCP::Domain object.
# 
# This call to the NCP::Domain constructor does not specify any
# database connection options.

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

# Use the NCP::Domain object ($domain->) to directly invoke the
# create method to create an entry in the domainMgr table for the
# NEWDOMAIN domain.

$domain->create();

# Call the NCP::Domain constructor a second time. This call to
# the NCP::Domain constructor specifies the name of the Network
# Manager domain with a hash keyword/value pair of domain => "COPY".
# The NCP::Domain constructor returns to $copy a new NCP::Domain object.
#
# This call to the NCP::Domain constructor does not specify any
# database connection options.

my $copy = new NCP::Domain(domain => "COPY");

# Use the NCP::Domain object ($copy->) to directly invoke the clone
# method to create a new domain that is a copy of the existing
# domain (NEWDOMAIN).

$copy->clone("NEWDOMAIN");

# Call the NCP::Domain constructor a third time. This call to
# the NCP::Domain constructor specifies the name of the Network
# Manager domain with the string "OLD". The NCP::Domain constructor
# returns to $obsolete a new NCP::Domain object.

my $obsolete = new NCP::Domain("OLD");

# Use the NCP::Domain object ($obsolete->) to directly invoke
# the drop method to remove all references to the specified
# domain (OLD) from the domainMgr table.

$obsolete->drop();

# Use the NCP::Domain object ($domain->) created in the first
# call to the  NCP::Domain constructor to directly invoke the id
# method to retrieve the domain manager ID for this domain.

$domain->id();

# Use the NCP::Domain object ($domain->) created in the first 
# call to the NCP::Domain constructor to directly invoke the name
# method to retrieve the domain name for this domain.

$domain->name();

# get a summary of the domain contents.

%summary = $domain->summary();

See Also