org.starhope.appius.mb
Class MBSession

java.lang.Object
  extended by org.starhope.appius.mb.MBSession
All Implemented Interfaces:
Serializable

public class MBSession
extends Object
implements Serializable

This is the session data collected from an arbitrary front-end system (e.g. typical web-browser front-end system) performing some actions involving the user's Membership & Billing records. This is typically associated with a web browser session cookie in a fairly transparent way.

Author:
brpocock@star-hope.org
See Also:
Serialized Form

Field Summary
 org.starhope.appius.mb.fields.MBField_String address1
          Street address (first line)
 org.starhope.appius.mb.fields.MBField_String address2
          Street address (second line)
private static BeforePageHook beforePageHook
          hook to run before the engine hits a page
 org.starhope.appius.mb.fields.MBField_String buyerFamilyName
          Buyer's family name / surname
 org.starhope.appius.mb.fields.MBField_String buyerGivenName
          Buyer's given name
 org.starhope.appius.mb.fields.MBField_Boolean canContact
          Permission to contact the user
 org.starhope.appius.mb.fields.MBField_DataRecord<AvatarClass> characterClass
          WRITEME: Document this brpocock@star-hope.org
 org.starhope.appius.mb.fields.MBField_Child child
          The child currently selected by a parent
 org.starhope.appius.mb.fields.MBField_String city
          City/town/village/&c
 org.starhope.appius.mb.fields.MBField_String country
          country
 MBField_NumericString creditCardCode
          Credit-Card confirmation code, aka CVC, CCV, and a million other names.
 org.starhope.appius.mb.fields.MBField_Calendar creditCardExpiry
          expiry date (month and year only are significant)
 MBField_CreditCardNumber creditCardNumber
          Credit-card number
 org.starhope.appius.mb.fields.MBField_String creditCardType
          Credit-card type string, “visa” or “mastercard”
 org.starhope.appius.mb.fields.MBField_DateOfBirth dateOfBirth
          New user registering, date of birth
 org.starhope.appius.mb.fields.MBField_DataRecord<Enrolment> enrolmentChosen
          Enrolment type chosen
private  EnumMap<org.starhope.appius.mb.fields.MBFieldIdent,EnumSet<MBErrorReason>> errors
          WRITEME: Document this brpocock@star-hope.org
private  Set<String> errorToasts
          Error message toasts
private  Map<String,String> extraParams
          extra params set for local use
private static EnumMap<org.starhope.appius.mb.fields.MBFieldIdent,Set<String>> fieldsMapConfirm
          fields that require double-entry confirmation in the UI
private static EnumMap<org.starhope.appius.mb.fields.MBFieldIdent,Set<String>> fieldsMapInput
          Mapping input fields to MBFieldIdent tokens
 org.starhope.appius.mb.fields.MBField_String forgotPasswordA
          Forgotten password recovery question's answer
 org.starhope.appius.mb.fields.MBField_String forgotPasswordQ
          Forgotten password recovery question
 org.starhope.appius.mb.fields.MBField_String givenName
          User's self-identified given name (optional)
(package private)  EnumSet<MBGoal> goals
          Goals that the user is trying to acheive
private  String lastPage
          previous page viewed
private  String latestPage
          current page being viewed
(package private)  String latestSource
          The latest place from which the user accessed this session.
 org.starhope.appius.mb.fields.MBField_String loginAuth
          Login, being entered for authentication purposes
 org.starhope.appius.mb.fields.MBField_LoginRequest loginRequested
          Login, being requested for new registration or rename
 org.starhope.appius.mb.fields.MBField_Mail mailAuth
          Parent logins
 org.starhope.appius.mb.fields.MBField_Mail mailProvided
          User's mail, maybe for registration, maybe for parent login
private  int mySerial
          Local session unique serial number for debugging tracing
