org.jets3t.service.model
Class AWSDevPayProduct

java.lang.Object
  extended by org.jets3t.service.model.AWSDevPayProduct
All Implemented Interfaces:
Serializable, Comparable

public class AWSDevPayProduct
extends Object
implements Serializable, Comparable

Class to contain information about an Amazon Web Services (AWS) S3 DevPay product.

Author:
Nikolas Coukouma
See Also:
Serialized Form

Constructor Summary
AWSDevPayProduct(String productToken)
           
AWSDevPayProduct(String productToken, String productName)
           
 
Method Summary
 int compareTo(Object o)
          Compare two products by their names (using string comparision)
 String getProductName()
           
 String getProductToken()
           
static Vector load()
          Loads the products listed in Constants.DEVPAY_PRODUCTS_PROPERTIES_FILENAME
static Vector load(InputStream pin)
          Loads the products listed in the Properties file represented by the input stream.
static Vector load(Properties prodProps)
          Loads the products listed in the Properties.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AWSDevPayProduct

public AWSDevPayProduct(String productToken)

AWSDevPayProduct

public AWSDevPayProduct(String productToken,
                        String productName)
Method Detail

getProductName

public String getProductName()
Returns:
the name of the DevPay product

getProductToken

public String getProductToken()
Returns:
the product token of the DevPay product

toString

public String toString()
Overrides:
toString in class Object
Returns:
the name of the DevPay product

compareTo

public int compareTo(Object o)
Compare two products by their names (using string comparision)

Specified by:
compareTo in interface Comparable

load

public static Vector load()
                   throws IOException
Loads the products listed in Constants.DEVPAY_PRODUCTS_PROPERTIES_FILENAME

Returns:
the Vector of AWSDevPayProducts
Throws:
IOException

load

public static Vector load(InputStream pin)
                   throws IOException
Loads the products listed in the Properties file represented by the input stream.

Parameters:
pin - the input stream
Returns:
the Vector of AWSDevPayProducts
Throws:
IOException

load

public static Vector load(Properties prodProps)
Loads the products listed in the Properties. Specifically, any properties ending in Constants.DEVPAY_PRODUCT_NAME_PROP_SUFFIX (the product's name) have that ending removed and replaced with Constants.DEVPAY_PRODUCT_NAME_PROP_SUFFIX (to form name of the property for the product's token). If the token exists, then a AWSDevPayProduct is constructed with that name and token, and then is added to the Vector. For example, (with the current constants) "foo.name" would become "foo.token"; if both properties exist, then a product is constructed with the values of the "foo.name" and "foo.token" properties (e.g. "Foo" and "{ProductToken}AAA...").

Parameters:
prodProps - the properties
Returns:
the Vector of AWSDevPayProducts, sorted by name