line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crashplan::Client::ComputerUsage; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
41
|
use strict; |
|
8
|
|
|
|
|
12
|
|
|
8
|
|
|
|
|
256
|
|
4
|
8
|
|
|
8
|
|
40
|
use warnings; |
|
8
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
4591
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.003_0'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Crashplan::Client::ComputerUsage - Object representation of Crashplan PROe server's entity |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Crashplan::Client::ComputerUsage objects are instancied by Crashplan::Client. |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Specifically, calling Crashplan::Client->parse_response after querying |
17
|
|
|
|
|
|
|
the server could produce Crashplan::Client::ComputerUsage |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
A record of computer usage provides statistics about the interaction between a |
22
|
|
|
|
|
|
|
pair of computers. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 METHODS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 new |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
The Crashplan::Client::ComputerUsage constructor |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub new { |
34
|
1
|
|
|
1
|
1
|
2
|
my $class = shift; |
35
|
1
|
|
50
|
|
|
4
|
my $param = shift || {}; |
36
|
|
|
|
|
|
|
|
37
|
1
|
|
|
|
|
2
|
my %converted_name = ( |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
|
41
|
1
|
|
|
|
|
2
|
my $self = $param; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
4
|
return bless $param,'Crashplan::Client::ComputerUsage'; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 id |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Getter for the 'id" attribute. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub id { |
54
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
0
|
return $self->{id}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 creationDate |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Getter for the 'creationDate" attribute. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=cut |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub creationDate { |
66
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
67
|
|
|
|
|
|
|
|
68
|
1
|
|
|
|
|
6
|
return $self->{creationDate}; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 modificationDate |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Getter for the 'modificationDate" attribute. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub modificationDate { |
78
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
79
|
|
|
|
|
|
|
|
80
|
1
|
|
|
|
|
6
|
return $self->{modificationDate}; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head2 targetId |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
The id of the target computer |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub targetId { |
90
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
91
|
1
|
|
|
|
|
3
|
my $val = shift; |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
1
|
|
|
|
|
6
|
return $self->{targetId}; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head2 lastConnected |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Timestamp indicating the last time the source connected to thetarget or null if there has been no connection |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=cut |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub lastConnected { |
104
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
105
|
1
|
|
|
|
|
2
|
my $val = shift; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
1
|
|
|
|
|
11
|
return $self->{lastConnected}; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head2 selectedBytes |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Byte count for all files selected for backup |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=cut |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
sub selectedBytes { |
118
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
119
|
1
|
|
|
|
|
1
|
my $val = shift; |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
|
122
|
1
|
|
|
|
|
5
|
return $self->{selectedBytes}; |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head2 todoFiles |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
Count of all files waiting to be backed up |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=cut |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
sub todoFiles { |
132
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
133
|
1
|
|
|
|
|
2
|
my $val = shift; |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
|
136
|
1
|
|
|
|
|
5
|
return $self->{todoFiles}; |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head2 sourceGuid |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
The GUID of the source computer |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=cut |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
sub sourceGuid { |
146
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
147
|
1
|
|
|
|
|
3
|
my $val = shift; |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
|
150
|
1
|
|
|
|
|
4
|
return $self->{sourceGuid}; |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=head2 targetGuid |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
The GUID of the target computer |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=cut |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
sub targetGuid { |
160
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
161
|
1
|
|
|
|
|
3
|
my $val = shift; |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
|
164
|
1
|
|
|
|
|
5
|
return $self->{targetGuid}; |
165
|
|
|
|
|
|
|
} |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=head2 archiveBytes |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
Source computer's archive size at the destination in bytes |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=cut |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
sub archiveBytes { |
174
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
175
|
1
|
|
|
|
|
3
|
my $val = shift; |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
|
178
|
1
|
|
|
|
|
6
|
return $self->{archiveBytes}; |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=head2 lastActivity |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
Timestamp indicating the last backup activity between the sourceand target or null if there has been no activity |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=cut |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
sub lastActivity { |
188
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
189
|
1
|
|
|
|
|
3
|
my $val = shift; |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
|
192
|
1
|
|
|
|
|
5
|
return $self->{lastActivity}; |
193
|
|
|
|
|
|
|
} |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=head2 sourceId |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
The id of the source computer |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=cut |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
sub sourceId { |
202
|
1
|
|
|
1
|
1
|
6896
|
my $self = shift; |
203
|
1
|
|
|
|
|
3
|
my $val = shift; |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
|
206
|
1
|
|
|
|
|
7
|
return $self->{sourceId}; |
207
|
|
|
|
|
|
|
} |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
=head2 isUsing |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
If checked, Computer B is a backup destination for Computer A |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
=cut |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
sub isUsing { |
216
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
217
|
1
|
|
|
|
|
3
|
my $val = shift; |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
|
220
|
1
|
|
|
|
|
4
|
return $self->{isUsing}; |
221
|
|
|
|
|
|
|
} |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
=head2 selectedFiles |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
Count of all files selected for backup |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
=cut |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
sub selectedFiles { |
230
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
231
|
1
|
|
|
|
|
3
|
my $val = shift; |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
|
234
|
1
|
|
|
|
|
6
|
return $self->{selectedFiles}; |
235
|
|
|
|
|
|
|
} |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
=head2 todoBytes |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
Byte count for all files waiting to be backed up |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
=cut |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
sub todoBytes { |
244
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
245
|
1
|
|
|
|
|
2
|
my $val = shift; |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
|
248
|
1
|
|
|
|
|
4
|
return $self->{todoBytes}; |
249
|
|
|
|
|
|
|
} |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
=head1 SEE ALSO |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
http://support.crashplanpro.com/doku.php/api#computerusage |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
=head1 AUTHOR |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
Arnaud (Arhuman) Assad, copyright 2011 Jaguar Network |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
=head1 LICENSE |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
This library is free software . You can redistribute it and/or modify |
262
|
|
|
|
|
|
|
it under the same terms as perl itself. |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
=cut |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
1; |