private static Set<MBParamTranslator> paramTranslators
          A collection of hooks to run during parameter processing
 org.starhope.appius.mb.fields.MBField_Password passwordAuth
          Password, being provided for authentication purposes
 org.starhope.appius.mb.fields.MBField_Password passwordRequested
          Password, being requested for new registration or password-change
 org.starhope.appius.mb.fields.MBField_Payment payment
          Payment being constructed
 org.starhope.appius.mb.fields.MBField_String phone
          phone number
 org.starhope.appius.mb.fields.MBField_String postalCode
          postal code / ZIP code
private static Set<PostParentRegistrationHook> postParentRegistrationHooks
          Hooks to run after successful parent registrations
private static Set<PostPaymentHook> postPaymentHooks
          Hooks to run after enrolment payments are received.
private static Set<PostUserRegistrationHook> postUserRegistrationHooks
          Hooks to run after successful user registrations
 org.starhope.appius.mb.fields.MBField_String prepaidCode
          Code from a prepaid card or promotion
 org.starhope.appius.mb.fields.MBField_String province
          State/province/locality/county/whatever
 org.starhope.appius.mb.fields.MBField_Boolean_True rulesAgree
          Agree to some rules other than the T&C
private static AtomicInteger serial
          For debugging/tracking purposes, assign unique serial numbers to each session originated.
private static long serialVersionUID
          Java serialisation unique ID
private  String sourceCookie
          a cookie identifying the referral source for the user coming in
 org.starhope.appius.mb.fields.MBField_Boolean_True termsConditionsAgree
          User agreeing to terms and conditions
private  Map<String,String> toasts
          Toasts
private static Map<String,EnumSet<org.starhope.appius.mb.fields.MBFieldIdent>> urls
          A mapping of URL:s to the fields that they are expected to set/provide
private  Parent visitorAsParent
          the parent who is visiting the site (if one, see visitorRole)
private  User visitorAsUser
          the user who is visiting the site (if one, see visitorAsUser)
private  VisitorRole visitorRole
          whether the current visitor to the site is acting for themself, or is a parent
 
Constructor Summary
MBSession()
          WRITEME: Document this constructor brpocock@star-hope.org
 
Method Summary
private  void _fulfillGoals()
          See if any goals can be fulfilled.
 void acceptInput(javax.servlet.ServletRequest params)
          Set any fields who find associated parameters, to their associated values.
 void add(org.starhope.appius.mb.fields.MBFieldIdent field, MBErrorReason reason)
          WRITEME: Document this method brpocock@star-hope.org
 boolean add(MBGoal goal)
           
 void addErrorToast(String text)
           
static void addParamTranslator(MBParamTranslator translator)
           
static void addPostEnrolmentHook(PostPaymentHook hook)
           
static void addPostParentRegistrationHook(PostParentRegistrationHook hook)
           
static void addPostUserRegistrationHook(PostUserRegistrationHook hook)
           
 void addToast(String id, String message)
          WRITEME: Document this method brpocock@star-hope.org
 void beforePage(javax.servlet.jsp.PageContext context)
          Do stuff before starting on the page
private  void changePassword()
          WRITEME: Document this method brpocock@star-hope.org
private  void checkForActiveMember()
          WRITEME: Document this method brpocock@star-hope.org
private  void chooseAccountToPay()
          Choose an account for which to pay
 void clearErrors()
          Clear the enqueued errors set
 void clearErrorsFor(org.starhope.appius.mb.fields.MBFieldIdent field)
          clear all errors
 void forgetVisitor()
          Forget (log out) the user.
static MBSession get(javax.servlet.http.HttpServletRequest request)
          Convenience method for JSP's
