org.jets3t.service.model
Class AWSDevPayProduct

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

public class AWSDevPayProduct
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable

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

Author:
Nikolas Coukouma
See Also:
Serialized Form

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

Constructor Detail

AWSDevPayProduct

public AWSDevPayProduct(java.lang.String productToken)

AWSDevPayProduct

public AWSDevPayProduct(java.lang.String productToken,
                        java.lang.String productName)
Method Detail

getProductName

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

getProductToken

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

toString

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

compareTo

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

Specified by:
compareTo in interface java.lang.Comparable

load

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

Returns:
the Vector of AWSDevPayProducts
Throws:
java.io.IOException

load

public static java.util.Vector load(java.io.InputStream pin)
                             throws java.io.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:
java.io.IOException

load

public static java.util.Vector load(java.util.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