| 1 | package XAS::Collector::Output::Console::Base; | ||
| 2 | |||
| 3 | our $VERSION = '0.01'; | ||
| 4 | |||
| 5 | 1 | ▶ | use POE; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use Try::Tiny; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | ▶ | use XAS::Lib::POE::PubSub; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 8 | |||
| 9 | use XAS::Class | ||
| 10 | debug => 0, | ||
| 11 | version => $VERSION, | ||
| 12 | base => 'XAS::Lib::POE::Service', | ||
| 13 | mixin => 'XAS::Lib::Mixins::Handlers', | ||
| 14 | utils => 'db2dt', | ||
| 15 | accessors => 'schema event', | ||
| 16 | ; | ||
| 17 | |||
| 18 | #use Data::Dumper; | ||
| 19 | |||
| 20 | # -------------------------------------------------------------------- | ||
| 21 | # Public Events | ||
| 22 | # -------------------------------------------------------------------- | ||
| 23 | |||
| 24 | # -------------------------------------------------------------------- | ||
| 25 | # Public Methods | ||
| 26 | # -------------------------------------------------------------------- | ||
| 27 | |||
| 28 | sub session_initialize { | ||
| 29 | my $self = shift; | ||
| 30 | |||
| 31 | my $alias = $self->alias; | ||
| 32 | |||
| 33 | $self->log->debug("$alias: entering session_initialize()"); | ||
| 34 | |||
| 35 | $poe_kernel->state('store_data', $self); | ||
| 36 | |||
| 37 | # walk the chain | ||
| 38 | |||
| 39 | $self->SUPER::session_initialize(); | ||
| 40 | |||
| 41 | $self->log->debug("$alias: leaving session_initialize()"); | ||
| 42 | |||
| 43 | } | ||
| 44 | |||
| 45 | sub session_startup { | ||
| 46 | my $self = shift; | ||
| 47 | |||
| 48 | my $alias = $self->alias; | ||
| 49 | |||
| 50 | $self->log->debug("$alias: entering session_startup()"); | ||
| 51 | |||
| 52 | $self->event->publish( | ||
| 53 | -event => 'start_queue', | ||
| 54 | -args => $alias | ||
| 55 | ); | ||
| 56 | |||
| 57 | # walk the chain | ||
| 58 | |||
| 59 | $self->SUPER::session_startup(); | ||
| 60 | |||
| 61 | $self->log->debug("$alias: leasing session_startup()"); | ||
| 62 | |||
| 63 | } | ||
| 64 | |||
| 65 | # -------------------------------------------------------------------- | ||
| 66 | # Private Methods | ||
| 67 | # -------------------------------------------------------------------- | ||
| 68 | |||
| 69 | sub init { | ||
| 70 | my $class = shift; | ||
| 71 | |||
| 72 | my $self = $class->SUPER::init(@_); | ||
| 73 | |||
| 74 | $self->{'event'} = XAS::Lib::POE::PubSub->new(); | ||
| 75 | |||
| 76 | return $self; | ||
| 77 | |||
| 78 | } | ||
| 79 | |||
| 80 | 1; | ||
| 81 | |||
| 82 | __END__ | ||
| 83 | |||
| 84 | =head1 NAME | ||
| 85 | |||
| 86 | XAS::Collector::Output::Console::Base - Perl extension for the XAS Environment | ||
| 87 | |||
| 88 | =head1 SYNOPSIS | ||
| 89 | |||
| 90 | use XAS::Collector::Output::Console::Logs; | ||
| 91 | |||
| 92 | my $notify = XAS::Collector::Output::Console::Logs->new( | ||
| 93 | -alias => 'database-logs', | ||
| 94 | ); | ||
| 95 | |||
| 96 | =head1 DESCRIPTION | ||
| 97 | |||
| 98 | This module is the base class for dumping data from packets. | ||
| 99 | |||
| 100 | =head1 METHODS | ||
| 101 | |||
| 102 | =head2 new | ||
| 103 | |||
| 104 | This module inherits from L<XAS::Lib::POE::Service|XAS::Lib::POE::Service> and | ||
| 105 | takes the same parameters. | ||
| 106 | |||
| 107 | =head1 PUBLIC EVENTS | ||
| 108 | |||
| 109 | This module declares the following events. | ||
| 110 | |||
| 111 | =head2 store_data | ||
| 112 | |||
| 113 | This event is called when a packet is ready for processing. | ||
| 114 | |||
| 115 | =head1 SEE ALSO | ||
| 116 | |||
| 117 | =over 4 | ||
| 118 | |||
| 119 | =item L<XAS::Collector::Output::Console::Alerts|XAS::Collector::Output::Console::Alerts> | ||
| 120 | |||
| 121 | =item L<XAS::Collector::Output::Console::Logs|XAS::Collector::Output::Console::Logs> | ||
| 122 | |||
| 123 | =item L<XAS::Collector|XAS::Collector> | ||
| 124 | |||
| 125 | =item L<XAS|XAS> | ||
| 126 | |||
| 127 | =back | ||
| 128 | |||
| 129 | =head1 AUTHOR | ||
| 130 | |||
| 131 | Kevin Esteb, E<lt>kevin@kesteb.usE<gt> | ||
| 132 | |||
| 133 | =head1 COPYRIGHT AND LICENSE | ||
| 134 | |||
| 135 | Copyright (c) 2012-2015 Kevin L. Esteb | ||
| 136 | |||
| 137 | This is free software; you can redistribute it and/or modify it under | ||
| 138 | the terms of the Artistic License 2.0. For details, see the full text | ||
| 139 | of the license at http://www.perlfoundation.org/artistic_license_2_0. | ||
| 140 | |||
| 141 | =cut | ||