com.xerox.amazonws.devpay
Class DevPayLS

java.lang.Object
  extended by com.xerox.amazonws.common.AWSConnection
      extended by com.xerox.amazonws.common.AWSQueryConnection
          extended by com.xerox.amazonws.devpay.DevPayLS

public class DevPayLS
extends AWSQueryConnection

This class provides an interface with the Amazon DevPay LS service. It provides high level methods for listing and creating and deleting domains.

Author:
D. Kavanagh, developer@dotech.com

Field Summary
 
Fields inherited from class com.xerox.amazonws.common.AWSConnection
headers
 
Constructor Summary
DevPayLS(String awsAccessId, String awsSecretKey)
          Initializes the devpay service with your AWS login information.
DevPayLS(String awsAccessId, String awsSecretKey, boolean isSecure)
          Initializes the devpay service with your AWS login information.
DevPayLS(String awsAccessId, String awsSecretKey, boolean isSecure, String server)
          Initializes the devpay service with your AWS login information.
DevPayLS(String awsAccessId, String awsSecretKey, boolean isSecure, String server, int port)
          Initializes the devpay service with your AWS login information.
 
Method Summary
 DesktopProductInfo activateDesktopProduct(String activationKey, String productToken)
          Activates a desktop product.
 HostedProductInfo activateHostedProduct(String activationKey, String productToken)
          Activates a hosted product.
 List<String> getActiveSubscriptionsByPid(String persistentIdentifier)
          Gets list of active subscriptions by persistent identifier
 int getSignatureVersion()
          This method returns the signature version
 boolean isProductSubscribedByPid(String persistentIdentifier, String productCode)
          Verifies that a specified product is subscribed to by a customer.
 boolean isProductSubscribedByTokens(String productToken, String userToken)
          Verifies that a specified product is subscribed to by a customer.
protected
<T> T
makeRequestInt(org.apache.http.client.methods.HttpRequestBase method, String action, Map<String,String> params, Class<T> respType)
           
 String refreshUserToken(String userToken, String additionalTokens)
          Gets the most up-to-date version of the user token.
 void setSignatureVersion(int version)
          This method sets the signature version used to sign requests (0 or 1).
 
Methods inherited from class com.xerox.amazonws.common.AWSQueryConnection
close, close, getConnectionManagerTimeout, getConnectionTimeout, getHeaders, getHttpClient, getMaxConnections, getMaxRetries, getServerTimeZone, getSoTimeout, getString, httpDate, makeRequest, setConnectionManagerTimeout, setConnectionTimeout, setHttpClient, setMaxConnections, setMaxRetries, setProxyValues, setProxyValues, setProxyValues, setServerTimeZone, setSoTimeout, useSystemProxy
 
Methods inherited from class com.xerox.amazonws.common.AWSConnection
encode, encode, getAlgorithm, getAwsAccessKeyId, getPort, getResourcePrefix, getSecretAccessKey, getServer, getUrl, isSecure, makeURL, setResourcePrefix, setServer, urlencode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DevPayLS

public DevPayLS(String awsAccessId,
                String awsSecretKey)
Initializes the devpay service with your AWS login information.

Parameters:
awsAccessId - The your user key into AWS
awsSecretKey - The secret string used to generate signatures for authentication.

DevPayLS

public DevPayLS(String awsAccessId,
                String awsSecretKey,
                boolean isSecure)
Initializes the devpay service with your AWS login information.

Parameters:
awsAccessId - The your user key into AWS
awsSecretKey - The secret string used to generate signatures for authentication.
isSecure - True if the data should be encrypted on the wire on the way to or from LS.

DevPayLS

public DevPayLS(String awsAccessId,
                String awsSecretKey,
                boolean isSecure,
                String server)
Initializes the devpay service with your AWS login information.

Parameters:
awsAccessId - The your user key into AWS
awsSecretKey - The secret string used to generate signatures for authentication.
isSecure - True if the data should be encrypted on the wire on the way to or from LS.
server - Which host to connect to. Usually, this will be ls.amazonaws.com

DevPayLS

public DevPayLS(String awsAccessId,
                String awsSecretKey,
                boolean isSecure,
                String server,
                int port)
Initializes the devpay service with your AWS login information.

Parameters:
awsAccessId - The your user key into AWS
awsSecretKey - The secret string used to generate signatures for authentication.
isSecure - True if the data should be encrypted on the wire on the way to or from LS.
server - Which host to connect to. Usually, this will be ls.amazonaws.com
port - Which port to use.
Method Detail

getSignatureVersion

public int getSignatureVersion()
This method returns the signature version

Overrides:
getSignatureVersion in class AWSConnection
Returns:
the version

setSignatureVersion

public void setSignatureVersion(int version)
This method sets the signature version used to sign requests (0 or 1).

Overrides:
setSignatureVersion in class AWSConnection
Parameters:
version - signature version

activateDesktopProduct

public DesktopProductInfo activateDesktopProduct(String activationKey,
                                                 String productToken)
                                          throws DevPayException
Activates a desktop product.

Parameters:
activationKey - key obtained from the customer
productToken - token for your product
Returns:
the product info
Throws:
DevPayException - wraps checked exceptions

activateHostedProduct

public HostedProductInfo activateHostedProduct(String activationKey,
                                               String productToken)
                                        throws DevPayException
Activates a hosted product.

Parameters:
activationKey - key obtained from the customer
productToken - token for your product
Returns:
the product info
Throws:
DevPayException - wraps checked exceptions

getActiveSubscriptionsByPid

public List<String> getActiveSubscriptionsByPid(String persistentIdentifier)
                                         throws DevPayException
Gets list of active subscriptions by persistent identifier

Parameters:
persistentIdentifier - customers's PID
Returns:
true if product is subscribed
Throws:
DevPayException - wraps checked exceptions

isProductSubscribedByPid

public boolean isProductSubscribedByPid(String persistentIdentifier,
                                        String productCode)
                                 throws DevPayException
Verifies that a specified product is subscribed to by a customer.

Parameters:
persistentIdentifier - customers's PID
productCode - the product code
Returns:
true if product is subscribed
Throws:
DevPayException - wraps checked exceptions

isProductSubscribedByTokens

public boolean isProductSubscribedByTokens(String productToken,
                                           String userToken)
                                    throws DevPayException
Verifies that a specified product is subscribed to by a customer.

Parameters:
productToken - the product token
userToken - the user token
Returns:
the list of product codes
Throws:
DevPayException - wraps checked exceptions

refreshUserToken

public String refreshUserToken(String userToken,
                               String additionalTokens)
                        throws DevPayException
Gets the most up-to-date version of the user token.

Parameters:
userToken - the user token
additionalTokens - optional token (see dev guide), null if not used
Returns:
the list of product codes
Throws:
DevPayException - wraps checked exceptions

makeRequestInt

protected <T> T makeRequestInt(org.apache.http.client.methods.HttpRequestBase method,
                               String action,
                               Map<String,String> params,
                               Class<T> respType)
                    throws DevPayException
Throws:
DevPayException