org.starhope.appius.mb
Class Enrolment

java.lang.Object
  extended by org.starhope.appius.sql.SQLPeerDatum
      extended by org.starhope.appius.mb.Enrolment
All Implemented Interfaces:
Serializable

public class Enrolment
extends SQLPeerDatum

An Enrolment object represents a potential type of enrolment or subscription into which an User can be subscribed. This does not represent an actual commitment by the user to a particular subscription, only that one is potentially possible.

Author:
brpocock
See Also:
UserEnrolment for actual subscriptions/registrations, Serialized Form

Field Summary
private  boolean autoRenew
          WRITEME
private  boolean available
          WRITEME
private  int id
          WRITEME
private  BigDecimal price
          WRITEME
private  String productCode
          WRITEME
private  long renewDays
          WRITEME
private  int renewMonths
          WRITEME
private static long serialVersionUID
          TODO: document this field (theys, Oct 5, 2009) serialVersionUID (long)
private  String title
          WRITEME
 
Constructor Summary
  Enrolment(BigDecimal d)
           
protected Enrolment(ResultSet resultSet)
          WRITEME
 
Method Summary
 void flush()
          This is an overriding method.
static Enrolment[] getAvailableEnrolments()
          Returns all products in the products table that are flagged as Available AND Visible
static Enrolment getByID(int id)
          TODO: document this method (brpocock, Sep 23, 2009)
static Enrolment getByProductCode(String id)
           
protected  String getCacheUniqueID()
          This is an overriding method.
 Currency getCurrency()
           
 Date getExpiryFor(Date begins)
           
 int getId()
          WRITEME TODO: document this method (brpocock, Oct 13, 2009)
 BigDecimal getPrice()
          TODO: document this method (brpocock, Oct 13, 2009)
 long getPrivilegeDays()
           
 int getPrivilegeMonths()
           
 String getProductCode()
          TODO: document this method (brpocock, Oct 13, 2009)
 int getProductID()
           
 int getRenewMonths()
          WRITEME TODO: document this method (brpocock, Oct 13, 2009)
 String getTitle()
           
 boolean isAutoRenew()
          TODO: document this method (brpocock, Oct 13, 2009)
 boolean isAvailable()
           
protected  void set(ResultSet rs)
          This is an overriding method.
 void setPrice(BigDecimal price1)
          TODO: document this method (brpocock, Sep 23, 2009)
 
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum
changed, findInCache, get, saveInCache, set, toJSON
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
TODO: document this field (theys, Oct 5, 2009) serialVersionUID (long)

See Also:
Constant Field Values

autoRenew

private boolean autoRenew
WRITEME


available

private boolean available
WRITEME


id

private int id
WRITEME


price

private BigDecimal price
WRITEME


productCode

private String productCode
WRITEME


renewDays

private long renewDays
WRITEME


renewMonths

private int renewMonths
WRITEME


title

private String title
WRITEME

Constructor Detail

Enrolment

public Enrolment(BigDecimal d)
Parameters:
d - WRITEME

Enrolment

protected Enrolment(ResultSet resultSet)
             throws NotFoundException
WRITEME

Parameters:
resultSet - WRITEME
Throws:
NotFoundException - WRITEME
Method Detail

getAvailableEnrolments

public static Enrolment[] getAvailableEnrolments()
Returns all products in the products table that are flagged as Available AND Visible

Returns:
all products in the products table that are flagged as Available AND Visible

getByID

public static Enrolment getByID(int id)
                         throws NotFoundException
TODO: document this method (brpocock, Sep 23, 2009)

Parameters:
id - WRITEME
Returns:
WRITEME
Throws:
NotFoundException - WRITEME

getByProductCode

public static Enrolment getByProductCode(String id)
                                  throws NotFoundException
Parameters:
id - the database ID of the Enrolment
Returns:
Enrolment object
Throws:
NotFoundException - if the ID doesn't point to a valid enrolment

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()

getCurrency

public Currency getCurrency()
Returns:
WRITEME

getExpiryFor

public Date getExpiryFor(Date begins)
Parameters:
begins - WRITEME
Returns:
WRITEME

getId

public int getId()
WRITEME TODO: document this method (brpocock, Oct 13, 2009)

Returns:
WRITEME

getPrice

public BigDecimal getPrice()
TODO: document this method (brpocock, Oct 13, 2009)

Returns:
WRITEME

getPrivilegeDays

public long getPrivilegeDays()
Returns:
WRITEME

getPrivilegeMonths

public int getPrivilegeMonths()
Returns:
WRITEME

getProductCode

public String getProductCode()
TODO: document this method (brpocock, Oct 13, 2009)

Returns:
WRITEME

getProductID

public int getProductID()
Returns:
WRITEME

getRenewMonths

public int getRenewMonths()
WRITEME TODO: document this method (brpocock, Oct 13, 2009)

Returns:
WRITEME

getTitle

public String getTitle()
Returns:
WRITEME

isAutoRenew

public boolean isAutoRenew()
TODO: document this method (brpocock, Oct 13, 2009)

Returns:
WRITEME

isAvailable

public boolean isAvailable()
Returns:
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)

setPrice

public void setPrice(BigDecimal price1)
TODO: document this method (brpocock, Sep 23, 2009)

Parameters:
price1 - WRITEME