1 /**************************************************************** 2 * Licensed to the Apache Software Foundation (ASF) under one * 3 * or more contributor license agreements. See the NOTICE file * 4 * distributed with this work for additional information * 5 * regarding copyright ownership. The ASF licenses this file * 6 * to you under the Apache License, Version 2.0 (the * 7 * "License"); you may not use this file except in compliance * 8 * with the License. You may obtain a copy of the License at * 9 * * 10 * http://www.apache.org/licenses/LICENSE-2.0 * 11 * * 12 * Unless required by applicable law or agreed to in writing, * 13 * software distributed under the License is distributed on an * 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * 15 * KIND, either express or implied. See the License for the * 16 * specific language governing permissions and limitations * 17 * under the License. * 18 ****************************************************************/ 19 20 package org.apache.james.mailrepository.javamail; 21 22 import javax.mail.Message; 23 import javax.mail.MessagingException; 24 import javax.mail.UIDFolder; 25 26 /** 27 * Interim interface to provide access to UID PLUS methods reflecting RFC 2359, 28 * until official Javamail API offers this. 29 */ 30 31 public interface UIDPlusFolder extends UIDFolder, FolderInterface { 32 /** 33 * Appends the given messages to the folder and returns corresponding uids.<br> 34 * Implementations may require the folder to be open. 35 * 36 * @see javax.mail.Folder#appendMessages(javax.mail.Message[]) 37 * 38 * @param msgs 39 * messages to append 40 * @return array of same size and sequenze of msgs containing corresponding 41 * uids or -1, if something went wrong 42 * @throws MessagingException 43 * @throws IllegalStateException when folder has to be open 44 */ 45 public long[] addUIDMessages(Message[] msgs) throws MessagingException; 46 47 /** 48 * Appends the given messages to the folder and returns corresponding 49 * instances of the appended messages.<br> 50 * Implementations may require the folder to be open. 51 * 52 * @see javax.mail.Folder#appendMessages(javax.mail.Message[]) 53 * 54 * @param msgs 55 * messages to append 56 * @return array of same size and sequenze of msgs containing corresponding 57 * added messages or null, if something went wrong 58 * @throws MessagingException 59 * @throws IllegalStateException when folder has to be open 60 */ 61 public Message[] addMessages(Message[] msgs) throws MessagingException; 62 63 }