|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.sql.SQLPeerDatum
org.starhope.appius.user.Person
org.starhope.appius.user.Parent
public class Parent
This class represents the parent of a kid or teen account
User.getParent()
,
Serialized FormField Summary | |
---|---|
private int |
parentID
Database ID value |
private static long |
serialVersionUID
Java serialization unique ID |
Fields inherited from class org.starhope.appius.user.Person |
---|
canContact, dialect, forgotPasswordAnswer, forgotPasswordQuestion, givenName, language, mail, mailConfirmed, mailConfirmSent, password |
Constructor Summary | |
---|---|
Parent(ResultSet rs)
|
|
Parent(String parentMail)
Create a new Parent record |
|
Parent(String newMail,
String newPassword)
Create a new parent record and set an initial password at the same time |
Method Summary | |
---|---|
void |
flush()
|
String |
getApprovalCookie()
Get a cookie object for sending mail. |
static Parent |
getByApprovalCookie(String cookie)
|
static Parent |
getByID(int id)
|
static Parent |
getByMail(String mail)
|
protected String |
getCacheUniqueID()
This is an overriding method. |
User[] |
getChildren()
This will load up to 2×maxChildren children for an account. |
String |
getConfirmationTemplate()
Get the name of the template file to be used to confirm accounts of this type. |
String |
getDisplayName()
This method's only use is for more closely aligning User and Parent classes. |
HashMap<Timestamp,HashMap<String,String>> |
getHistory(Date after,
int limit)
This is an overriding method. |
int |
getID()
Return the parent record's database ID |
String |
getName()
WRITEME: document this method (twheys, Aug 05, 2009) |
static Parent |
getOrCreateByMail(String parentMail)
|
String |
getPotentialUserName()
This is an overriding method. |
String |
getResponsibleMail()
This is an overriding method. |
boolean |
hasBannedKids()
|
private void |
insert()
Insert a new parent record into the database, saving the parent eMail address and password. |
boolean |
isRegistered()
|
void |
mailIsConfirmed()
assert that the mail |
protected void |
remindPassword()
This is an overriding method. |
void |
rename(String newName)
This is an overriding method. |
void |
requestApproval(User user)
|
void |
sendNotificationForChild(User kid)
Send a notification to the parent that their child has registered an account, giving instructions on how to approve the account. |
protected void |
set(ResultSet rs)
|
org.json.JSONObject |
toJSON()
This is an overriding method. |
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum |
---|
changed, findInCache, get, saveInCache, set |
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 int parentID
Constructor Detail |
---|
public Parent(ResultSet rs)
rs
- resultset describing a parentpublic Parent(String parentMail) throws AlreadyExistsException
parentMail
- the address of the parent
AlreadyExistsException
- if a parent record already exists
with the given eMail addresspublic Parent(String newMail, String newPassword) throws PrivilegeRequiredException, AlreadyExistsException
newMail
- mail addressnewPassword
- password
AlreadyExistsException
- if the user has an existing
account, and they know the password
PrivilegeRequiredException
- if the mail exists, but the
password is wrongMethod Detail |
---|
public static Parent getByApprovalCookie(String cookie) throws NotFoundException, IOException
cookie
- the approval cookie uniquely identifying the
desired Parent
NotFoundException
- if the cookie does not uniquely
identify any Parent
IOException
- if the contents of the approval cookie can't
be decodedpublic static Parent getByID(int id)
id
- database ID number
public static Parent getByMail(String mail)
mail
- The parent's eMail address
public static Parent getOrCreateByMail(String parentMail)
parentMail
- the mail address for the parent
public void flush()
flush
in class Person
SQLPeerDatum.flush()
public String getApprovalCookie()
Person
getApprovalCookie
in class Person
Parent
,
User
protected String getCacheUniqueID()
getCacheUniqueID
in class SQLPeerDatum
SQLPeerDatum.getCacheUniqueID()
public User[] getChildren()
public String getConfirmationTemplate()
getConfirmationTemplate
in class Person
Person.getConfirmationTemplate()
public String getDisplayName()
Person
getDisplayName
in class Person
Person.getDisplayName()
public HashMap<Timestamp,HashMap<String,String>> getHistory(Date after, int limit)
getHistory
in class Person
after
- If non-null, specifies the date after which we want
to view records. To see all records, back to the creation
of the user record, supply a null.limit
- If this is a positive number, it limits the results
to this number of records.
Person.getHistory(java.sql.Date,int)
public int getID()
public String getName()
public String getPotentialUserName()
getPotentialUserName
in class Person
Person.getPotentialUserName()
public String getResponsibleMail()
getResponsibleMail
in class Person
Person.getResponsibleMail()
public boolean hasBannedKids()
private void insert() throws AlreadyExistsException
AlreadyExistsException
- if the record already existspublic boolean isRegistered()
public void mailIsConfirmed()
protected void remindPassword()
remindPassword
in class Person
Person.remindPassword()
public void rename(String newName)
rename
in class Person
newName
- The new user namePerson.rename(java.lang.String)
public void requestApproval(User user)
user
- send a notification for the given child user, to
request parental approvalpublic void sendNotificationForChild(User kid)
Send a notification to the parent that their child has registered an account, giving instructions on how to approve the account.
kid
- the user who is a child of this parentprotected void set(ResultSet rs) throws SQLException
set
in class SQLPeerDatum
rs
- 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 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 |