Amazon-SQS-Simple-2.04/000755 000765 000024 00000000000 12521425230 014643 5ustar00mikestaff000000 000000 Amazon-SQS-Simple-2.04/bin/000755 000765 000024 00000000000 12521425230 015413 5ustar00mikestaff000000 000000 Amazon-SQS-Simple-2.04/Changes000644 000765 000024 00000004632 12521422621 016144 0ustar00mikestaff000000 000000 Revision history for Amazon-SQS-Simple 0.1 26 June 2007 First version, running against SQS version 2007-05-01 0.2 29 June 2007 Added full POD docs 0.3 17 July 2007 Added Amazon::SQS::Simple::Base, Amazon::SQS::Simple::Message 0.4 17 July 2007 Mended POD docs in Base and Message classes 0.5 06 August 2007 Fixed bug in Queue.pm where RetrieveMessage could attempt to bless a null reference. 0.6 06 February 2008 Updated to be compatible with the latest version of SQS (2008-01-01). NOTE: This version introduces non-backwards compatible changes! See this URL for details of the API change: http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1148 0.7 14 Feb 2008 Documentation fixes 0.8 31 Jul 2008 Documentation fixes 0.9 25 Sep 2008 Added ability to call old API versions 1.00 28 Oct 2008 Fixed bug rt.cpan.org#34120 (http://rt.cpan.org/Public/Bug/Display.html?id=34120) 1.01 1 Nov 2008 Improved error reporting when using old API versions 1.02 21 Nov 2008 Fixed bug where interpolating an Amazon::SQS::Simple object in string context threw an error. 1.03 21 Nov 2008 Fixed ReceiveMessages when called with MaxNumberOfMessages > 1 1.04 23 May 2009 Added support for API version 2009-02-01 Removed support for API version 2007-05-01 1.05 14 Nov 2009 Minor tweak to improve the lives of folks using strict and mod_perl (Thanks to Stephen Sayre) 1.06 31 Mar 2010 Added Timeout constructor arg 2.00 22 May 2013 New Maintainer (PENFOLD) ReceiveMessage now always returns the first message in scalar context, irrespective of how many there are. (previously if there were more than one, it would return a count) Updated to support and default to SignatureVersion 2, stub SignatureVersion 3 (Roland Walker) Proxy Support (James Neal) Added SendMessageBatch, ReceiveMessageBatch (Chris Jones) 2.01 1 Jul 2013 Fix bug with SendMessageBatch and single messages :D 2.02 1 Jul 2013 As above with updated Changes file :D 2.03 1 Sep 2013 Retry 500 errors (on advice from AWS support) Handle ARN-style endpoints (https://sqs..amazonaws.com//) 2.03 3 May 2015 Fix access bug surfaced by hash key randomization (cebjyre)Amazon-SQS-Simple-2.04/lib/000755 000765 000024 00000000000 12521425230 015411 5ustar00mikestaff000000 000000 Amazon-SQS-Simple-2.04/LICENSE000644 000765 000024 00000000247 12521422301 015647 0ustar00mikestaff000000 000000 COPYRIGHT AND LICENCE Copyright (C) 2007 Simon Whitaker This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Amazon-SQS-Simple-2.04/Makefile000644 000765 000024 00000071564 12521425223 016322 0ustar00mikestaff000000 000000 # This Makefile is for the Amazon::SQS::Simple extension to perl. # # It was generated automatically by MakeMaker version # 6.66 (Revision: 66600) from the contents of # Makefile.PL. Don't edit this file, edit Makefile.PL instead. # # ANY CHANGES MADE HERE WILL BE LOST! # # MakeMaker ARGV: () # # MakeMaker Parameters: # ABSTRACT_FROM => q[lib/Amazon/SQS/Simple.pm] # AUTHOR => [q[Simon Whitaker ]] # BUILD_REQUIRES => { } # CONFIGURE_REQUIRES => { } # NAME => q[Amazon::SQS::Simple] # PL_FILES => { } # PREREQ_PM => { Digest::SHA=>q[0], MIME::Base64=>q[0], URI::Escape=>q[0], Test::More=>q[0], Digest::HMAC_SHA1=>q[0], XML::Simple=>q[0], LWP::UserAgent=>q[0] } # TEST_REQUIRES => { } # VERSION_FROM => q[lib/Amazon/SQS/Simple.pm] # clean => { FILES=>q[Amazon-SQS-Simple-*] } # dist => { SUFFIX=>q[gz], COMPRESS=>q[gzip -9f] } # --- MakeMaker post_initialize section: # --- MakeMaker const_config section: # These definitions are from config.sh (via /System/Library/Perl/5.18/darwin-thread-multi-2level/Config.pm). # They may have been overridden via Makefile.PL or on the command line. AR = ar CC = cc CCCDLFLAGS = CCDLFLAGS = DLEXT = bundle DLSRC = dl_dlopen.xs EXE_EXT = FULL_AR = /usr/bin/ar LD = cc -mmacosx-version-min=10.10 LDDLFLAGS = -arch x86_64 -arch i386 -bundle -undefined dynamic_lookup -fstack-protector LDFLAGS = -arch x86_64 -arch i386 -fstack-protector LIBC = LIB_EXT = .a OBJ_EXT = .o OSNAME = darwin OSVERS = 14.0 RANLIB = /usr/bin/ar s SITELIBEXP = /Library/Perl/5.18 SITEARCHEXP = /Library/Perl/5.18/darwin-thread-multi-2level SO = dylib VENDORARCHEXP = /Network/Library/Perl/5.18/darwin-thread-multi-2level VENDORLIBEXP = /Network/Library/Perl/5.18 # --- MakeMaker constants section: AR_STATIC_ARGS = cr DIRFILESEP = / DFSEP = $(DIRFILESEP) NAME = Amazon::SQS::Simple NAME_SYM = Amazon_SQS_Simple VERSION = 2.04 VERSION_MACRO = VERSION VERSION_SYM = 2_04 DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\" XS_VERSION = 2.04 XS_VERSION_MACRO = XS_VERSION XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\" INST_ARCHLIB = blib/arch INST_SCRIPT = blib/script INST_BIN = blib/bin INST_LIB = blib/lib INST_MAN1DIR = blib/man1 INST_MAN3DIR = blib/man3 MAN1EXT = 1 MAN3EXT = 3pm INSTALLDIRS = site DESTDIR = PREFIX = $(SITEPREFIX) PERLPREFIX = / SITEPREFIX = /usr/local VENDORPREFIX = /usr/local INSTALLPRIVLIB = /Library/Perl/Updates/5.18.2 DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB) INSTALLSITELIB = /Library/Perl/5.18 DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB) INSTALLVENDORLIB = /Network/Library/Perl/5.18 DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB) INSTALLARCHLIB = /Library/Perl/Updates/5.18.2/darwin-thread-multi-2level DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB) INSTALLSITEARCH = /Library/Perl/5.18/darwin-thread-multi-2level DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH) INSTALLVENDORARCH = /Network/Library/Perl/5.18/darwin-thread-multi-2level DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH) INSTALLBIN = /usr/bin DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN) INSTALLSITEBIN = /usr/local/bin DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN) INSTALLVENDORBIN = /usr/local/bin DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN) INSTALLSCRIPT = /usr/bin DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT) INSTALLSITESCRIPT = /usr/local/bin DESTINSTALLSITESCRIPT = $(DESTDIR)$(INSTALLSITESCRIPT) INSTALLVENDORSCRIPT = /usr/local/bin DESTINSTALLVENDORSCRIPT = $(DESTDIR)$(INSTALLVENDORSCRIPT) INSTALLMAN1DIR = /usr/share/man/man1 DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR) INSTALLSITEMAN1DIR = /usr/local/share/man/man1 DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR) INSTALLVENDORMAN1DIR = /usr/local/share/man/man1 DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR) INSTALLMAN3DIR = /usr/share/man/man3 DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR) INSTALLSITEMAN3DIR = /usr/local/share/man/man3 DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR) INSTALLVENDORMAN3DIR = /usr/local/share/man/man3 DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR) PERL_LIB = /System/Library/Perl/5.18 PERL_ARCHLIB = /System/Library/Perl/5.18/darwin-thread-multi-2level LIBPERL_A = libperl.a FIRST_MAKEFILE = Makefile MAKEFILE_OLD = Makefile.old MAKE_APERL_FILE = Makefile.aperl PERLMAINCC = $(CC) PERL_INC = /System/Library/Perl/5.18/darwin-thread-multi-2level/CORE PERL = /usr/bin/perl FULLPERL = /usr/bin/perl ABSPERL = $(PERL) PERLRUN = $(PERL) FULLPERLRUN = $(FULLPERL) ABSPERLRUN = $(ABSPERL) PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" PERL_CORE = 0 PERM_DIR = 755 PERM_RW = 644 PERM_RWX = 755 MAKEMAKER = /System/Library/Perl/5.18/ExtUtils/MakeMaker.pm MM_VERSION = 6.66 MM_REVISION = 66600 # FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle). # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle) # PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar) # DLBASE = Basename part of dynamic library. May be just equal BASEEXT. MAKE = make FULLEXT = Amazon/SQS/Simple BASEEXT = Simple PARENT_NAME = Amazon::SQS DLBASE = $(BASEEXT) VERSION_FROM = lib/Amazon/SQS/Simple.pm OBJECT = LDFROM = $(OBJECT) LINKTYPE = dynamic BOOTDEP = # Handy lists of source code files: XS_FILES = C_FILES = O_FILES = H_FILES = MAN1PODS = MAN3PODS = lib/Amazon/SQS/Simple.pm \ lib/Amazon/SQS/Simple/Base.pm \ lib/Amazon/SQS/Simple/Message.pm \ lib/Amazon/SQS/Simple/Queue.pm \ lib/Amazon/SQS/Simple/SendResponse.pm # Where is the Config information that we are using/depend on CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h # Where to build things INST_LIBDIR = $(INST_LIB)/Amazon/SQS INST_ARCHLIBDIR = $(INST_ARCHLIB)/Amazon/SQS INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT) INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT) INST_STATIC = INST_DYNAMIC = INST_BOOT = # Extra linker info EXPORT_LIST = PERL_ARCHIVE = PERL_ARCHIVE_AFTER = TO_INST_PM = lib/Amazon/SQS/Simple.pm \ lib/Amazon/SQS/Simple/Base.pm \ lib/Amazon/SQS/Simple/Message.pm \ lib/Amazon/SQS/Simple/Queue.pm \ lib/Amazon/SQS/Simple/SendResponse.pm PM_TO_BLIB = lib/Amazon/SQS/Simple/Base.pm \ blib/lib/Amazon/SQS/Simple/Base.pm \ lib/Amazon/SQS/Simple/SendResponse.pm \ blib/lib/Amazon/SQS/Simple/SendResponse.pm \ lib/Amazon/SQS/Simple/Message.pm \ blib/lib/Amazon/SQS/Simple/Message.pm \ lib/Amazon/SQS/Simple.pm \ blib/lib/Amazon/SQS/Simple.pm \ lib/Amazon/SQS/Simple/Queue.pm \ blib/lib/Amazon/SQS/Simple/Queue.pm # --- MakeMaker platform_constants section: MM_Unix_VERSION = 6.66 PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc # --- MakeMaker tool_autosplit section: # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto AUTOSPLITFILE = $(ABSPERLRUN) -e 'use AutoSplit; autosplit($$$$ARGV[0], $$$$ARGV[1], 0, 1, 1)' -- # --- MakeMaker tool_xsubpp section: # --- MakeMaker tools_other section: SHELL = /bin/sh CHMOD = chmod CP = cp MV = mv NOOP = $(TRUE) NOECHO = @ RM_F = rm -f RM_RF = rm -rf TEST_F = test -f TOUCH = touch UMASK_NULL = umask 0 DEV_NULL = > /dev/null 2>&1 MKPATH = $(ABSPERLRUN) -MExtUtils::Command -e 'mkpath' -- EQUALIZE_TIMESTAMP = $(ABSPERLRUN) -MExtUtils::Command -e 'eqtime' -- FALSE = false TRUE = true ECHO = echo ECHO_N = echo -n UNINST = 0 VERBINST = 0 MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install([ from_to => {@ARGV}, verbose => '\''$(VERBINST)'\'', uninstall_shadows => '\''$(UNINST)'\'', dir_mode => '\''$(PERM_DIR)'\'' ]);' -- DOC_INSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'perllocal_install' -- UNINSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'uninstall' -- WARN_IF_OLD_PACKLIST = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'warn_if_old_packlist' -- MACROSTART = MACROEND = USEMAKEFILE = -f FIXIN = $(ABSPERLRUN) -MExtUtils::MY -e 'MY->fixin(shift)' -- # --- MakeMaker makemakerdflt section: makemakerdflt : all $(NOECHO) $(NOOP) # --- MakeMaker dist section: TAR = COPY_EXTENDED_ATTRIBUTES_DISABLE=1 COPYFILE_DISABLE=1 tar TARFLAGS = cvf ZIP = zip ZIPFLAGS = -r COMPRESS = gzip -9f SUFFIX = gz SHAR = shar PREOP = $(NOECHO) $(NOOP) POSTOP = $(NOECHO) $(NOOP) TO_UNIX = $(NOECHO) $(NOOP) CI = ci -u RCS_LABEL = rcs -Nv$(VERSION_SYM): -q DIST_CP = best DIST_DEFAULT = tardist DISTNAME = Amazon-SQS-Simple DISTVNAME = Amazon-SQS-Simple-2.04 # --- MakeMaker macro section: # --- MakeMaker depend section: # --- MakeMaker cflags section: # --- MakeMaker const_loadlibs section: # --- MakeMaker const_cccmd section: # --- MakeMaker post_constants section: # --- MakeMaker pasthru section: PASTHRU = LIBPERL_A="$(LIBPERL_A)"\ LINKTYPE="$(LINKTYPE)"\ PREFIX="$(PREFIX)" # --- MakeMaker special_targets section: .SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT) .PHONY: all config static dynamic test linkext manifest blibdirs clean realclean disttest distdir # --- MakeMaker c_o section: # --- MakeMaker xs_c section: # --- MakeMaker xs_o section: # --- MakeMaker top_targets section: all :: pure_all manifypods $(NOECHO) $(NOOP) pure_all :: config pm_to_blib subdirs linkext $(NOECHO) $(NOOP) subdirs :: $(MYEXTLIB) $(NOECHO) $(NOOP) config :: $(FIRST_MAKEFILE) blibdirs $(NOECHO) $(NOOP) help : perldoc ExtUtils::MakeMaker # --- MakeMaker blibdirs section: blibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists $(NOECHO) $(NOOP) # Backwards compat with 6.18 through 6.25 blibdirs.ts : blibdirs $(NOECHO) $(NOOP) $(INST_LIBDIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_LIBDIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_LIBDIR) $(NOECHO) $(TOUCH) $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_ARCHLIB) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHLIB) $(NOECHO) $(TOUCH) $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_AUTODIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_AUTODIR) $(NOECHO) $(TOUCH) $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHAUTODIR) $(NOECHO) $(TOUCH) $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_BIN) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_BIN) $(NOECHO) $(TOUCH) $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_SCRIPT) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_SCRIPT) $(NOECHO) $(TOUCH) $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_MAN1DIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN1DIR) $(NOECHO) $(TOUCH) $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_MAN3DIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN3DIR) $(NOECHO) $(TOUCH) $(INST_MAN3DIR)$(DFSEP).exists # --- MakeMaker linkext section: linkext :: $(LINKTYPE) $(NOECHO) $(NOOP) # --- MakeMaker dlsyms section: # --- MakeMaker dynamic section: dynamic :: $(FIRST_MAKEFILE) $(INST_DYNAMIC) $(INST_BOOT) $(NOECHO) $(NOOP) # --- MakeMaker dynamic_bs section: BOOTSTRAP = # --- MakeMaker dynamic_lib section: # --- MakeMaker static section: ## $(INST_PM) has been moved to the all: target. ## It remains here for awhile to allow for old usage: "make static" static :: $(FIRST_MAKEFILE) $(INST_STATIC) $(NOECHO) $(NOOP) # --- MakeMaker static_lib section: # --- MakeMaker manifypods section: POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--" POD2MAN = $(POD2MAN_EXE) manifypods : pure_all \ lib/Amazon/SQS/Simple/SendResponse.pm \ lib/Amazon/SQS/Simple/Base.pm \ lib/Amazon/SQS/Simple/Queue.pm \ lib/Amazon/SQS/Simple/Message.pm \ lib/Amazon/SQS/Simple.pm $(NOECHO) $(POD2MAN) --section=3 --perm_rw=$(PERM_RW) \ lib/Amazon/SQS/Simple/SendResponse.pm $(INST_MAN3DIR)/Amazon::SQS::Simple::SendResponse.$(MAN3EXT) \ lib/Amazon/SQS/Simple/Base.pm $(INST_MAN3DIR)/Amazon::SQS::Simple::Base.$(MAN3EXT) \ lib/Amazon/SQS/Simple/Queue.pm $(INST_MAN3DIR)/Amazon::SQS::Simple::Queue.$(MAN3EXT) \ lib/Amazon/SQS/Simple/Message.pm $(INST_MAN3DIR)/Amazon::SQS::Simple::Message.$(MAN3EXT) \ lib/Amazon/SQS/Simple.pm $(INST_MAN3DIR)/Amazon::SQS::Simple.$(MAN3EXT) # --- MakeMaker processPL section: # --- MakeMaker installbin section: # --- MakeMaker subdirs section: # none # --- MakeMaker clean_subdirs section: clean_subdirs : $(NOECHO) $(NOOP) # --- MakeMaker clean section: # Delete temporary files but do not touch installed files. We don't delete # the Makefile here so a later make realclean still has a makefile to use. clean :: clean_subdirs - $(RM_F) \ MYMETA.yml *$(OBJ_EXT) \ core.*perl.*.? $(BASEEXT).exp \ core lib$(BASEEXT).def \ blibdirs.ts core.[0-9][0-9] \ $(INST_ARCHAUTODIR)/extralibs.ld *$(LIB_EXT) \ so_locations pm_to_blib \ $(BASEEXT).x tmon.out \ mon.out perl.exe \ $(BOOTSTRAP) $(BASEEXT).bso \ $(BASEEXT).def core.[0-9][0-9][0-9] \ perl perlmain.c \ pm_to_blib.ts core.[0-9][0-9][0-9][0-9][0-9] \ perl$(EXE_EXT) $(INST_ARCHAUTODIR)/extralibs.all \ core.[0-9] *perl.core \ MYMETA.json $(MAKE_APERL_FILE) \ core.[0-9][0-9][0-9][0-9] - $(RM_RF) \ Amazon-SQS-Simple-* blib - $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL) # --- MakeMaker realclean_subdirs section: realclean_subdirs : $(NOECHO) $(NOOP) # --- MakeMaker realclean section: # Delete temporary files (via clean) and also delete dist files realclean purge :: clean realclean_subdirs - $(RM_F) \ $(MAKEFILE_OLD) $(FIRST_MAKEFILE) - $(RM_RF) \ $(DISTVNAME) # --- MakeMaker metafile section: metafile : create_distdir $(NOECHO) $(ECHO) Generating META.yml $(NOECHO) $(ECHO) '---' > META_new.yml $(NOECHO) $(ECHO) 'abstract: '\''OO API for accessing the Amazon Simple Queue '\''' >> META_new.yml $(NOECHO) $(ECHO) 'author:' >> META_new.yml $(NOECHO) $(ECHO) ' - '\''Simon Whitaker '\''' >> META_new.yml $(NOECHO) $(ECHO) 'build_requires:' >> META_new.yml $(NOECHO) $(ECHO) ' ExtUtils::MakeMaker: 0' >> META_new.yml $(NOECHO) $(ECHO) 'configure_requires:' >> META_new.yml $(NOECHO) $(ECHO) ' ExtUtils::MakeMaker: 0' >> META_new.yml $(NOECHO) $(ECHO) 'dynamic_config: 1' >> META_new.yml $(NOECHO) $(ECHO) 'generated_by: '\''ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.133380'\''' >> META_new.yml $(NOECHO) $(ECHO) 'license: unknown' >> META_new.yml $(NOECHO) $(ECHO) 'meta-spec:' >> META_new.yml $(NOECHO) $(ECHO) ' url: http://module-build.sourceforge.net/META-spec-v1.4.html' >> META_new.yml $(NOECHO) $(ECHO) ' version: 1.4' >> META_new.yml $(NOECHO) $(ECHO) 'name: Amazon-SQS-Simple' >> META_new.yml $(NOECHO) $(ECHO) 'no_index:' >> META_new.yml $(NOECHO) $(ECHO) ' directory:' >> META_new.yml $(NOECHO) $(ECHO) ' - t' >> META_new.yml $(NOECHO) $(ECHO) ' - inc' >> META_new.yml $(NOECHO) $(ECHO) 'requires:' >> META_new.yml $(NOECHO) $(ECHO) ' Digest::HMAC_SHA1: 0' >> META_new.yml $(NOECHO) $(ECHO) ' Digest::SHA: 0' >> META_new.yml $(NOECHO) $(ECHO) ' LWP::UserAgent: 0' >> META_new.yml $(NOECHO) $(ECHO) ' MIME::Base64: 0' >> META_new.yml $(NOECHO) $(ECHO) ' Test::More: 0' >> META_new.yml $(NOECHO) $(ECHO) ' URI::Escape: 0' >> META_new.yml $(NOECHO) $(ECHO) ' XML::Simple: 0' >> META_new.yml $(NOECHO) $(ECHO) 'version: 2.04' >> META_new.yml -$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml $(NOECHO) $(ECHO) Generating META.json $(NOECHO) $(ECHO) '{' > META_new.json $(NOECHO) $(ECHO) ' "abstract" : "OO API for accessing the Amazon Simple Queue ",' >> META_new.json $(NOECHO) $(ECHO) ' "author" : [' >> META_new.json $(NOECHO) $(ECHO) ' "Simon Whitaker "' >> META_new.json $(NOECHO) $(ECHO) ' ],' >> META_new.json $(NOECHO) $(ECHO) ' "dynamic_config" : 1,' >> META_new.json $(NOECHO) $(ECHO) ' "generated_by" : "ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.133380",' >> META_new.json $(NOECHO) $(ECHO) ' "license" : [' >> META_new.json $(NOECHO) $(ECHO) ' "unknown"' >> META_new.json $(NOECHO) $(ECHO) ' ],' >> META_new.json $(NOECHO) $(ECHO) ' "meta-spec" : {' >> META_new.json $(NOECHO) $(ECHO) ' "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",' >> META_new.json $(NOECHO) $(ECHO) ' "version" : "2"' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "name" : "Amazon-SQS-Simple",' >> META_new.json $(NOECHO) $(ECHO) ' "no_index" : {' >> META_new.json $(NOECHO) $(ECHO) ' "directory" : [' >> META_new.json $(NOECHO) $(ECHO) ' "t",' >> META_new.json $(NOECHO) $(ECHO) ' "inc"' >> META_new.json $(NOECHO) $(ECHO) ' ]' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "prereqs" : {' >> META_new.json $(NOECHO) $(ECHO) ' "build" : {' >> META_new.json $(NOECHO) $(ECHO) ' "requires" : {' >> META_new.json $(NOECHO) $(ECHO) ' "ExtUtils::MakeMaker" : "0"' >> META_new.json $(NOECHO) $(ECHO) ' }' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "configure" : {' >> META_new.json $(NOECHO) $(ECHO) ' "requires" : {' >> META_new.json $(NOECHO) $(ECHO) ' "ExtUtils::MakeMaker" : "0"' >> META_new.json $(NOECHO) $(ECHO) ' }' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "runtime" : {' >> META_new.json $(NOECHO) $(ECHO) ' "requires" : {' >> META_new.json $(NOECHO) $(ECHO) ' "Digest::HMAC_SHA1" : "0",' >> META_new.json $(NOECHO) $(ECHO) ' "Digest::SHA" : "0",' >> META_new.json $(NOECHO) $(ECHO) ' "LWP::UserAgent" : "0",' >> META_new.json $(NOECHO) $(ECHO) ' "MIME::Base64" : "0",' >> META_new.json $(NOECHO) $(ECHO) ' "Test::More" : "0",' >> META_new.json $(NOECHO) $(ECHO) ' "URI::Escape" : "0",' >> META_new.json $(NOECHO) $(ECHO) ' "XML::Simple" : "0"' >> META_new.json $(NOECHO) $(ECHO) ' }' >> META_new.json $(NOECHO) $(ECHO) ' }' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "release_status" : "stable",' >> META_new.json $(NOECHO) $(ECHO) ' "version" : "2.04"' >> META_new.json $(NOECHO) $(ECHO) '}' >> META_new.json -$(NOECHO) $(MV) META_new.json $(DISTVNAME)/META.json # --- MakeMaker signature section: signature : cpansign -s # --- MakeMaker dist_basics section: distclean :: realclean distcheck $(NOECHO) $(NOOP) distcheck : $(PERLRUN) "-MExtUtils::Manifest=fullcheck" -e fullcheck skipcheck : $(PERLRUN) "-MExtUtils::Manifest=skipcheck" -e skipcheck manifest : $(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest veryclean : realclean $(RM_F) *~ */*~ *.orig */*.orig *.bak */*.bak *.old */*.old # --- MakeMaker dist_core section: dist : $(DIST_DEFAULT) $(FIRST_MAKEFILE) $(NOECHO) $(ABSPERLRUN) -l -e 'print '\''Warning: Makefile possibly out of date with $(VERSION_FROM)'\''' \ -e ' if -e '\''$(VERSION_FROM)'\'' and -M '\''$(VERSION_FROM)'\'' < -M '\''$(FIRST_MAKEFILE)'\'';' -- tardist : $(DISTVNAME).tar$(SUFFIX) $(NOECHO) $(NOOP) uutardist : $(DISTVNAME).tar$(SUFFIX) uuencode $(DISTVNAME).tar$(SUFFIX) $(DISTVNAME).tar$(SUFFIX) > $(DISTVNAME).tar$(SUFFIX)_uu $(DISTVNAME).tar$(SUFFIX) : distdir $(PREOP) $(TO_UNIX) $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME) $(RM_RF) $(DISTVNAME) $(COMPRESS) $(DISTVNAME).tar $(POSTOP) zipdist : $(DISTVNAME).zip $(NOECHO) $(NOOP) $(DISTVNAME).zip : distdir $(PREOP) $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME) $(RM_RF) $(DISTVNAME) $(POSTOP) shdist : distdir $(PREOP) $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar $(RM_RF) $(DISTVNAME) $(POSTOP) # --- MakeMaker distdir section: create_distdir : $(RM_RF) $(DISTVNAME) $(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \ -e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');" distdir : create_distdir distmeta $(NOECHO) $(NOOP) # --- MakeMaker dist_test section: disttest : distdir cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL cd $(DISTVNAME) && $(MAKE) $(PASTHRU) cd $(DISTVNAME) && $(MAKE) test $(PASTHRU) # --- MakeMaker dist_ci section: ci : $(PERLRUN) "-MExtUtils::Manifest=maniread" \ -e "@all = keys %{ maniread() };" \ -e "print(qq{Executing $(CI) @all\n}); system(qq{$(CI) @all});" \ -e "print(qq{Executing $(RCS_LABEL) ...\n}); system(qq{$(RCS_LABEL) @all});" # --- MakeMaker distmeta section: distmeta : create_distdir metafile $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'exit unless -e q{META.yml};' \ -e 'eval { maniadd({q{META.yml} => q{Module YAML meta-data (added by MakeMaker)}}) }' \ -e ' or print "Could not add META.yml to MANIFEST: $$$${'\''@'\''}\n"' -- $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'exit unless -f q{META.json};' \ -e 'eval { maniadd({q{META.json} => q{Module JSON meta-data (added by MakeMaker)}}) }' \ -e ' or print "Could not add META.json to MANIFEST: $$$${'\''@'\''}\n"' -- # --- MakeMaker distsignature section: distsignature : create_distdir $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) } ' \ -e ' or print "Could not add SIGNATURE to MANIFEST: $$$${'\''@'\''}\n"' -- $(NOECHO) cd $(DISTVNAME) && $(TOUCH) SIGNATURE cd $(DISTVNAME) && cpansign -s # --- MakeMaker install section: install :: pure_install doc_install $(NOECHO) $(NOOP) install_perl :: pure_perl_install doc_perl_install $(NOECHO) $(NOOP) install_site :: pure_site_install doc_site_install $(NOECHO) $(NOOP) install_vendor :: pure_vendor_install doc_vendor_install $(NOECHO) $(NOOP) pure_install :: pure_$(INSTALLDIRS)_install $(NOECHO) $(NOOP) doc_install :: doc_$(INSTALLDIRS)_install $(NOECHO) $(NOOP) pure__install : pure_site_install $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site doc__install : doc_site_install $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site pure_perl_install :: all $(NOECHO) $(MOD_INSTALL) \ read $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist \ write $(DESTINSTALLARCHLIB)/auto/$(FULLEXT)/.packlist \ $(INST_LIB) $(DESTINSTALLPRIVLIB) \ $(INST_ARCHLIB) $(DESTINSTALLARCHLIB) \ $(INST_BIN) $(DESTINSTALLBIN) \ $(INST_SCRIPT) $(DESTINSTALLSCRIPT) \ $(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) \ $(INST_MAN3DIR) $(DESTINSTALLMAN3DIR) $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ $(SITEARCHEXP)/auto/$(FULLEXT) pure_site_install :: all $(NOECHO) $(MOD_INSTALL) \ read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \ write $(DESTINSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \ $(INST_LIB) $(DESTINSTALLSITELIB) \ $(INST_ARCHLIB) $(DESTINSTALLSITEARCH) \ $(INST_BIN) $(DESTINSTALLSITEBIN) \ $(INST_SCRIPT) $(DESTINSTALLSITESCRIPT) \ $(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) \ $(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR) $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ $(PERL_ARCHLIB)/auto/$(FULLEXT) pure_vendor_install :: all $(NOECHO) $(MOD_INSTALL) \ read $(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist \ write $(DESTINSTALLVENDORARCH)/auto/$(FULLEXT)/.packlist \ $(INST_LIB) $(DESTINSTALLVENDORLIB) \ $(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) \ $(INST_BIN) $(DESTINSTALLVENDORBIN) \ $(INST_SCRIPT) $(DESTINSTALLVENDORSCRIPT) \ $(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \ $(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR) doc_perl_install :: all $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod -$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) -$(NOECHO) $(DOC_INSTALL) \ "Module" "$(NAME)" \ "installed into" "$(INSTALLPRIVLIB)" \ LINKTYPE "$(LINKTYPE)" \ VERSION "$(VERSION)" \ EXE_FILES "$(EXE_FILES)" \ >> $(DESTINSTALLARCHLIB)/perllocal.pod doc_site_install :: all $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod -$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) -$(NOECHO) $(DOC_INSTALL) \ "Module" "$(NAME)" \ "installed into" "$(INSTALLSITELIB)" \ LINKTYPE "$(LINKTYPE)" \ VERSION "$(VERSION)" \ EXE_FILES "$(EXE_FILES)" \ >> $(DESTINSTALLARCHLIB)/perllocal.pod doc_vendor_install :: all $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod -$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) -$(NOECHO) $(DOC_INSTALL) \ "Module" "$(NAME)" \ "installed into" "$(INSTALLVENDORLIB)" \ LINKTYPE "$(LINKTYPE)" \ VERSION "$(VERSION)" \ EXE_FILES "$(EXE_FILES)" \ >> $(DESTINSTALLARCHLIB)/perllocal.pod uninstall :: uninstall_from_$(INSTALLDIRS)dirs $(NOECHO) $(NOOP) uninstall_from_perldirs :: $(NOECHO) $(UNINSTALL) $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist uninstall_from_sitedirs :: $(NOECHO) $(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist uninstall_from_vendordirs :: $(NOECHO) $(UNINSTALL) $(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist # --- MakeMaker force section: # Phony target to force checking subdirectories. FORCE : $(NOECHO) $(NOOP) # --- MakeMaker perldepend section: # --- MakeMaker makefile section: # We take a very conservative approach here, but it's worth it. # We move Makefile to Makefile.old here to avoid gnu make looping. $(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP) $(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?" $(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..." -$(NOECHO) $(RM_F) $(MAKEFILE_OLD) -$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) - $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL) $(PERLRUN) Makefile.PL $(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <==" $(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <==" $(FALSE) # --- MakeMaker staticmake section: # --- MakeMaker makeaperl section --- MAP_TARGET = perl FULLPERL = /usr/bin/perl $(MAP_TARGET) :: static $(MAKE_APERL_FILE) $(MAKE) $(USEMAKEFILE) $(MAKE_APERL_FILE) $@ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib $(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET) $(NOECHO) $(PERLRUNINST) \ Makefile.PL DIR= \ MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \ MAKEAPERL=1 NORECURS=1 CCCDLFLAGS= # --- MakeMaker test section: TEST_VERBOSE=0 TEST_TYPE=test_$(LINKTYPE) TEST_FILE = test.pl TEST_FILES = t/*.t TESTDB_SW = -d testdb :: testdb_$(LINKTYPE) test :: $(TEST_TYPE) subdirs-test subdirs-test :: $(NOECHO) $(NOOP) test_dynamic :: pure_all PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) testdb_dynamic :: pure_all PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE) test_ : test_dynamic test_static :: test_dynamic testdb_static :: testdb_dynamic # --- MakeMaker ppd section: # Creates a PPD (Perl Package Description) for a binary distribution. ppd : $(NOECHO) $(ECHO) '' > $(DISTNAME).ppd $(NOECHO) $(ECHO) ' OO API for accessing the Amazon Simple Queue ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' Simon Whitaker <sw@netcetera.org>' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) '' >> $(DISTNAME).ppd # --- MakeMaker pm_to_blib section: pm_to_blib : $(FIRST_MAKEFILE) $(TO_INST_PM) $(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', q[$(PM_FILTER)], '\''$(PERM_DIR)'\'')' -- \ lib/Amazon/SQS/Simple/Base.pm blib/lib/Amazon/SQS/Simple/Base.pm \ lib/Amazon/SQS/Simple/SendResponse.pm blib/lib/Amazon/SQS/Simple/SendResponse.pm \ lib/Amazon/SQS/Simple/Message.pm blib/lib/Amazon/SQS/Simple/Message.pm \ lib/Amazon/SQS/Simple.pm blib/lib/Amazon/SQS/Simple.pm \ lib/Amazon/SQS/Simple/Queue.pm blib/lib/Amazon/SQS/Simple/Queue.pm $(NOECHO) $(TOUCH) pm_to_blib # --- MakeMaker selfdocument section: # --- MakeMaker postamble section: # End. Amazon-SQS-Simple-2.04/Makefile.PL000644 000765 000024 00000001364 12521422301 016615 0ustar00mikestaff000000 000000 use strict; use warnings; use ExtUtils::MakeMaker; use 5.0073; # for Encode/utf8 WriteMakefile( NAME => 'Amazon::SQS::Simple', AUTHOR => 'Simon Whitaker ', VERSION_FROM => 'lib/Amazon/SQS/Simple.pm', ABSTRACT_FROM => 'lib/Amazon/SQS/Simple.pm', PL_FILES => {}, PREREQ_PM => { 'Test::More' => 0, 'Digest::HMAC_SHA1' => 0, 'Digest::SHA' => 0, 'LWP::UserAgent' => 0, 'MIME::Base64' => 0, 'URI::Escape' => 0, 'XML::Simple' => 0, }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'Amazon-SQS-Simple-*' }, ); Amazon-SQS-Simple-2.04/MANIFEST000644 000765 000024 00000001014 12521425211 015767 0ustar00mikestaff000000 000000 bin/sqs-toolkit Changes lib/Amazon/SQS/Simple.pm lib/Amazon/SQS/Simple/Base.pm lib/Amazon/SQS/Simple/Message.pm lib/Amazon/SQS/Simple/Queue.pm lib/Amazon/SQS/Simple/SendResponse.pm LICENSE Makefile Makefile.PL MANIFEST This list of files MANIFEST.SKIP META.json Module JSON meta-data (added by MakeMaker) META.yml MYMETA.json MYMETA.yml README t/00-load.t t/01-construct.t t/dev-boilerplate.t t/dev-functions.t t/dev-methods-batch.t t/dev-methods-regression-2008-01-01.t t/dev-methods.t t/dev-pod-coverage.t t/dev-pod.t Amazon-SQS-Simple-2.04/MANIFEST.SKIP000644 000765 000024 00000000014 12521425130 016533 0ustar00mikestaff000000 000000 \.svn \.git Amazon-SQS-Simple-2.04/META.json000644 000765 000024 00000002124 12521425230 016263 0ustar00mikestaff000000 000000 { "abstract" : "OO API for accessing the Amazon Simple Queue ", "author" : [ "Simon Whitaker " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.133380", "license" : [ "unknown" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Amazon-SQS-Simple", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Digest::HMAC_SHA1" : "0", "Digest::SHA" : "0", "LWP::UserAgent" : "0", "MIME::Base64" : "0", "Test::More" : "0", "URI::Escape" : "0", "XML::Simple" : "0" } } }, "release_status" : "stable", "version" : "2.04" } Amazon-SQS-Simple-2.04/META.yml000644 000765 000024 00000001162 12521425230 016114 0ustar00mikestaff000000 000000 --- abstract: 'OO API for accessing the Amazon Simple Queue ' author: - 'Simon Whitaker ' build_requires: ExtUtils::MakeMaker: 0 configure_requires: ExtUtils::MakeMaker: 0 dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.133380' license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Amazon-SQS-Simple no_index: directory: - t - inc requires: Digest::HMAC_SHA1: 0 Digest::SHA: 0 LWP::UserAgent: 0 MIME::Base64: 0 Test::More: 0 URI::Escape: 0 XML::Simple: 0 version: 2.04 Amazon-SQS-Simple-2.04/MYMETA.json000644 000765 000024 00000002174 12521425223 016540 0ustar00mikestaff000000 000000 { "abstract" : "OO API for accessing the Amazon Simple Queue ", "author" : [ "Simon Whitaker " ], "dynamic_config" : 0, "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120921, CPAN::Meta::Converter version 2.133380", "license" : [ "unknown" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Amazon-SQS-Simple", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Digest::HMAC_SHA1" : "0", "Digest::SHA" : "0", "LWP::UserAgent" : "0", "MIME::Base64" : "0", "Test::More" : "0", "URI::Escape" : "0", "XML::Simple" : "0" } } }, "release_status" : "stable", "version" : "2.04" } Amazon-SQS-Simple-2.04/MYMETA.yml000644 000765 000024 00000001232 12521425224 016363 0ustar00mikestaff000000 000000 --- abstract: 'OO API for accessing the Amazon Simple Queue ' author: - 'Simon Whitaker ' build_requires: ExtUtils::MakeMaker: 0 configure_requires: ExtUtils::MakeMaker: 0 dynamic_config: 0 generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120921, CPAN::Meta::Converter version 2.133380' license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Amazon-SQS-Simple no_index: directory: - t - inc requires: Digest::HMAC_SHA1: 0 Digest::SHA: 0 LWP::UserAgent: 0 MIME::Base64: 0 Test::More: 0 URI::Escape: 0 XML::Simple: 0 version: 2.04 Amazon-SQS-Simple-2.04/README000644 000765 000024 00000001507 12521422301 015522 0ustar00mikestaff000000 000000 Amazon-SQS-Simple INSTALLATION To install this module, run the following commands: perl Makefile.PL make make test make install SUPPORT AND DOCUMENTATION After installing, you can find documentation for this module with the perldoc command. perldoc Amazon::SQS::Simple You can also look for information at: Search CPAN http://search.cpan.org/dist/Amazon-SQS-Simple CPAN Request Tracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Amazon-SQS-Simple AnnoCPAN, annotated CPAN documentation: http://annocpan.org/dist/Amazon-SQS-Simple CPAN Ratings: http://cpanratings.perl.org/d/Amazon-SQS-Simple COPYRIGHT AND LICENCE Copyright (C) 2007 Simon Whitaker This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Amazon-SQS-Simple-2.04/t/000755 000765 000024 00000000000 12521425230 015106 5ustar00mikestaff000000 000000 Amazon-SQS-Simple-2.04/t/00-load.t000644 000765 000024 00000000247 12521422301 016426 0ustar00mikestaff000000 000000 #!perl -T use Test::More tests => 1; BEGIN { use_ok( 'Amazon::SQS::Simple' ); } diag( "Testing Amazon::SQS::Simple $Amazon::SQS::Simple::VERSION, Perl $], $^X" ); Amazon-SQS-Simple-2.04/t/01-construct.t000644 000765 000024 00000001404 12521422301 017530 0ustar00mikestaff000000 000000 #!perl -T use Test::More tests => 4; use Amazon::SQS::Simple; my $obj; eval { $obj = new Amazon::SQS::Simple(); }; ok($@, "should get a constructor exception when no AWS keys exist"); my $error = $@; chomp($error); like($error, qr/missing.*aws.*key/i, "should have a good error message (got: \"$error\")"); eval { $obj = new Amazon::SQS::Simple('fake access', 'fake secret', Version => "bogus version"); }; ok(!$@, "Giving an unrecognised version is OK"); eval { $obj = new Amazon::SQS::Simple('fake access', 'fake secret'); }; ok(!$@ && $obj->_api_version eq $Amazon::SQS::Simple::Base::DEFAULT_SQS_VERSION, "Constructor should default to the default API version if no version is given"); Amazon-SQS-Simple-2.04/t/dev-boilerplate.t000644 000765 000024 00000002330 12521422301 020343 0ustar00mikestaff000000 000000 #!perl -T use strict; use warnings; use Test::More tests => 3; sub not_in_file_ok { my ($filename, %regex) = @_; open my $fh, "<", $filename or die "couldn't open $filename for reading: $!"; my %violated; while (my $line = <$fh>) { while (my ($desc, $regex) = each %regex) { if ($line =~ $regex) { push @{$violated{$desc}||=[]}, $.; } } } if (%violated) { fail("$filename contains boilerplate text"); diag "$_ appears on lines @{$violated{$_}}" for keys %violated; } else { pass("$filename contains no boilerplate text"); } } not_in_file_ok(README => "The README is used..." => qr/The README is used/, "'version information here'" => qr/to provide version information/, ); not_in_file_ok(Changes => "placeholder date/time" => qr(Date/time) ); sub module_boilerplate_ok { my ($module) = @_; not_in_file_ok($module => 'the great new $MODULENAME' => qr/ - The great new /, 'boilerplate description' => qr/Quick summary of what the module/, 'stub function definition' => qr/function[12]/, ); } module_boilerplate_ok('lib/Amazon/SQS/Simple.pm'); Amazon-SQS-Simple-2.04/t/dev-functions.t000644 000765 000024 00000000366 12521422301 020060 0ustar00mikestaff000000 000000 #!perl -T use strict; use warnings; use Test::More tests => 2; BEGIN { use_ok('Amazon::SQS::Simple', qw( timestamp )); } my $timestamp = timestamp('0'); ok( $timestamp && $timestamp eq '1970-01-01T00:00:00Z' , 'timestamp' );Amazon-SQS-Simple-2.04/t/dev-methods-batch.t000755 000765 000024 00000004045 12521423103 020574 0ustar00mikestaff000000 000000 #!perl -T use strict; use warnings; use Test::More tests => 50; use Test::Warn; use Digest::MD5 qw(md5_hex); BEGIN { use_ok('Amazon::SQS::Simple'); } ################################################# #### Creating an Amazon::SQS::Simple object my $sqs = new Amazon::SQS::Simple( $ENV{AWS_ACCESS_KEY}, $ENV{AWS_SECRET_KEY}, Timeout => 20, # _Debug => \*STDERR, ); my $queue_name = "_test_queue_$$"; my $timeout = 123; my ($href, $responses, $ten_responses, $one_response, @received, $received); my $q = $sqs->CreateQueue($queue_name); $received = $q->ReceiveMessageBatch(); ok(!defined($received), 'ReceiveMessage called on empty queue returns undef'); my @ten_messages = ('A'..'J'); ok($responses = $q->SendMessageBatch(\@ten_messages), 'SendMessageBatch'); is(scalar(@$responses), 10, '10 response objects'); foreach my $response (@$responses){ isa_ok($response, 'Amazon::SQS::Simple::SendResponse', "SendMessage returns Amazon::SQS::Simple::SendResponse object"); is($response->VerifyReceipt, 1, 'Message receipt verified') or diag('VerifyReceipt failed'); } my @eleven_messages = ('K'..'U'); warning_is { $ten_responses = $q->SendMessageBatch(\@eleven_messages) } "Batch messaging limited to 10 messages", "SendMessageBatch: Too many messages warning"; is(scalar(@$ten_responses), 10, '10 response objects from 11 batch messages'); # list context ok(@received = $q->ReceiveMessageBatch(), 'ReceiveMessageBatch, list return of '. scalar @received .' messages'); while (my @more = $q->ReceiveMessageBatch() ){ push @received, @more; } is(scalar(@received), 20, '20 messages received'); foreach my $msg (@received){ isa_ok($msg, 'Amazon::SQS::Simple::Message', "ReceiveMessage returns Amazon::SQS::Simple::Message objects in list context"); } my @five = splice(@received, 0, 5); ok($q->DeleteMessageBatch(\@five), 'DeleteMessageBatch - five messages'); my @eleven = splice(@received, 0, 11); warning_is { $q->DeleteMessageBatch(\@eleven) } "Batch deletion limited to 10 messages", "SendMessageBatch: Too many messages warning"; $q->Delete; Amazon-SQS-Simple-2.04/t/dev-methods-regression-2008-01-01.t000644 000765 000024 00000007617 12521422301 022722 0ustar00mikestaff000000 000000 #!perl -T use strict; use warnings; use Test::More tests => 24; use Digest::MD5 qw(md5_hex); BEGIN { use_ok('Amazon::SQS::Simple'); } my $sqs = new Amazon::SQS::Simple( $ENV{AWS_ACCESS_KEY}, $ENV{AWS_SECRET_KEY}, Version => '2008-01-01' # _Debug => \*STDERR, ); eval { my $str = "$sqs"; }; ok(!$@, "Interpolating Amazon::SQS::Simple object in string context"); isa_ok($sqs, 'Amazon::SQS::Simple', "[$$] Amazon::SQS::Simple object created successfully"); my $queue_name = "_test_queue_$$"; my %messages = ( GET => "x " x 8, POST => "x " x (1024 * 4), ); my $timeout = 123; my ($href, $response); my $orig_lists = $sqs->ListQueues(); my $orig_count = 0; $orig_count = scalar @$orig_lists if defined $orig_lists; my $q = $sqs->CreateQueue($queue_name); ok( $q && $q->Endpoint() && $q->Endpoint() =~ /$queue_name$/ , "CreateQueue returned a queue (name was $queue_name)" ); eval { my $str = "$q"; }; ok(!$@, "Interpolating Amazon::SQS::Simple::Queue object in string context"); my $q2 = $sqs->GetQueue($q->Endpoint()); is_deeply($q, $q2, 'GetQueue returns the queue we just created'); eval { $q->SetAttribute('VisibilityTimeout', $timeout); }; ok(!$@, 'SetAttribute'); $response = $q->ReceiveMessage(); ok(!defined($response), 'ReceiveMessage called on empty queue returns undef'); sleep 5; my $lists = $sqs->ListQueues(); my $iteration = 1; while ((!defined($lists) or (scalar @$lists == $orig_count)) && $iteration < 60) { sleep 2; $lists = $sqs->ListQueues(); $iteration++; } ok((grep { $_->Endpoint() eq $q->Endpoint() } @$lists), 'ListQueues returns the queue we just created'); foreach my $msg_type (keys %messages) { my $msg = $messages{$msg_type}; $response = $q->SendMessage($msg); ok(UNIVERSAL::isa($response, 'Amazon::SQS::Simple::SendResponse'), "SendMessage returns Amazon::SQS::Simple::SendResponse object ($msg_type)"); eval { my $str = "$response"; }; ok(!$@, "Interpolating Amazon::SQS::Simple::SendResponse object in string context"); ok($response->MessageId, 'Got MessageId when sending message'); ok($response->MD5OfMessageBody eq md5_hex($msg), 'Got back correct MD5 checksum for message') or diag("Looking for " . md5_hex($msg) . ", got " . $response->MD5OfMessageBody); } my $received_msg = $q->ReceiveMessage(); $iteration = 1; while (!defined($received_msg) && $iteration < 4) { sleep 2; $received_msg = $q->ReceiveMessage(); $iteration++; } eval { my $str = "$received_msg"; }; ok(!$@, "Interpolating Amazon::SQS::Simple::Message object in string context"); ok(UNIVERSAL::isa($received_msg, 'Amazon::SQS::Simple::Message'), 'ReceiveMessage returns Amazon::SQS::Simple::Message object'); ok((grep {$_ eq $received_msg->MessageBody} values %messages), 'ReceiveMessage returned one of the messages we wrote'); # Have a few goes at GetAttributes, sometimes takes a while for SetAttributes # method to be processed $iteration = 0; do { sleep 10 if $iteration++; $href = $q->GetAttributes(); } while ((!$href->{VisibilityTimeout} || $href->{VisibilityTimeout} != $timeout) && $iteration < 4); ok( $href->{VisibilityTimeout} && $href->{VisibilityTimeout} == $timeout , "GetAttributes" ) or diag("Failed after $iteration attempts, sent $timeout, got back " . ($href->{VisibilityTimeout} ? $href->{VisibilityTimeout} : 'undef')); for (1..10) { $q->SendMessage($_); } my @messages = $q->ReceiveMessage(MaxNumberOfMessages => 10); ok(UNIVERSAL::isa($messages[0], 'Amazon::SQS::Simple::Message') , 'Calling ReceiveMessage with MaxNumberOfMessages returns array of Amazon::SQS::Simple::Message objects'); # 2007-05-01 uses the MessageId, 2008-01-01 uses the ReceiptHandle eval { $q->DeleteMessage($received_msg->ReceiptHandle); }; ok(!$@, 'DeleteMessage on ReceiptHandle of received message') or diag($@); eval { $q->Delete(); }; ok(!$@, 'Delete on non-empty queue') or diag($@); Amazon-SQS-Simple-2.04/t/dev-methods.t000644 000765 000024 00000023225 12521423103 017513 0ustar00mikestaff000000 000000 #!perl -T use strict; use warnings; use Test::More tests => 43; use Digest::MD5 qw(md5_hex); use Encode; BEGIN { use_ok('Amazon::SQS::Simple'); } ################################################# #### Creating an Amazon::SQS::Simple object my $sqs = new Amazon::SQS::Simple( $ENV{AWS_ACCESS_KEY}, $ENV{AWS_SECRET_KEY}, Timeout => 20, # _Debug => \*STDERR, ); eval { my $str = "$sqs"; }; ok(!$@, "Interpolating Amazon::SQS::Simple object in string context"); ok($sqs->_api_version eq $Amazon::SQS::Simple::Base::DEFAULT_SQS_VERSION, "Constructor should default to the default API version"); isa_ok($sqs, 'Amazon::SQS::Simple', "[$$] Amazon::SQS::Simple object created successfully"); my $queue_name = "_test_queue_$$"; my %messages = ( GET => "x " x 8, POST => "x " x (1024 * 4), ); my $timeout = 123; my ($href, $response); ################################################# #### Creating, retrieving and listing queues my $orig_lists = $sqs->ListQueues(); my $orig_count = 0; $orig_count = scalar @$orig_lists if defined $orig_lists; my $q = $sqs->CreateQueue($queue_name); ok( $q && $q->Endpoint() && $q->Endpoint() =~ /$queue_name$/ , "CreateQueue returned a queue (name was $queue_name)" ); eval { my $str = "$q"; }; ok(!$@, "Interpolating Amazon::SQS::Simple::Queue object in string context"); my $q2 = $sqs->GetQueue($q->Endpoint()); is_deeply($q, $q2, 'GetQueue returns the queue we just created'); sleep 5; my $lists = $sqs->ListQueues(); my $iteration = 1; while ((!defined($lists) or (scalar @$lists == $orig_count)) && $iteration < 60) { sleep 2; $lists = $sqs->ListQueues(); $iteration++; } ok((grep { $_->Endpoint() eq $q->Endpoint() } @$lists), 'ListQueues returns the queue we just created'); ################################################# #### Setting and getting list attributes eval { $q->SetAttribute('VisibilityTimeout', $timeout); }; ok(!$@, 'SetAttribute'); # Have a few goes at GetAttributes, sometimes takes a while for SetAttributes # method to be processed $iteration = 0; do { sleep 10 if $iteration++; $href = $q->GetAttributes(); } while ((!$href->{VisibilityTimeout} || $href->{VisibilityTimeout} != $timeout) && $iteration < 4); ok( $href->{VisibilityTimeout} && $href->{VisibilityTimeout} == $timeout , "GetAttributes" ) or diag("Failed after $iteration attempts, sent $timeout, got back " . ($href->{VisibilityTimeout} ? $href->{VisibilityTimeout} : 'undef')); ################################################# #### Sending and receiving messages $response = $q->ReceiveMessage(); ok(!defined($response), 'ReceiveMessage called on empty queue returns undef'); foreach my $msg_type (keys %messages) { my $msg = $messages{$msg_type}; $response = $q->SendMessage($msg); isa_ok($response, 'Amazon::SQS::Simple::SendResponse', "SendMessage returns Amazon::SQS::Simple::SendResponse object ($msg_type)"); eval { my $str = "$response"; }; ok(!$@, "Interpolating Amazon::SQS::Simple::SendResponse object in string context"); ok($response->MessageId, 'Got MessageId when sending message'); ok($response->MD5OfMessageBody eq md5_hex(Encode::encode_utf8($msg)), 'Got back correct MD5 checksum for message') or diag("Looking for " . md5_hex(Encode::encode_utf8($msg)) . ", got " . $response->MD5OfMessageBody); } my $received_msg = $q->ReceiveMessage(); $iteration = 1; while (!defined($received_msg) && $iteration < 4) { sleep 2; $received_msg = $q->ReceiveMessage(); $iteration++; } eval { my $str = "$received_msg"; }; ok(!$@, "Interpolating Amazon::SQS::Simple::Message object in string context"); isa_ok($received_msg, 'Amazon::SQS::Simple::Message', 'ReceiveMessage returns Amazon::SQS::Simple::Message object'); ok((grep {$_ eq $received_msg->MessageBody} values %messages), 'ReceiveMessage returned one of the messages we wrote'); foreach my $international ( # may fail if "use encoding 'utf8'" or other trickery is in effect Encode::decode("iso-8859-1", "L\xE1szl\xF3 S\xF3lyom"), # certain to work Encode::decode("iso-8859-1", pack "C*", qw/76 225 115 122 108 243 32 83 243 108 121 111 109/), # utf8 data which is not marked as such is tricky Encode::decode('utf8', "L\xC3\xA1szl\xC3\xB3 S\xC3\xB3lyom"), Encode::decode("iso-8859-15", "\xBCUF"), ) { my $response = eval {$q->SendMessage($international)}; ok(!$@ && UNIVERSAL::isa($response, 'Amazon::SQS::Simple::SendResponse'), "SendMessage works with UTF-8 messages"); } SKIP: { skip '\N{U+xxxx} escapes require Perl 5.12 or above', 2 unless $] >= 5.012; foreach my $international ( "I\N{U+00f1}t\N{U+00eb}rn\N{U+00e2}ti\N{U+00f4}n\N{U+00e0}liz\N{U+00e6}ti\N{U+00f8}n", "\N{U+01cf}\N{U+00f1}\N{U+04ad}\N{U+00eb}\N{U+0550}\N{U+014b}\N{U+00e2}\N{U+0165}\N{U+1e2f}\N{U+1e4f}\N{U+1e4b}\N{U+03b1}\N{U+0142}\N{U+0457}\N{U+017c}\N{U+00e6}\N{U+0167}\N{U+00ed}\N{U+00f8}\N{U+1e45}", ) { my $response = eval {$q->SendMessage($international)}; ok(!$@ && UNIVERSAL::isa($response, 'Amazon::SQS::Simple::SendResponse'), "SendMessage works with UTF-8 messages"); } }; foreach my $international ( "emoji |\N{U+1f320}|", # shooting star "cjk ideograph |\N{U+22222}|", ) { my $response = eval {$q->SendMessage($international)}; ok(!$@ && UNIVERSAL::isa($response, 'Amazon::SQS::Simple::SendResponse'), "SendMessage works with UTF8 messages outside the BMP"); } for (1..10) { $q->SendMessage($_); } my @messages = $q->ReceiveMessage(MaxNumberOfMessages => 10); isa_ok($messages[0], 'Amazon::SQS::Simple::Message', 'Calling ReceiveMessage with MaxNumberOfMessages returns array of Amazon::SQS::Simple::Message objects'); ################################################# #### Changing message visibility eval { $q->ChangeMessageVisibility($received_msg->ReceiptHandle, 120); }; ok(!$@, 'ChangeMessageVisibility on ReceiptHandle of received message') or diag($@); eval { $q->ChangeMessageVisibility($received_msg->ReceiptHandle); }; ok($@, 'ChangeMessageVisibility with no timeout is fatal'); ################################################# #### Adding and removing permissions SKIP: { # these environment variables may hold information about a separate account through which to test permissions skip "ALT_AWS_ACCESS_KEY environment variable is not defined", 6 unless exists $ENV{ALT_AWS_ACCESS_KEY}; skip "ALT_AWS_SECRET_KEY environment variable is not defined", 6 unless exists $ENV{ALT_AWS_SECRET_KEY}; skip "ALT_AWS_ACCOUNT_NUM environment variable is not defined", 6 unless exists $ENV{ALT_AWS_ACCOUNT_NUM}; my $alt_sqs = new Amazon::SQS::Simple($ENV{ALT_AWS_ACCESS_KEY}, $ENV{ALT_AWS_SECRET_KEY}); my $alt_q = $alt_sqs->GetQueue($q->Endpoint); eval { my $alt_msg = $alt_q->ReceiveMessage }; ok($@, "Attempting to pop queue from different user fails"); my $alt_aws_account_num = $ENV{ALT_AWS_ACCOUNT_NUM}; # this number can be found in the endpoint eval { $q->AddPermission('SimonTest', {$alt_aws_account_num => 'ReceiveMessage'})}; ok(!$@, "AddPermission for account $alt_aws_account_num") or diag($@); # wait until we've seen the policy appear in the queue attributes twice in a row my $policy_applied = 0; my $tries = 0; while ($policy_applied < 2 && $tries < 10) { my $attr = $q->GetAttributes; if (exists $attr->{Policy}) { $policy_applied++ } else { $policy_applied = 0 } sleep(5) if $policy_applied < 2 && $tries < 10; } eval { my $alt_msg = $alt_q->ReceiveMessage }; ok(!$@, "Attempting to pop queue from user with ReceiveMessage permissions succeeds") or diag($@); eval { $q->AddPermission('SimonTest2', {$alt_aws_account_num => 'FooBar'})}; ok($@, "AddPermission for account $alt_aws_account_num with bad ActionName is fatal"); eval { $q->RemovePermission('SimonTest')}; ok(!$@, "RemovePermission for account $alt_aws_account_num") or diag($@); my $policy_removed = 0; $tries = 0; while ($policy_removed < 2 && $tries < 10) { my $attr = $q->GetAttributes; if ($attr->{Policy} && $attr->{Policy} !~ /$alt_aws_account_num/) { $policy_removed++; } else { $policy_removed = 0; } sleep(5) if $policy_removed < 2 && $tries < 10; } eval { my $alt_msg = $alt_q->ReceiveMessage }; ok($@, "Attempting to pop queue from different user once permissions revoked fails"); } ################################################# #### Deleting messages eval { $q->DeleteMessage($received_msg->ReceiptHandle); }; ok(!$@, 'DeleteMessage on ReceiptHandle of received message') or diag($@); ################################################# #### Deleting a queue eval { $q->Delete(); }; ok(!$@, 'Delete on non-empty queue') or diag($@); ################################################# #### Version 1 signatures $sqs = new Amazon::SQS::Simple( $ENV{AWS_ACCESS_KEY}, $ENV{AWS_SECRET_KEY}, Timeout => 20, SignatureVersion => 1, # _Debug => \*STDERR, ); isa_ok($sqs, 'Amazon::SQS::Simple', "[$$] Amazon::SQS::Simple object created successfully with SignatureVersion 1"); $queue_name = "_test_queue_v1_$$"; $q = $sqs->CreateQueue($queue_name); ok( $q && $q->Endpoint() && $q->Endpoint() =~ m{/$queue_name$} , "CreateQueue returned a queue with SignatureVersion 1 (name was $queue_name)" ); $q->Delete; Amazon-SQS-Simple-2.04/t/dev-pod-coverage.t000644 000765 000024 00000001033 12521422301 020413 0ustar00mikestaff000000 000000 #!perl -T use Test::More; eval "use Test::Pod::Coverage 1.04"; if ($@) { plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage"; } else { plan tests => 4; } # ignore subs starting with an underscore my $trustme = { trustme => [ qr/^_/ ] }; pod_coverage_ok('Amazon::SQS::Simple', $trustme); pod_coverage_ok('Amazon::SQS::Simple::Message', {trustme => [ qr/^new$/ ]}); pod_coverage_ok('Amazon::SQS::Simple::Queue', $trustme); pod_coverage_ok('Amazon::SQS::Simple::SendResponse', {trustme => [ qr/^new$/ ]}); Amazon-SQS-Simple-2.04/t/dev-pod.t000644 000765 000024 00000000214 12521422301 016622 0ustar00mikestaff000000 000000 #!perl -T use Test::More; eval "use Test::Pod 1.14"; plan skip_all => "Test::Pod 1.14 required for testing POD" if $@; all_pod_files_ok(); Amazon-SQS-Simple-2.04/lib/Amazon/000755 000765 000024 00000000000 12521425230 016636 5ustar00mikestaff000000 000000 Amazon-SQS-Simple-2.04/lib/Amazon/SQS/000755 000765 000024 00000000000 12521425230 017304 5ustar00mikestaff000000 000000 Amazon-SQS-Simple-2.04/lib/Amazon/SQS/Simple/000755 000765 000024 00000000000 12521425230 020535 5ustar00mikestaff000000 000000 Amazon-SQS-Simple-2.04/lib/Amazon/SQS/Simple.pm000644 000765 000024 00000015326 12521423115 021102 0ustar00mikestaff000000 000000 package Amazon::SQS::Simple; use strict; use warnings; use Carp qw( croak ); use Amazon::SQS::Simple::Base; # for constants use Amazon::SQS::Simple::Queue; use base qw(Exporter Amazon::SQS::Simple::Base); our $VERSION = '2.04'; our @EXPORT_OK = qw( timestamp ); sub GetQueue { my ($self, $queue_endpoint) = @_; if ($queue_endpoint =~ /^arn:aws:sqs/) { my ($host, $user, $queue); (undef, undef, undef, $host, $user, $queue) = split(/:/, $queue_endpoint); $queue_endpoint = "https://sqs.$host.amazonaws.com/$user/$queue"; } return Amazon::SQS::Simple::Queue->new( $self->{AWSAccessKeyId}, #AWSAccessKeyId and SecretKey are the first two arguments to Amazon::SQS::Simple::Base->new $self->{SecretKey}, %$self, Endpoint => $queue_endpoint, ); } sub CreateQueue { my ($self, $queue_name, %params) = @_; $params{Action} = 'CreateQueue'; $params{QueueName} = $queue_name; my $href = $self->_dispatch(\%params); if ($href->{CreateQueueResult}{QueueUrl}) { return Amazon::SQS::Simple::Queue->new( $self->{AWSAccessKeyId}, #AWSAccessKeyId and SecretKey are the first two arguments to Amazon::SQS::Simple::Base->new $self->{SecretKey}, %$self, Endpoint => $href->{CreateQueueResult}{QueueUrl}, ); } } sub ListQueues { my ($self, %params) = @_; $params{Action} = 'ListQueues'; my $href = $self->_dispatch(\%params, ['QueueUrl']); # default to the current version if ($href->{ListQueuesResult}{QueueUrl}) { my @result = map { Amazon::SQS::Simple::Queue->new( $self->{AWSAccessKeyId}, #AWSAccessKeyId and SecretKey are the first two arguments to Amazon::SQS::Simple::Base->new $self->{SecretKey}, %$self, Endpoint => $_, ) } @{$href->{ListQueuesResult}{QueueUrl}}; return \@result; } else { return undef; } } sub timestamp { return Amazon::SQS::Simple::Base::_timestamp(@_); } 1; __END__ =head1 NAME Amazon::SQS::Simple - OO API for accessing the Amazon Simple Queue Service =head1 SYNOPSIS use Amazon::SQS::Simple; my $access_key = 'foo'; # Your AWS Access Key ID my $secret_key = 'bar'; # Your AWS Secret Key # Create an SQS object my $sqs = new Amazon::SQS::Simple($access_key, $secret_key); # Create a new queue my $q = $sqs->CreateQueue('queue_name'); # Send a message my $response = $q->SendMessage('Hello world!'); # Send multiple messages my @responses = $q->SendMessageBatch(['Hello world', 'Farewell cruel world']); # Retrieve a message my $msg = $q->ReceiveMessage(); print $msg->MessageBody() # Hello world! # Delete the message $q->DeleteMessage($msg->ReceiptHandle()); # or $q->DeleteMessage($msg); # Delete the queue $q->Delete(); =head1 INTRODUCTION Amazon::SQS::Simple is an OO API for the Amazon Simple Queue Service. =head1 IMPORTANT This version of Amazon::SQS::Simple defaults to work against version 2009-02-01 of the SQS API. Earlier API versions may or may not work. =head1 CONSTRUCTOR =over 2 =item new($access_key, $secret_key, [%opts]) Constructs a new Amazon::SQS::Simple object C<$access_key> is your Amazon Web Services access key. C<$secret_key> is your Amazon Web Services secret key. If you don't have either of these credentials, visit L. Options for new: =over 4 =item Timeout => SECONDS Set the HTTP user agent's timeout (default is 180 seconds) =item Version => VERSION_STRING Specifies the SQS API version you wish to use. E.g.: my $sqs = new Amazon::SQS::Simple($access_key, $secret_key, Version => '2008-01-01'); =back =back =head1 METHODS =over 2 =item GetQueue($queue_endpoint) Gets the queue with the given endpoint. Returns a C object. (See L for details.) =item CreateQueue($queue_name, [%opts]) Creates a new queue with the given name. Returns a C object. (See L for details.) Options for CreateQueue: =over 4 =item DefaultVisibilityTimeout => SECONDS Set the default visibility timeout for this queue =back =item ListQueues([%opts]) Gets a list of all your current queues. Returns an array of C objects. (See L for details.) Options for ListQueues: =over 4 =item QueueNamePrefix => STRING Only those queues whose name begins with the specified string are returned. =back =back =head1 FUNCTIONS No functions are exported by default; if you want to use them, export them in your use line: use Amazon::SQS::Simple qw( timestamp ); =over 2 =item timestamp($seconds) Takes a time in seconds since the epoch and returns a formatted timestamp suitable for using in a Timestamp or Expires optional method parameter. =back =head1 STANDARD OPTIONS The following options can be supplied with any of the listed methods. =over 2 =item AWSAccessKeyId => STRING The AWS Access Key Id to use with the method call. If not provided, Amazon::SQS::Simple uses the value passed to the constructor. =item SecretKey => STRING The Secret Key to use with the method call. If not provided, Amazon::SQS::Simple uses the value passed to the constructor. =item Timestamp => TIMESTAMP All methods are automatically given a timestamp of the time at which they are called, but you can override this value if you need to. The value for this key should be a timestamp as returned by the Amazon::SQS::Simple::timestamp() function. You generally do not need to supply this option. =item Expires => TIMESTAMP All methods are automatically given a timestamp of the time at which they are called. You can alternatively set an expiry time by providing an Expires option. The value for this key should be a timestamp as returned by the C function. You generally do not need to supply this option. =back =head1 ACKNOWLEDGEMENTS Bill Alford wrote the code to support basic functionality of older API versions in release 0.9. James Neal provided the proxy support code in release 2.0 Roland Walker provided support for the newer signature version in release 2.0 Chris Jones provied the batch message code in release 2.0 Glenn Fowler (among others) provided a patch for the subtle access bug surfaved by hash key randomisation, as well as some test cleanup code in 2.04 =head1 AUTHOR Copyright 2007-2008 Simon Whitaker Eswhitaker@cpan.orgE Copyright 2013 Mike (no relation) Whitaker Epenfold@cpan.orgE This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut Amazon-SQS-Simple-2.04/lib/Amazon/SQS/Simple/Base.pm000755 000765 000024 00000026372 12521422301 021756 0ustar00mikestaff000000 000000 package Amazon::SQS::Simple::Base; use strict; use warnings; use Carp qw( croak carp ); use Digest::HMAC_SHA1; use Digest::SHA qw(hmac_sha256 sha256); use LWP::UserAgent; use MIME::Base64; use URI::Escape; use XML::Simple; use Encode qw(encode); use base qw(Exporter); use constant { SQS_VERSION_2012_11_05 => '2012-11-05', SQS_VERSION_2009_02_01 => '2009-02-01', SQS_VERSION_2008_01_01 => '2008-01-01', BASE_ENDPOINT => 'http://queue.amazonaws.com', DEF_MAX_GET_MSG_SIZE => 4096, # Messages larger than this size will use a POST request. }; our $DEFAULT_SQS_VERSION = SQS_VERSION_2012_11_05; our @EXPORT = qw(SQS_VERSION_2012_11_05 SQS_VERSION_2009_02_01 SQS_VERSION_2008_01_01); our $URI_SAFE_CHARACTERS = '^A-Za-z0-9-_.~'; # defined by AWS, same as URI::Escape defaults sub new { my $class = shift; my $access_key = shift; my $secret_key = shift; my $self = { AWSAccessKeyId => $access_key, SecretKey => $secret_key, Endpoint => +BASE_ENDPOINT, SignatureVersion => 2, Version => $DEFAULT_SQS_VERSION, @_, }; if (!$self->{AWSAccessKeyId} || !$self->{SecretKey}) { croak "Missing AWSAccessKey or SecretKey"; } # validate the Version, warn if it's not one we recognise my @valid_versions = ( SQS_VERSION_2012_11_05, SQS_VERSION_2008_01_01, SQS_VERSION_2009_02_01 ); if (!grep {$self->{Version} eq $_} @valid_versions) { carp "Warning: " . $self->{Version} . " might not be a valid version. Recognised versions are " . join(', ', @valid_versions); } $self = bless($self, $class); $self->_debug_log("Version is set to $self->{Version}"); return $self; } sub _api_version { my $self = shift; return $self->{Version}; } sub _dispatch { my $self = shift; my $params = shift || {}; my $force_array = shift || []; my $ua = LWP::UserAgent->new(); my $url = $self->{Endpoint}; my $response; my $post_body; my $post_request = 0; if ($self->{Timeout}) { $ua->timeout($self->{Timeout}); } $ua->env_proxy; $params = { AWSAccessKeyId => $self->{AWSAccessKeyId}, Version => $self->{Version}, %$params }; if (!$params->{Timestamp} && !$params->{Expires}) { $params->{Timestamp} = _timestamp(); } if ($params->{MessageBody} && length($params->{MessageBody}) > $self->_max_get_msg_size) { $post_request = 1; } my ($query, @auth_headers) = $self->_get_signed_query($params, $post_request); $self->_debug_log($query); my $try; foreach $try (1..3) { if ($post_request) { $response = $ua->post( $url, 'Content-Type' => 'application/x-www-form-urlencoded;charset=utf-8', 'Content' => $query, @auth_headers, ); } else { $response = $ua->get("$url/?$query", "Content-Type" => "text/plain;charset=utf-8", @auth_headers); } # $response isa HTTP::Response if ($response->is_success) { $self->_debug_log($response->content); my $href = XMLin($response->content, ForceArray => $force_array, KeyAttr => {}); return $href; } # advice from internal AWS support - most client libraries try 3 times in the face # of 500 errors, so ours should too next if ($response->code == 500); } # if we fall out of the loop, then we have either a non-500 error or a persistent 500. my $msg; eval { my $href = XMLin($response->content); $msg = $href->{Error}{Message}; }; my $error = "ERROR [try $try]: On calling $params->{Action}: " . $response->status_line; $error .= " ($msg)" if $msg; croak $error; } sub _get_or_post { my ($self, $params) = @_; my $msg_size = 0; # a single message if ($params->{MessageBody}) { $msg_size = length($params->{MessageBody}); } # a batch message elsif ($params->{"SendMessageBatchRequestEntry.1.MessageBody"}) { foreach my $i (1..10){ last unless $msg_size += length($params->{"SendMessageBatchRequestEntry.$i.MessageBody"}); } } return $msg_size > $self->_max_get_msg_size ? 1 : 0; } sub _debug_log { my ($self, $msg) = @_; return unless $self->{_Debug}; chomp($msg); print {$self->{_Debug}} $msg . "\n\n"; } sub _get_signed_query { my ($self, $params, $post_request) = @_; my $version = $params->{SignatureVersion}; $version = $self->{SignatureVersion} unless defined $version; my @auth_headers; if ($version == 0 and defined $version) { $params = $self->_sign_query_v0($params); } elsif ($version == 1) { $params = $self->_sign_query_v1($params); } elsif ($version == 2) { $params = $self->_sign_query_v2($params, $post_request); } elsif ($version == 3) { ($params, @auth_headers) = $self->_sign_query_v3($params, $post_request); } else { croak "unrecognized SignatureVersion: $version"; } $params = $self->_escape_params($params); my $query = join('&', map { $_ . '=' . $params->{$_} } keys %$params); return ($query, @auth_headers); } sub _sign_query_v0 { my ($self, $params) = @_; carp "Signature version 0 is deprecated"; my $to_sign = $params->{Action} . $params->{Timestamp}; $params->{SignatureVersion} = 0; my $hmac = Digest::HMAC_SHA1->new($self->{SecretKey})->add($to_sign); $params->{Signature} = encode_base64($hmac->digest, ''); return $params; } sub _sign_query_v1 { my ($self, $params) = @_; my $to_sign = ''; $params->{SignatureVersion} = 1; for my $key( sort { uc $a cmp uc $b } keys %$params ) { if (defined $params->{$key}) { $to_sign = $to_sign . $key . $params->{$key}; } } my $hmac = Digest::HMAC_SHA1->new($self->{SecretKey})->add($to_sign); $params->{Signature} = encode_base64($hmac->digest, ''); return $params; } sub _sign_query_v2 { my ($self, $params, $post_request) = @_; $params->{SignatureVersion} = 2; $params->{SignatureMethod} = 'HmacSHA256'; my $to_sign; for my $key( sort keys %$params ) { $to_sign .= '&' if $to_sign; my $key_octets = encode('utf-8-strict', $key); my $value_octets = encode('utf-8-strict', $params->{$key}); $to_sign .= uri_escape($key_octets, $URI_SAFE_CHARACTERS) . '=' . uri_escape($value_octets, $URI_SAFE_CHARACTERS); } my $verb = "GET"; $verb = "POST" if $post_request; my $host = lc URI->new($self->{Endpoint})->host; my $path = '/'; if ($self->{Endpoint} =~ m{^https?://[^/]*(/.*)$}) { $path = "$1"; $path .= '/' unless $post_request; # why is this not in the spec? } $to_sign = "$verb\n$host\n$path\n$to_sign"; $params->{Signature} = encode_base64(hmac_sha256($to_sign, $self->{SecretKey}),''); return $params; } sub _sign_query_v3 { croak "Signature version 3 is not yet supported"; # this is an untested draft based on V3 signatures in SES # SQS apparently does not yet support this # my ($self, $params, $post_request) = @_; # # my @auth_headers; # require Date::Format; # my $date = Date::Format::time2str('%a, %d %b %Y %X %z', time() + 5); # or must this be GM time? # # if ($self->{Endpoint} =~ m{^https://}) { # my $to_sign = $date; # my $signature = encode_base64(hmac_sha256($to_sign, $self->{SecretKey}),''); # @auth_headers = ('Date', $date, # 'X-Amzn-Authorization', "AWS3-HTTPS AWSAccessKeyId=$self->{AWSAccessKeyId},Algorithm=HmacSHA256,Signature=$signature"); # } else { # my $query; # for my $key ( sort keys %$params ) { # $query .= '&' if $query; # my $key_octets = encode('utf-8-strict', $key); # my $value_octets = encode('utf-8-strict', $params->{$key}); # $query .= uri_escape($key_octets, $URI_SAFE_CHARACTERS) . '=' . uri_escape($value_octets, $URI_SAFE_CHARACTERS); # } # my $verb = "GET"; # $verb = "POST" if $post_request; # my $host = lc URI->new($self->{Endpoint})->host; # my $path = '/'; # if ($self->{Endpoint} =~ m{^https?://[^/]*(/.*)$}) { # $path = "$1"; # $path .= '/' unless $post_request; # why is this not in the spec? # } # my $to_sign = "$verb\n$path\n$query\nhost:$host\ndate:$date\n"; # my $signature = encode_base64(hmac_sha256(sha256($to_sign), $self->{SecretKey}),''); # yes, it hashes twice in the reference code # @auth_headers = ('Date', $date, # 'Host', $host, # 'X-Amzn-Authorization', "AWS3 AWSAccessKeyId=$self->{AWSAccessKeyId},Algorithm=HmacSHA256,Signature=$signature,SignedHeaders=Date;Host'"); # } # # return $params, @auth_headers; } sub _escape_params { my ($self, $params) = @_; # Need to escape + characters in signature # see http://docs.amazonwebservices.com/AWSSimpleQueueService/2006-04-01/Query_QueryAuth.html # Likewise, need to escape + characters in ReceiptHandle # Many characters are possible in MessageBody: # #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] # probably should encode all keys and values for consistency and future-proofing my $to_escape = qr{^(?:Signature|MessageBody|ReceiptHandle)|\.\d+\.(?:MessageBody|ReceiptHandle)$}; foreach my $key (keys %$params) { next unless $key =~ m/$to_escape/; next unless exists $params->{$key}; my $octets = encode('utf-8-strict', $params->{$key}); $params->{$key} = uri_escape($octets, $URI_SAFE_CHARACTERS); } return $params; } sub _escape_param { my $params = shift; my $single = shift; my $multi_n = shift; if ($params->{$single}){ $params->{$single} = uri_escape($params->{$single}); } else { foreach my $i (1..10){ my $multi = $multi_n; $multi =~ s/\.n\./\.$i\./; if ($params->{$multi}){ $params->{$multi} = uri_escape($params->{$multi}); } else { last; } } } } sub _max_get_msg_size { my $self = shift; # a user-defined cut-off if (defined $self->{MAX_GET_MSG_SIZE}){ return $self->{MAX_GET_MSG_SIZE}; } # the default cut-off else { return DEF_MAX_GET_MSG_SIZE; } } sub _timestamp { my $t = shift; if (!defined $t) { $t = time; } my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($t); return sprintf("%4i-%02i-%02iT%02i:%02i:%02iZ", ($year + 1900), ($mon + 1), $mday, $hour, $min, $sec ); } 1; __END__ =head1 NAME Amazon::SQS::Simple::Base - No user-serviceable parts included =head1 AUTHOR Copyright 2007-2008 Simon Whitaker Eswhitaker@cpan.orgE Copyright 2013 Mike (no relation) Whitaker Epenfold@cpan.orgE This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut Amazon-SQS-Simple-2.04/lib/Amazon/SQS/Simple/Message.pm000644 000765 000024 00000002743 12521422301 022461 0ustar00mikestaff000000 000000 package Amazon::SQS::Simple::Message; use strict; use warnings; use Amazon::SQS::Simple::Base; # for constants sub new { my $class = shift; my $msg = shift; my $version = shift || $Amazon::SQS::Simple::Base::DEFAULT_SQS_VERSION; $msg->{Version} = $version; return bless ($msg, $class); } sub MessageBody { my $self = shift; return $self->{Body}; } sub MD5OfBody { my $self = shift; return $self->{MD5OfBody}; } sub MessageId { my $self = shift; return $self->{MessageId}; } sub ReceiptHandle { my $self = shift; return $self->{ReceiptHandle}; } 1; __END__ =head1 NAME Amazon::SQS::Simple::Message - OO API for representing messages from the Amazon Simple Queue Service. =head1 INTRODUCTION Don't instantiate this class directly. Objects of this class are returned by various methods in C. See L for more details. =head1 METHODS =over 2 =item B Get the message body. =item B Get the message unique identifier =item B Get the MD5 checksum of the message body =item B Get the receipt handle for the message (used as an argument to DeleteMessage) =back =head1 AUTHOR Copyright 2007-2008 Simon Whitaker Eswhitaker@cpan.orgE Copyright 2013 Mike (no relation) Whitaker Epenfold@cpan.orgE This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut Amazon-SQS-Simple-2.04/lib/Amazon/SQS/Simple/Queue.pm000755 000765 000024 00000030211 12521422301 022153 0ustar00mikestaff000000 000000 package Amazon::SQS::Simple::Queue; use strict; use warnings; use Amazon::SQS::Simple::Message; use Amazon::SQS::Simple::SendResponse; use Carp qw( croak carp ); use base 'Amazon::SQS::Simple::Base'; use Amazon::SQS::Simple::Base; # for constants use overload '""' => \&_to_string; sub Endpoint { my $self = shift; return $self->{Endpoint}; } sub Delete { my $self = shift; my $params = { Action => 'DeleteQueue' }; my $href = $self->_dispatch($params); } sub SendMessage { my ($self, $message, %params) = @_; $params{Action} = 'SendMessage'; $params{MessageBody} = $message; my $href = $self->_dispatch(\%params); # default to most recent version return new Amazon::SQS::Simple::SendResponse( $href->{SendMessageResult}, $message ); } sub SendMessageBatch { my ($self, $messages, %params) = @_; $params{Action} = 'SendMessageBatch'; if (ref($messages) eq 'ARRAY'){ my %messages; my @IDs = map { "msg_$_" } (1..scalar(@$messages)); @messages{@IDs} = @$messages; $messages = \%messages; } my $i=0; while (my ($id, $msg) = each %$messages){ if ($i==10){ warn "Batch messaging limited to 10 messages"; last; } $i++; $params{"SendMessageBatchRequestEntry.$i.Id"} = $id; $params{"SendMessageBatchRequestEntry.$i.MessageBody"} = $msg; } my $href = $self->_dispatch(\%params, [qw/SendMessageBatchResultEntry/]); my @responses = (); # default to most recent version for (@{$href->{SendMessageBatchResult}{SendMessageBatchResultEntry}}) { push @responses, new Amazon::SQS::Simple::SendResponse($_, $messages->{$_->{Id}}); } if (wantarray){ return @responses; } else { return \@responses; } } sub ReceiveMessage { my ($self, %params) = @_; $params{Action} = 'ReceiveMessage'; my $href = $self->_dispatch(\%params, [qw(Message)]); my @messages = (); # default to most recent version if (defined $href->{ReceiveMessageResult}{Message}) { foreach (@{$href->{ReceiveMessageResult}{Message}}) { push @messages, new Amazon::SQS::Simple::Message( $_, $self->_api_version() ); } } if (wantarray) { return @messages; } elsif (@messages) { return $messages[0]; } else { return undef; } } sub ReceiveMessageBatch { my ($self, %params) = @_; $params{MaxNumberOfMessages} = 10; $self->ReceiveMessage(%params); } sub DeleteMessage { my ($self, $message, %params) = @_; # to be consistent with DeleteMessageBatch, this will now accept a message object my $receipt_handle; if (ref($message) && $message->isa('Amazon::SQS::Simple::Message')){ $receipt_handle = $message->ReceiptHandle; } # for backward compatibility, we will still cope with a receipt handle else { $receipt_handle = $message; } $params{Action} = 'DeleteMessage'; $params{ReceiptHandle} = $receipt_handle; my $href = $self->_dispatch(\%params); } sub DeleteMessageBatch { my ($self, $messages, %params) = @_; return unless @$messages; $params{Action} = 'DeleteMessageBatch'; my $i=0; foreach my $msg (@$messages){ $i++; if ($i>10){ warn "Batch deletion limited to 10 messages"; last; } $params{"DeleteMessageBatchRequestEntry.$i.Id"} = $msg->MessageId; $params{"DeleteMessageBatchRequestEntry.$i.ReceiptHandle"} = $msg->ReceiptHandle; } my $href = $self->_dispatch(\%params); } sub ChangeMessageVisibility { my ($self, $receipt_handle, $timeout, %params) = @_; if ($self->_api_version eq SQS_VERSION_2008_01_01) { carp "ChangeMessageVisibility not supported in this API version"; } else { if (!defined($timeout) || $timeout =~ /\D/ || $timeout < 0 || $timeout > 43200) { croak "timeout must be specified and in range 0..43200"; } $params{Action} = 'ChangeMessageVisibility'; $params{ReceiptHandle} = $receipt_handle; $params{VisibilityTimeout} = $timeout; my $href = $self->_dispatch(\%params); } } our %valid_permission_actions = map { $_ => 1 } qw(* SendMessage ReceiveMessage DeleteMessage ChangeMessageVisibility GetQueueAttributes); sub AddPermission { my ($self, $label, $account_actions, %params) = @_; if ($self->_api_version eq SQS_VERSION_2008_01_01) { carp "AddPermission not supported in this API version"; } else { $params{Action} = 'AddPermission'; $params{Label} = $label; my $i = 1; foreach my $account_id (keys %$account_actions) { $account_id =~ /^\d{12}$/ or croak "Account IDs passed to AddPermission should be 12 digit AWS account numbers, no hyphens"; my $actions = $account_actions->{$account_id}; my @actions; if (UNIVERSAL::isa($actions, 'ARRAY')) { @actions = @$actions; } else { @actions = ($actions); } foreach my $action (@actions) { exists $valid_permission_actions{$action} or croak "Action passed to AddPermission must be one of " . join(', ', sort keys %valid_permission_actions); $params{"AWSAccountId.$i"} = $account_id; $params{"ActionName.$i"} = $action; $i++; } } my $href = $self->_dispatch(\%params); } } sub RemovePermission { my ($self, $label, %params) = @_; if ($self->_api_version eq SQS_VERSION_2008_01_01) { carp "RemovePermission not supported in this API version"; } else { $params{Action} = 'RemovePermission'; $params{Label} = $label; my $href = $self->_dispatch(\%params); } } sub GetAttributes { my ($self, %params) = @_; $params{Action} = 'GetQueueAttributes'; my %result; # default to the current version $params{AttributeName} ||= 'All'; my $href = $self->_dispatch(\%params, [ 'Attribute' ]); if ($href->{GetQueueAttributesResult}) { foreach my $attr (@{$href->{GetQueueAttributesResult}{Attribute}}) { $result{$attr->{Name}} = $attr->{Value}; } } return \%result; } sub SetAttribute { my ($self, $key, $value, %params) = @_; $params{Action} = 'SetQueueAttributes'; $params{'Attribute.Name'} = $key; $params{'Attribute.Value'} = $value; my $href = $self->_dispatch(\%params); } sub _to_string { my $self = shift; return $self->Endpoint(); } 1; __END__ =head1 NAME Amazon::SQS::Simple::Queue - OO API for representing queues from the Amazon Simple Queue Service. =head1 SYNOPSIS use Amazon::SQS::Simple; my $access_key = 'foo'; # Your AWS Access Key ID my $secret_key = 'bar'; # Your AWS Secret Key my $sqs = new Amazon::SQS::Simple($access_key, $secret_key); my $q = $sqs->CreateQueue('queue_name'); # Single messages my $response = $q->SendMessage('Hello world!'); my $msg = $q->ReceiveMessage; print $msg->MessageBody; # Hello world! $q->DeleteMessage($msg); # or, for backward compatibility $q->DeleteMessage($msg->ReceiptHandle); # Batch messaging of up to 10 messages per operation my @responses = $q->SendMessageBatch( [ 'Hello world!', 'Hello again!' ] ); # or with defined message IDs $q->SendMessageBatch( { msg1 => 'Hello world!', msg2 => 'Hello again!' } ); my @messages = $q->ReceiveMessageBatch; $q->DeleteMessageBatch( \@messages ); =head1 INTRODUCTION Don't instantiate this class directly. Objects of this class are returned by various methods in C. See L for more details. =head1 METHODS =over 2 =item B Get the endpoint for the queue. =item B Deletes the queue. Any messages contained in the queue will be lost. =item B Sends the message. The message can be up to 8KB in size and should be plain text. =item B Sends a batch of up to 10 messages, passed as an array-ref. Message IDs (of the style 'msg_1', 'msg_2', etc) are auto-generated for each message. Alternatively, if you need to specify the format of the message ID then you can pass a hash-ref {$id1 => $message1, etc} =item B Get the next message from the queue. Returns one or more C objects (depending on whether called in list or scalar context), or undef if no messages are retrieved. NOTE: This behaviour has changed slightly since v1.06. It now always returns the first message in scalar context, irrespective of how many there are. See L for more details. Options for ReceiveMessage: =over 4 =item * MaxNumberOfMessages => INTEGER Maximum number of messages to return (integer from 1 to 20). SQS never returns more messages than this value but might return fewer. Not necessarily all the messages in the queue are returned. Defaults to 1. =item * WaitTimeSeconds => INTEGER Long poll support (integer from 0 to 20). The duration (in seconds) that the I action call will wait until a message is in the queue to include in the response, as opposed to returning an empty response if a message is not yet available. If you do not specify I in the request, the queue attribute I is used to determine how long to wait. =item * VisibilityTimeout => INTEGER The duration in seconds (integer from 0 to 43200) that the received messages are hidden from subsequent retrieve requests after being retrieved by a I request. If you do not specify I in the request, the queue attribute I is used to determine how long to wait. =back =item B As ReceiveMessage(MaxNumberOfMessages => 10) =item B Pass this method either a message object or receipt handle to delete that message from the queue. For backward compatibility, can pass the message ReceiptHandle rather than the message. =item B Pass this method an array-ref containing up to 10 message objects to delete all of those messages from the queue =item B NOT SUPPORTED IN APIs EARLIER THAN 2009-01-01 Changes the visibility of the message with the specified receipt handle to C<$timeout> seconds. C<$timeout> must be in the range 0..43200. =item B NOT SUPPORTED IN APIs EARLIER THAN 2009-01-01 Sets a permissions policy with the specified label. C<$account_actions> is a reference to a hash mapping 12-digit AWS account numbers to the action(s) you want to permit for those account IDs. The hash value for each key can be a string (e.g. "ReceiveMessage") or a reference to an array of strings (e.g. ["ReceiveMessage", "DeleteMessage"]) =item B NOT SUPPORTED IN APIs EARLIER THAN 2009-01-01 Removes the permissions policy with the specified label. =item B Get the attributes for the queue. Returns a reference to a hash mapping attribute names to their values. Currently the following attribute names are returned: =over 4 =item * VisibilityTimeout =item * ApproximateNumberOfMessages =back =item B Sets the value for a queue attribute. Currently the only valid attribute name is C. =back =head1 ACKNOWLEDGEMENTS Chris Jones provied the batch message code in release 2.0 =head1 AUTHOR Copyright 2007-2008 Simon Whitaker Eswhitaker@cpan.orgE Copyright 2013 Mike (no relation) Whitaker Epenfold@cpan.orgE This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut Amazon-SQS-Simple-2.04/lib/Amazon/SQS/Simple/SendResponse.pm000755 000765 000024 00000002773 12521422301 023513 0ustar00mikestaff000000 000000 package Amazon::SQS::Simple::SendResponse; use strict; use warnings; use Digest::MD5 qw(md5_hex); sub new { my ($class, $msg, $body) = @_; $msg = bless($msg, $class); if ($body){ $msg->{MessageBody} = $body; } return $msg; } sub MessageId { my $self = shift; return $self->{MessageId}; } sub MD5OfMessageBody { my $self = shift; return $self->{MD5OfMessageBody}; } sub VerifyReceipt { my $self = shift; return $self->{MD5OfMessageBody} eq md5_hex($self->{MessageBody}) ? 1 : undef; } 1; __END__ =head1 NAME Amazon::SQS::Simple::SendResponse - OO API for representing responses to messages sent to the Amazon Simple Queue Service. =head1 INTRODUCTION Don't instantiate this class directly. Objects of this class are returned by SendMessage in C. See L for more details. =head1 METHODS =over 2 =item B Get the message unique identifier =item B Get the MD5 checksum of the message body you sent =item B Perform verification of message receipt. Compares the MD5 checksum returned by the response object with the expected checksum. Returns 1 if receipt is verified, undef otherwise. =back =head1 AUTHOR Copyright 2007-2008 Simon Whitaker Eswhitaker@cpan.orgE Copyright 2013 Mike (no relation) Whitaker Epenfold@cpan.orgE This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut Amazon-SQS-Simple-2.04/bin/sqs-toolkit000755 000765 000024 00000006374 12521422301 017640 0ustar00mikestaff000000 000000 #!/usr/bin/perl -w use File::Basename; use Getopt::Long; use Amazon::SQS::Simple; my %opts; GetOptions( \%opts, 'flush', 'timeout=i', 'help', 'delete', 'create', 'info', 'access-key', 'secret-key', 'list-queues', 'verbose', ); my $scr = basename($0); my $queue_name = shift; my $AWSAccessKeyId = $opts{'access-key'} || $ENV{AWS_ACCESS_KEY}; my $SecretKey = $opts{'secret-key'} || $ENV{AWS_SECRET_KEY}; usage(0) if ($opts{help}); usage(1) if @ARGV; sub usage { my $status = shift || 0; print <ListQueues(); if ($queues) { foreach my $queue (@$queues) { (my $name = $queue->Endpoint()) =~ s|.*/||; printf ("%s (Endpoint: %s)\n", $name, $queue->Endpoint()); } } else { print "You don't have any queues (use --create to create one)" } exit(0); } usage(1) unless $queue_name; if ($opts{create}) { $q = q_create($queue_name); } else { $q = q_find($queue_name); } if ($opts{timeout}) { q_timeout($q, $opts{timeout}); } if ($opts{info}) { q_info($q); } if ($opts{flush}) { q_flush($q); } if ($opts{delete}) { q_delete($q); } sub q_find { my $name = shift; my $queues = $sqs->ListQueues(QueueNamePrefix => $name); if ($queues) { my @matches = grep { $_->Endpoint() =~ m|/$name$|} @$queues; if (@matches > 1) { warn "[WARNING] Multiple queues found with name $name\n"; } if (@matches) { return $matches[0]; } } die "No queue called $name found (try using --list-queues)\n"; } sub q_create { my $name = shift; $sqs->CreateQueue($name); } sub q_delete { my $queue = shift; my $href = $queue->Delete(); } sub q_info { my $queue = shift; print "Endpoint: $queue\nAttributes:\n"; my $attrs = $queue->GetAttributes(); for (keys %$attrs) { print "$_ => $attrs->{$_}\n"; } } sub q_flush { my $queue = shift; while (my $msg = $queue->ReceiveMessage) { if ($opts{verbose}) { print "Deleting " . $msg->MessageId . "\n"; } $queue->DeleteMessage($msg->ReceiptHandle); } } sub q_timeout { my $queue = shift; my $t = shift; if (defined $t) { $queue->SetAttribute('VisibilityTimeout', $t); } else { my $href = $queue->GetAttributes(); return $href->{VisibilityTimeout}; } }