line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::OpenSocial::Client::Protocol; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
533
|
use Any::Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
390
|
use LWP::UserAgent; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has 'formatter' => ( |
8
|
|
|
|
|
|
|
is => 'ro', |
9
|
|
|
|
|
|
|
required => 1, |
10
|
|
|
|
|
|
|
does => 'Net::OpenSocial::Client::Formatter', |
11
|
|
|
|
|
|
|
); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has 'request_builder' => ( |
14
|
|
|
|
|
|
|
is => 'ro', |
15
|
|
|
|
|
|
|
required => 1, |
16
|
|
|
|
|
|
|
does => 'Net::OpenSocial::Client::HTTPRequestBuilder', |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has 'agent' => ( |
20
|
|
|
|
|
|
|
is => 'ro', |
21
|
|
|
|
|
|
|
required => 1, |
22
|
|
|
|
|
|
|
default => sub { |
23
|
|
|
|
|
|
|
LWP::UserAgent->new; |
24
|
|
|
|
|
|
|
}, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub execute { |
28
|
0
|
|
|
0
|
1
|
|
my ( $self, $container, $requests ) = @_; |
29
|
0
|
|
|
|
|
|
die "abstract method"; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
1
|
|
114
|
no Any::Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
33
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 NAME |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Net::OpenSocial::Client::Protocol - Protocol base class |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 SYNOPSIS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
package ConcreteProtocol; |
43
|
|
|
|
|
|
|
use Any::Moose; |
44
|
|
|
|
|
|
|
exnteds 'Net::OpenSocial::Client::Protocol'; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
override 'execute' => sub { |
47
|
|
|
|
|
|
|
... |
48
|
|
|
|
|
|
|
}; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 DESCRIPTION |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Protocol base class. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 METHODS |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head2 formatter |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Formatter concrete class object. |
59
|
|
|
|
|
|
|
See L |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 request_builder |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
HTTPRequestBuilder concrete class object. |
64
|
|
|
|
|
|
|
See L |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 agent |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
HTTP Agent class object. |
69
|
|
|
|
|
|
|
Set LWP::UserAgent object by default. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 execute($container, $requests) |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Execute a protocol, and returns a L object |
74
|
|
|
|
|
|
|
or nothing |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
my $result_set = $protocol->execute($container, $requests) |
77
|
|
|
|
|
|
|
or die $protocol->errstr; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 SEE ALSO |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
L |
82
|
|
|
|
|
|
|
L |
83
|
|
|
|
|
|
|
L |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 AUTHOR |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Lyo Kato, Elyo.kato@gmail.comE |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Copyright (C) 2009 by Lyo Kato |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
94
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.8.8 or, |
95
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=cut |