Monitoring::Spooler::Transport - baseclass for any transport plugin
package Monitoring::Spooler::Transport::Subclass; use Moose; extends 'Monitoring::Spooler::Transport'; ...
This is the base class for all transport plugins.
Given a media type (text, phone or smth. else) this must return a true value if this plugin supports this type.
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)
Monitoring::Spooler::Transport - Transport Plugin baseclass
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.
Dominik Schulz <firstname.lastname@example.org>
This software is copyright (c) 2012 by Dominik Schulz.