1 /* 2 * The contents of this file are subject to the terms 3 * of the Common Development and Distribution License 4 * (the "License"). You may not use this file except 5 * in compliance with the License. 6 * 7 * You can obtain a copy of the license at 8 * glassfish/bootstrap/legal/CDDLv1.0.txt or 9 * https://glassfish.dev.java.net/public/CDDLv1.0.html. 10 * See the License for the specific language governing 11 * permissions and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL 14 * HEADER in each file and include the License file at 15 * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, 16 * add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your 18 * own identifying information: Portions Copyright [yyyy] 19 * [name of copyright owner] 20 */ 21 22 /* 23 * @(#)QuotaAwareStore.java 1.3 06/03/10 24 * 25 * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. 26 */ 27 28 package javax.mail; 29 30 /** 31 * An interface implemented by Stores that support quotas. 32 * The {@link #getQuota getQuota} and {@link #setQuota setQuota} methods 33 * support the quota model defined by the IMAP QUOTA extension. 34 * Refer to <A HREF="http://www.ietf.org/rfc/rfc2087.txt">RFC 2087</A> 35 * for more information. <p> 36 * 37 * @since JavaMail 1.4 38 */ 39 public interface QuotaAwareStore { 40 /** 41 * Get the quotas for the named quota root. 42 * Quotas are controlled on the basis of a quota root, not 43 * (necessarily) a folder. The relationship between folders 44 * and quota roots depends on the server. Some servers 45 * might implement a single quota root for all folders owned by 46 * a user. Other servers might implement a separate quota root 47 * for each folder. A single folder can even have multiple 48 * quota roots, perhaps controlling quotas for different 49 * resources. 50 * 51 * @param root the name of the quota root 52 * @return array of Quota objects 53 * @exception MessagingException if the server doesn't support the 54 * QUOTA extension 55 */ 56 Quota[] getQuota(String root) throws MessagingException; 57 58 /** 59 * Set the quotas for the quota root specified in the quota argument. 60 * Typically this will be one of the quota roots obtained from the 61 * <code>getQuota</code> method, but it need not be. 62 * 63 * @param quota the quota to set 64 * @exception MessagingException if the server doesn't support the 65 * QUOTA extension 66 */ 67 void setQuota(Quota quota) throws MessagingException; 68 } 69