Michael Gilfix > Notify-0.0.1 > Notify::Notice

Download:
Notify-0.0.1.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.0.1   Source  

NAME ^

Notify::Notice - Notification object for use with the NoticePool object.

SYNOPSIS ^

    use Notify::Notice;

    my $init = { 'id' => 23, 'status' = EMPTY };
    my $notice = new Notify::Notice ($init);

    my $attribs = $notice->getNotice ();
    foreach ($notice->attribs () ) { ... }
    $notice->setNotice ($attribs);

DESCRIPTION ^

Notify::Notice encapsulates notification data. The object provides methods for retreiving and settings the attributes as well as listing the currently supported attribs.

The notification object also export the following constants and can be in the following states:

    EMPTY  - The notice object is currently in the empty state.

    OUTGOING_PENDING - The notice object is waiting to be sent.

    WAITING_REPONSE - The notice has been sent and is in a wait
                      state.

    WAITING_PROCESSING - A response has been received for the
                         notice and awaits retrieval.

    FAILURE - The notice could not be successfully sent.

    DONE - The transaction is completed and is halted until the
           state is futher changed or the notification object
           destroyed.

EXPORT

    This module exports the constants listed in the description:

       ( EMPTY, OUTGOING_PENDING, WAITING_RESPONSE,
         WAITING_PROCESSING, FAILURE, DONE )

CLASS ATTRIBUTES

    This class defines the following attributes in its external
    function which can be retrieved through a hash ref via
    the getNotice () method:

       status - The current status of the notification object.
                Takes on the value of the value of one of the
                above constants.

       attempts - The number of attempts made to send this
                  notification.

       id - The unique id of the notification.

       src - The sender of the notification.

       dest - The intended receiver of the notification.

       message - The message to deliver to the receiver.

       transport - The transport type to use to deliver this
                   object. A transport object of some sort
                   needs to be associated with this type and
                   must know how to deliver the notification
                   accordingly.

       time_created - The time the notification was created.

       time_updated - The time the notificationw as last
                      updated.

       history - An array containing the history of
                 notifications and responses.

PUBLIC METHODS

    new ($hashref)

      The constructor builds a new notification object and
      copies over any attribute values found in the $hashref
      into the internal attribute structure.

    attribs ()

      Returns an array of keys to the notification attribute
      hash.

    getNotice ()

      Returns a reference to a *copy* of the internal
      attribute hash. To iterate through the keys, use
      attribs ().

   setNotice ($attribs)

      Copies the new attributes into the internal copy. All
      non-supported keys are dropped.

AUTHOR ^

Michael Gilfix <mgilfix@eecs.tufts.edu> Copyright (C) 2001

SEE ALSO ^

perl (1), Notify::NoticePool, Notify::Email

VERSION ^

  This software is currently alpha, version 0.0.1.
syntax highlighting: