line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#------------------------------------------------------------------------------------------------------ |
2
|
|
|
|
|
|
|
# OBJET : Module du constructeur CTM::ReadEM::WorkOnCurrentBIMServices() |
3
|
|
|
|
|
|
|
# APPLICATION : Control-M EM + Batch Impact Manager (BIM) |
4
|
|
|
|
|
|
|
# AUTEUR : Yoann Le Garff |
5
|
|
|
|
|
|
|
# DATE DE CREATION : 22/05/2014 |
6
|
|
|
|
|
|
|
#------------------------------------------------------------------------------------------------------ |
7
|
|
|
|
|
|
|
# USAGE / AIDE |
8
|
|
|
|
|
|
|
# perldoc CTM::ReadEM::WorkOnCurrentBIMServices |
9
|
|
|
|
|
|
|
#------------------------------------------------------------------------------------------------------ |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#-> BEGIN |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#----> ** initialisation ** |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
package CTM::ReadEM::WorkOnCurrentBIMServices; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
18
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
386
|
use base qw/ |
21
|
|
|
|
|
|
|
CTM::Base |
22
|
|
|
|
|
|
|
CTM::Base::SubClass |
23
|
1
|
|
|
1
|
|
4
|
/; |
|
1
|
|
|
|
|
1
|
|
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
45
|
use Sub::Name qw/ |
26
|
|
|
|
|
|
|
subname |
27
|
1
|
|
|
1
|
|
6
|
/; |
|
1
|
|
|
|
|
14
|
|
28
|
1
|
|
|
|
|
36
|
use Carp qw/ |
29
|
|
|
|
|
|
|
carp |
30
|
1
|
|
|
1
|
|
4
|
/; |
|
1
|
|
|
|
|
1
|
|
31
|
1
|
|
|
|
|
32
|
use String::Util qw/ |
32
|
|
|
|
|
|
|
crunch |
33
|
1
|
|
|
1
|
|
3
|
/; |
|
1
|
|
|
|
|
2
|
|
34
|
1
|
|
|
|
|
4
|
use Hash::Util qw/ |
35
|
|
|
|
|
|
|
unlock_hash |
36
|
1
|
|
|
1
|
|
4
|
/; |
|
1
|
|
|
|
|
1
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
#----> ** variables de classe ** |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
our $VERSION = 0.181; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
#----> ** methodes privees ** |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
my $_getAllViaLogID = subname '_getAllViaLogID' => sub { |
45
|
|
|
|
|
|
|
my ($self, $sqlRequest, $logID) = @_; |
46
|
|
|
|
|
|
|
my $sth = $self->getParentClass()->_DBI()->prepare($sqlRequest . ' WHERE log_id IN (' . join(', ', ('?') x @{$logID}) . ')'); |
47
|
|
|
|
|
|
|
$self->getParentClass()->_invokeVerbose((caller 0)[3], "\n" . $sth->{Statement} . "\n"); |
48
|
|
|
|
|
|
|
if ($sth->execute(@{$logID})) { |
49
|
|
|
|
|
|
|
return 1, $sth->fetchall_hashref('log_id'); |
50
|
|
|
|
|
|
|
} else { |
51
|
|
|
|
|
|
|
return 0, 0; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
}; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
#-> methodes liees aux services |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
my $_getFromRequest = sub { |
58
|
|
|
|
|
|
|
my ($self, $childSub, $sqlRequestSelectFrom, $errorType, $logID) = @_; |
59
|
|
|
|
|
|
|
$self->_tagAtWork; |
60
|
|
|
|
|
|
|
$self->unshiftError(); |
61
|
|
|
|
|
|
|
if ($self->getParentClass()->isSessionSeemAlive()) { |
62
|
|
|
|
|
|
|
$logID = [keys %{$self->getItems()}] unless (ref $logID eq 'ARRAY'); |
63
|
|
|
|
|
|
|
if (@{$logID}) { |
64
|
|
|
|
|
|
|
my ($situation, $hashRefPAlertsJobsForServices) = $self->$_getAllViaLogID($sqlRequestSelectFrom, $logID); |
65
|
|
|
|
|
|
|
if ($situation) { |
66
|
|
|
|
|
|
|
$self->_tagAtRest; |
67
|
|
|
|
|
|
|
return $hashRefPAlertsJobsForServices; |
68
|
|
|
|
|
|
|
} else { |
69
|
|
|
|
|
|
|
$self->_addError(CTM::Base::_myErrorMessage($childSub, 'erreur lors de la recuperation des ' . $errorType . " : la methode DBI 'execute()' a echouee : '" . $self->getParentClass()->_DBI()->errstr() . "'.")); |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
} else { |
72
|
|
|
|
|
|
|
$self->_tagAtRest; |
73
|
|
|
|
|
|
|
return {}; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
} else { |
76
|
|
|
|
|
|
|
$self->_addError(CTM::Base::_myErrorMessage($childSub, "impossible de continuer car la connexion au SGBD n'est pas active.")); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
$self->_tagAtRest; |
79
|
|
|
|
|
|
|
return 0; |
80
|
|
|
|
|
|
|
}; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
#----> ** methodes publiques ** |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
#-> methodes liees aux services |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub resetAndRefresh { |
87
|
0
|
|
|
0
|
0
|
|
return shift->SUPER::_resetAndRefresh(CTM::Base::_currentBIMServicesWorkMethod); |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub getAlerts { |
91
|
0
|
|
|
0
|
0
|
|
my ($self, $logID) = @_; |
92
|
0
|
|
|
|
|
|
return $self->$_getFromRequest((caller 0)[3], 'SELECT * FROM bim_alert', 'alertes', $logID); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub getProblematicsJobs { |
96
|
0
|
|
|
0
|
0
|
|
my ($self, $logID) = @_; |
97
|
0
|
|
|
|
|
|
return $self->$_getFromRequest((caller 0)[3], 'SELECT * FROM bim_prob_jobs', 'jobs en erreur', $logID); |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
#-> Perl BuiltIn |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
BEGIN { |
103
|
1
|
|
|
1
|
|
475
|
*AUTOLOAD = \&CTM::Base::AUTOLOAD; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub DESTROY { |
107
|
0
|
|
|
0
|
|
|
unlock_hash(%{+shift}); |
|
0
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
#-> END |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
__END__ |