Dominik Schulz > Monitoring-Spooler-0.05 > Monitoring::Spooler::Transport

Download:
Monitoring-Spooler-0.05.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.05   Source  

NAME ^

Monitoring::Spooler::Transport - baseclass for any transport plugin

SYNOPSIS ^

    package Monitoring::Spooler::Transport::Subclass;
    use Moose;
    extends 'Monitoring::Spooler::Transport';
    ...

DESCRIPTION ^

This is the base class for all transport plugins.

METHODS ^

provides

Given a media type (text, phone or smth. else) this must return a true value if this plugin supports this type.

run

If this plugin is chosen to be run, this sub is invoked with two arguments: the destination number and some payload (i.e. the message for Text plugins)

NAME ^

Monitoring::Spooler::Transport - Transport Plugin baseclass

ADDING NEW TRANSPORTS ^

Transports must subclass this class (or use dirty perl magic) to pass the type constraints defined in the command classes (they check for isa(Monitoring::Spooler::Transpport)).

Implementors must override provides and run subs.

At the moment there are two types of media being handled by the transports with the possibility of adding more. These are text and phone.

The method run will always receive the destination number and optionally an message.

Text plugins MAY decline and return false without a message being passed while phone plugins SHOULD NOT return false without a message and fall back to using some default value.

The escalation handling is done withing Monitoring::Spooler::Cmd::SendingCommand and it's subclasses. Don't care about that inside the transport. Just deliver the message passed and return true on success or false on error.

Transport plugins may die or raise an exception on error. Those are caught and logged.

Please see the perldoc of Monitoring::Spooler::Cmd::SendingCommand for an explaination of the control flow and escalation handling.

AUTHOR ^

Dominik Schulz <tex@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2012 by Dominik Schulz.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: