~ubuntu-branches/ubuntu/lucid/libamazon-sqs-simple-perl/lucid

« back to all changes in this revision

Viewing changes to lib/Amazon/SQS/Simple/Message.pm

  • Committer: Bazaar Package Importer
  • Author(s): Thierry Carrez
  • Date: 2010-02-16 14:29:13 UTC
  • Revision ID: james.westby@ubuntu.com-20100216142913-keyrxsi00ko2v1v0
Tags: upstream-1.03
ImportĀ upstreamĀ versionĀ 1.03

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package Amazon::SQS::Simple::Message;
 
2
 
 
3
use strict;
 
4
use warnings;
 
5
 
 
6
use Amazon::SQS::Simple::Base; # for constants
 
7
 
 
8
sub new {
 
9
    my $class = shift;
 
10
    my $msg = shift;
 
11
    my $version = shift || +SQS_VERSION_2008_01_01;
 
12
    $msg->{Version} = $version;
 
13
    return bless ($msg, $class);
 
14
}
 
15
 
 
16
sub MessageBody {
 
17
    my $self = shift;
 
18
    if ($self->{Version} eq +SQS_VERSION_2007_05_01) {
 
19
        return $self->{MessageBody};
 
20
    }
 
21
    else {
 
22
        return $self->{Body};
 
23
    }
 
24
}
 
25
 
 
26
sub MD5OfBody {
 
27
    my $self = shift;
 
28
    return $self->{MD5OfBody};
 
29
}
 
30
 
 
31
sub MessageId {
 
32
    my $self = shift;
 
33
    return $self->{MessageId};
 
34
}
 
35
 
 
36
sub ReceiptHandle {
 
37
    my $self = shift;
 
38
    return $self->{ReceiptHandle};
 
39
}
 
40
 
 
41
1;
 
42
 
 
43
__END__
 
44
 
 
45
=head1 NAME
 
46
 
 
47
Amazon::SQS::Simple::Message - OO API for representing messages from 
 
48
the Amazon Simple Queue Service.
 
49
 
 
50
=head1 INTRODUCTION
 
51
 
 
52
Don't instantiate this class directly. Objects of this class are returned
 
53
by various methods in C<Amazon::SQS::Simple::Queue>. 
 
54
See L<Amazon::SQS::Simple::Queue> for more details.
 
55
 
 
56
=head1 METHODS
 
57
 
 
58
=over 2
 
59
 
 
60
=item B<MessageBody()>
 
61
 
 
62
Get the message body.
 
63
 
 
64
=item B<MessageId()>
 
65
 
 
66
Get the message unique identifier
 
67
 
 
68
=item B<MD5OfBody()>
 
69
 
 
70
Get the MD5 checksum of the message body
 
71
 
 
72
=item B<ReceiptHandle()>
 
73
 
 
74
Get the receipt handle for the message (used as an argument to DeleteMessage)
 
75
 
 
76
=back
 
77
 
 
78
=head1 AUTHOR
 
79
 
 
80
Copyright 2007-2008 Simon Whitaker E<lt>swhitaker@cpan.orgE<gt>
 
81
 
 
82
This program is free software; you can redistribute it and/or modify it
 
83
under the same terms as Perl itself.
 
84
 
 
85
=cut