static MBSession get(javax.servlet.http.HttpSession httpSession)
          Extract the MBSession from the HttpSession
 String getBestNextURI()
           
 Calendar getBirthDate()
           
 String getCharacterClass()
           
 Enrolment getEnrolmentType()
          WRITEME: Document this method brpocock@star-hope.org
 Map<org.starhope.appius.mb.fields.MBFieldIdent,EnumSet<MBErrorReason>> getErrors()
           
 Map<org.starhope.appius.mb.fields.MBFieldIdent,EnumSet<MBErrorReason>> getErrorsAndClear()
           
 Set<Pair<org.starhope.appius.mb.fields.MBFieldIdent,String>> getErrorToastsAndClear()
           This gets all errors, whether associated with a particular field or not, and returns them for toasts and tool tips and such.
 String getExtraParam(String key)
          Store an extra param
 org.starhope.appius.mb.fields.MBField<?> getField(org.starhope.appius.mb.fields.MBFieldIdent ident)
          Find a field in the session that handles the given ident
 Set<org.starhope.appius.mb.fields.MBFieldIdent> getFieldsNeeded()
           
 Set<org.starhope.appius.mb.fields.MBFieldIdent> getFieldsOn(String requestURI)
           
 String getForgotPasswordAnswer()
           
 String getForgotPasswordQuestion()
           
 Set<MBGoal> getGoals()
           
 String getLastURI()
           
 String getLatestSource()
           
 String getMail()
          Deprecated. mailProvided
 String getPasswordRequested()
          Deprecated. passwordRequested
 Payment getPayment()
           
 String getPrepaidCookie()
          Historically was "ibc" — prepaid card identification string of some kind
 String getRequestedUserName()
          Deprecated. loginRequested
 String getSource()
          Get the referral source for this user landing
private  User getTargetMember()
           
 List<String> getToastsAndClear()
          Get the toasts, and clear them.
 Parent getVisitorAsParent()
          WRITEME: Document this method brpocock@star-hope.org
 User getVisitorAsUser()
          WRITEME: Document this method brpocock@star-hope.org
 VisitorRole getVisitorRole()
          WRITEME: Document this method brpocock@star-hope.org
 boolean hasAgreedToTerms()
          WRITEME: Document this method brpocock@star-hope.org
 boolean hasAgreedToTerms(boolean really)
          WRITEME: Document this method brpocock@star-hope.org
 boolean hasErrors()
           
private  void logInParent()
          WRITEME: Document this method brpocock@star-hope.org
private  void logInSelf()
          WRITEME: Document this method brpocock@star-hope.org
 void logout(javax.servlet.http.HttpSession httpSession)
          Destroy the association between this session object and the HTTP session provided
static void mapConfirmField(org.starhope.appius.mb.fields.MBFieldIdent ident, Set<String> fieldNames)
           
static void mapConfirmField(org.starhope.appius.mb.fields.MBFieldIdent ident, String fieldName)
           
static void mapField(org.starhope.appius.mb.fields.MBFieldIdent ident, Set<String> fieldNames)
           
static void mapField(org.starhope.appius.mb.fields.MBFieldIdent ident, String fieldName)
           
private  void payAccount()
          WRITEME: Document this method brpocock@star-hope.org
static void provideURL(Collection<org.starhope.appius.mb.fields.MBFieldIdent> fields, String url)
          Identify an URL which can be used to ask for a certain set of fields.
static void provideURL(org.starhope.appius.mb.fields.MBFieldIdent[] fields, String url)
          Identify an URL which can be used to ask for a certain set of fields.
private  void registerParent()
          Register a new parent account (but be lenient, in case they forgot they already have one)
private  void registerUser()
          Create a new user account
 boolean remove(MBGoal goal)
           
static void setBeforePageHook(BeforePageHook newHook)
           
 Calendar setBirthDate(String year, String month, String day)
          WRITEME: Document this method brpocock@star-hope.org
 String setCharacterClass(String newClass)
          WRITEME: Document this method brpocock@star-hope.org
 String setExtraParam(String key, String value)
          store something extra in the session for local handlers; use SPARINGLY
 void setForgottenPassword(String q, String a)
          WRITEME: Document this method brpocock@star-hope.org
 void setLatestSource(String newSource)
           
 void setPrepaidCookie(String newCookie)
           
 String setRequestedUserName(String login)
          WRITEME: Document this method brpocock@star-hope.org
