org.sakaiproject.component.legacy.message
Interface BaseMessageService.Storage

All Known Implementing Classes:
DbAnnouncementService.DbStorage, DbChatService.DbStorage, DbDiscussionService.DbStorage, DbMailArchiveService.DbStorage
Enclosing interface:
BaseMessageService

protected static interface BaseMessageService.Storage

Storage implementation


Method Summary
 void cancelChannel(MessageChannelEdit edit)
          Cancel a channel edit.
 void cancelMessage(MessageChannel channel, MessageEdit edit)
          Cancel an edit.
 boolean checkChannel(String ref)
          Return true if the identified channel exists.
 boolean checkMessage(MessageChannel channel, String messageId)
          Does this messages exist in a channel?
 void close()
          Write and Close.
 void commitChannel(MessageChannelEdit edit)
          Commit a channel edit.
 void commitMessage(MessageChannel channel, MessageEdit edit)
          Commit an edit.
 MessageChannelEdit editChannel(String ref)
          Get a channel locked for update
 MessageEdit editMessage(MessageChannel channel, String messageId)
          Get a message from a channel locked for update
 MessageChannel getChannel(String ref)
          Return the identified channel, or null if not found.
 List getChannelIdsMatching(String root)
          Access a list of channel ids from channels with refs that start with (match) context.
 List getChannels()
          Get a list of all channels
 Message getMessage(MessageChannel channel, String messageId)
          Get a message from a channel.
 List getMessages(MessageChannel channel)
          Get the messages from a channel
 List getMessages(MessageChannel channel, Time afterDate, int limitedToLatest, String draftsForId, boolean pubViewOnly)
          Get messages filtered by date and count and drafts, in descending (latest first) order
 void open()
          Open and read.
 MessageChannelEdit putChannel(String ref)
          Keep a new channel.
 MessageEdit putMessage(MessageChannel channel, String id)
          Make and lock a new message.
 void removeChannel(MessageChannelEdit channel)
          Forget about a channel.
 void removeMessage(MessageChannel channel, MessageEdit edit)
          Forget about a message.
 

Method Detail

open

public void open()
Open and read.


close

public void close()
Write and Close.


getChannel

public MessageChannel getChannel(String ref)
Return the identified channel, or null if not found.


checkChannel

public boolean checkChannel(String ref)
Return true if the identified channel exists.


getChannels

public List getChannels()
Get a list of all channels


putChannel

public MessageChannelEdit putChannel(String ref)
Keep a new channel.


editChannel

public MessageChannelEdit editChannel(String ref)
Get a channel locked for update


commitChannel

public void commitChannel(MessageChannelEdit edit)
Commit a channel edit.


cancelChannel

public void cancelChannel(MessageChannelEdit edit)
Cancel a channel edit.


removeChannel

public void removeChannel(MessageChannelEdit channel)
Forget about a channel.


getMessage

public Message getMessage(MessageChannel channel,
                          String messageId)
Get a message from a channel.


editMessage

public MessageEdit editMessage(MessageChannel channel,
                               String messageId)
Get a message from a channel locked for update


commitMessage

public void commitMessage(MessageChannel channel,
                          MessageEdit edit)
Commit an edit.


cancelMessage

public void cancelMessage(MessageChannel channel,
                          MessageEdit edit)
Cancel an edit.


checkMessage

public boolean checkMessage(MessageChannel channel,
                            String messageId)
Does this messages exist in a channel?


getMessages

public List getMessages(MessageChannel channel)
Get the messages from a channel


putMessage

public MessageEdit putMessage(MessageChannel channel,
                              String id)
Make and lock a new message.


removeMessage

public void removeMessage(MessageChannel channel,
                          MessageEdit edit)
Forget about a message.


getMessages

public List getMessages(MessageChannel channel,
                        Time afterDate,
                        int limitedToLatest,
                        String draftsForId,
                        boolean pubViewOnly)
Get messages filtered by date and count and drafts, in descending (latest first) order

Parameters:
afterDate - if null, no date limit, else limited to only messages after this date.
limitedToLatest - if 0, no count limit, else limited to only the latest this number of messages.
draftsForId - how to handle drafts: null means no drafts, "*" means all, otherwise drafts only if created by this userId.
pubViewOnly - if true, include only messages marked pubview, else include any.
Returns:
A list of Message objects that meet the criteria; may be empty

getChannelIdsMatching

public List getChannelIdsMatching(String root)
Access a list of channel ids from channels with refs that start with (match) context.

Returns:
A List (String) of channel id for channels within the context.