001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/mailarchive/tags/sakai_2-4-1/mailarchive-api/api/src/java/org/sakaiproject/mailarchive/api/MailArchiveChannel.java $
003: * $Id: MailArchiveChannel.java 8184 2006-04-23 23:45:05Z ggolden@umich.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.mailarchive.api;
021:
022: import java.util.List;
023:
024: import org.sakaiproject.exception.IdUnusedException;
025: import org.sakaiproject.exception.PermissionException;
026: import org.sakaiproject.message.api.MessageChannel;
027: import org.sakaiproject.time.api.Time;
028: import org.sakaiproject.user.api.User;
029:
030: /**
031: * <p>
032: * MailArchiveChannel is the extension to the MessageChannel interface for a Sakai Mail Archive service. Messages in the MailArchiveChannel are MailArchiveMessages with MailArchiveMessageHeaders.
033: * </p>
034: * <p>
035: * Security on the channel include:
036: * <ul>
037: * <li>mailarchive.channel.read</li>
038: * <li>mailarchive.channel.remove.any</li>
039: * <li>mailarchive.channel.remove.own</li>
040: * <li>mailarchive.channel.post</li>
041: * </ul>
042: * Security Roles for the channel include:
043: * <ul>
044: * <li>mailarchive.member: read, remove.own, post</li>
045: * <li>mailarchive.administrator: mailarchive.member, remove.any</li>
046: * </ul>
047: * </p>
048: * <p>
049: * Usage Events generated:
050: * <ul>
051: * <li>mailarchive.channel.read - mailarchive message resource id</li>
052: * <li>mailarchive.channel.remove.any - mailarchive message resource id</li>
053: * <li>mailarchive.channel.remove.own - mailarchive message resource id</li>
054: * <li>mailarchive.channel.post - mailarchive message resource id</li>
055: * </p>
056: */
057: public interface MailArchiveChannel extends MessageChannel {
058: /**
059: * A (MailArchiveMessage) cover for getMessage to return a specific mail archive group message, as specified by message id.
060: *
061: * @param messageId
062: * The id of the message to get.
063: * @return the MailArchiveMessage that has the specified id.
064: * @exception IdUnusedException
065: * If this name is not a defined message in this announcement channel.
066: * @exception PermissionException
067: * If the user does not have any permissions to read the message.
068: */
069: public MailArchiveMessage getMailArchiveMessage(String messageId)
070: throws IdUnusedException, PermissionException;
071:
072: /**
073: * a (MailArchiveMessage) cover for addMessage to add a new message to this channel.
074: *
075: * @param subject
076: * The message header subject.
077: * @param fromAddress
078: * The mail from: address from the message.
079: * @param dateSent
080: * The date: sent from the message.
081: * @param mailHeaders
082: * The full set of mail headers from the message.
083: * @param attachments
084: * The message header attachments, a vector of Reference objects.
085: * @param body
086: * The message body.
087: * @return The newly added message.
088: * @exception PermissionException
089: * If the user does not have write permission to the channel.
090: */
091: public MailArchiveMessage addMailArchiveMessage(String subject,
092: String fromAddress, Time dateSent, List mailHeaders,
093: List attachments, String body) throws PermissionException;
094:
095: /** @return true if the channel enabled, false if not. */
096: public boolean getEnabled();
097:
098: /** @return true if the channel is open to messages from outside the membership, false if not. */
099: public boolean getOpen();
100:
101: /**
102: * check permissions for addMessage() for the given user.
103: *
104: * @param user
105: * The user.
106: * @return true if the specified user is allowed to addMessage(...), false if not.
107: */
108: public boolean allowAddMessage(User user);
109: }
|