private  void setResponsibleMail()
          WRITEME: Document this method brpocock@star-hope.org
 String setSource(String cookie)
          WRITEME: Document this method brpocock@star-hope.org
 void setVisitorAsParent(Parent parent)
          WRITEME: Document this method brpocock@star-hope.org
 void setVisitorAsUser(User sessionUser)
          WRITEME: Document this method brpocock@star-hope.org
static String stripIndex(String uri)
          Strip the “index.jsp” and/or trailing “/” off a URI to get a normalised form for index pages
 String toString()
           
 boolean wantToVisit(String pageURI)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serial

private static final AtomicInteger serial
For debugging/tracking purposes, assign unique serial numbers to each session originated.


beforePageHook

private static BeforePageHook beforePageHook
hook to run before the engine hits a page


fieldsMapConfirm

private static final EnumMap<org.starhope.appius.mb.fields.MBFieldIdent,Set<String>> fieldsMapConfirm
fields that require double-entry confirmation in the UI


fieldsMapInput

private static final EnumMap<org.starhope.appius.mb.fields.MBFieldIdent,Set<String>> fieldsMapInput
Mapping input fields to MBFieldIdent tokens


paramTranslators

private static final Set<MBParamTranslator> paramTranslators
A collection of hooks to run during parameter processing


postParentRegistrationHooks

private static final Set<PostParentRegistrationHook> postParentRegistrationHooks
Hooks to run after successful parent registrations


postPaymentHooks

private static final Set<PostPaymentHook> postPaymentHooks
Hooks to run after enrolment payments are received.


postUserRegistrationHooks

private static final Set<PostUserRegistrationHook> postUserRegistrationHooks
Hooks to run after successful user registrations


serialVersionUID

private static final long serialVersionUID
Java serialisation unique ID

See Also:
Constant Field Values

urls

private static Map<String,EnumSet<org.starhope.appius.mb.fields.MBFieldIdent>> urls
A mapping of URL:s to the fields that they are expected to set/provide


address1

public final org.starhope.appius.mb.fields.MBField_String address1
Street address (first line)


address2

public final org.starhope.appius.mb.fields.MBField_String address2
Street address (second line)


buyerFamilyName

public final org.starhope.appius.mb.fields.MBField_String buyerFamilyName
Buyer's family name / surname


buyerGivenName

public final org.starhope.appius.mb.fields.MBField_String buyerGivenName
Buyer's given name


canContact

public final org.starhope.appius.mb.fields.MBField_Boolean canContact
Permission to contact the user


characterClass

public final org.starhope.appius.mb.fields.MBField_DataRecord<AvatarClass> characterClass
WRITEME: Document this brpocock@star-hope.org


child

public final org.starhope.appius.mb.fields.MBField_Child child
The child currently selected by a parent


city

public final org.starhope.appius.mb.fields.MBField_String city
City/town/village/&c


country

public final org.starhope.appius.mb.fields.MBField_String country
country


creditCardCode

public final MBField_NumericString creditCardCode
Credit-Card confirmation code, aka CVC, CCV, and a million other names. The confirmation code off the back of the card.


creditCardExpiry

public final org.starhope.appius.mb.fields.MBField_Calendar creditCardExpiry
expiry date (month and year only are significant)


creditCardNumber

public final MBField_CreditCardNumber creditCardNumber
Credit-card number


creditCardType

public final org.starhope.appius.mb.fields.MBField_String creditCardType
Credit-card type string, “visa” or “mastercard”


mailAuth

public final org.starhope.appius.mb.fields.MBField_Mail mailAuth
Parent logins


dateOfBirth

public final org.starhope.appius.mb.fields.MBField_DateOfBirth dateOfBirth
New user registering, date of birth


enrolmentChosen

public final org.starhope.appius.mb.fields.MBField_DataRecord<Enrolment> enrolmentChosen
Enrolment type chosen


errors

