Bric::Dist::ActionType - Interface to types of actions supported by Bricolage distribution.
$Revision: 1.7 $
$Date: 2002/08/30 22:13:39 $
use Bric::Dist::ActionType;
# Constructors.
# Create a new object.
my $at = Bric::Dist::ActionType->new;
# Look up an existing object.
$at = Bric::Dist::ActionType->lookup({ id => 1 });
# Get a list of action type objects.
my @servers = Bric::Dist::ActionType->list({ description => 'File%' });
# Class methods.
# Get a list of object IDs.
my @st_ids = Bric::Dist::ActionType->list_ids({ description => 'File%' });
# Get an introspection hashref.
my $int = Bric::Dist::ActionType->my_meths;
# Instance Methods.
my $id = $at->get_id;
my $name = $at->get_name;
my $description = $at->get_description;
my @medias = $at->get_media_types;
my $medias = $at->get_medias_href;
print "AT is ", $at->is_active ? '' : 'not ', "active\n";
This class defines types of actions that can be performed on resources. Types of actions include "Akamaize," "Gzip," "Put," "Delete," etc. All actions are created at development time by Bricolage developers and cannot be created or changed by users. Users can specify what types of actions apply to jobs executed for given server types by accessing the Bric::Dist::Action class. Use Bric::Dist::ActionType objects to help define Bric::Dist::Action objects.
Looks up and instantiates a new Bric::Dist::ActionType object based on the Bric::Dist::ActionType object ID or name passed. If $id or $name is not found in the database, lookup() returns undef.
Throws:
Too many Bric::Dist::Dist::ActionType objects found.
Unable to connect to database.
Unable to prepare SQL statement.
Unable to select column into arrayref.
Unable to execute SQL statement.
Unable to bind to columns to statement handle.
Unable to fetch row from statement handle.
Side Effects: If $id is found, populates the new Bric::Dist::ActionType object with data from the database before returning it.
Notes: NONE.
Returns a list or anonymous array of Bric::Dist::ActionType objects based on the search parameters passed via an anonymous hash. The supported lookup keys are:
description
Throws:
Unable to connect to database.
Unable to prepare SQL statement.
Unable to select column into arrayref.
Unable to execute SQL statement.
Unable to bind to columns to statement handle.
Unable to fetch row from statement handle.
Side Effects: Populates each Bric::Dist::ActionType object with data from the database before returning them all.
Notes: NONE.
Dummy method to prevent wasting time trying to AUTOLOAD DESTROY.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Returns a list or anonymous array of Bric::Dist::ActionType object IDs based on the search criteria passed via an anonymous hash. The supported lookup keys are the same as those for list().
Throws:
Unable to connect to database.
Unable to prepare SQL statement.
Unable to select column into arrayref.
Unable to execute SQL statement.
Unable to bind to columns to statement handle.
Unable to fetch row from statement handle.
Side Effects: NONE.
Notes: NONE.
Returns an anonymous hash of instrospection data for this object. The format for the introspection is as follows:
Each hash key is the name of a property or attribute of the object. The value for a hash key is another anonymous hash containing the following keys:
meth - A reference to the method that will retrieve the value of the property or attribute.
args - An anonymous array of arguments to pass to a call to meth in order to retrieve the value of the property or attribute.
disp_name - The display name of the property or attribute.
type - The type of value the property or attribute contains. There are only three types:
length - If the value is a 'short' value, this hash key contains the length of the field.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Returns the ID of the Bric::Dist::ActionType object.
Throws:
Bad AUTOLOAD method format.
Cannot AUTOLOAD private methods.
Access denied: READ access for field 'id' required.
No AUTOLOAD method.
Side Effects: NONE.
Notes: If the Bric::Dist::ActionType object has been instantiated via the new() constructor and has not yet been saved, the object will not yet have an ID, so this method call will return undef.
Returns the name of this type of action.
Throws:
Bad AUTOLOAD method format.
Cannot AUTOLOAD private methods.
Access denied: READ access for field 'name' required.
No AUTOLOAD method.
Side Effects: NONE.
Notes: NONE.
Returns the description of this type of action.
Throws:
Bad AUTOLOAD method format.
Cannot AUTOLOAD private methods.
Access denied: READ access for field 'description' required.
No AUTOLOAD method.
Side Effects: NONE.
Notes: NONE.
Returns a list or anonymous array of the MEDIA types that apply to this action. Returns an empty list (or undef in a scalar context) if this action applies to all MEDIA types.
Throws:
Bric::_get() - Problems retrieving fields.
Side Effects: NONE.
Notes: NONE.
Returns an anonymous hash of the MEDIA types that apply to this action. Returns undef if this action applies to all MEDIA types.
Throws:
Bric::_get() - Problems retrieving fields.
Side Effects: NONE.
Notes: NONE.
Returns $self if the Bric::Dist::ActionType object is active, and undef if it is not.
Throws:
Bric::_get() - Problems retrieving fields.
Side Effects: NONE.
Notes: NONE.
NONE.
NONE.
Function used by lookup() and list() to return a list of Bric::Dist::ActionType objects or, if called with an optional third argument, returns a listof Bric::Dist::ActionType object IDs (used by list_ids()).
Throws:
Unable to connect to database.
Unable to prepare SQL statement.
Unable to select column into arrayref.
Unable to execute SQL statement.
Unable to bind to columns to statement handle.
Unable to fetch row from statement handle.
Side Effects: NONE.
Notes: NONE.
NONE.
David Wheeler <david@wheeler.net>
Hey! The above document had some coding errors, which are explained below:
=back doesn't take any parameters, but you said =back 4
=back doesn't take any parameters, but you said =back 4