| 1 | package Mail::MtPolicyd::VirtualHost; | ||||||||||
| 2 | |||||||||||
| 3 | 3 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 3 | our $VERSION = '2.01'; # VERSION | |||||||||
| 7 | # ABSTRACT: class for a VirtualHost instance | ||||||||||
| 8 | |||||||||||
| 9 | 3 | ▶ | use Mail::MtPolicyd::PluginChain; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 3 | has 'port' => ( is => 'ro', isa => 'Str', required => 1 ); | |||||||||
| 12 | 3 | has 'name' => ( is => 'ro', isa => 'Str', required => 1 ); | |||||||||
| 13 | |||||||||||
| 14 | 3 | has 'chain' => ( | |||||||||
| 15 | is => 'ro', | ||||||||||
| 16 | isa => 'Mail::MtPolicyd::PluginChain', | ||||||||||
| 17 | required => 1, | ||||||||||
| 18 | handles => [ 'run' ], | ||||||||||
| 19 | ); | ||||||||||
| 20 | |||||||||||
| 21 | sub new_from_config { | ||||||||||
| 22 | 1 | ▶ | my ( $class, $port, $config ) = @_; | ||||||||
|
Subroutine
new_from_config: called CC=2 SCAR=7.4
Pod
undocumented
| |||||||||||
| 23 | |||||||||||
| 24 | 1 | ▶ | if( ! defined $config->{'Plugin'} ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 0 | die('no <Plugin> defined for <VirtualHost> on port '.$port.'!'); | |||||||||
| 26 | } | ||||||||||
| 27 | my $vhost = $class->new( | ||||||||||
| 28 | 'port' => $port, | ||||||||||
| 29 | 'name' => $config->{'name'}, | ||||||||||
| 30 | 'chain' => Mail::MtPolicyd::PluginChain->new_from_config( | ||||||||||
| 31 | $config->{'name'}, | ||||||||||
| 32 | 1 | $config->{'Plugin'} | |||||||||
| 33 | ), | ||||||||||
| 34 | ); | ||||||||||
| 35 | |||||||||||
| 36 | 1 | return $vhost; | |||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | sub cron { | ||||||||||
| 40 | 2 | ▶ | my $self = shift; | ||||||||
|
Subroutine
cron: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 41 | 2 | return $self->chain->cron(@_); | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 3 | __PACKAGE__->meta->make_immutable; | |||||||||
| 45 | |||||||||||
| 46 | 3 | 1; | |||||||||
| 47 | |||||||||||
| 48 | __END__ | ||||||||||
| 49 | |||||||||||
| 50 | =pod | ||||||||||
| 51 | |||||||||||
| 52 | =encoding UTF-8 | ||||||||||
| 53 | |||||||||||
| 54 | =head1 NAME | ||||||||||
| 55 | |||||||||||
| 56 | Mail::MtPolicyd::VirtualHost - class for a VirtualHost instance | ||||||||||
| 57 | |||||||||||
| 58 | =head1 VERSION | ||||||||||
| 59 | |||||||||||
| 60 | version 2.01 | ||||||||||
| 61 | |||||||||||
| 62 | =head1 AUTHOR | ||||||||||
| 63 | |||||||||||
| 64 | Markus Benning <ich@markusbenning.de> | ||||||||||
| 65 | |||||||||||
| 66 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 67 | |||||||||||
| 68 | This software is Copyright (c) 2014 by Markus Benning <ich@markusbenning.de>. | ||||||||||
| 69 | |||||||||||
| 70 | This is free software, licensed under: | ||||||||||
| 71 | |||||||||||
| 72 | The GNU General Public License, Version 2, June 1991 | ||||||||||
| 73 | |||||||||||
| 74 | =cut | ||||||||||