org.starhope.appius.mb
Class Enrolment

java.lang.Object
  extended by org.starhope.appius.util.SimpleDataRecord<Enrolment>
      extended by org.starhope.appius.mb.Enrolment
All Implemented Interfaces:
com.whirlycott.cache.Cacheable, Serializable, Comparable<Enrolment>, CTime, DataRecord, HasSubversionRevision

public class Enrolment
extends SimpleDataRecord<Enrolment>

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@star-hope.org
See Also:
UserEnrolment for actual subscriptions/registrations, Serialized Form

Field Summary
private  boolean autoRenew
          WRITEME
private  boolean autoRenewAsk
          WRITEME: Document this brpocock@star-hope.org
private  boolean available
          WRITEME
private  int id
          WRITEME
private  BigDecimal price
          WRITEME
private  String productCode
          WRITEME
private  int renewDays
          WRITEME
private  int renewMonths
          WRITEME
private static long serialVersionUID
          WRITEME: document this field (twheys@gmail.com, Oct 5, 2009) serialVersionUID (long)
private  String title
          WRITEME
 
Fields inherited from class org.starhope.appius.util.SimpleDataRecord
myLoader, timeLastChanged, timeLastSaved
 
Constructor Summary
Enrolment(BigDecimal d)
           
Enrolment(RecordLoader<Enrolment> loader)
          WRITEME: Document this constructor brpocock@star-hope.org
 
Method Summary
 boolean askToAutoRenew()
          WRITEME: Document this method brpocock@star-hope.org
static Enrolment[] getAvailableEnrolments()
          Returns all products in the products table that are flagged as Available AND Visible
static Enrolment getByID(int productID)
          Deprecated. use Nomenclator.getDataRecord(Class, int) with Enrolment.class
static Enrolment getByProductCode(String productCode2)
          Deprecated. use Nomenclator.getDataRecord(Class, String)
 int getCacheableID()
          Note that all records must have either a numeric ID ( DataRecord.getCacheableID() or a string identifier ( DataRecord.getCacheableIdent() or both.
 String getCacheableIdent()
          Note that all records must have either a numeric ID ( DataRecord.getCacheableID() or a string identifier ( DataRecord.getCacheableIdent() or both.
 Currency getCurrency()
           
 int getId()
          WRITEME WRITEME: document this method (brpocock@star-hope.org, Oct 13, 2009)
 int getID()
           
 BigDecimal getPrice()
          WRITEME: document this method (brpocock@star-hope.org, Oct 13, 2009)
 int getPrivilegeDays()
           
 int getPrivilegeMonths()
           
 String getProductCode()
          WRITEME: document this method (brpocock@star-hope.org, Oct 13, 2009)
 int getProductID()
           
 int getRenewalDays()
           
 int getRenewalMonths()
           
 int getRenewMonths()
          WRITEME WRITEME: document this method (brpocock@star-hope.org, Oct 13, 2009)
 String getSubversionRevision()
           Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence.
 String getTitle()
           
 boolean isAutoRenew()
          WRITEME: document this method (brpocock@star-hope.org, Oct 13, 2009)
 boolean isAutoRenewed()
           
 boolean isAvailable()
           
 void setAutoRenewalAsk(boolean equals)
          WRITEME: Document this method brpocock@star-hope.org
 void setAutoRenewed(boolean alwaysAutoRenew)
           
 void setAvailable(boolean nowAvailable)
           
 void setID(int newID)
           
 void setPrice(BigDecimal price1)
          WRITEME: document this method (brpocock@star-hope.org, Sep 23, 2009)
 void setProductCode(String newProductCode)
           
 void setRenewalDays(int newRenewDays)
           
 void setRenewalMonths(int newRenewMonths)
           
 void setTitle(String newTitle)
           
 
Methods inherited from class org.starhope.appius.util.SimpleDataRecord
changed, checkStale, compareTo, equals, finalize, getRecordLoader, getTimeLastChanged, getTimeLastSaved, hashCode, isBeingLoaded, markAsLoaded, markAsSaved, markForReload, onRemove, onRetrieve, onStore, save, setRecordLoader, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
WRITEME: document this field (twheys@gmail.com, 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 int renewDays
WRITEME


renewMonths

private int renewMonths
WRITEME


title

private String title
WRITEME


autoRenewAsk

private boolean autoRenewAsk
WRITEME: Document this brpocock@star-hope.org

Constructor Detail

Enrolment

public Enrolment(BigDecimal d)
Parameters:
d - WRITEME

Enrolment

public Enrolment(RecordLoader<Enrolment> loader)
WRITEME: Document this constructor brpocock@star-hope.org

Parameters:
loader - loader
Method Detail

getAvailableEnrolments

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

XXX contains SQL

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

getByID

@Deprecated
public static Enrolment getByID(int productID)
                         throws NotFoundException
Deprecated. use Nomenclator.getDataRecord(Class, int) with Enrolment.class

WRITEME: Document this method brpocock@star-hope.org

Parameters:
productID - WRITEME
Returns:
WRITEME
Throws:
NotFoundException - WRITEME

getByProductCode

@Deprecated
public static Enrolment getByProductCode(String productCode2)
                                  throws NotFoundException
Deprecated. use Nomenclator.getDataRecord(Class, String)

Parameters:
productCode2 - the product code for that enrolment type
Returns:
the enrolment named by the product code
Throws:
NotFoundException - if the enrolment type is not found

askToAutoRenew

public boolean askToAutoRenew()
WRITEME: Document this method brpocock@star-hope.org

Returns:
WRITEME

getCacheableID

public int getCacheableID()
                   throws NotFoundException
Description copied from interface: DataRecord
Note that all records must have either a numeric ID ( DataRecord.getCacheableID() or a string identifier ( DataRecord.getCacheableIdent() or both.

Returns:
an unique ID number
Throws:
NotFoundException - if the item doesn't have a distinct numeric ID
See Also:
DataRecord.getCacheableID()

getCacheableIdent

public String getCacheableIdent()
                         throws NotFoundException
Description copied from interface: DataRecord
Note that all records must have either a numeric ID ( DataRecord.getCacheableID() or a string identifier ( DataRecord.getCacheableIdent() or both.

Returns:
an unique identifier string
Throws:
NotFoundException - if the item doesn't have a distinct string identifier
See Also:
DataRecord.getCacheableIdent()

getCurrency

public Currency getCurrency()
Returns:
WRITEME

getId

public int getId()
WRITEME WRITEME: document this method (brpocock@star-hope.org, Oct 13, 2009)

Returns:
WRITEME

getID

public int getID()
Returns:
the id

getPrice

public BigDecimal getPrice()
WRITEME: document this method (brpocock@star-hope.org, Oct 13, 2009)

Returns:
WRITEME

getPrivilegeDays

public int getPrivilegeDays()
Returns:
WRITEME

getPrivilegeMonths

public int getPrivilegeMonths()
Returns:
WRITEME

getProductCode

public String getProductCode()
WRITEME: document this method (brpocock@star-hope.org, Oct 13, 2009)

Returns:
WRITEME

getProductID

public int getProductID()
Returns:
WRITEME

getRenewalDays

public int getRenewalDays()
Returns:
the renewDays

getRenewalMonths

public int getRenewalMonths()
Returns:
the renewMonths

getRenewMonths

public int getRenewMonths()
WRITEME WRITEME: document this method (brpocock@star-hope.org, Oct 13, 2009)

Returns:
WRITEME

getSubversionRevision

public String getSubversionRevision()
Description copied from interface: HasSubversionRevision

Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence.

As an example,the Subversion revision string for this file is "$Rev: 1968 $"

 
 @Override
 public String getSubversionRevision () {
        return "$Rev: ";
 }
 

Returns:
The Subversion revision level for this class's source code file.
See Also:
HasSubversionRevision.getSubversionRevision()

getTitle

public String getTitle()
Returns:
WRITEME

isAutoRenew

public boolean isAutoRenew()
WRITEME: document this method (brpocock@star-hope.org, Oct 13, 2009)

Returns:
WRITEME

isAutoRenewed

public boolean isAutoRenewed()
Returns:
the autoRenew

isAvailable

public boolean isAvailable()
Returns:
WRITEME

setAutoRenewalAsk

public void setAutoRenewalAsk(boolean equals)
WRITEME: Document this method brpocock@star-hope.org

Parameters:
equals - WRITEME

setAutoRenewed

public void setAutoRenewed(boolean alwaysAutoRenew)
Parameters:
alwaysAutoRenew - the autoRenew to set

setAvailable

public void setAvailable(boolean nowAvailable)
Parameters:
nowAvailable - the available to set

setID

public void setID(int newID)
Parameters:
newID - the id to set

setPrice

public void setPrice(BigDecimal price1)
WRITEME: document this method (brpocock@star-hope.org, Sep 23, 2009)

Parameters:
price1 - WRITEME

setProductCode

public void setProductCode(String newProductCode)
Parameters:
newProductCode - the productCode to set

setRenewalDays

public void setRenewalDays(int newRenewDays)
Parameters:
newRenewDays - the renewDays to set

setRenewalMonths

public void setRenewalMonths(int newRenewMonths)
Parameters:
newRenewMonths - the renewMonths to set

setTitle

public void setTitle(String newTitle)
Parameters:
newTitle - the title to set