alanwilliamson

A simple Java API class for Amazon SimpleDB

We recently had cause to utilise the latest addition to Amazon's Web Services platform, SimpleDB. There are a number of Java libraries to get up and running with, and each one has their strengths and weaknesses.

When I coded up the SimpleDB for inclusion into OpenBD, I used the typica library, which is a great set of API's. Although recently, for another project, I just wanted something real quick, and while typica is nice, it does have some funky JAR file dependencies that makes it non trivial to install at times.

simple life

I found this chap, which is a single class that does everything inside one class and does not require any external JAR files that are not within the JDK.

Not a single XML parser in sight. It merely packages up the REST call to Amazon, doing all the authenication token passing, and then dumps you the resulting response back. Nice and simple.

And it works beautifully!

I decided to add to it though, with a very crude parsing algorithm (no SAX/DOM parser) to pull out the results from the XML packet and put them into something the calling function can use. Amazon's XML is so simple you don't need the extra overhead of those fully rounded parsers in 99% of the time.

So instead of calling listDomains(), which returns the raw string, you can now call listDomainsList() that will return a java.util.List of domains. I've added the same for the other methods where you need the actual data back out from the web service call.

Thanks to Ian Schumacher for developing the original class and making it available on Amazon under a very liberal license (Absolutely free in all senses of the word, absolutely no restrictions, no attribution necessary).

In the same spirit, I include the modified version of that code here, to be used in the same spirit as the original author. Just Use It!

Adapated from the original code submission.


 

Recent Cloud posts

Recent JAVA posts

Latest CFML posts


 
Site Links