1 17 18 package org.apache.james.imapserver; 19 20 import org.apache.avalon.framework.component.Composable; 21 import org.apache.avalon.framework.configuration.Configurable; 22 import org.apache.james.imapserver.AccessControlException; 23 import org.apache.james.imapserver.AuthorizationException; 24 import org.apache.james.core.MimeMessageWrapper; 25 26 import javax.mail.internet.InternetHeaders ; 27 import javax.mail.internet.MimeMessage ; 28 import java.util.List ; 29 import java.util.Map ; 30 31 74 public interface Mailbox 75 extends Configurable, Composable { 76 77 String SYSTEM_FLAGS = "\\Seen \\Answered \\Flagged \\Deleted \\Draft"; 78 String RECENT_FLAG = "\\Recent"; 79 80 88 String getName(); 89 90 97 String getAbsoluteName(); 98 99 104 106 112 boolean matchesName(String name); 113 114 119 int getUIDValidity(); 120 121 126 int getNextUID(); 127 128 134 int getMailboxSize(); 135 136 142 boolean getInferiorsAllowed(); 143 144 154 boolean isSelectable(String username) throws AccessControlException; 155 156 163 boolean isMarked(); 164 165 172 String getSupportedFlags(); 173 174 182 boolean allFlags(String username) throws AccessControlException; 183 184 193 String getPermanentFlags( String username ) 194 throws AccessControlException; 195 196 201 int getExists(); 202 203 208 int getRecent(); 209 210 211 215 void unsetRecent(); 216 217 225 int getOldestUnseen( String user ); 226 227 232 int getUnseen( String user ); 233 234 248 boolean isReadOnly( String username ) 249 throws AccessControlException; 250 251 257 void addMailboxEventListener( MailboxEventListener mel ); 258 void removeMailboxEventListener( MailboxEventListener mel ); 259 260 269 boolean store( MimeMessage message, String username ) 270 throws AccessControlException, AuthorizationException, IllegalArgumentException ; 271 272 286 boolean store( MimeMessage message, 287 String username, 288 MessageAttributes attrs, 289 Flags flags ) 290 throws AccessControlException, AuthorizationException, IllegalArgumentException ; 291 292 304 MimeMessageWrapper retrieve( int msn, String user ) 305 throws AccessControlException, AuthorizationException; 306 307 319 MimeMessageWrapper retrieveUID( int uid, String user ) 320 throws AccessControlException, AuthorizationException; 321 322 333 boolean markDeleted( int msn, String user ) 334 throws AccessControlException, AuthorizationException; 335 336 348 boolean markDeletedUID( int uid, String user ) 349 throws AccessControlException, AuthorizationException; 350 351 364 MessageAttributes getMessageAttributes( int msn, String user ) 365 throws AccessControlException, AuthorizationException; 366 367 380 MessageAttributes getMessageAttributesUID( int uid, String user ) 381 throws AccessControlException, AuthorizationException; 382 383 392 boolean updateMessageAttributes( MessageAttributes attrs, String user ) 393 throws AccessControlException, AuthorizationException; 394 395 406 String getFlags( int msn, String user ) 407 throws AccessControlException, AuthorizationException; 408 409 420 String getFlagsUID(int uid, String user) 421 throws AccessControlException, AuthorizationException; 422 423 434 boolean setFlags( int msn, String user, String request ) 435 throws AccessControlException, AuthorizationException, IllegalArgumentException ; 436 437 448 boolean setFlagsUID( int uid, String user, String request ) 449 throws AccessControlException, AuthorizationException, IllegalArgumentException ; 450 451 466 InternetHeaders getInternetHeaders( int msn, String user ) 467 throws AccessControlException, AuthorizationException; 468 469 484 InternetHeaders getInternetHeadersUID( int uid, String user ) 485 throws AccessControlException, AuthorizationException; 486 487 497 boolean expunge( String user ) 498 throws AccessControlException, AuthorizationException, IllegalArgumentException ; 499 500 509 boolean renameMailbox(String username, String newmailboxname) 510 throws MailboxException, AuthorizationException; 511 512 boolean renameSubMailbox(String username, String oldname, String newmailboxname); 513 519 boolean hasLookupRights( String user ); 520 521 529 boolean hasCreateRights( String user ) 530 throws AccessControlException; 531 532 538 List listUIDs( String user ); 539 540 547 boolean checkpoint(); 548 549 555 void setNotSelectableByAnyone( boolean state ); 556 557 boolean isNotSelectableByAnyone(); 558 559 564 Map getUnseenByUser(); 565 566 569 boolean isSubscribed( String userName ); 570 571 574 void subscribe( String userName ); 575 576 579 void unsubscribe( String userName ); 580 581 } 582 583 584 | Popular Tags |