The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::MonM::Notifier::Server - monotifier server class

VERSION

Version 1.00

SYNOPSIS

    use App::MonM::Notifier::Server;

    my $server = new App::MonM::Notifier::Server;

DESCRIPTION

This module provides server methods.

For internal use only

METHODS

new

Constructor

status
    if ($server->status) {
        # OK
    } else {
        # ERROR
    }

Returns object's status. 1 - OK, 0 - ERROR

    my $status = $server->status( 1 );

Sets new status and returns it

error
    my $error = $server->error;

Returns error string

    my $status = $server->error( "error text" );

Sets error string also sets status to false (if error string is not null) or to true (if error string is null) and returns this status

store
    my $store = $server->store;

Returns current store object

send
    $id = $server->send( @opts );

This method creates new record in store and returns ID

check
    my $data = $client->check( $id );

This method get record from store

data
    my $data = $server->data;

Get/Set data struct

get
    my $value = $server->get( "name" );

Returns data value by name

set
    $server->set( "name", "value" );

Set value to data structure by name

register_handler
    $server->register_handler(
            handler => "index",
            method  => "GET",
            path    => "/",
            query   => undef,
            code    => \&_index_handler,
        ) or die("Can't register handler");

Register handler

run_handler
    $server->run_handler(
            $r->method,
            $r->uri,
            $q->param("object"),
            $q
        ) or die($server->error);
remove
    my $status = $client->remove( $id );

Removes message by ID and returns status. 0 - Error; 1 - Ok

update
    $status = $server->update( @opts );

This method update existing record in store and returns status

HISTORY

See CHANGES file

DEPENDENCIES

CTK

TO DO

See TODO file

BUGS

* none noted

SEE ALSO

App::MonM::Notifier

AUTHOR

Sergey Lepenkov (Serz Minus) http://www.serzik.com <abalama@cpan.org>

COPYRIGHT

Copyright (C) 1998-2017 D&D Corporation. All Rights Reserved

LICENSE

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