001    //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.3_testing/src/org/deegree/framework/mail/MailMessage.java $
002    /*----------------------------------------------------------------------------
003     This file is part of deegree, http://deegree.org/
004     Copyright (C) 2001-2009 by:
005       Department of Geography, University of Bonn
006     and
007       lat/lon GmbH
008    
009     This library is free software; you can redistribute it and/or modify it under
010     the terms of the GNU Lesser General Public License as published by the Free
011     Software Foundation; either version 2.1 of the License, or (at your option)
012     any later version.
013     This library is distributed in the hope that it will be useful, but WITHOUT
014     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
015     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
016     details.
017     You should have received a copy of the GNU Lesser General Public License
018     along with this library; if not, write to the Free Software Foundation, Inc.,
019     59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020    
021     Contact information:
022    
023     lat/lon GmbH
024     Aennchenstr. 19, 53177 Bonn
025     Germany
026     http://lat-lon.de/
027    
028     Department of Geography, University of Bonn
029     Prof. Dr. Klaus Greve
030     Postfach 1147, 53001 Bonn
031     Germany
032     http://www.geographie.uni-bonn.de/deegree/
033    
034     e-mail: info@deegree.org
035    ----------------------------------------------------------------------------*/
036    package org.deegree.framework.mail;
037    
038    /**
039     * Interface of a email message.
040     *
041     * @author <a href="mailto:tfr@users.sourceforge.net">Torsten Friebe</A>
042     *
043     * @author last edited by: $Author: mschneider $
044     *
045     * @version $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
046     */
047    
048    public interface MailMessage {
049    
050        /**
051         * Returns the subject.
052         *
053         *
054         * @return the subjec string
055         */
056        String getSubject();
057    
058        /**
059         * Returns the sender
060         *
061         *
062         * @return the sender mail address
063         */
064        String getSender();
065    
066        /**
067         * Returns the message body
068         *
069         * @return string representation of the message body
070         */
071        String getMessageBody();
072    
073        /**
074         * Returns the receiver mail address
075         *
076         *
077         * @return the mail address of the receiver
078         */
079        String getReceiver();
080    
081        /**
082         * Sets the receiver mail address
083         *
084         *
085         * @param to
086         *            the receiver mail address
087         */
088        void setReceiver( String to );
089    
090        /**
091         * Sets the message body
092         *
093         * @param message
094         *            the string representation of the message body
095         */
096        void setMessageBody( String message );
097    
098        /**
099         * Sets the sender mail address.
100         *
101         *
102         * @param from
103         *            the sender mail address
104         */
105        void setSender( String from );
106    
107        /**
108         * Sets the subject.
109         *
110         * @param title
111         *            the message subject
112         */
113        void setSubject( String title );
114    
115        /**
116         * Return mail header including sender, receiver and subject.
117         *
118         * @return string with sender, receiver and subject
119         */
120        String getHeader();
121    
122        /**
123         * Sets the MIME type of the message
124         *
125         * @param mimeType
126         *            the MIME type as string
127         *
128         * @see #PLAIN_TEXT
129         * @see #TEXT_HTML
130         * @see <a href="http://www.ietf.org/rfc/rfc1341.txt">IETF MIME RFC</a>
131         * @see javax.mail.Part#setContent(java.lang.Object, java.lang.String)
132         * @see javax.mail.Part#setText
133         */
134        void setMimeType( String mimeType )
135                                throws UnknownMimeTypeException;
136    
137        /**
138         * Returns the MIME type of the message body.
139         *
140         * @return the MIME type as a string
141         *
142         * @see javax.mail.Part#getContentType
143         */
144        String getMimeType();
145    
146        /**
147         * Validates the message.
148         *
149         * @return <code>true</code> - if the message is complete, otherwise false.
150         */
151        boolean isValid();
152    
153        /**
154         * MIME type <code>text/plain</code>
155         */
156        String PLAIN_TEXT = "text/plain";
157    
158        /**
159         * MIME type <code>text/html</code>
160         */
161        String TEXT_HTML = "text/html";
162    
163        /**
164         * MIME type <code>text/xml</code>
165         */
166        String TEXT_XML = "text/xml";
167    
168        /**
169         * HTML mulitpart message with inline elements
170         *
171         * @see javax.mail.Part
172         */
173        short PART_INLINE = 0;
174    
175        /**
176         * Mulitpart message with references
177         *
178         * @see javax.mail.Part
179         */
180        short PART_REF = 1;
181    }