Kevin L. Esteb > XAS-0.04 > XAS::Collector::Base

Download:
XAS-0.04.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source   Latest Release: XAS-0.05

NAME ^

XAS::Collector::Base - The base class for collectors within the XAS Environment

SYNOPSIS ^

  use XAS::Collector::Base;

  my $collector = XAS::Collector::Base->new(
      -connector => 'connector',
      -logger    => 'logger',
  );

DESCRIPTION ^

This is the base class for collectors within the XAS environment. This module will connect to the indicated database and create an event named "store_data". Modules that inherit from this module need to define what "store_data" does.

METHODS ^

new

This nethod initliazes the modules and takes the following parameters:

-connector

The name of the connector session. This is used to send ACK's back to the message queue server.

-alias

The name of this POE session.

-logger

The name of the logger session. This is used for sending log items too.

initialize($self, $config)

This method makes the initial connection to the database and defines the "store_data" event.

$self

A pointer to the current object.

$config

Configuration items from new().

cleanup($self, $kernel, $session)

Closes the connection to the database.

$self

A pointer to the current object.

$kernel

A handle to the POE kernel.

$session

A handle to the current POE session.

log($level, $message)

This method sends log items to the logger session.

$level

The level of the log action.

$message

The message to write to the log.

exception_handler($ex)

A common exception handler for error reporting.

$ex

The exception that should be acted upon.

PUBLIC EVENTS ^

This module responds to the following POE events.

store_data

This event will trigger the storage of the packet received from the message queue server.

shutdown

This event will trigger the execution of the cleanup() method.

SEE ALSO ^

XAS

AUTHOR ^

Kevin L. Esteb, <kevin@kesteb.us>

COPYRIGHT AND LICENSE ^

Copyright (C) 2012 by Kevin L. Esteb

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: