19 Apr 2013 18:04:04 UTC
- Distribution: Transform-Alert
- Module version: 1.00
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Testers (86 / 165 / 9)
- KwaliteeBus factor: 0
- % Coverage
- License: artistic_2
- Perl: v5.10.1
- Activity24 month
- Download (44.13KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionBBYRD Brendan Byrd
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- PERSISTENT CONNECTIONS
- COPYRIGHT AND LICENSE
Transform::Alert::Input - Base role for Transform::Alert input types
This is the role used for all input types.
The InputGrp object that constructed it.
Hash ref of the connection options (from configuration).
All I/O types require the following methods below. Unless specified, all of the methods should report a true value on success or undef on error. The methods are responsible for their own error logging.
Called on every new interval, if
openedreturns false. Most types would open up the connection here and run through any "pre-get/send" setup. Though, in the case of UDP, this isn't always necessary.
Must return a true value if the connection is currently open and valid, or false otherwise.
Called on each message/alert that is to be parsed through the templates and sent to the outputs. This is called on a loop, so the I/O cycle will happen on a per-alert basis.
This must return a list of:
or undef on error. The
$textis used for Template validation, while the
$hashis stored in the Output/Munger variables as
p. See "OUTPUTS" in Transform::Alert::Input::POP3 for an example.
Must return a true value if there are no more alerts available to process, or false otherwise.
Called after the interval loop has been completed. This should close the connection and run through any cleanup.
This method should double-check all I/O cleanup with the
openedmethod to ensure that close doesn't fail. This is important if the loop detects that the
openedmethod is false, since it will try a
closebefore trying to re-open.
Persistent connections can be done by defining
closein such a way that it still keeps the connection online, and making sure
openedcan handle the state. Take special care to check that the connection is indeed valid and the module can handle re-opens properly.
The project homepage is https://github.com/SineSwiper/Transform-Alert/wiki.
The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit http://www.perl.com/CPAN/ to find a CPAN site near you, or see https://metacpan.org/module/Transform::Alert/.
Brendan Byrd <BBYRD@CPAN.org>
This software is Copyright (c) 2013 by Brendan Byrd.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
Module Install Instructions
To install Transform::Alert, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Transform::Alert
For more information on module installation, please visit the detailed CPAN module installation guide.