App::MonM::Notifier::Store - monotifier store class
Version 1.00
use App::MonM::Notifier::Store; my $store = new App::MonM::Notifier::Store;
This module provides store methods.
For internal use only
Constructor
my $status = $store->status; my $status = $store->status( 1 ); # Sets the status value and returns it
Get/set BOOL status of the operation
my $error = $store->error;
Returns error message
my $status = $store->error( "Error message" );
Sets error message if argument is provided. This method in "set" context returns status of the operation as status() method.
my $newid = $store->add( ip => LOCALHOSTIP, host => hostname, ident => "quux", level => getLevelByName("error"), to => "test", from => "test", subject => "Test message", message => "Content", pubdate => time() + 60*5, expires => 60*5 + 60*60*24, status => "NEW", );
This method adds new record into store. Returns ID created record
my %data = $store->get( $id );
This method gets record from store. Returns hash of this record
my @table = $store->getall( id => $id ); my @table = $store->getall( id => $id, # Integer value ip => $ip, # IPv4 value host => $host, ident => $ident, level => $level, # Integer value to => $to, from => $from, status => $status, # String value errcode => $errcode, # Integer value );
This method returns all records from store by criteria. Returns array-ref
my %data = $store->getJob;
This method gets record as new job from store for processing. Returns hash of this record
$store->setJob( id => $id, status => $status, errcode => $errcode, errmsg => $errmsg, comment => "... comment ...", # ... other fields ... );
This method sets the new data for the record by record id
$store->ping ? 'OK' : 'Database session is expired';
Checks the connection to database
my $status = $store->del( $id );
This method removes record in store. Returns status
$store->set( id => $id, status => $status, errcode => $errcode, errmsg => $errmsg, comment => "... comment ...", # ... other fields ... );
See CHANGES file
CHANGES
CTK, DBI
See TODO file
TODO
* none noted
App::MonM::Notifier, App::MonM::AlertGrid
Sergey Lepenkov (Serz Minus) http://www.serzik.com <abalama@cpan.org>
Copyright (C) 1998-2017 D&D Corporation. All Rights Reserved
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
See LICENSE file
LICENSE
To install App::MonM::Notifier, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::MonM::Notifier
CPAN shell
perl -MCPAN -e shell install App::MonM::Notifier
For more information on module installation, please visit the detailed CPAN module installation guide.