line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Amazon::SQS::Simple::SendResponse; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
29
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
61
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
59
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
8
|
use Digest::MD5 qw(md5_hex); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
529
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
0
|
|
|
0
|
0
|
|
my ($class, $msg, $body) = @_; |
10
|
0
|
|
|
|
|
|
$msg = bless($msg, $class); |
11
|
0
|
0
|
|
|
|
|
if ($body){ |
12
|
0
|
|
|
|
|
|
$msg->{MessageBody} = $body; |
13
|
|
|
|
|
|
|
} |
14
|
0
|
|
|
|
|
|
return $msg; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub MessageId { |
18
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
19
|
0
|
|
|
|
|
|
return $self->{MessageId}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub MD5OfMessageBody { |
23
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
24
|
0
|
|
|
|
|
|
return $self->{MD5OfMessageBody}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub VerifyReceipt { |
28
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
29
|
0
|
0
|
|
|
|
|
return $self->{MD5OfMessageBody} eq md5_hex($self->{MessageBody}) ? 1 : undef; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 NAME |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Amazon::SQS::Simple::SendResponse - OO API for representing responses to |
39
|
|
|
|
|
|
|
messages sent to the Amazon Simple Queue Service. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 INTRODUCTION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Don't instantiate this class directly. Objects of this class are returned |
44
|
|
|
|
|
|
|
by SendMessage in C<Amazon::SQS::Simple::Queue>. |
45
|
|
|
|
|
|
|
See L<Amazon::SQS::Simple::Queue> for more details. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 METHODS |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=over 2 |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=item B<MessageId()> |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Get the message unique identifier |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=item B<MD5OfMessageBody()> |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Get the MD5 checksum of the message body you sent |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=item B<VerifyReceipt()> |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Perform verification of message receipt. |
62
|
|
|
|
|
|
|
Compares the MD5 checksum returned by the response object with the expected checksum. |
63
|
|
|
|
|
|
|
Returns 1 if receipt is verified, undef otherwise. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=back |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 AUTHOR |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Copyright 2007-2008 Simon Whitaker E<lt>swhitaker@cpan.orgE<gt> |
70
|
|
|
|
|
|
|
Copyright 2013-2017 Mike (no relation) Whitaker E<lt>penfold@cpan.orgE<gt> |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
73
|
|
|
|
|
|
|
under the same terms as Perl itself. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |