line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#------------------------------------------------------------------------------------------------------ |
2
|
|
|
|
|
|
|
# OBJET : Module du constructeur CTM::ReadEM::workOnAlarms() |
3
|
|
|
|
|
|
|
# APPLICATION : Control-M EM + Global Alert Server (GAS) |
4
|
|
|
|
|
|
|
# AUTEUR : Yoann Le Garff |
5
|
|
|
|
|
|
|
# DATE DE CREATION : 27/05/2014 |
6
|
|
|
|
|
|
|
#------------------------------------------------------------------------------------------------------ |
7
|
|
|
|
|
|
|
# USAGE / AIDE |
8
|
|
|
|
|
|
|
# perldoc CTM::ReadEM::WorkOnAlarms |
9
|
|
|
|
|
|
|
#------------------------------------------------------------------------------------------------------ |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#-> BEGIN |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#----> ** initialisation ** |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
package CTM::ReadEM::WorkOnAlarms; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
18
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
76
|
use base qw/ |
21
|
|
|
|
|
|
|
CTM::Base |
22
|
|
|
|
|
|
|
CTM::Base::SubClass |
23
|
1
|
|
|
1
|
|
3
|
/; |
|
1
|
|
|
|
|
1
|
|
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
37
|
use Carp qw/ |
26
|
|
|
|
|
|
|
croak |
27
|
1
|
|
|
1
|
|
4
|
/; |
|
1
|
|
|
|
|
1
|
|
28
|
1
|
|
|
|
|
5
|
use Hash::Util qw/ |
29
|
|
|
|
|
|
|
unlock_hash |
30
|
1
|
|
|
1
|
|
3
|
/; |
|
1
|
|
|
|
|
1
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
#----> ** variables de classe ** |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
our $VERSION = 0.181; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#----> ** methodes publiques ** |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub resetAndRefresh { |
39
|
0
|
|
|
0
|
0
|
|
return shift->SUPER::_resetAndRefresh(CTM::Base::_alarmsWorkMethod); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub notice { |
43
|
0
|
|
|
0
|
0
|
|
return shift->SUPER::_setSerials((caller 0)[3], "UPDATE alarm SET handled = '1'", { |
44
|
|
|
|
|
|
|
'handled' => 1 |
45
|
|
|
|
|
|
|
}, @_); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub unnotice { |
49
|
0
|
|
|
0
|
0
|
|
return shift->SUPER::_setSerials((caller 0)[3], "UPDATE alarm SET handled = '0'", { |
50
|
|
|
|
|
|
|
'handled' => 0 |
51
|
|
|
|
|
|
|
}, @_); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub handle { |
55
|
0
|
|
|
0
|
0
|
|
return shift->SUPER::_setSerials((caller 0)[3], "UPDATE alarm SET handled = '2'", { |
56
|
|
|
|
|
|
|
'handled' => 2 |
57
|
|
|
|
|
|
|
}, @_); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub unhandle { |
61
|
0
|
|
|
0
|
0
|
|
return shift->SUPER::_setSerials((caller 0)[3], "UPDATE alarm SET handled = '1'", { |
62
|
|
|
|
|
|
|
'handled' => 1 |
63
|
|
|
|
|
|
|
}, @_); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub delete { |
67
|
0
|
|
|
0
|
0
|
|
return shift->SUPER::_setSerials((caller 0)[3], 'DELETE FROM alarm', {}, @_); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub setSeverity { |
71
|
0
|
|
|
0
|
0
|
|
my ($self, $severity, $serialID) = @_; |
72
|
0
|
|
|
|
|
|
my $subName = (caller 0)[3]; |
73
|
0
|
0
|
0
|
|
|
|
croak(CTM::Base::_myErrorMessage($subName, CTM::Base::_myUsageMessage('$obj->' . $subName, "'R' || 'U' || 'V'"))) unless ($severity eq 'R' || $severity eq 'U' || $severity eq 'V'); |
|
|
|
0
|
|
|
|
|
74
|
0
|
|
|
|
|
|
return shift->SUPER::_setSerials($subName, "UPDATE alarm SET severity = '" . $severity . "'", { |
75
|
|
|
|
|
|
|
'severity' => $severity |
76
|
|
|
|
|
|
|
}, $serialID); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub setNote { |
80
|
0
|
|
|
0
|
0
|
|
my ($self, $notes, $serialID) = @_; |
81
|
0
|
|
|
|
|
|
my $subName = (caller 0)[3]; |
82
|
0
|
0
|
|
|
|
|
croak(CTM::Base::_myErrorMessage($subName, CTM::Base::_myUsageMessage('$obj->' . $subName, '$definedNote'))) unless (defined $notes); |
83
|
0
|
|
|
|
|
|
return shift->SUPER::_setSerials($subName, "UPDATE alarm SET notes = '" . $notes . "'", { |
84
|
|
|
|
|
|
|
'notes' => $notes |
85
|
|
|
|
|
|
|
}, $serialID); |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
#-> Perl BuiltIn |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
BEGIN { |
91
|
1
|
|
|
1
|
|
422
|
*AUTOLOAD = \&CTM::Base::AUTOLOAD; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub DESTROY { |
95
|
0
|
|
|
0
|
|
|
unlock_hash(%{+shift}); |
|
0
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
1; |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
#-> END |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
__END__ |