line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#------------------------------------------------------------------------------------------------------ |
2
|
|
|
|
|
|
|
# OBJET : Consultation de Control-M Server 6/7/8 via son SGBD |
3
|
|
|
|
|
|
|
# APPLICATION : Control-M Server |
4
|
|
|
|
|
|
|
# AUTEUR : Yoann Le Garff |
5
|
|
|
|
|
|
|
# DATE DE CREATION : 01/10/2014 |
6
|
|
|
|
|
|
|
#------------------------------------------------------------------------------------------------------ |
7
|
|
|
|
|
|
|
# USAGE / AIDE |
8
|
|
|
|
|
|
|
# perldoc CTM::ReadServer |
9
|
|
|
|
|
|
|
#------------------------------------------------------------------------------------------------------ |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#-> BEGIN |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#----> ** initialisation ** |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
package CTM::ReadServer; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
957
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
18
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
127
|
use base qw/ |
21
|
|
|
|
|
|
|
CTM::Base |
22
|
|
|
|
|
|
|
CTM::Base::MainClass |
23
|
1
|
|
|
1
|
|
4
|
/; |
|
1
|
|
|
|
|
1
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
use Exporter::Easy ( |
26
|
1
|
|
|
|
|
12
|
OK => [qw/ |
27
|
|
|
|
|
|
|
getNbServerSessionsCreated |
28
|
|
|
|
|
|
|
getNbServerSessionsConnected |
29
|
|
|
|
|
|
|
/], |
30
|
|
|
|
|
|
|
TAGS => [ |
31
|
|
|
|
|
|
|
ctmFunctions => [qw/ |
32
|
|
|
|
|
|
|
/], |
33
|
|
|
|
|
|
|
sessionFunctions => [qw/ |
34
|
|
|
|
|
|
|
getNbServerSessionsCreated |
35
|
|
|
|
|
|
|
getNbServerSessionsConnected |
36
|
|
|
|
|
|
|
/], |
37
|
|
|
|
|
|
|
allFunctions => [qw/ |
38
|
|
|
|
|
|
|
:ctmFunctions |
39
|
|
|
|
|
|
|
:sessionFunctions |
40
|
|
|
|
|
|
|
/], |
41
|
|
|
|
|
|
|
all => [qw/ |
42
|
|
|
|
|
|
|
$VERSION |
43
|
|
|
|
|
|
|
:allFunctions |
44
|
|
|
|
|
|
|
/] |
45
|
|
|
|
|
|
|
] |
46
|
1
|
|
|
1
|
|
5
|
); |
|
1
|
|
|
|
|
1
|
|
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
59
|
use Sub::Name qw/ |
49
|
|
|
|
|
|
|
subname |
50
|
1
|
|
|
1
|
|
452
|
/; |
|
1
|
|
|
|
|
4
|
|
51
|
1
|
|
|
|
|
48
|
use Carp qw/ |
52
|
|
|
|
|
|
|
croak |
53
|
1
|
|
|
1
|
|
6
|
/; |
|
1
|
|
|
|
|
1
|
|
54
|
1
|
|
|
|
|
37
|
use String::Util qw/ |
55
|
|
|
|
|
|
|
crunch |
56
|
1
|
|
|
1
|
|
4
|
/; |
|
1
|
|
|
|
|
2
|
|
57
|
1
|
|
|
|
|
7
|
use Hash::Util qw/ |
58
|
|
|
|
|
|
|
lock_hash |
59
|
|
|
|
|
|
|
lock_value |
60
|
|
|
|
|
|
|
unlock_value |
61
|
1
|
|
|
1
|
|
11
|
/; |
|
1
|
|
|
|
|
1
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
#----> ** variables de classe ** |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
our $VERSION = 0.181; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
my %_serverSessionsState = ( |
68
|
|
|
|
|
|
|
CTM::Base::_nbSessionsInstancedClassProperty => 0, |
69
|
|
|
|
|
|
|
CTM::Base::_nbSessionsConnectedClassProperty => 0 |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
#----> ** fonctions publiques ** |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub getNbServerSessionsCreated { |
75
|
1
|
|
|
1
|
0
|
208
|
return $_serverSessionsState{CTM::Base::_nbSessionsInstancedClassProperty}; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub getNbServerSessionsConnected { |
79
|
0
|
|
|
0
|
0
|
0
|
return $_serverSessionsState{CTM::Base::_nbSessionsConnectedClassProperty}; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
#----> ** methodes publiques ** |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
#-> wrappers de constructeurs/destructeurs |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub new { |
87
|
1
|
|
|
1
|
0
|
4
|
my $subName = (caller 0)[3]; |
88
|
1
|
50
|
|
|
|
12
|
croak(CTM::Base::_myErrorMessage($subName, CTM::Base::_myUsageMessage('$session->' . $subName, "'cle' => 'valeur'"))) unless (@_ % 2); |
89
|
1
|
|
|
|
|
9
|
my $self = shift->SUPER::_new(@_); |
90
|
1
|
|
|
|
|
2
|
lock_hash(%{$self}); |
|
1
|
|
|
|
|
8
|
|
91
|
1
|
|
|
|
|
20
|
$_serverSessionsState{CTM::Base::_nbSessionsInstancedClassProperty}++; |
92
|
1
|
|
|
|
|
3
|
return $self; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
*newSession = \&new; |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
#-> accesseurs/mutateurs |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub isSessionAlive { |
100
|
0
|
|
|
0
|
0
|
0
|
return shift->SUPER::_isSessionAlive(); |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub isSessionSeemAlive { |
104
|
|
|
|
|
|
|
return shift->SUPER::_isSessionSeemAlive() |
105
|
0
|
|
|
0
|
0
|
0
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
#-> Perl BuiltIn |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
BEGIN { |
110
|
1
|
|
|
1
|
|
342
|
*AUTOLOAD = \&CTM::Base::AUTOLOAD; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub DESTROY { |
114
|
1
|
|
|
1
|
|
214
|
my $self = shift; |
115
|
|
|
|
|
|
|
# $self->disconnect(); |
116
|
1
|
|
|
|
|
8
|
$_serverSessionsState{CTM::Base::_nbSessionsInstancedClassProperty}--; |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
1; |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
#-> END |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
__END__ |