private final EnumMap<org.starhope.appius.mb.fields.MBFieldIdent,EnumSet<MBErrorReason>> errors
WRITEME: Document this brpocock@star-hope.org


errorToasts

private final Set<String> errorToasts
Error message toasts


extraParams

private final Map<String,String> extraParams
extra params set for local use


forgotPasswordA

public final org.starhope.appius.mb.fields.MBField_String forgotPasswordA
Forgotten password recovery question's answer


forgotPasswordQ

public final org.starhope.appius.mb.fields.MBField_String forgotPasswordQ
Forgotten password recovery question


givenName

public final org.starhope.appius.mb.fields.MBField_String givenName
User's self-identified given name (optional)


goals

EnumSet<MBGoal> goals
Goals that the user is trying to acheive


loginAuth

public final org.starhope.appius.mb.fields.MBField_String loginAuth
Login, being entered for authentication purposes


loginRequested

public final org.starhope.appius.mb.fields.MBField_LoginRequest loginRequested
Login, being requested for new registration or rename


mailProvided

public final org.starhope.appius.mb.fields.MBField_Mail mailProvided
User's mail, maybe for registration, maybe for parent login


passwordAuth

public final org.starhope.appius.mb.fields.MBField_Password passwordAuth
Password, being provided for authentication purposes


passwordRequested

public final org.starhope.appius.mb.fields.MBField_Password passwordRequested
Password, being requested for new registration or password-change


payment

public final org.starhope.appius.mb.fields.MBField_Payment payment
Payment being constructed


phone

public final org.starhope.appius.mb.fields.MBField_String phone
phone number


postalCode

public final org.starhope.appius.mb.fields.MBField_String postalCode
postal code / ZIP code


prepaidCode

public final org.starhope.appius.mb.fields.MBField_String prepaidCode
Code from a prepaid card or promotion


province

public final org.starhope.appius.mb.fields.MBField_String province
State/province/locality/county/whatever


rulesAgree

public final org.starhope.appius.mb.fields.MBField_Boolean_True rulesAgree
Agree to some rules other than the T&C


sourceCookie

private String sourceCookie
a cookie identifying the referral source for the user coming in


termsConditionsAgree

public final org.starhope.appius.mb.fields.MBField_Boolean_True termsConditionsAgree
User agreeing to terms and conditions


toasts

private final Map<String,String> toasts
Toasts


visitorAsParent

private Parent visitorAsParent
the parent who is visiting the site (if one, see visitorRole)


visitorAsUser

private User visitorAsUser
the user who is visiting the site (if one, see visitorAsUser)


visitorRole

private VisitorRole visitorRole
whether the current visitor to the site is acting for themself, or is a parent


latestSource

String latestSource
The latest place from which the user accessed this session.


mySerial

private final int mySerial
Local session unique serial number for debugging tracing


lastPage

private String lastPage
previous page viewed


latestPage

private String latestPage
current page being viewed

Constructor Detail

MBSession

public MBSession()
WRITEME: Document this constructor brpocock@star-hope.org

Method Detail

addParamTranslator

public static void addParamTranslator(MBParamTranslator translator)
Parameters:
translator - A facility that may be able to translate “unusual” fields submitted by forms into types that can be understood by MBSession

addPostEnrolmentHook

public static void addPostEnrolmentHook(PostPaymentHook hook)
Parameters:
hook - A hook to be run after receiving an enrolment payment. The interface provides different methods to easily handle various cases.

addPostParentRegistrationHook

public static void addPostParentRegistrationHook(PostParentRegistrationHook hook)
Parameters:
hook - a hook to run after registering a new parent successfully

addPostUserRegistrationHook

public static void addPostUserRegistrationHook(PostUserRegistrationHook hook)
Parameters:
hook - a hook to run after registering a new user successfully

get

public static MBSession get(javax.servlet.http.HttpServletRequest request)
Convenience method for JSP's

Parameters:
request - Servlet request object
Returns:
MBSession gotten from the associated HttpSession by get(HttpSession)

get

