KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > james > imapserver > MessageAttributes


1 /***********************************************************************
2  * Copyright (c) 2000-2004 The Apache Software Foundation. *
3  * All rights reserved. *
4  * ------------------------------------------------------------------- *
5  * Licensed under the Apache License, Version 2.0 (the "License"); you *
6  * may not use this file except in compliance with the License. You *
7  * may obtain a copy of the License at: *
8  * *
9  * http://www.apache.org/licenses/LICENSE-2.0 *
10  * *
11  * Unless required by applicable law or agreed to in writing, software *
12  * distributed under the License is distributed on an "AS IS" BASIS, *
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or *
14  * implied. See the License for the specific language governing *
15  * permissions and limitations under the License. *
16  ***********************************************************************/

17
18 package org.apache.james.imapserver;
19
20 import java.util.Date JavaDoc;
21
22 /**
23  * Interface for objects holding IMAP4rev1 Message Attributes. Message
24  * Attributes should be set when a message enters a mailbox. Implementations
25  * are encouraged to implement and store MessageAttributes apart from the
26  * underlying message. This allows the Mailbox to respond to questions about
27  * very large message without needing to access them directly.
28  * <p> Note that the message in a mailbox have the same order using either
29  * Message Sequence Numbers or UIDs.
30  *
31  * Reference: RFC 2060 - para 2.3
32  * @version 0.1 on 14 Dec 2000
33  */

34 public interface MessageAttributes {
35
36     /**
37      * Provides the current Message Sequence Number for this message. MSNs
38      * change when messages are expunged from the mailbox.
39      *
40      * @return int a positive non-zero integer
41      */

42     int getMessageSequenceNumber();
43
44     /**
45      * Provides the unique identity value for this message. UIDs combined with
46      * a UIDValidity value form a unique reference for a message in a given
47      * mailbox. UIDs persist across sessions unless the UIDValidity value is
48      * incremented. UIDs are not copied if a message is copied to another
49      * mailbox.
50      *
51      * @return int a 32-bit value
52      */

53     int getUID();
54
55     /**
56      * Provides the date and time at which the message was received. In the
57      * case of delivery by SMTP, this SHOULD be the date and time of final
58      * delivery as defined for SMTP. In the case of messages copied from
59      * another mailbox, it shuld be the internalDate of the source message. In
60      * the case of messages Appended to the mailbox, example drafts, the
61      * internalDate is either specified in the Append command or is the
62      * current dat and time at the time of the Append.
63      *
64      * @return Date imap internal date
65      */

66     Date JavaDoc getInternalDate();
67
68     /**
69      * Returns IMAP formatted String representation of Date
70      */

71     String JavaDoc getInternalDateAsString();
72
73     /**
74      * Provides the sizeof the message in octets.
75      *
76      * @return int number of octets in message.
77      */

78     int getSize();
79
80     /**
81      * Provides the Envelope structure information for this message.
82      * This is a parsed representation of the rfc-822 envelope information.
83      * This is not to be confused with the SMTP envelope!
84      *
85      * @return String satisfying envelope syntax in rfc 2060.
86      */

87     String JavaDoc getEnvelope();
88
89     /**
90      * Provides the Body Structure information for this message.
91      * This is a parsed representtion of the MIME structure of the message.
92      *
93      * @return String satisfying body syntax in rfc 2060.
94      */

95     String JavaDoc getBodyStructure();
96 }
97
98
99
Popular Tags