com.tootsville
Class IBCUtil

java.lang.Object
  extended by org.starhope.appius.sql.SQLPeerDatum
      extended by com.tootsville.IBCUtil
All Implemented Interfaces:
Serializable, Comparable<Object>

public class IBCUtil
extends SQLPeerDatum

TODO: The documentation for this type (IBCUtil) is incomplete. (twheys@gmail.com, Sep 23, 2009)

Author:
twheys@gmail.com
See Also:
Serialized Form

Field Summary
private static String AVAILABLE
          WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) AVAILABLE (IBCUtil)
private static String CANCELED
          WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) CANCELED (IBCUtil)
private static String FAIL
          WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) FAIL (IBCUtil)
private static String ORDER_SOURCE_IBC
          WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) ORDER_SOURCE_IBC (IBCUtil)
private  String orderCode
          WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) orderCode (IBCUtil)
private static char[] orderCodeChars
          WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) orderCodeChars (IBCUtil)
private  String orderSource
          Order Source must be one of the following values "avl, cncl, or rdmd"
private  String orderStatus
          WRITEME
private  int productCode
          WRITEME
private static String REDEEMED
          WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) REDEEMED (IBCUtil)
private  int redeemedByUserID
          WRITEME
private static long serialVersionUID
          WRITEME: document this field (twheys@gmail.com, Oct 7, 2009) serialVersionUID (long)
private static String signatureKey
          WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) signatureKey (IBCUtil)
private static String SUCCESS
          WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) SUCCESS (IBCUtil)
 
Constructor Summary
  IBCUtil(ResultSet rs)
           
  IBCUtil(String productCode2)
           
private IBCUtil(String order_source, String order_code)
           
 
Method Summary
static void cancel(javax.servlet.http.HttpServletRequest request, javax.servlet.jsp.JspWriter out)
          WRITEME: document this method (twheys@gmail.com, Sep 25, 2009)
private static void checkSignature(String signature)
           Verify the signature parameter as a sha1 and hex code.
private static void displayJSON(org.json.JSONObject json, javax.servlet.jsp.JspWriter out)
           Display the JSONObject created as output.
 void flush()
          This is an overriding method.
static void generate(javax.servlet.http.HttpServletRequest request, javax.servlet.jsp.JspWriter out)
           This method should be called when the 'command' parameter is "generate".
private static String generateRandomCode()
          WRITEME: document this method (twheys@gmail.com, Sep 29, 2009)
protected  String getCacheUniqueID()
          This is an overriding method.
static String getEnrolmentTitle(String order_code)
          WRITEME: document this method (twheys@gmail.com, Oct 7, 2009)
 String getOrderCode()
          WRITEME: document this method (twheys@gmail.com, Oct 13, 2009)
 String getOrderSource()
          WRITEME: document this method (twheys@gmail.com, Oct 13, 2009)
 String getOrderStatus()
          WRITEME: document this method (twheys@gmail.com, Oct 13, 2009)
 int getProductCode()
          WRITEME: document this method (twheys@gmail.com, Oct 13, 2009)
 int getRedeemedByUserID()
          WRITEME: document this method (twheys@gmail.com, Oct 13, 2009)
static String getSignatureKey()
          WRITEME: document this method (twheys@gmail.com, Sep 29, 2009)
static void getStatus(javax.servlet.http.HttpServletRequest request, javax.servlet.jsp.JspWriter out)
          WRITEME: document this method (twheys@gmail.com, Sep 25, 2009)
static void handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.jsp.JspWriter out)
          WRITEME: document this method (twheys@gmail.com, Sep 25, 2009)
 void insert()
           
static void redeemCode(String codeUntrimmed, AbstractUser sessionUser)
          WRITEME: document this method (twheys@gmail.com, Sep 23, 2009)
protected  void set(ResultSet rs)
          This is an overriding method.
 void setOrderStatus(String orderStatus1)
          WRITEME: document this method (twheys@gmail.com, Sep 29, 2009)
 void setProductCode(int productCode1)
          WRITEME: document this method (twheys@gmail.com, Sep 29, 2009)
 void setRedeemedByUserID(int redeemedByUserID1)
          WRITEME: document this method (twheys@gmail.com, Sep 29, 2009)
static boolean verifyCode(String code)
          WRITEME: document this method (twheys@gmail.com, Sep 29, 2009)
 
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum
changed, compareTo, findInCache, saveInCache, set, toJSON
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AVAILABLE

private static final String AVAILABLE
WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) AVAILABLE (IBCUtil)

See Also:
Constant Field Values

CANCELED

private static final String CANCELED
WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) CANCELED (IBCUtil)

See Also:
Constant Field Values

FAIL

private static final String FAIL
WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) FAIL (IBCUtil)

See Also:
Constant Field Values

ORDER_SOURCE_IBC

private static final String ORDER_SOURCE_IBC
WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) ORDER_SOURCE_IBC (IBCUtil)

See Also:
Constant Field Values

orderCodeChars

private static final char[] orderCodeChars
WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) orderCodeChars (IBCUtil)


REDEEMED

private static final String REDEEMED
WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) REDEEMED (IBCUtil)

See Also:
Constant Field Values

serialVersionUID

private static final long serialVersionUID
WRITEME: document this field (twheys@gmail.com, Oct 7, 2009) serialVersionUID (long)

See Also:
Constant Field Values

signatureKey

private static final String signatureKey
WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) signatureKey (IBCUtil)

See Also:
Constant Field Values

SUCCESS

private static final String SUCCESS
WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) SUCCESS (IBCUtil)

See Also:
Constant Field Values

orderCode

private String orderCode
WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) orderCode (IBCUtil)


orderSource

private String orderSource
Order Source must be one of the following values "avl, cncl, or rdmd"


