|
||||||||||
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 interpretedMethod Detail |
---|
public void addFlag(AbstractUser u, MailMessage.MessageFlag flag)
u
- The user adding the flagflag
- the flag to be addedpublic 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 GameWorldMessage
GameWorldMessage.delete()
public void flush()
flush
in interface GameWorldMessage
flush
in class SQLPeerDatum
GameWorldMessage.flush()
public String getAttachmentURL()
getAttachmentURL
in interface GameWorldMessage
public String getBody()
getBody
in interface GameWorldMessage
GameWorldMessage.getBody()
public GameWorldMessage getByID(int idToGet) throws NotFoundException
getByID
in interface GameWorldMessage
idToGet
- WRITEME
NotFoundException
- WRITEMEprotected String getCacheUniqueID()
getCacheUniqueID
in class SQLPeerDatum
SQLPeerDatum.getCacheUniqueID()
private void getFlags()
twheys@gmail.com Apr 6, 2010TO getFlags WRITEME...
public int getFromID()
getFromID
in interface GameWorldMessage
GameWorldMessage.getFromID()
public String getFromName()
getFromName
in interface GameWorldMessage
GameWorldMessage.getFromName()
public int getID()
GameWorldMessage
getID
in interface GameWorldMessage
GameWorldMessage.getID()
public int getInReplyTo()
getInReplyTo
in interface GameWorldMessage
GameWorldMessage.getInReplyTo()
public Vector<GameWorldMessage> getMessagesFrom(PreparedStatement st) throws SQLException
getMessagesFrom
in interface GameWorldMessage
st
- A prepared statement ready to be executed
SQLException
- if there's a problem getting resultspublic Timestamp getRead()
getRead
in interface GameWorldMessage
GameWorldMessage.getRead()
public Timestamp getSent()
getSent
in interface GameWorldMessage
GameWorldMessage.getSent()
public String getSubject()
getSubject
in interface GameWorldMessage
GameWorldMessage.getSubject()
public int getToID()
getToID
in interface GameWorldMessage
GameWorldMessage.getToID()
public String getToName()
getToName
in interface GameWorldMessage
GameWorldMessage.getToName()
private void insert()
public boolean isDeleted()
isDeleted
in interface GameWorldMessage
GameWorldMessage.isDeleted()
public boolean isWallPost()
isWallPost
in interface GameWorldMessage
GameWorldMessage.isWallPost()
public void markAsRead()
markAsRead
in interface GameWorldMessage
GameWorldMessage.markAsRead()
public boolean send()
send
in interface GameWorldMessage
GameWorldMessage.send()
protected 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 void setAttachmentURL(String newAttachmentURL)
setAttachmentURL
in interface GameWorldMessage
newAttachmentURL
- the attachmentURL to setpublic boolean setBody(String newBody)
setBody
in interface GameWorldMessage
newBody
- The new body content for the message
GameWorldMessage.setBody(java.lang.String)
public void setFrom(GeneralUser sender)
GameWorldMessage
setFrom
in interface GameWorldMessage
sender
- the sender (FROM: field) for the messageGameWorldMessage.setFrom(GeneralUser)
public void setFromID(int fromID1)
setFromID
in interface GameWorldMessage
fromID1
- the sender's user IDGameWorldMessage.setFromID(int)
public void setInReplyTo(int parentMessageID)
setInReplyTo
in interface GameWorldMessage
parentMessageID
- the message ID of the parent message, to
which this one is a replyGameWorldMessage.setInReplyTo(int)
public void setRead(Timestamp timeRead)
setRead
in interface GameWorldMessage
timeRead
- WRITEMEGameWorldMessage.setRead(java.sql.Timestamp)
public void setSent(Timestamp sent1)
setSent
in interface GameWorldMessage
sent1
- WRITEMEGameWorldMessage.setSent(java.sql.Timestamp)
public void setSubject(String subject1)
setSubject
in interface GameWorldMessage
subject1
- The Subject of the messageGameWorldMessage.setSubject(java.lang.String)
public void setTo(GeneralUser recipient)
GameWorldMessage
setTo
in interface GameWorldMessage
recipient
- WRITEMEGameWorldMessage#setTo(org.starhope.appius.user.User)
public void setToID(int toID1)
GameWorldMessage
setToID
in interface GameWorldMessage
toID1
- WRITEMEGameWorldMessage.setToID(int)
public void setWallPost(boolean wallPostQ)
setWallPost
in interface GameWorldMessage
wallPostQ
- the isWallPost to setGameWorldMessage.setWallPost(boolean)
public org.json.JSONObject toJSON()
SQLPeerDatum
toJSON
in interface GameWorldMessage
toJSON
in class SQLPeerDatum
GameWorldMessage.toJSON()
public org.json.JSONObject toJSON(boolean inMailbox)
GameWorldMessage
toJSON
in interface GameWorldMessage
inMailbox
- WRITEME
GameWorldMessage.toJSON(boolean)
public void undelete()
GameWorldMessage
Undeletes 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 GameWorldMessage
GameWorldMessage.undelete()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |