Bric::Dist::ServerType

Name

Bric::Dist::ServerType - Interface for managing types of servers to which to distribute content.

Synopsis

use Bric::Dist::ServerType;

# Constructors.
# Create a new object.
my $st = Bric::Dist::ServerType->new;
# Look up an existing object.
$st = Bric::Dist::ServerType->lookup({ id => 1 });
# Get a list of server type objects.
my @sts = Bric::Dist::ServerType->list({ move_method => 'FTP Transport' });
# Get an anonymous hash of server type objects.
my $sts_href = Bric::Dist::ServerType->href({ description => 'Preview%' });

# Class methods.
# Get a list of object IDs.
my @st_ids = Bric::Dist::ServerType->list_ids({ description => 'Prev%' });
# Get an introspection hashref.
my $int = Bric::Dist::ServerType->my_meths;
# Get a list of mover types.
my @move_methods = Bric::Dist::ServerType->list_move_methods;

# Instance Methods.
my $id = $st->get_id;
my $name = $st->get_name;
$st = $st->set_name($name);
my $description = $st->get_description;
$st = $st->set_description($description);
my $move_method = $st->get_move_method;
$st = $st->set_move_method($move_method);
my $site_id = $st->get_site_id;
$st = $st->set_site_id($site_id);
print "ST is ", $st->can_copy ? '' : 'not ', "copyable.\n";
$st->copy;
$st->no_copy;

print "ST ", $st->can_publish ? 'publishes' : "does not publish.\n";
$st = $st->on_publish; # Used for publish event.
$st = $st->no_publish; # Not used for publish event.

print "ST ", $st->can_preview ? 'previews' : "does not preview.\n";
$st = $st->on_preview; # Used for preview event.
$st = $st->no_preview; # Not used for preview event.

print "ST is ", $st->is_active ? '' : 'not ', "active.\n";
$st->deactivate;
$st->activate;

# Accessors to servers of this type.
my @servers = $st->get_servers;
my $server = $st->new_server;
$st->del_servers;

# Accessors to output channels associated with this server type.
my @ocs = $st->get_output_channels;
$st = $st->add_output_channels(@ocs);
$st = $st->del_output_channels(@ocs);

# Accessors to actions associated with this type.
my @actions = $st->get_actions;
my $action = $st->new_action;
$st->del_actions;

# Save it.
$st->save;

Description

This class manages types of servers. A server type represents a class of servers on which a list of actions should be performed upon the execution of a job. A server type, therefore, simply describes a list of servers for which the actions will be performed and a list of actions to be executed on the files associated with a given job. The last action should be a move statement, to move each file to each of the servers.

So use this class a the central management point for figuring out what happens to files, and in what order, and what servers they are sent to, in the event of a publish or preview event.

Interface

Constructors

Destructors

Public Class Methods

Public Instance Methods

Private

Private Class Methods

NONE.

Private Instance Methods

Private Functions

Notes

NONE.

Author

David Wheeler

See Also

Bric