orderStatus

private String orderStatus
WRITEME


productCode

private int productCode
WRITEME


redeemedByUserID

private int redeemedByUserID
WRITEME

Constructor Detail

IBCUtil

public IBCUtil(ResultSet rs)
Parameters:
rs - WRITEME

IBCUtil

public IBCUtil(String productCode2)
        throws DataException
Parameters:
productCode2 - WRITEME
Throws:
DataException - WRITEME

IBCUtil

private IBCUtil(String order_source,
                String order_code)
         throws NotFoundException
Parameters:
order_source - WRITEME
order_code - WRITEME
Throws:
NotFoundException - WRITEME
Method Detail

cancel

public static void cancel(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.jsp.JspWriter out)
WRITEME: document this method (twheys@gmail.com, Sep 25, 2009)

Parameters:
request - request allows method to retrieve data
out - out allows method to display results

checkSignature

private static void checkSignature(String signature)
                            throws DataException

Verify the signature parameter as a sha1 and hex code. Throw DataException if the code is invalid.

Parameters:
signature - is a literal string of a sha1 and hex code used for security.
Throws:
DataException - WRITEME

displayJSON

private static void displayJSON(org.json.JSONObject json,
                                javax.servlet.jsp.JspWriter out)

Display the JSONObject created as output.

BRP: Say what? TODO: explain why anyone would call this?

Parameters:
json - json is the JSON to be displayed
out - is the JSPWriter to display json

generate

public static void generate(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.jsp.JspWriter out)
                     throws DataException

This method should be called when the 'command' parameter is "generate". This will create a JSON object with the keys result, error, orderSource, orderCode, and productCode and display the JSONObject as a string thru the JSPWriter object.

The parameters in the request object should be productCode and signature. productCode is a literal String that must equal "monthly", "trimonthly", "semiannual", or "annual". Signature is a literal string of a sha1 and hex code used for security.

Parameters:
request - request allows method to retrieve data
out - allows method to display results
Throws:
DataException - if the parameters in the request object are invalid

generateRandomCode

private static String generateRandomCode()
WRITEME: document this method (twheys@gmail.com, Sep 29, 2009)

Returns:
WRITEME

getEnrolmentTitle

public static String getEnrolmentTitle(String order_code)
WRITEME: document this method (twheys@gmail.com, Oct 7, 2009)

Parameters:
order_code - WRITEME
Returns:
WRITEME

getSignatureKey

public static String getSignatureKey()
WRITEME: document this method (twheys@gmail.com, Sep 29, 2009)

Returns:
WRITEME

getStatus

public static void getStatus(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.jsp.JspWriter out)
WRITEME: document this method (twheys@gmail.com, Sep 25, 2009)

Parameters:
request - request allows method to retrieve data
out - out allows method to display results

handleRequest

public static void handleRequest(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.jsp.JspWriter out)
WRITEME: document this method (twheys@gmail.com, Sep 25, 2009)

Parameters:
request - WRITEME
out - WRITEME

redeemCode

public static void redeemCode(String codeUntrimmed,
                              AbstractUser sessionUser)
                       throws DataException
WRITEME: document this method (twheys@gmail.com, Sep 23, 2009)

Parameters:
codeUntrimmed - WRITEME
sessionUser - WRITEME
Throws:
DataException - WRITEME

verifyCode

public static boolean verifyCode(String code)
                          throws DataException
WRITEME: document this method (twheys@gmail.com, Sep 29, 2009)

Parameters:
code - WRITEME
Returns:
WRITEME
Throws:
DataException - WRITEME

flush

public void flush()
This is an overriding method.

Specified by:
flush in class SQLPeerDatum
See Also:
SQLPeerDatum.flush()

getCacheUniqueID

protected String getCacheUniqueID()
This is an overriding method.

Specified by:
getCacheUniqueID in class SQLPeerDatum
Returns:
The local (Stringified) version of an unique ID; usually the database ID column
See Also:
SQLPeerDatum.getCacheUniqueID()

getOrderCode

public String getOrderCode()
WRITEME: document this method (twheys@gmail.com, Oct 13, 2009)

Returns:
WRITEME

getOrderSource

public String getOrderSource()
WRITEME: document this method (twheys@gmail.com, Oct 13, 2009)

Returns:
WRITEME

getOrderStatus

public String getOrderStatus()
WRITEME: document this method (twheys@gmail.com, Oct 13, 2009)

Returns:
WRITEME

getProductCode

public int getProductCode()
WRITEME: document this method (twheys@gmail.com, Oct 13, 2009)

Returns:
WRITEME

getRedeemedByUserID

public int getRedeemedByUserID()
WRITEME: document this method (twheys@gmail.com, Oct 13, 2009)

Returns:
WRITEME

insert

public void insert()
            throws SQLException
Throws:
SQLException - WRITEME

set

protected void set(ResultSet rs)
            throws SQLException
This is an overriding method.

Specified by:
set in class SQLPeerDatum
Parameters:
rs - The result of an SQL query, with the cursor already pointed at the row describing this specific instance of the object.
Throws:
SQLException - if the database fails somehow
See Also:
SQLPeerDatum.set(java.sql.ResultSet)

setOrderStatus

public void setOrderStatus(String orderStatus1)
WRITEME: document this method (twheys@gmail.com, Sep 29, 2009)

Parameters:
orderStatus1 - WRITEME

setProductCode

public void setProductCode(int productCode1)
WRITEME: document this method (twheys@gmail.com, Sep 29, 2009)

Parameters:
productCode1 - WRITEME

setRedeemedByUserID

public void setRedeemedByUserID(int redeemedByUserID1)
WRITEME: document this method (twheys@gmail.com, Sep 29, 2009)

Parameters:
redeemedByUserID1 - WRITEME