public static MBSession get(javax.servlet.http.HttpSession httpSession)
Extract the MBSession from the HttpSession

Parameters:
httpSession - the HttpSession with the MBSession stored in it
Returns:
the stored (or a new) MBSession

mapConfirmField

public static void mapConfirmField(org.starhope.appius.mb.fields.MBFieldIdent ident,
                                   Set<String> fieldNames)
Parameters:
ident - the M&B Field identifier
fieldNames - the names of input confirmation fields from the ServletRequest

mapConfirmField

public static void mapConfirmField(org.starhope.appius.mb.fields.MBFieldIdent ident,
                                   String fieldName)
Parameters:
ident - the M&B Field identifier
fieldName - the name of one input confirmation field from the HttpParams

mapField

public static void mapField(org.starhope.appius.mb.fields.MBFieldIdent ident,
                            Set<String> fieldNames)
Parameters:
ident - the M&B Field identifier
fieldNames - the names of input fields from the HttpParams

mapField

public static void mapField(org.starhope.appius.mb.fields.MBFieldIdent ident,
                            String fieldName)
Parameters:
ident - the M&B Field identifier
fieldName - the name of one input field from the HttpParams

provideURL

public static void provideURL(Collection<org.starhope.appius.mb.fields.MBFieldIdent> fields,
                              String url)
Identify an URL which can be used to ask for a certain set of fields.

Parameters:
fields - fields presented at that URL
url - the URL

provideURL

public static void provideURL(org.starhope.appius.mb.fields.MBFieldIdent[] fields,
                              String url)
Identify an URL which can be used to ask for a certain set of fields.

Parameters:
fields - fields presented at that URL
url - the URL

setBeforePageHook

public static void setBeforePageHook(BeforePageHook newHook)
Parameters:
newHook - beforePage(PageContext) hook for beforePageHook (singular)

stripIndex

public static String stripIndex(String uri)
Strip the “index.jsp” and/or trailing “/” off a URI to get a normalised form for index pages

Parameters:
uri - The URI to be stripped
Returns:
The original URI, less any final “/index.jsp” or “/”

_fulfillGoals

