Bric::Util::Trans::Jabber(3)

NAME
Bric::Util::Trans::Jabber - Utility class for sending instant messages.

VERSION
$LastChangedRevision$

DATE
$LastChangedDate: 2006-03-18 01:26:34 +0100 (Sat, 18 Mar 2006) $

SYNOPSIS
  use Bric::Util::Trans::Jabber;
  my $j = Bric::Util::Trans::Jabber->new(
    { to      => ['jchaddickerson@aol.jabber.org'],
      subject => 'Greetings',
      message => 'This is an instant message sent via Bric::Util::Trans::Jabber'
     });
  $j->send;

DESCRIPTION
This class provides a thin abstraction to the Net::Jabber module. Use it to send instant messages from within Bricolage applications.

INTERFACE

  Constructors

my $j = Bric::Util::Trans::Jabber->new($init)
    Instantiates a Bric::Util::Trans::Jabber object. An anonymous of initial values may be passed. The supported intial value keys are:

    •   to - Anonymous array of instant message addresses to send mail to. Be sure to include a full address and server name in email address style, as this is what jabber uses to send the message to the proper network. For example, 'jchaddickerson@aol.jabber.org'.

    •   subject - The subject of the message.

    •   message - The message to be sent.

    Throws:

    •   Incorrect number of args to Bric::_set().

    •   Bric::set() - Problems setting fields.

    Side Effects: NONE.

    Notes: NONE.

  Destructors

$org->DESTROY
    Dummy method to prevent wasting time trying to AUTOLOAD DESTROY.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

  Public Class Methods
NONE.

  Public Instance Methods

my $to_aref = $j->get_to
    Returns an anonymous array of addresses to which to send the instant message.

    Throws:

    •   Bad AUTOLOAD method format.

    •   Cannot AUTOLOAD private methods.

    •   Access denied: READ access for field '' required.

    •   No AUTOLOAD method.

    Side Effects: NONE.

    Notes: NONE.

$self = $j->set_to($to_aref)
    Sets the list of addresses to which to send the instant message. Pass in the list as an anonymous array.

    Throws:

    •   Bad AUTOLOAD method format.

    •   Cannot AUTOLOAD private methods.

    •   Access denied: WRITE access for field 'to' required.

    •   No AUTOLOAD method.

    Side Effects: NONE.

    Notes: NONE.

my $sub = $j->get_subject
    Returns the subject of the instant message.

    Throws:

    •   Bad AUTOLOAD method format.

    •   Cannot AUTOLOAD private methods.

    •   Access denied: READ access for field 'subject' required.

    •   No AUTOLOAD method.

    Side Effects: NONE.

    Notes: NONE.

$self = $j->set_subject($sub)
    Sets subject of the instant message.

    Throws:

    •   Bad AUTOLOAD method format.

    •   Cannot AUTOLOAD private methods.

    •   Access denied: WRITE access for field 'subject' required.

    •   No AUTOLOAD method.

    Side Effects: NONE.

    Notes: NONE.

my $msg = $j->get_message
    Returns the message (body) of the instant message.

    Throws:

    •   Bad AUTOLOAD method format.

    •   Cannot AUTOLOAD private methods.

    •   Access denied: READ access for field 'message' required.

    •   No AUTOLOAD method.

    Side Effects: NONE.

    Notes: NONE.

$self = $j->set_message($msg)
    Sets message (body) of the instant message.

    Throws:

    •   Bad AUTOLOAD method format.

    •   Cannot AUTOLOAD private methods.

    •   Access denied: WRITE access for field 'message' required.

    •   No AUTOLOAD method.

    Side Effects: NONE.

    Notes: NONE.

$self = $j->send
    Sends the instant message to the addresses stored in to.

    Throws:

    •   Unable to send instant message.

    Side Effects: NONE.

    Notes: NONE.

PRIVATE

  Private Class Methods
NONE.

  Private Instance Methods
NONE.

  Private Functions
NONE.

NOTES
NONE.

AUTHOR
David Wheeler <david@justatheory.com>

SEE ALSO
Bric, Net::Jabber