001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one
003     * or more contributor license agreements.  See the NOTICE file
004     * distributed with this work for additional information
005     * regarding copyright ownership.  The ASF licenses this file
006     * to you under the Apache License, Version 2.0 (the
007     * "License"); you may not use this file except in compliance
008     * with the License.  You may obtain a copy of the License at
009     *
010     *  http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing,
013     * software distributed under the License is distributed on an
014     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     * KIND, either express or implied.  See the License for the
016     * specific language governing permissions and limitations
017     * under the License.
018     */
019    
020    package javax.mail;
021    
022    /**
023     * An interface for Store implementations to support the IMAP RFC 2087 Quota extension.
024     *
025     * @version $Rev: 581202 $ $Date: 2007-10-02 08:05:22 -0400 (Tue, 02 Oct 2007) $
026     */
027    public interface QuotaAwareStore {
028        
029        /**
030         * Get the quotas for the specified root element.
031         *
032         * @param root   The root name for the quota information.
033         *
034         * @return An array of Quota objects defined for the root.
035         * @throws MessagingException if the quotas cannot be retrieved
036         */
037        public Quota[] getQuota(String root) throws javax.mail.MessagingException;
038    
039        /**
040         * Set a quota item.  The root contained in the Quota item identifies
041         * the quota target.
042         *
043         * @param quota  The source quota item.
044         * @throws MessagingException if the quota cannot be set
045         */
046        public void setQuota(Quota quota) throws javax.mail.MessagingException;
047    }
048    
049