|
||||||||||
| 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.messaging.MailMessage
public class MailMessage
| Nested Class Summary | |
|---|---|
static class |
MailMessage.MessageFlag
Flags for messages |
| Field Summary | |
|---|---|
private String |
attachmentURL
URL of an attachment (XXX WHAT?) |
private String |
body
body of the message |
private static AbstractCensor |
censor
The censoring object used to filter in-game mail messages |
private HashMap<Integer,MailMessage.MessageFlag> |
flags
Flags set on this message, stored by key of the userID who created the flag and the value of the flag names. |
private int |
fromID
sender user ID |
private String |
fromName
sender name |
private int |
id
message unique ID |
private int |
inReplyTo
If this message is in reply to another, then this is the message ID of the parent message. |
private boolean |
isDeleted
If true, the user (or a moderator) has deleted this message |
private boolean |
isWallPost
If true, this message is a Wall Post on TootsBook. |
private Timestamp |
read
WRITEME: document this field (brpocock@star-hope.org, Nov 19, 2009) read (MailMessage) |
private Timestamp |
sent
WRITEME: document this field (brpocock@star-hope.org, Nov 19, 2009) sent (MailMessage) |
private static long |
serialVersionUID
Java serialisation version ID |
private String |
subject
WRITEME: document this field (brpocock@star-hope.org, Nov 19, 2009) subject (MailMessage) |
private int |
toID
WRITEME: document this field (brpocock@star-hope.org, Nov 19, 2009) toID (MailMessage) |
private String |
toName
The name of the message's recipient. |
| Constructor Summary | |
|---|---|
MailMessage()
|
|
MailMessage(ResultSet row)
Instantiate a mail message from a database row |
|
| Method Summary | |
|---|---|
void |
addFlag(AbstractUser u,
MailMessage.MessageFlag flag)
Add a flag to this message. |
void |
addFlag(int fromUserID,
MailMessage.MessageFlag flag)
Add a flag to this message. |
void |
delete()
Delete this message (making it invisible in the inbox or wall) |
void |
flush()
|
String |
getAttachmentURL()
WRITEME |
String |
getBody()
WRITEME |
GameWorldMessage |
getByID(int idToGet)
|
protected String |
getCacheUniqueID()
|
private void |
getFlags()
twheys@gmail.com Apr 6, 2010 |
int |
getFromID()
|
String |
getFromName()
|
int |
getID()
Returns the ID of this post. |
int |
getInReplyTo()
|
Vector<GameWorldMessage> |
getMessagesFrom(PreparedStatement st)
Fetch an ordered set of messages based upon a prepared statement |
Timestamp |
getRead()
|
Timestamp |
getSent()
|
String |
getSubject()
|
int |
getToID()
|
String |
getToName()
|
private void |
insert()
|
boolean |
isDeleted()
|
boolean |
isWallPost()
|
void |
markAsRead()
|
boolean |
send()
|
protected void |
set(ResultSet rs)
|
void |
setAttachmentURL(String newAttachmentURL)
WRITEME |
boolean |
setBody(String newBody)
|
void |
setFrom(GeneralUser sender)
Set the sender of this message |
void |
setFromID(int fromID1)
|
void |
setInReplyTo(int parentMessageID)
|
void |
setRead(Timestamp timeRead)
|
void |
setSent(Timestamp sent1)
|
void |
setSubject(String subject1)
|
void |
setTo(GeneralUser recipient)
Set the recipient of this message |
void |
setToID(int toID1)
Set the recipient of this message |
void |
setWallPost(boolean wallPostQ)
// * @param wallPostQ WRITEME |
org.json.JSONObject |
toJSON()
This is the default SQLPeerDatum implementation of toJSON. |
org.json.JSONObject |
toJSON(boolean inMailbox)
Get the public representation of this message in JSON form |
void |
undelete()
Undeletes a mail message and places it in the Inbox. |
| Methods inherited from class org.starhope.appius.sql.SQLPeerDatum |
|---|
changed, compareTo, 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 AbstractCensor censor
private static final long serialVersionUID
private String attachmentURL
private String body
private final HashMap<Integer,MailMessage.MessageFlag> flags
private int fromID
private String fromName
private int id
private int inReplyTo
private boolean isDeleted
private boolean isWallPost
private Timestamp read
private Timestamp sent
private String subject
private int toID
private String toName
| Constructor Detail |
|---|
public MailMessage()
public MailMessage(ResultSet row)
throws SQLException
row - the database row to be interpreted
SQLException - if the dataset can't be interpreted| Method Detail |
|---|
public void addFlag(AbstractUser u,
MailMessage.MessageFlag flag)
u - The user adding the flagflag - the flag to be added
public void addFlag(int fromUserID,
MailMessage.MessageFlag flag)
fromUserID - The user ID for the user adding the flagflag - the flag to be addedpublic void delete()
GameWorldMessage
delete in interface GameWorldMessageGameWorldMessage.delete()public void flush()
flush in interface GameWorldMessageflush in class SQLPeerDatumGameWorldMessage.flush()public String getAttachmentURL()
getAttachmentURL in interface GameWorldMessagepublic String getBody()
getBody in interface GameWorldMessageGameWorldMessage.getBody()
public GameWorldMessage getByID(int idToGet)
throws NotFoundException
getByID in interface GameWorldMessageidToGet - WRITEME
NotFoundException - WRITEMEprotected String getCacheUniqueID()
getCacheUniqueID in class SQLPeerDatumSQLPeerDatum.getCacheUniqueID()private void getFlags()
twheys@gmail.com Apr 6, 2010TO getFlags WRITEME...
public int getFromID()
getFromID in interface GameWorldMessageGameWorldMessage.getFromID()public String getFromName()
getFromName in interface GameWorldMessageGameWorldMessage.getFromName()public int getID()
GameWorldMessage
getID in interface GameWorldMessageGameWorldMessage.getID()public int getInReplyTo()
getInReplyTo in interface GameWorldMessageGameWorldMessage.getInReplyTo()
public Vector<GameWorldMessage> getMessagesFrom(PreparedStatement st)
throws SQLException
getMessagesFrom in interface GameWorldMessagest - A prepared statement ready to be executed
SQLException - if there's a problem getting resultspublic Timestamp getRead()
getRead in interface GameWorldMessageGameWorldMessage.getRead()public Timestamp getSent()
getSent in interface GameWorldMessageGameWorldMessage.getSent()public String getSubject()
getSubject in interface GameWorldMessageGameWorldMessage.getSubject()public int getToID()
getToID in interface GameWorldMessageGameWorldMessage.getToID()public String getToName()
getToName in interface GameWorldMessageGameWorldMessage.getToName()private void insert()
public boolean isDeleted()
isDeleted in interface GameWorldMessageGameWorldMessage.isDeleted()public boolean isWallPost()
isWallPost in interface GameWorldMessageGameWorldMessage.isWallPost()public void markAsRead()
markAsRead in interface GameWorldMessageGameWorldMessage.markAsRead()public boolean send()
send in interface GameWorldMessageGameWorldMessage.send()
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 setAttachmentURL(String newAttachmentURL)
setAttachmentURL in interface GameWorldMessagenewAttachmentURL - the attachmentURL to setpublic boolean setBody(String newBody)
setBody in interface GameWorldMessagenewBody - The new body content for the message
GameWorldMessage.setBody(java.lang.String)public void setFrom(GeneralUser sender)
GameWorldMessage
setFrom in interface GameWorldMessagesender - the sender (FROM: field) for the messageGameWorldMessage.setFrom(GeneralUser)public void setFromID(int fromID1)
setFromID in interface GameWorldMessagefromID1 - the sender's user IDGameWorldMessage.setFromID(int)public void setInReplyTo(int parentMessageID)
setInReplyTo in interface GameWorldMessageparentMessageID - the message ID of the parent message, to
which this one is a replyGameWorldMessage.setInReplyTo(int)public void setRead(Timestamp timeRead)
setRead in interface GameWorldMessagetimeRead - WRITEMEGameWorldMessage.setRead(java.sql.Timestamp)public void setSent(Timestamp sent1)
setSent in interface GameWorldMessagesent1 - WRITEMEGameWorldMessage.setSent(java.sql.Timestamp)public void setSubject(String subject1)
setSubject in interface GameWorldMessagesubject1 - The Subject of the messageGameWorldMessage.setSubject(java.lang.String)public void setTo(GeneralUser recipient)
GameWorldMessage
setTo in interface GameWorldMessagerecipient - WRITEMEGameWorldMessage#setTo(org.starhope.appius.user.User)public void setToID(int toID1)
GameWorldMessage
setToID in interface GameWorldMessagetoID1 - WRITEMEGameWorldMessage.setToID(int)public void setWallPost(boolean wallPostQ)
setWallPost in interface GameWorldMessagewallPostQ - the isWallPost to setGameWorldMessage.setWallPost(boolean)public org.json.JSONObject toJSON()
SQLPeerDatum
toJSON in interface GameWorldMessagetoJSON in class SQLPeerDatumGameWorldMessage.toJSON()public org.json.JSONObject toJSON(boolean inMailbox)
GameWorldMessage
toJSON in interface GameWorldMessageinMailbox - WRITEME
GameWorldMessage.toJSON(boolean)public void undelete()
GameWorldMessageUndeletes a mail message and places it in the Inbox.
Note that this will not undelete a Wall message correctly, as it will go into the Inbox regardless.
undelete in interface GameWorldMessageGameWorldMessage.undelete()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||