|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.util.ManagedReferenceHolder
org.starhope.appius.sql.SQLPeerDatum
org.starhope.appius.mb.UserEnrolment
public class UserEnrolment
Field Summary | |
---|---|
private BigDecimal |
authSubID
Authorize.net subscription ID |
private Date |
begins
start date |
private Date |
expires
expiry date |
private int |
id
database ID |
private String |
orderCode
order code |
private static char[] |
orderCodeChars
An internally-used array of characters used to create order codes. |
private String |
orderSource
order source |
private int |
productID
Enrolment product ID |
private static long |
serialVersionUID
serialVersionUID |
private int |
userID
subscribed user |
Constructor Summary | |
---|---|
UserEnrolment(ResultSet rs)
|
|
UserEnrolment(String order_source,
int product_id,
int user_id,
Date beginsOn)
WRITEME: document |
|
UserEnrolment(String order_source,
String order_code)
|
Method Summary | |
---|---|
void |
cancelNow()
|
void |
flush()
|
private void |
generateOrderCode()
WRITEME: document this method (brpocock, Aug 5, 2009) |
static UserEnrolment[] |
getAllForUserID(int userID)
|
BigDecimal |
getAmount()
|
BigDecimal |
getAuthSubID()
|
Date |
getBegins()
|
Person |
getBuyer()
TODO: refactor payment gateways to use the buyer information: promote this up to Invoiceable interface. |
protected String |
getCacheUniqueID()
|
Currency |
getCurrency()
|
Enrolment |
getEnrolment()
|
Date |
getExpires()
|
private int |
getID()
|
String |
getInvoiceID()
|
char |
getInvoiceIDPrefix()
|
Payment |
getLastPayment()
|
String |
getOrderCode()
|
String |
getOrderSource()
|
int |
getProductID()
|
String |
getTitle()
|
User |
getUser()
|
int |
getUserID()
|
void |
insert()
|
boolean |
isActive()
|
void |
set(ResultSet rs)
|
void |
setAuthSubID(BigDecimal authSubID)
|
void |
setBegins(Date newBegins)
|
void |
setEnrolment(Enrolment newEnrolment)
|
void |
setExpires(Date newExpires)
|
void |
setOrderCode(String orderCode)
|
void |
setOrderSource(String orderSource)
|
void |
setProductID(int productID)
|
void |
setUser(User newUser)
|
void |
setUserID(int userID)
|
org.json.JSONObject |
toJSON()
|
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum |
---|
changed, findInCache, get, prepare, prepare, saveInCache, set |
Methods inherited from class org.starhope.appius.util.ManagedReferenceHolder |
---|
deref, setRef |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final char[] orderCodeChars
private static final long serialVersionUID
private BigDecimal authSubID
private Date begins
private Date expires
private int id
private String orderCode
private String orderSource
private int productID
private int userID
Constructor Detail |
---|
public UserEnrolment(ResultSet rs) throws NotFoundException
rs
- SQL result set
NotFoundException
public UserEnrolment(String order_source, int product_id, int user_id, Date beginsOn) throws NotFoundException
order_source
- order sourceproduct_id
- user_id
- beginsOn
-
NotFoundException
- if the enrolment type is not found.public UserEnrolment(String order_source, String order_code) throws NotFoundException
order_source
- order sourceorder_code
- roder code
NotFoundException
- if the order doesn't already existMethod Detail |
---|
public static UserEnrolment[] getAllForUserID(int userID)
userID
- user enrolled
public void cancelNow()
public void flush()
flush
in class SQLPeerDatum
SQLPeerDatum.flush()
private void generateOrderCode()
public BigDecimal getAmount()
getAmount
in interface Invoiceable
Invoiceable.getAmount()
public BigDecimal getAuthSubID()
public Date getBegins()
public Person getBuyer()
Invoiceable
getBuyer
in interface Invoiceable
Invoiceable.getBuyer()
protected String getCacheUniqueID()
getCacheUniqueID
in class SQLPeerDatum
SQLPeerDatum.getCacheUniqueID()
public Currency getCurrency()
getCurrency
in interface Invoiceable
Invoiceable.getAmount()
Invoiceable.getCurrency()
public Enrolment getEnrolment()
NotFoundException
public Date getExpires()
private int getID()
public String getInvoiceID()
getInvoiceID
in interface Invoiceable
Invoiceable.getInvoiceID()
public char getInvoiceIDPrefix()
getInvoiceIDPrefix
in interface Invoiceable
Invoiceable.getInvoiceIDPrefix()
public Payment getLastPayment() throws NotFoundException
NotFoundException
- if nobody's paid anything yetpublic String getOrderCode()
public String getOrderSource()
public int getProductID()
public String getTitle()
getTitle
in interface Invoiceable
Invoiceable.getTitle()
public User getUser()
public int getUserID()
public void insert() throws SQLException
SQLException
public boolean isActive()
public void set(ResultSet rs) throws SQLException
set
in class SQLPeerDatum
SQLException
SQLPeerDatum.set(java.sql.ResultSet)
public void setAuthSubID(BigDecimal authSubID)
authSubID
- authorize.net subscription IDpublic void setBegins(Date newBegins)
newBegins
- begin datepublic void setEnrolment(Enrolment newEnrolment)
newEnrolment
- enrolment productpublic void setExpires(Date newExpires)
newExpires
- expiry datepublic void setOrderCode(String orderCode)
orderCode
- order codepublic void setOrderSource(String orderSource)
orderSource
- order sourcepublic void setProductID(int productID)
productID
- enrolment productpublic void setUser(User newUser)
newUser
- user enrolledpublic void setUserID(int userID)
userID
- user enrolledpublic org.json.JSONObject toJSON()
toJSON
in class SQLPeerDatum
SQLPeerDatum.toJSON()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |