import torrus 1.0.9
[freeside.git] / torrus / perllib / Torrus / Collector / CDef_Params.pm
1 #
2 #  Copyright (C) 2004  Christian Schnidrig
3 #
4 #  This program is free software; you can redistribute it and/or modify
5 #  it under the terms of the GNU General Public License as published by
6 #  the Free Software Foundation; either version 2 of the License, or
7 #  (at your option) any later version.
8 #
9 #  This program is distributed in the hope that it will be useful,
10 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 #  GNU General Public License for more details.
13 #
14 #  You should have received a copy of the GNU General Public License
15 #  along with this program; if not, write to the Free Software
16 #  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 # $Id: CDef_Params.pm,v 1.1 2010-12-27 00:03:57 ivan Exp $
19 # Christian Schnidrig <christian.schnidrig@bluewin.ch>
20
21
22 # Parameter definitions for CDef collector plugin
23
24 package Torrus::Collector::CDef_Params;
25
26 use strict;
27
28 ###  Initialize the configuration validator with module-specific parameters
29 our %params =
30     (
31      'rpn-expr'                 => undef,
32      'cdef-collector-delay'     => undef,
33      'cdef-collector-tolerance' => undef,
34      );
35
36
37 sub initValidatorLeafParams
38 {
39     my $hashref = shift;
40     $hashref->{'ds-type'}{'collector'}{'collector-type'}{'cdef'} =
41         \%params;
42 }
43
44
45 my %admInfoParamCategories =
46     (
47      'cdef-collector-delay'        => 'CDef_Collector',
48      'cdef-collector-tolerance'    => 'CDef_Collector',
49      );     
50
51
52 sub initAdmInfo
53 {
54     my $map = shift;
55     my $categories = shift;
56     
57     $map->{'ds-type'}{'collector'}{'collector-type'}{'cdef'} =
58         \%params;
59     
60     while( my ($pname, $category) = each %admInfoParamCategories )
61     {
62         $categories->{$pname} = $category;
63     }
64 }
65
66
67
68 1;
69