private void _fulfillGoals()
See if any goals can be fulfilled. (Note: the underscore isn't some kind of dumb “don't mess with me” marker or anything: it's just so this very important dispatcher routine alphabetises to the top in Eclipse. ~BRP)


acceptInput

public void acceptInput(javax.servlet.ServletRequest params)
Set any fields who find associated parameters, to their associated values.

Parameters:
params - parameters provided by Tomcat (&c.)

add

public void add(org.starhope.appius.mb.fields.MBFieldIdent field,
                MBErrorReason reason)
WRITEME: Document this method brpocock@star-hope.org

Parameters:
field - the field affected by the error
reason - what type of error

add

public boolean add(MBGoal goal)
Parameters:
goal - a (possibly new) goal that the user wants to achieve
Returns:
whether the goal was new (false, if we already knew they wanted to do that)

addErrorToast

public void addErrorToast(String text)
Parameters:
text - a new error message toast

addToast

public void addToast(String id,
                     String message)
WRITEME: Document this method brpocock@star-hope.org

Parameters:
id - WRITEME
message - WRITEME

beforePage

public void beforePage(javax.servlet.jsp.PageContext context)
Do stuff before starting on the page

Parameters:
context - page context

changePassword

private void changePassword()
WRITEME: Document this method brpocock@star-hope.org


checkForActiveMember

private void checkForActiveMember()
WRITEME: Document this method brpocock@star-hope.org


chooseAccountToPay

private void chooseAccountToPay()
Choose an account for which to pay


clearErrors

public void clearErrors()
Clear the enqueued errors set


clearErrorsFor

public void clearErrorsFor(org.starhope.appius.mb.fields.MBFieldIdent field)
clear all errors

Parameters:
field - the field

forgetVisitor

public void forgetVisitor()
Forget (log out) the user. Other cachéd values are remembered.


getBestNextURI

public String getBestNextURI()
Returns:
The best page to go, next.

getBirthDate

public Calendar getBirthDate()
Returns:
get the birthdate of the user entered.

getCharacterClass

public String getCharacterClass()
Returns:
the character class or type chosen during player registration. In Tootsville™ this is one of the Basic 8 Toot names; in other games, it might e.g. be “fighter” or “mage” or “female-gnome-bard-with-bad-teeth”

getEnrolmentType

public Enrolment getEnrolmentType()
                           throws NotFoundException
WRITEME: Document this method brpocock@star-hope.org

Returns:
WRITEME
Throws:
NotFoundException - WRITEME

getErrors

public Map<org.starhope.appius.mb.fields.MBFieldIdent,EnumSet<MBErrorReason>> getErrors()
Returns:
get all errors reported, without disturbing them.

getErrorsAndClear

public Map<org.starhope.appius.mb.fields.MBFieldIdent,EnumSet<MBErrorReason>> getErrorsAndClear()
Returns:
get all errors reported, without disturbing them.

getErrorToastsAndClear

public Set<Pair<org.starhope.appius.mb.fields.MBFieldIdent,String>> getErrorToastsAndClear()

This gets all errors, whether associated with a particular field or not, and returns them for toasts and tool tips and such. Toasts are returned with a null field entry.

This is not a Map, because one field could have multiple errors associated with it. However, the EnumSet implementation in the back end will ensure that a single error, even if detected multiple times, will only be reported once per field.

Both field-associated error codes and general toasts are cleared.

Returns:
All errors known to date.

getExtraParam

public String getExtraParam(String key)
Store an extra param

Parameters:
key - dotted-notation unique ID, e.g. com.tootsville.peanutCode
Returns:
value saved in this session

getField

public org.starhope.appius.mb.fields.MBField<?> getField(org.starhope.appius.mb.fields.MBFieldIdent ident)
Find a field in the session that handles the given ident

Parameters:
ident - the MBFieldIdent
Returns:
the <> in this session handling it

getFieldsNeeded

public Set<org.starhope.appius.mb.fields.MBFieldIdent> getFieldsNeeded()
Returns:
the set of fields which have errors before the goal(s) can be reached. Does not clear any existing error codes, so this includes stuff we tried to process recently (since the error stack was cleared) as well as anything that might happen to be failing validation for one of the expressed goals.

getFieldsOn

public Set<org.starhope.appius.mb.fields.MBFieldIdent> getFieldsOn(String requestURI)
Parameters:
requestURI - the page
Returns:
all fields expected to be found on that page

getForgotPasswordAnswer

public String getForgotPasswordAnswer()
Returns:
the answer to the forgotten password question c.v. getForgotPasswordQuestion()

getForgotPasswordQuestion

public String getForgotPasswordQuestion()
Returns:
the question for forgotten password recovery, c.v. getForgotPasswordAnswer()

getGoals

public Set<MBGoal> getGoals()
Returns:
the goals that we think the user wants to acheive

getLastURI

public String getLastURI()
Returns:
the URI of the PRIOR page

getLatestSource

public String getLatestSource()
Returns:
the latestSource

getMail

@Deprecated
public String getMail()
Deprecated. mailProvided

Returns:
mail provided

getPasswordRequested

@Deprecated
public String getPasswordRequested()
Deprecated. passwordRequested

Returns:
password requested

getPayment

public Payment getPayment()
Returns:
WRITEME payment object

getPrepaidCookie

public String getPrepaidCookie()
Historically was "ibc" — prepaid card identification string of some kind

Returns:
prepaid card cookie

getRequestedUserName

@Deprecated
public String getRequestedUserName()
Deprecated. loginRequested

Returns:
WRITEME

getSource

public String getSource()
Get the referral source for this user landing

Returns:
referral source cookie string

getTargetMember

private User getTargetMember()
Returns:
the member being targeted for change password, payment, cancel account, and so forth.

getToastsAndClear

public List<String> getToastsAndClear()
Get the toasts, and clear them. (Remove them all)

Returns:
The toasts

getVisitorAsParent

public Parent getVisitorAsParent()
                          throws NotFoundException
WRITEME: Document this method brpocock@star-hope.org

Returns:
WRITEME
Throws:
NotFoundException - if the visitor isn't known to be a parent

getVisitorAsUser

public User getVisitorAsUser()
                      throws NotFoundException
WRITEME: Document this method brpocock@star-hope.org

Returns:
WRITEME
Throws:
NotFoundException - WRITEME

getVisitorRole

public VisitorRole getVisitorRole()
WRITEME: Document this method brpocock@star-hope.org

Returns:
WRITEME

hasAgreedToTerms

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

Returns:
WRITEME

hasAgreedToTerms

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

Parameters:
really - WRITEME
Returns:
WRITEME

hasErrors

public boolean hasErrors()
Returns:
true, if there are errors to report.

logInParent

private void logInParent()
WRITEME: Document this method brpocock@star-hope.org


logInSelf

private void logInSelf()
WRITEME: Document this method brpocock@star-hope.org


logout

public void logout(javax.servlet.http.HttpSession httpSession)
Destroy the association between this session object and the HTTP session provided

Parameters:
httpSession - the session storing the reference

payAccount

private void payAccount()
WRITEME: Document this method brpocock@star-hope.org


registerParent

private void registerParent()
Register a new parent account (but be lenient, in case they forgot they already have one)


registerUser

private void registerUser()
Create a new user account


remove

public boolean remove(MBGoal goal)
Parameters:
goal - the goal to remove (as achieved or decided against it)
Returns:
whether that had actually been a goal before, and was removed

setBirthDate

public Calendar setBirthDate(String year,
                             String month,
                             String day)
                      throws NumberFormatException,
                             GameLogicException
WRITEME: Document this method brpocock@star-hope.org

Parameters:
year - WRITEME
month - WRITEME
day - WRITEME
Returns:
the calendar date set
Throws:
NumberFormatException - WRITEME
GameLogicException - if the date is impossible(-ish) for a date of birth

setCharacterClass

public String setCharacterClass(String newClass)
WRITEME: Document this method brpocock@star-hope.org

Parameters:
newClass - WRITEME
Returns:
WRITEME

setExtraParam

public String setExtraParam(String key,
                            String value)
store something extra in the session for local handlers; use SPARINGLY

Parameters:
key - dotted-notation unique ID, e.g. com.tootsville.peanutCode
value - arbitrary value; set to null to clear.
Returns:
the value stored, for chaining

setForgottenPassword

public void setForgottenPassword(String q,
                                 String a)
WRITEME: Document this method brpocock@star-hope.org

Parameters:
q - WRITEME
a - WRITEME

setLatestSource

public void setLatestSource(String newSource)
Parameters:
newSource - the latestSource to set

setPrepaidCookie

public void setPrepaidCookie(String newCookie)
Parameters:
newCookie - the prepaidCookie to set

setRequestedUserName

public String setRequestedUserName(String login)
WRITEME: Document this method brpocock@star-hope.org

Parameters:
login - WRITEME
Returns:
WRITEME

setResponsibleMail

private void setResponsibleMail()
WRITEME: Document this method brpocock@star-hope.org


setSource

public String setSource(String cookie)
WRITEME: Document this method brpocock@star-hope.org

Parameters:
cookie - WRITEME
Returns:
WRITEME

setVisitorAsParent

public void setVisitorAsParent(Parent parent)
WRITEME: Document this method brpocock@star-hope.org

Parameters:
parent - WRITEME

setVisitorAsUser

public void setVisitorAsUser(User sessionUser)
WRITEME: Document this method brpocock@star-hope.org

Parameters:
sessionUser - WRITEME

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

wantToVisit

public boolean wantToVisit(String pageURI)
Parameters:
pageURI - page URI
Returns:
true, if we really want to be here.