net.datacrow.util.amazon
Class SignedRequestsHelper

java.lang.Object
  extended by net.datacrow.util.amazon.SignedRequestsHelper

public class SignedRequestsHelper
extends java.lang.Object

This class contains all the logic for signing requests to the Amazon Product Advertising API.


Constructor Summary
SignedRequestsHelper(java.lang.String awsAccessKeyId, java.lang.String awsSecretKey)
           
 
Method Summary
 java.lang.String sign(java.lang.String server, java.util.Map<java.lang.String,java.lang.String> params)
          This method signs requests in hash map form.
 java.lang.String sign(java.lang.String server, java.lang.String queryString)
          This method signs requests in query-string form.
 java.lang.String sign(java.net.URL url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignedRequestsHelper

public SignedRequestsHelper(java.lang.String awsAccessKeyId,
                            java.lang.String awsSecretKey)
                     throws java.io.UnsupportedEncodingException,
                            java.security.NoSuchAlgorithmException,
                            java.security.InvalidKeyException
Throws:
java.io.UnsupportedEncodingException
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
Method Detail

sign

public java.lang.String sign(java.net.URL url)

sign

public java.lang.String sign(java.lang.String server,
                             java.util.Map<java.lang.String,java.lang.String> params)
This method signs requests in hash map form. It returns a URL that should be used to fetch the response. The URL returned should not be modified in any way, doing so will invalidate the signature and Amazon will reject the request.


sign

public java.lang.String sign(java.lang.String server,
                             java.lang.String queryString)
This method signs requests in query-string form. It returns a URL that should be used to fetch the response. The URL returned should not be modified in any way, doing so will invalidate the signature and Amazon will reject the request.