001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/mailarchive/tags/sakai_2-4-1/mailarchive-api/api/src/java/org/sakaiproject/mailarchive/api/MailArchiveService.java $
003: * $Id: MailArchiveService.java 8378 2006-04-27 03:06:01Z 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 org.sakaiproject.exception.IdInvalidException;
023: import org.sakaiproject.exception.IdUnusedException;
024: import org.sakaiproject.exception.IdUsedException;
025: import org.sakaiproject.exception.PermissionException;
026: import org.sakaiproject.message.api.MessageService;
027:
028: /**
029: * <p>
030: * MailArchiveService is the extension to MessageService configured for the Mail Archive.
031: * </p>
032: * <p>
033: * Channels are MailArchiveChannels, and Messages are MailArchiveMessages with MailArchiveMessageHeaders.
034: * </p>
035: * <p>
036: * Security in the mail archive service, in addition to that defined in the channels, include:
037: * <ul>
038: * <li>mailarchive.channel.add</li>
039: * </ul>
040: * </p>
041: * <li>mailarchive.channel.remove</li>
042: * </ul>
043: * </p>
044: * <p>
045: * Usage Events are generated:
046: * <ul>
047: * <li>mailarchive.channel.add - mail archive channel resource id</li>
048: * <li>mailarchive.channel.remove - mail archive channel resource id</li>
049: * </ul>
050: * </p>
051: */
052: public interface MailArchiveService extends MessageService {
053: /** The type string for this application: should not change over time as it may be stored in various parts of persistent entities. */
054: static final String APPLICATION_ID = "sakai:mailarchive";
055:
056: /** This string starts the references to resources in this service. */
057: public static final String REFERENCE_ROOT = "/mailarchive";
058:
059: /** Security lock / event root for generic message events to make it a mail event. */
060: public static final String SECURE_MAIL_ROOT = "mail.";
061:
062: /** Security lock / event for reading channel / message. */
063: public static final String SECURE_MAIL_READ = SECURE_MAIL_ROOT
064: + SECURE_READ;
065:
066: /** Security lock / event for adding channel / message. */
067: public static final String SECURE_MAIL_ADD = SECURE_MAIL_ROOT
068: + SECURE_ADD;
069:
070: /** Security lock / event for removing one's own message. */
071: public static final String SECURE_MAIL_REMOVE_OWN = SECURE_MAIL_ROOT
072: + SECURE_REMOVE_OWN;
073:
074: /** Security lock / event for removing anyone's message or channel. */
075: public static final String SECURE_MAIL_REMOVE_ANY = SECURE_MAIL_ROOT
076: + SECURE_REMOVE_ANY;
077:
078: /** Security lock / event for updating one's own message or the channel. */
079: public static final String SECURE_MAIL_UPDATE_OWN = SECURE_MAIL_ROOT
080: + SECURE_UPDATE_OWN;
081:
082: /** Security lock / event for updating any message. */
083: public static final String SECURE_MAIL_UPDATE_ANY = SECURE_MAIL_ROOT
084: + SECURE_UPDATE_ANY;
085:
086: /** Security lock / event for accessing someone elses draft. */
087: public static final String SECURE_MAIL_READ_DRAFT = SECURE_MAIL_ROOT
088: + SECURE_READ_DRAFT;
089:
090: /** Message header that indicates the original outer-envelope Content-Type of an archived message */
091: public static final String HEADER_OUTER_CONTENT_TYPE = "X-Content-Type-Outer-Envelope";
092:
093: /**
094: * Message header that indicates the Content-Type of the message body of an archived message - this may be different from the original outer-envelope Content-Type (outer might be multipart)
095: */
096: public static final String HEADER_INNER_CONTENT_TYPE = "X-Content-Type-Message-Body";
097:
098: /**
099: * A (MailArchiveChannel) cover for getChannel() to return a specific mail archive group.
100: *
101: * @param ref
102: * The channel reference.
103: * @return the MailArchiveChannel that has the specified name.
104: * @exception IdUnusedException
105: * If this name is not defined for a mail archive channel.
106: * @exception PermissionException
107: * If the user does not have any permissions to the channel.
108: */
109: public MailArchiveChannel getMailArchiveChannel(String ref)
110: throws IdUnusedException, PermissionException;
111:
112: /**
113: * A (MailArchiveChannel) cover for add() to add a new announcement channel.
114: *
115: * @param ref
116: * The channel reference.
117: * @return The newly created group.
118: * @exception IdUsedException
119: * if the id is not unique.
120: * @exception IdInvalidException
121: * if the id is not made up of valid characters.
122: * @exception PermissionException
123: * if the user does not have permission to add a group.
124: */
125: public MailArchiveChannelEdit addMailArchiveChannel(String ref)
126: throws IdUsedException, IdInvalidException,
127: PermissionException;
128: }
|