1 package net.suberic.pooka.cache; 2 import javax.mail.*; 3 import javax.mail.internet.*; 4 import javax.activation.DataHandler ; 5 import net.suberic.pooka.MessageInfo; 6 7 public interface MessageCache { 8 9 public static int NOT_CACHED = -1; 10 public static int FLAGS = 1; 11 public static int HEADERS = 5; 12 public static int FLAGS_AND_HEADERS = 10; 13 public static int CONTENT = 20; 14 public static int MESSAGE = 30; 15 16 19 public DataHandler getDataHandler(long uid, long uidValidity) throws MessagingException; 20 21 24 public DataHandler getDataHandler(long uid, long uidValidity, boolean saveToCache) throws MessagingException; 25 26 29 public MimeMessage getMessageRepresentation(long uid, long uidValidity) throws MessagingException; 30 31 34 public MimeMessage getMessageRepresentation(long uid, long uidValidity, boolean saveToCache) throws MessagingException; 35 36 42 public void addFlag(long uid, long uidValidity, Flags flag) throws MessagingException; 43 44 50 public void removeFlag(long uid, long uidValidity, Flags flag) throws MessagingException; 51 52 55 public InternetHeaders getHeaders(long uid, long uidValidity) throws MessagingException; 56 57 60 public Flags getFlags(long uid, long uidValidity) throws MessagingException; 61 62 70 public boolean cacheMessage(MimeMessage m, long uid, long uidValidity, int status) throws MessagingException; 71 72 80 public boolean cacheMessage(MimeMessage m, long uid, long uidValidity, int status, boolean writeMsgFile) throws MessagingException; 81 82 86 public boolean invalidateCache(long uid, int status); 87 88 91 public boolean invalidateCache(long[] uids, int status); 92 93 96 public void invalidateCache(); 97 98 105 public long[] appendMessages(MessageInfo[] msgs) throws MessagingException; 106 107 116 public void expungeMessages() throws MessagingException; 117 118 122 public long[] getAddedMessages(long[] updatedUids, long uidValidity) throws StaleCacheException; 123 124 128 public long[] getRemovedMessages(long[] updatedUids, long uidValidity) throws StaleCacheException; 129 130 135 public long[] getMessageUids(); 136 137 140 public int getMessageCount() throws MessagingException; 141 142 145 public int getUnreadMessageCount() throws MessagingException; 146 147 150 public long getUIDValidity(); 151 152 156 public void setUIDValidity(long newValidity); 157 158 161 public void writeChangesToServer(Folder f) throws MessagingException; 162 163 166 public int getSize(long uid); 167 168 171 public boolean isFullyCached(long uid); 172 173 176 public int getCacheStatus(long uid) throws MessagingException; 177 178 182 public MessageInfo[] search(javax.mail.search.SearchTerm term) throws 183 javax.mail.MessagingException ; 184 185 188 public void writeMsgFile(); 189 } 190 | Popular Tags |