Skip to content

Package: QuotaAwareStore

QuotaAwareStore

Coverage

1: /*
2: * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0, which is available at
6: * http://www.eclipse.org/legal/epl-2.0.
7: *
8: * This Source Code may also be made available under the following Secondary
9: * Licenses when the conditions for such availability set forth in the
10: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11: * version 2 with the GNU Classpath Exception, which is available at
12: * https://www.gnu.org/software/classpath/license.html.
13: *
14: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15: */
16:
17: package jakarta.mail;
18:
19: /**
20: * An interface implemented by Stores that support quotas.
21: * The {@link #getQuota getQuota} and {@link #setQuota setQuota} methods
22: * support the quota model defined by the IMAP QUOTA extension.
23: * Refer to <A HREF="http://www.ietf.org/rfc/rfc2087.txt">RFC 2087</A>
24: * for more information.
25: *
26: * @since JavaMail 1.4
27: */
28: public interface QuotaAwareStore {
29: /**
30: * Get the quotas for the named folder.
31: * Quotas are controlled on the basis of a quota root, not
32: * (necessarily) a folder. The relationship between folders
33: * and quota roots depends on the server. Some servers
34: * might implement a single quota root for all folders owned by
35: * a user. Other servers might implement a separate quota root
36: * for each folder. A single folder can even have multiple
37: * quota roots, perhaps controlling quotas for different
38: * resources.
39: *
40: * @param folder the name of the folder
41: * @return array of Quota objects
42: * @throws MessagingException if the server doesn't support the
43: * QUOTA extension
44: */
45: Quota[] getQuota(String folder) throws MessagingException;
46:
47: /**
48: * Set the quotas for the quota root specified in the quota argument.
49: * Typically this will be one of the quota roots obtained from the
50: * <code>getQuota</code> method, but it need not be.
51: *
52: * @param quota the quota to set
53: * @throws MessagingException if the server doesn't support the
54: * QUOTA extension
55: */
56: void setQuota(Quota quota) throws MessagingException;
57: }