| org.sakaiproject.message.api.MessageChannel
MessageChannel | public interface MessageChannel extends Entity(Code) | |
MessageChannel is the base interface for Sakai communications service message channels. Extensions to this interface configure types of communications channels (Chat, Announcements, etc.)
Channels contains collections of messages, each Message (or extension) object. Each chat channel has a unique channel id (read only), and is a Sakai Resource.
The chat channel can be asked:
- for an iterator on the messages, with a filter
- to find a specific message
- to add a new message
- to update an existing message
- to remove an existing message
The chat channel can be subscribed to providing notification when:
- a new message has been posted
- a message has been changed
- a message has been removed
- the channel has been removed
Security on the channel include:
- message.channel.read
- message.channel.remove.any
- message.channel.remove.own
- message.channel.post
Security Roles for the channel include:
- message.member: read, remove.own, post
- message.administrator: chat.member, remove.any
Event handling is defined in the specific extension classes.
author: Sakai Software Development Team |
Method Summary | |
MessageEdit | addMessage() Add a new message to this channel. | boolean | allowAddChannelMessage() Check if the user has permission to add a channel-wide (not grouped) message. | boolean | allowAddDraftMessage() check permission for adding draft message and modifying it afterwards. | boolean | allowAddMessage() check permissions for addMessage(). | boolean | allowEditMessage(String messageId) check permissions for editMessage()
Parameters: id - The message id. | boolean | allowGetMessages() check permissions for getMessages() or getMessage(). | boolean | allowRemoveMessage(Message message) check permissions for removeMessage().
Parameters: message - The message from this channel to remove. | void | cancelMessage(MessageEdit edit) Cancel the changes made to a MessageEdit object, and release the lock. | void | commitMessage(MessageEdit edit) Commit the changes made to a MessageEdit object, and release the lock. | void | commitMessage(MessageEdit edit, int priority) Commit the changes made to a MessageEdit object, and release the lock. | void | commitMessage(MessageEdit edit, int priority, String invokee) Commit the changes made to a MessageEdit object, and release the lock. | MessageEdit | editMessage(String messageId) Return a specific channel message, as specified by message name, locked for update. | String | getContext() Access the context of the resource. | Collection | getGroupsAllowAddMessage() Get the collection of Groups defined for the context of this channel that the end user has add message permissions in. | Collection | getGroupsAllowGetMessage() Get the collection of Group defined for the context of this channel that the end user has get message permissions in. | Collection | getGroupsAllowRemoveMessage(boolean own) Get the collection of Group defined for the context of this channel that the end user has remove message permissions in.
Parameters: own - true if the message is the user's own, false if it is someone else's. | Message | getMessage(String messageId) Return a specific channel message, as specified by message name.
Parameters: messageId - The id of the message to get. | List | getMessages(Filter filter, boolean ascending) Return a list of all or filtered messages in the channel. | MessageEdit | mergeMessage(Element el) Merge in a new message as defined in the xml. | void | removeMessage(String messageId) | void | removeMessage(MessageEdit message) Remove a message from the channel - it must be locked from editMessage(). |
addMessage | MessageEdit addMessage() throws PermissionException(Code) | | Add a new message to this channel. Must commitEdit() to make official, or cancelEdit() when done!
The newly added message, locked for update. exception: PermissionException - If the user does not have write permission to the channel. |
allowAddChannelMessage | boolean allowAddChannelMessage()(Code) | | Check if the user has permission to add a channel-wide (not grouped) message.
true if the user has permission to add a channel-wide (not grouped) message. |
allowAddDraftMessage | boolean allowAddDraftMessage()(Code) | | check permission for adding draft message and modifying it afterwards.
|
allowAddMessage | boolean allowAddMessage()(Code) | | check permissions for addMessage().
true if the user is allowed to addMessage(...), false if not. |
allowEditMessage | boolean allowEditMessage(String messageId)(Code) | | check permissions for editMessage()
Parameters: id - The message id. true if the user is allowed to update the message, false if not. |
allowGetMessages | boolean allowGetMessages()(Code) | | check permissions for getMessages() or getMessage().
true if the user is allowed to get messages from this channel, false if not. |
allowRemoveMessage | boolean allowRemoveMessage(Message message)(Code) | | check permissions for removeMessage().
Parameters: message - The message from this channel to remove. true if the user is allowed to removeMessage(...), false if not. |
cancelMessage | void cancelMessage(MessageEdit edit)(Code) | | Cancel the changes made to a MessageEdit object, and release the lock. The MessageEdit is disabled, and not to be used after this call.
Parameters: user - The UserEdit object to commit. |
commitMessage | void commitMessage(MessageEdit edit)(Code) | | Commit the changes made to a MessageEdit object, and release the lock. The MessageEdit is disabled, and not to be used after this call. If the message is in a form that the user has no permission to store, a PermissionException is thrown, and the
edit is canceled.
Parameters: user - The UserEdit object to commit. |
commitMessage | void commitMessage(MessageEdit edit, int priority)(Code) | | Commit the changes made to a MessageEdit object, and release the lock. The MessageEdit is disabled, and not to be used after this call. If the message is in a form that the user has no permission to store, a PermissionException is thrown, and the
edit is canceled.
Parameters: user - The UserEdit object to commit. Parameters: priority - The notification priority for this commit. |
commitMessage | void commitMessage(MessageEdit edit, int priority, String invokee)(Code) | | Commit the changes made to a MessageEdit object, and release the lock. The MessageEdit is disabled, and not to be used after this call. If the message is in a form that the user has no permission to store, a PermissionException is thrown, and the
edit is canceled. Used when a scheduled notification is made for this message.
Parameters: user - The UserEdit object to commit. Parameters: priority - The notification priority for this commit. Parameters: invokee - The id for the object to be called when the scheduled notification fires. |
editMessage | MessageEdit editMessage(String messageId) throws IdUnusedException, PermissionException, InUseException(Code) | | Return a specific channel message, as specified by message name, locked for update. Must commitEdit() to make official, or cancelEdit() when done!
Parameters: messageId - The id of the message to get. the Message that has the specified id. exception: IdUnusedException - If this name is not a defined message in this channel. exception: PermissionException - If the user does not have any permissions to edit the message. exception: InUseException - if the message is locked for edit by someone else. |
getContext | String getContext()(Code) | | Access the context of the resource.
The context. |
getGroupsAllowAddMessage | Collection getGroupsAllowAddMessage()(Code) | | Get the collection of Groups defined for the context of this channel that the end user has add message permissions in.
The Collection (Group) of groups defined for the context of this channel that the end user has add message permissions in, empty if none. |
getGroupsAllowGetMessage | Collection getGroupsAllowGetMessage()(Code) | | Get the collection of Group defined for the context of this channel that the end user has get message permissions in.
The Collection (Group) of groups defined for the context of this channel that the end user has get message permissions in, empty if none. |
getGroupsAllowRemoveMessage | Collection getGroupsAllowRemoveMessage(boolean own)(Code) | | Get the collection of Group defined for the context of this channel that the end user has remove message permissions in.
Parameters: own - true if the message is the user's own, false if it is someone else's. The Collection (Group) of groups defined for the context of this channel that the end user has get message permissions in, empty if none. |
getMessages | List getMessages(Filter filter, boolean ascending) throws PermissionException(Code) | | Return a list of all or filtered messages in the channel. The order in which the messages will be found in the iteration is by date, oldest first if ascending is true, newest first if ascending is false.
Parameters: filter - A filtering object to accept messages, or null if no filtering is desired. Parameters: ascending - Order of messages, ascending if true, descending if false a list of channel Message objects or specializations of Message objects (may be empty). exception: PermissionException - if the user does not have read permission to the channel. |
mergeMessage | MessageEdit mergeMessage(Element el) throws PermissionException, IdUsedException(Code) | | Merge in a new message as defined in the xml. Must commitEdit() to make official, or cancelEdit() when done!
Parameters: el - The message information in XML in a DOM element. The newly added message, locked for update. exception: PermissionException - If the user does not have write permission to the channel. exception: IdUsedException - if the user id is already used. |
removeMessage | void removeMessage(String messageId) throws PermissionException(Code) | | Remove a message from the channel based on message id
Parameters: messageId - The messageId for the message of the channel to remove. exception: PermissionException - if the user does not have permission to remove the message. |
removeMessage | void removeMessage(MessageEdit message) throws PermissionException(Code) | | Remove a message from the channel - it must be locked from editMessage().
Parameters: message - The message from this channel to remove. exception: PermissionException - if the user does not have permission to remove the message. |
|
|