|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.forum.proxy.PrivateMessageProxy
public class PrivateMessageProxy
Proxy class for PrivateMessage objects.
Constructor Summary | |
---|---|
PrivateMessageProxy(PrivateMessage privateMessage,
Permissions permissions)
Creates a new PrivateMessageProxy to protect the supplied message with the specified permissions. |
Method Summary | |
---|---|
Attachment |
createAttachment(java.lang.String name,
java.lang.String contentType,
java.io.InputStream data)
Creates a new attachment for this private message. |
void |
deleteAttachment(Attachment attachment)
Deletes an attachment that belongs to this private message. |
void |
deleteProperty(java.lang.String name)
Deletes an extended property. |
boolean |
equals(java.lang.Object object)
|
int |
getAttachmentCount()
Returns the number of attachments this private message has. |
java.util.Iterator |
getAttachments()
Returns an Iterator for all attachments of this private message. |
java.lang.String |
getBody()
Returns the message body. |
java.util.Date |
getDate()
Returns the date the message was saved or sent, or null if the message hasn't been sent or saved yet. |
PrivateMessageFolder |
getFolder()
Returns the folder the private message or null if the message does not yet belong to a folder. |
long |
getID()
Returns the id of the message. |
java.util.Collection |
getProperties(java.lang.String parentName)
Return all immediate children property values of a parent property as an unmodifiable Collection of String values. |
java.lang.String |
getProperty(java.lang.String name)
Returns an extended property of this private message. |
java.util.Iterator |
getPropertyNames()
Returns an Iterator of String values for all the names of the message properties. |
PrivateMessage |
getProxiedPrivateMessage()
Returns the proxied private message. |
User |
getRecipient()
Returns the user the message was sent to. |
User |
getSender()
Returns the user the message was sent by, or null if the message was sent by the system. |
java.lang.String |
getSubject()
Returns the message subject. |
java.lang.String |
getUnfilteredBody()
Returns the message body, bypassing any active filters. |
java.lang.String |
getUnfilteredProperty(java.lang.String name)
Returns an extended property of this private message, bypassing any filters. |
java.lang.String |
getUnfilteredSubject()
Returns the message subject, bypassing any active filters. |
int |
hashCode()
|
boolean |
isAuthorized(long type)
Returns true if the handle on this object has the permission specified. |
boolean |
isRead()
Returns true if this message has been marked as read. |
void |
setBody(java.lang.String body)
Sets the body of the message. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets an extended property of this private message. |
void |
setRead(boolean read)
Marks this message as read or unread. |
void |
setSubject(java.lang.String subject)
Sets the subject of the message. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PrivateMessageProxy(PrivateMessage privateMessage, Permissions permissions)
Method Detail |
---|
public long getID()
PrivateMessage
getID
in interface PrivateMessage
public java.util.Date getDate()
PrivateMessage
getDate
in interface PrivateMessage
public PrivateMessageFolder getFolder()
PrivateMessage
getFolder
in interface PrivateMessage
public java.lang.String getSubject()
PrivateMessage
getSubject
in interface PrivateMessage
public java.lang.String getUnfilteredSubject()
PrivateMessage
Unfiltered content is necessary for a few reasons. One is when saving Jive content to another persistence mechanism such as an XML format. Another is when you need to skip filter formatting, such as when a user is responding to another user's message.
getUnfilteredSubject
in interface PrivateMessage
public void setSubject(java.lang.String subject) throws UnauthorizedException
PrivateMessage
setSubject
in interface PrivateMessage
subject
- the subject of the message.
UnauthorizedException
- if not allowed to edit the message.public java.lang.String getBody()
PrivateMessage
getBody
in interface PrivateMessage
public java.lang.String getUnfilteredBody()
PrivateMessage
Unfiltered content is necessary for a few reasons. One is when saving Jive content to another persistence mechanism such as an XML format. Another is when you need to skip filter formatting, such as when a user is responding to another user's message.
getUnfilteredBody
in interface PrivateMessage
public void setBody(java.lang.String body) throws UnauthorizedException
PrivateMessage
setBody
in interface PrivateMessage
body
- the body of the message.
UnauthorizedException
- if does not have ADMIN permissions.public User getSender()
PrivateMessage
getSender
in interface PrivateMessage
public User getRecipient()
PrivateMessage
getRecipient
in interface PrivateMessage
public boolean isRead()
PrivateMessage
isRead
in interface PrivateMessage
public void setRead(boolean read)
PrivateMessage
setRead
in interface PrivateMessage
read
- true to mark the message as read.public Attachment createAttachment(java.lang.String name, java.lang.String contentType, java.io.InputStream data) throws java.lang.IllegalStateException, AttachmentException, UnauthorizedException
PrivateMessage
createAttachment
in interface PrivateMessage
name
- the name of the new attachment, usually the file name.contentType
- the content type of the attachment.data
- an InputStream that contains the binary data of the
attachment. The stream will never be closed so you must
close it manually after calling this method.
AttachmentException
- if an error occured while creating the
attachment. Errors can occur because the attachment is too large or
because the private message already has too many attachments.
UnauthorizedException
- if not allowed to create attachments.
java.lang.IllegalStateException
Attachment
,
AttachmentManager
public int getAttachmentCount()
PrivateMessage
getAttachmentCount
in interface PrivateMessage
public java.util.Iterator getAttachments()
PrivateMessage
getAttachments
in interface PrivateMessage
Attachment
public void deleteAttachment(Attachment attachment) throws AttachmentException, UnauthorizedException
PrivateMessage
deleteAttachment
in interface PrivateMessage
attachment
- the attachment to delete.
AttachmentException
- if there was an error deleting the attachment.
UnauthorizedException
- if not authorized to delete the attachment.public java.lang.String getProperty(java.lang.String name)
PrivateMessage
For security reasons, you should enable an HTML filter in case properties contain malicious HTML code.
getProperty
in interface PrivateMessage
name
- the name of the property to get.
public java.util.Collection getProperties(java.lang.String parentName)
PrivateMessage
getProperties
in interface PrivateMessage
parentName
- the name of the parent property to return the children for.
public java.lang.String getUnfilteredProperty(java.lang.String name)
PrivateMessage
Because properties are not filtered before being returned, this method should be used with caution. In particular, you should avoid showing unfiltered data in an environment where embedded HTML might be interpreted.
getUnfilteredProperty
in interface PrivateMessage
name
- the name of the property to get.
public void setProperty(java.lang.String name, java.lang.String value) throws UnauthorizedException
PrivateMessage
setProperty
in interface PrivateMessage
name
- the name of the property to set.value
- the new value for the property.
UnauthorizedException
- if not allowed to edit the message.public void deleteProperty(java.lang.String name) throws UnauthorizedException
PrivateMessage
name
does not exist, this method will do nothing.
deleteProperty
in interface PrivateMessage
name
- the name of the property to delete.
UnauthorizedException
- if not allowed to edit the message.public java.util.Iterator getPropertyNames()
PrivateMessage
getPropertyNames
in interface PrivateMessage
public boolean isAuthorized(long type)
PrivateMessage
A list of possible permissions can be found in the ForumPermissions class. Certain methods of this class are restricted to certain permissions as specified in the method comments.
isAuthorized
in interface PrivateMessage
type
- permissionType a permission type.
ForumPermissions
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public PrivateMessage getProxiedPrivateMessage()
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |