|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.starhope.appius.sql.SQLPeerDatum
com.tootsville.promo.Promotion
public class Promotion
Promotions used for Marketing. These can either be used for tracking links from advertising sites or for peanut codes for marketing events.
| Nested Class Summary | |
|---|---|
private static class |
Promotion.TrackingType
Types of marketing tracking available. |
| Field Summary | |
|---|---|
private char[] |
code
4 letter tracking code for storing a referer for User. |
private String |
description
Description of this promotion. |
private String |
link
The link used for advertisement links. |
private int |
promotionID
The ID of this promotion |
private String |
redirect
URL to where the tracking link redirects to. |
private static long |
serialVersionUID
Java serialisation unique ID |
(package private) Promotion.TrackingType |
type
The Tracking type for this promotion. |
| Constructor Summary | |
|---|---|
protected |
Promotion(ResultSet rs)
Create a Promotion object from a result set. |
|
Promotion(String newCode,
String newLink,
String newDescription,
Promotion.TrackingType newType)
Creates a promotion with a redirect link set as the default "http://www.tootsville.com" |
|
Promotion(String newCode,
String newLink,
String newRedirect,
String newDescription,
Promotion.TrackingType newType)
Create a new promotion. |
| Method Summary | |
|---|---|
private void |
assertPromotionLinkAvailable(String newLink)
Check if the link already exists. |
void |
changed()
Indicate that some of the contents of this datum have changed, and that the database and/or object caches may need to be updated. |
static Promotion |
createEventPromotion(String prefixCode)
Create a new promotional code series for a specific event |
void |
createPeanutCodesForPromotion(int numberOfCodes,
int minValue,
int maxValue)
twheys@gmail.com Jan 7, 2010 |
void |
flush()
|
private String |
generatePeanutCode(String prefix)
Create a pseudorandom, unique order code consisting of the approved letters and numbers. |
static Promotion |
getAdByLink(String maybe)
Get an Advertisement Promotion object from a tracking link. |
static Promotion |
getByLink(String maybe)
Get a Promotion object from a tracking link. |
protected String |
getCacheUniqueID()
|
String |
getCode()
|
String |
getDescription()
|
String |
getLink()
|
String |
getRedirect()
|
Promotion.TrackingType |
getType()
|
private void |
insert()
twheys@gmail.com Jan 7, 2010 |
protected void |
set(ResultSet rs)
|
void |
setCode(String newCodeString)
Set the code for this promotion. |
void |
setDescription(String newDescription)
|
void |
setLink(String newLink)
|
void |
setRedirect(String newRedirectLink)
|
void |
setType(Promotion.TrackingType newType)
|
| Methods inherited from class org.starhope.appius.sql.SQLPeerDatum |
|---|
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 |
|---|
private static final long serialVersionUID
private char[] code
private String description
private String link
private int promotionID
private String redirect
Promotion.TrackingType type
Promotion.TrackingType| Constructor Detail |
|---|
protected Promotion(ResultSet rs)
throws SQLException
set(ResultSet).
rs - The result set of a Promotion.
SQLException - if the result set can't be interpreted
public Promotion(String newCode,
String newLink,
String newRedirect,
String newDescription,
Promotion.TrackingType newType)
throws IndexOutOfBoundsException,
DataException,
AlreadyExistsException
newCode - The code 4 letter tracking code for storing a
referrer for User.newLink - The link to this promotion. Follows the format of
https://members.tootsville.com/l/{link}newRedirect - The redirect link for this link if it is other
than default.newDescription - The description for this promotion.newType - The type of this promotion.
IndexOutOfBoundsException - if the code is not 4 characters
long.
DataException - if the code contains characters other than
letters.
AlreadyExistsException - if a Promotion with this link
already exists.Promotion.TrackingType
public Promotion(String newCode,
String newLink,
String newDescription,
Promotion.TrackingType newType)
throws IndexOutOfBoundsException,
DataException,
AlreadyExistsException
newCode - The code 4 letter tracking code for storing a
referer for User.newLink - The link to this promotion. Follows the format of
https://members.tootsville.com/l/{link}newDescription - The description for this promotion.newType - The type of this promotion.
IndexOutOfBoundsException - if the code is not 4 characters
long.
DataException - if the code contains characters other than
letters.
AlreadyExistsException - if a Promotion with this link
already exists.Promotion(String, String, String, String, TrackingType),
Promotion.TrackingType| Method Detail |
|---|
public static Promotion createEventPromotion(String prefixCode)
throws IndexOutOfBoundsException,
DataException,
AlreadyExistsException
prefixCode - WRITEME
AlreadyExistsException - WRITEME
DataException - WRITEME
IndexOutOfBoundsException - WRITEME
public static Promotion getAdByLink(String maybe)
throws NotFoundException
getByLink(String) to only retrieve
promotions labeled as an advertisement type.
maybe - The link in question.
NotFoundException - if there is no such ad link matching
param maybe.
public static Promotion getByLink(String maybe)
throws NotFoundException
maybe - The link in question.
NotFoundException - if there is no such link matching param
maybe.
private void assertPromotionLinkAvailable(String newLink)
throws AlreadyExistsException
newLink - The link in question.
AlreadyExistsException - if the link already exists.public void changed()
SQLPeerDatum
changed in class SQLPeerDatumSQLPeerDatum.changed()
public void createPeanutCodesForPromotion(int numberOfCodes,
int minValue,
int maxValue)
twheys@gmail.com Jan 7, 2010TO createPeanutCodesForPromotion WRITEME...
numberOfCodes - WRITEMEminValue - WRITEMEmaxValue - WRITEMEpublic void flush()
flush in class SQLPeerDatumSQLPeerDatum.flush()private String generatePeanutCode(String prefix)
prefix - prefix code for this event/product
protected String getCacheUniqueID()
getCacheUniqueID in class SQLPeerDatumSQLPeerDatum.getCacheUniqueID()public String getCode()
codepublic String getDescription()
descriptionpublic String getLink()
linkpublic String getRedirect()
redirectpublic Promotion.TrackingType getType()
typeprivate void insert()
twheys@gmail.com Jan 7, 2010TO insert WRITEME...
protected void set(ResultSet rs)
throws SQLException
set in class SQLPeerDatumrs - The result of an SQL query, with the cursor already
pointed at the row describing this specific instance
of the object.
SQLException - if the database fails somehowSQLPeerDatum.set(java.sql.ResultSet)
public void setCode(String newCodeString)
throws IndexOutOfBoundsException,
DataException
newCodeString - a 4 character string of only letters.
IndexOutOfBoundsException - if the code is not 4 characters
long.
DataException - if the code contains characters other than
letters.public void setDescription(String newDescription)
newDescription - the description of this promotion.descriptionpublic void setLink(String newLink)
newLink - the tracking link for this promotion.linkpublic void setRedirect(String newRedirectLink)
newRedirectLink - the redirect to setredirectpublic void setType(Promotion.TrackingType newType)
newType - the type to settype
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||