| org.sakaiproject.chat2.model.ChatManager
All known Subclasses: org.sakaiproject.chat2.model.impl.ChatManagerImpl,
Method Summary | |
public void | addRoomListener(RoomObserver observer, String roomId) | public Date | calculateDateByOffset(int offset) | public ChatChannel | createNewChannel(String context, String title, boolean contextDefaultChannel, boolean checkAuthz) Creates a new ChatChannel but doesn't put it in the database. | public ChatMessage | createNewMessage(ChatChannel channel, String owner) | public void | deleteChannel(ChatChannel channel) deletes the channel from the database. | public void | deleteMessage(ChatMessage message) | public boolean | getCanCreateChannel() | public boolean | getCanDelete(ChatMessage chatMessage) | public boolean | getCanDelete(ChatMessage message, String placementId) | public boolean | getCanDelete(ChatChannel channel) | public boolean | getCanEdit(ChatChannel channel) | public boolean | getCanReadMessage(ChatChannel channel) | public List<ChatMessage> | getChannelMessages(ChatChannel channel, String context, Date date, int items, boolean sortAsc) gets all the messages from the Channel after the passed date
Parameters: channel - ChatChannel Parameters: context - Context of channel and messages to return Parameters: date - Date that the messages need to be newer than. | public ChatChannel | getChatChannel(String chatChannelId) | public List | getContextChannels(String context, boolean lazy) | public List | getContextChannels(String contextId, String defaultNewTitle) | public ChatChannel | getDefaultChannel(String contextId) Returns the context's default channel, or null if none. | public String | getLabel() | public ChatMessage | getMessage(String chatMessageId) | public boolean | isMaintainer() | public void | makeDefaultContextChannel(ChatChannel channel) | public void | removeRoomListener(RoomObserver observer, String roomId) | public void | sendMessage(ChatMessage entry) | public String | serviceName() | public void | updateChannel(ChatChannel channel, boolean checkAuthz) | public void | updateMessage(ChatMessage message) |
APPLICATION_ID | final static String APPLICATION_ID(Code) | | The type string for this application: should not change over time as it may be stored in various parts of persistent entities.
|
REFERENCE_ROOT | final public static String REFERENCE_ROOT(Code) | | This string starts the references to resources in this service.
|
REF_TYPE_CHANNEL | final public static String REF_TYPE_CHANNEL(Code) | | |
REF_TYPE_MESSAGE | final public static String REF_TYPE_MESSAGE(Code) | | The Reference type for a messgae.
|
addRoomListener | public void addRoomListener(RoomObserver observer, String roomId)(Code) | | Adds a room listener on the room
Parameters: observer - RoomObserver the class to observe the room Parameters: roomId - the room being observed |
calculateDateByOffset | public Date calculateDateByOffset(int offset)(Code) | | Returns a Date object that is the offset number of days before the current date
Parameters: offset - Difference in days from current date |
createNewChannel | public ChatChannel createNewChannel(String context, String title, boolean contextDefaultChannel, boolean checkAuthz) throws PermissionException(Code) | | Creates a new ChatChannel but doesn't put it in the database.
Parameters: context - Id of what the channel is linked to Parameters: title - String the title of the channel Parameters: contextDefaultChannel - boolean to set this as the default channel in the context Parameters: checkAuthz - boolean indicating if we should check for authorization before creating the channel ChatChannel the new un-saved channel |
deleteChannel | public void deleteChannel(ChatChannel channel) throws PermissionException(Code) | | deletes the channel from the database. It also removes the ChatMessages
Parameters: channel - |
getCanCreateChannel | public boolean getCanCreateChannel()(Code) | | |
getChannelMessages | public List<ChatMessage> getChannelMessages(ChatChannel channel, String context, Date date, int items, boolean sortAsc) throws PermissionException(Code) | | gets all the messages from the Channel after the passed date
Parameters: channel - ChatChannel Parameters: context - Context of channel and messages to return Parameters: date - Date that the messages need to be newer than. All messages will be returned if null Parameters: items - The number of messages to return. All if set to 0 Parameters: sortAsc - Boolean to sort the records in ascending order List of ChatMessages |
getChatChannel | public ChatChannel getChatChannel(String chatChannelId)(Code) | | gets one chat room
Parameters: chatChannelId - Id ChatChannel |
getContextChannels | public List getContextChannels(String context, boolean lazy)(Code) | | gets the rooms associated with the context
Parameters: context - Site the channel is in Parameters: lazy - boolean to load the messages lazily or not List of ChatChannel |
getContextChannels | public List getContextChannels(String contextId, String defaultNewTitle)(Code) | | Gets the rooms associated with the context
If no rooms are found, one is created with the passed title
Parameters: contextId - Id Parameters: defaultNewTitle - String the default name of a new ChatChannel List of ChatChannel |
getDefaultChannel | public ChatChannel getDefaultChannel(String contextId)(Code) | | Returns the context's default channel, or null if none.
Parameters: contextId - |
getMessage | public ChatMessage getMessage(String chatMessageId)(Code) | | gets the message with the id
Parameters: chatMessageId - Id ChatMessage |
isMaintainer | public boolean isMaintainer()(Code) | | |
makeDefaultContextChannel | public void makeDefaultContextChannel(ChatChannel channel)(Code) | | Makes the passed channel the dfault in the channel's context
Parameters: channel - |
removeRoomListener | public void removeRoomListener(RoomObserver observer, String roomId)(Code) | | Removes a room listener on the room
Parameters: observer - RoomObserver the class to stop observing the room Parameters: roomId - the room being observed |
sendMessage | public void sendMessage(ChatMessage entry)(Code) | | sends the message out to the other clients
Parameters: entry - ChatMessage |
updateChannel | public void updateChannel(ChatChannel channel, boolean checkAuthz) throws PermissionException(Code) | | updates the channel back into the database
Parameters: channel - ChatChannel Parameters: checkAuthz - boolean indicating if we should check for authorization before updating |
|
|