Bric::Util::Async(3)

NAME
Bric::Util::Async - This will handle all the async events

VERSION
$LastChangedRevision$

DATE
$LastChangedDate: 2004-06-04 12:21:12 -0700 (Fri, 04 Jun 2004) $

SYNOPSIS
 # creation of new objects
 $a = Bric::Util::Async->new($param);
 $a = Bric::Util::Async->lookup( { id => $id });
 ($a_list || @as) = Bric::Util::Async->list( $param )

 # list of ids
 ($a_ids || @a_ids) = Bric::Util::Async->list_ids( $param )

 # manipulation of events
 $a = $a->add_event( $param )
 ($events || @events) = $a->get_events( $param )
 $a = $a->delete_events( $param )

 # manipulation of active state ( not the company )
 $a = $a->activate()
 $a = $a->deactivate();
 ($a || undef) $a->is_active()

 # save whatever just happened
 $a = $a->save()

DESCRIPTION
This class will govern the async output events

INTERFACE

  Constructors

$a = Bric::Util::Async->new( $init )
    Creates a new Async Object

    Supproted Keys:

    *   name

    *   description

    *   active

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$a = Bric::Util::Async->lookup({ id => $id } )
    Looks up the object form the data base

    Throws:

    "Missing required parameter 'id'"

    Side Effects:

    NONE

    Notes:

    NONE

(@a_ids || $a_ids) = Bric::Util::Async->list( $param )
    returns a list or list ref of objects that match the criteria

    Supported Keys:

    *   name

    *   active

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

  DESTRUCTORS

$a->DESTROY
    Dummy method to save the waste of autoloads time

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

  Public Class Methods

(@a_ids || $a_ids) = Bric::Util::Async->list_ids( $param )
    Returns a list of the ids that match said param. Check out list to see what the possible params are

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

  Public Instance methods

$id = $a->get_id()
    Returns the id

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    Well this will return the id only if there is one, ie gotta call save on a new object before there can be an id silly.

$a = $a->set_name( $name )
    Sets the name for this collection of events

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$name = $a->get_name()
    returns the name for the object

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$a = $a->set_description( $description )
    Sets the description for the object

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$description = $a->get_description()
    returns the description of the object

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$a = $a->add_events( $param )
    Adds parts to the async object

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

($parts || @parts) = $a->get_events()
    Returns a list of the parts that are associated with this

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$a = $a->delete_events()
    removes the parts from the async obj

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$a = $a->delete()
    Will set the delete flag and will then delete once save is called

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$a = $a->activate()
    Sets the active flag

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$a = $a->deactivate()
    unsets the active flag

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

($a || undef) = $a->is_active()
    returns if the active flag is set

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$a = $a->save()
    saves the changes to the data base

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

PRIVATE

  Private Class Methods

$self->_do_list()
    This does the dirty work of list and list_ids

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

  Private Instance Methods

$self = $self->_generate_file()
    Goes through all the parts and writes out the cron tab file

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$self = $self->_sync_parts()
    called by save this will sync the held parts

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$self = $self->_do_insert()
    This will create a record for this object

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$self = $self->_do_update()
    Updates the record in the data base

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$self = $self->_do_delete()
    removes this record from the database

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$self = $self->_select_async()
    Populates an object from the database

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

  Private Functions
NONE

NOTES
NONE

AUTHOR
Michael Soderstrom <miraso@pacbell.net>

SEE ALSO
Bric, Bric::Util::Async::Parts::Event