org.sakaiproject.service.legacy.message
Interface MessageHeader

All Superinterfaces:
AttachmentContainer
All Known Subinterfaces:
AnnouncementMessageHeader, AnnouncementMessageHeaderEdit, ChatMessageHeader, ChatMessageHeaderEdit, DiscussionMessageHeader, DiscussionMessageHeaderEdit, MailArchiveMessageHeader, MailArchiveMessageHeaderEdit, MessageHeaderEdit
All Known Implementing Classes:
BaseAnnouncementService.BaseAnnouncementMessageHeaderEdit, BaseChatService.BaseChatMessageHeaderEdit, BaseDiscussionService.BaseDiscussionMessageHeaderEdit, BaseMailArchiveService.BaseMailArchiveMessageHeaderEdit, BaseMessageService.BaseMessageHeaderEdit

public interface MessageHeader
extends AttachmentContainer

MessageHeader is the base Interface for a Sakai Message headers. Header fields common to all message service message headers are defined here.

Author:
Sakai Software Development Team

Nested Class Summary
static class MessageHeader.MessageAccess
           MessageAccess enumerates different access modes for the message: channel-wide or grouped.
 
Method Summary
 MessageHeader.MessageAccess getAccess()
          Access the access mode for the message - how we compute who has access to the message.
 Time getDate()
          Access the date/time the message was sent to the channel.
 boolean getDraft()
          Access the draft status of the message.
 User getFrom()
          Access the User who sent the message to the channel.
 Collection getGroups()
          Access the groups defined for this message.
 String getId()
          Access the unique (within the channel) message id.
 Element toXml(Document doc, Stack stack)
          Serialize the resource into XML, adding an element to the doc under the top of the stack element.
 
Methods inherited from interface org.sakaiproject.service.legacy.entity.AttachmentContainer
getAttachments
 

Method Detail

getId

public String getId()
Access the unique (within the channel) message id.

Returns:
The unique (within the channel) message id.

getDate

public Time getDate()
Access the date/time the message was sent to the channel.

Returns:
The date/time the message was sent to the channel.

getFrom

public User getFrom()
Access the User who sent the message to the channel.

Returns:
The User who sent the message to the channel.

getDraft

public boolean getDraft()
Access the draft status of the message.

Returns:
True if the message is a draft, false if not.

getGroups

public Collection getGroups()
Access the groups defined for this message.

Returns:
A Collection (String) of group refs (authorization group ids) defined for this message; empty if none are defined.

getAccess

public MessageHeader.MessageAccess getAccess()
Access the access mode for the message - how we compute who has access to the message.

Returns:
The MessageAccess access mode for the message.

toXml

public Element toXml(Document doc,
                     Stack stack)
Serialize the resource into XML, adding an element to the doc under the top of the stack element.

Parameters:
doc - The DOM doc to contain the XML (or null for a string return).
stack - The DOM elements, the top of which is the containing element of the new "resource" element.
Returns:
The newly added element.