001    /*
002     * Copyright 2010 the original author or authors.
003     * 
004     *  Licensed under the Apache License, Version 2.0 (the "License");
005     *  you may not use this file except in compliance with the License.
006     *  You may obtain a copy of the License at
007     *
008     *      http://www.apache.org/licenses/LICENSE-2.0
009     *
010     *  Unless required by applicable law or agreed to in writing, software
011     *  distributed under the License is distributed on an "AS IS" BASIS,
012     *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     *  See the License for the specific language governing permissions and
014     *  limitations under the License.
015     */
016    package com.hs.mail.imap.dao;
017    
018    import java.util.List;
019    import java.util.Map;
020    
021    import javax.mail.Flags;
022    
023    import com.hs.mail.imap.message.FetchData;
024    import com.hs.mail.imap.message.MailMessage;
025    import com.hs.mail.imap.message.MessageHeader;
026    import com.hs.mail.imap.message.PhysMessage;
027    
028    /**
029     * 
030     * @author Won Chul Doh
031     * @since Mar 8, 2010
032     *
033     */
034    public interface MessageDao {
035    
036            public List<Long> getMessageIDList(long mailboxID);
037    
038            public void copyMessage(long messageID, long mailboxID);
039    
040            public FetchData getMessageFetchData(long messageID);
041            
042            public PhysMessage getDanglingMessageID(long messageID);
043    
044            public void addMessage(long mailboxID, MailMessage message);
045            
046            public void addMessage(long mailboxID, MailMessage message, Flags flags);
047            
048            public void deleteMessage(long messageID);
049            
050            public void deletePhysicalMessage(long physMessageID);
051    
052            public void setFlags(long messageID, Flags flags, boolean replace, boolean set);
053            
054            public List<Long> resetRecent(long messageID);
055            
056            public Flags getFlags(long messageID);
057            
058            public Map<String, String> getHeader(long physMessageID);
059            
060            public Map<String, String> getHeader(long physMessageID, String[] fields);
061    
062            public void addHeader(long physMessageID, MessageHeader header);
063    
064            public long getHeaderNameID(String headerName);
065            
066    }