📄 mailbox.java
字号:
* Retrieves a message given a message sequence number. * * @param msn the message sequence number * @param username String represnting user * @return a Mail object containing the message, null if no message with * the given msn. * @throws AccessControlException if user does not have lookup rights for * this mailbox. * @throws AuthorizationException if user has lookup rights but does not * have read rights. */ MimeMessageWrapper retrieve( int msn, String user ) throws AccessControlException, AuthorizationException; /** * Retrieves a message given a unique identifier. * * @param uid the unique identifier of a message * @param username String represnting user * @return a Mail object containing the message, null if no message with * the given msn. * @throws AccessControlException if user does not have read rights for * this mailbox. * @throws AuthorizationException if user has lookup rights but does not * have read rights. */ MimeMessageWrapper retrieveUID( int uid, String user ) throws AccessControlException, AuthorizationException; /** * Marks a message for deletion given a message sequence number. * * @param msn the message sequence number * @param username String represnting user * @return boolean true if successful. * @throws AccessControlException if user does not have read rights for * this mailbox. * @throws AuthorizationException if user has lookup rights but does not * have delete rights. */ boolean markDeleted( int msn, String user ) throws AccessControlException, AuthorizationException; /** * Marks a message for deletion given a unique identifier. * * @param uidunique identifier * @param username String represnting user * @return boolean true if successful, false if failed including no * message with the given uid. * @throws AccessControlException if user does not have read rights for * this mailbox. * @throws AuthorizationException if user has lookup rights but does not * have delete rights. */ boolean markDeletedUID( int uid, String user ) throws AccessControlException, AuthorizationException; /** * Returns the message attributes for a message. * * @param msn message sequence number * @param username String represnting user * @return MessageAttributes for message, null if no such message. * Changing the MessageAttributes object must not affect the actual * MessageAttributes. * @throws AccessControlException if user does not have read rights for * this mailbox. * @throws AuthorizationException if user has lookup rights but does not * have delete rights. */ MessageAttributes getMessageAttributes( int msn, String user ) throws AccessControlException, AuthorizationException; /** * Returns the message attributes for a message. * * @param uid unique identifier * @param username String represnting user * @return MessageAttributes for message, null if no such message. * Changing the MessageAttributes object must not affect the actual * MessageAttributes. * @throws AccessControlException if user does not have read rights for * this mailbox. * @throws AuthorizationException if user has lookup rights but does not * have delete rights. */ MessageAttributes getMessageAttributesUID( int uid, String user ) throws AccessControlException, AuthorizationException; /** * Updates the attributes of a message. * * @param MessageAttributes of a message already in this Mailbox * @throws AccessControlException if user does not have read rights for * this mailbox. * @throws AuthorizationException if user has lookup rights but does not * have delete rights. */ boolean updateMessageAttributes( MessageAttributes attrs, String user ) throws AccessControlException, AuthorizationException; /** * Get the IMAP-formatted String of flags for specified message. * * @param msn message sequence number for a message in this mailbox * @param username String represnting user * @return flags for this message and user, null if no such message. * @throws AccessControlException if user does not have lookup rights for * this mailbox. * @throws AuthorizationException if user has lookup rights but does not * have read rights. */ String getFlags( int msn, String user ) throws AccessControlException, AuthorizationException; /** * Get the IMAP-formatted String of flags for specified message. * * @param uid UniqueIdentifier for a message in this mailbox * @param username String represnting user * @return flags for this message and user, null if no such message. * @throws AccessControlException if user does not have lookup rights for * this mailbox. * @throws AuthorizationException if user has lookup rights but does not * have read rights. */ String getFlagsUID(int uid, String user) throws AccessControlException, AuthorizationException; /** * Updates the flags of a message. * * @param msn message sequence number for a message in this mailbox * @param username String represnting user * @param request IMAP formatted string of flag request * @throws AccessControlException if user does not have read rights for * this mailbox. * @throws AuthorizationException if user has lookup rights but does not * have delete rights. */ boolean setFlags( int msn, String user, String request ) throws AccessControlException, AuthorizationException, IllegalArgumentException; /** * Updates the flags of a message. * * @param uid UniqueIdentifier for a message in this mailbox * @param username String represnting user * @param request IMAP formatted string of flag request * @throws AccessControlException if user does not have read rights for * this mailbox. * @throws AuthorizationException if user has lookup rights but does not * have delete rights. */ boolean setFlagsUID( int uid, String user, String request ) throws AccessControlException, AuthorizationException, IllegalArgumentException; /** * Returns the Internet Headers for a message. These are the top-level * headers only, ie not MIME part headers or headers of encapsulated * messages. * * @param msn message sequence number * @param username String represnting user * @return InternetHeaders for message, null if no such message. * Changing the InternetHeaders object must not affect the actual * InternetHeaders of the underlying message. * @throws AccessControlException if user does not have read rights for * this mailbox. * @throws AuthorizationException if user has lookup rights but does not * have delete rights. */ InternetHeaders getInternetHeaders( int msn, String user ) throws AccessControlException, AuthorizationException; /** * Returns the Internet Headers for a message. These are the top-level * headers only, ie not MIME part headers or headers of encapsulated * messages. * * @param uid UniqueIdentifier for a message in this mailbox * @param username String represnting user * @return InternetHeaders for message, null if no such message. * Changing the InternetHeaders object must not affect the actual * InternetHeaders of the underlying message. * @throws AccessControlException if user does not have read rights for * this mailbox. * @throws AuthorizationException if user has lookup rights but does not * have delete rights. */ InternetHeaders getInternetHeadersUID( int uid, String user ) throws AccessControlException, AuthorizationException; /** * Removes all messages marked Deleted. User must have delete rights. * * @param username String representing user * @return true if successful * @throws AccessControlException if user does not have read rights for * this mailbox. * @throws AuthorizationException if user has delete rights but does not * have delete rights. */ boolean expunge( String user ) throws AccessControlException, AuthorizationException, IllegalArgumentException; /** * Renames this Mailbox to a new name. * * @param username String representing user * @param newmailboxname String representing the new Mailbox Name * @return true if successful * @throws MailboxException if the Mailbox can't be renamed * @throws AuthorizationException if user has no write rights */ boolean renameMailbox(String username, String newmailboxname) throws MailboxException, AuthorizationException; boolean renameSubMailbox(String username, String oldname, String newmailboxname); /** * Establishes if specified user has lookup rights for this mailbox. * * @param username String represnting user * @return true if user has at least lookup rights */ boolean hasLookupRights( String user ); /** * Establishes if specified user has create rights for this mailbox. * * @param username String represnting user * @return true if user has at create rights * @throws AccessControlException if user does not have lookup rights for * this mailbox. */ boolean hasCreateRights( String user ) throws AccessControlException; /** * Lists uids of messages in mailbox indexed by MSN. * * @param username String represnting user * @return List of Integers wrapping uids of message */ List listUIDs( String user ); /** * Returns true once this Mailbox has been checkpointed. * This may include resolving in-memory state with disk state. * Implementations not requiring checkpointing should return immeadiately. * * @return true if check completes normally, false otherwise. */ boolean checkpoint(); /** * Mark this mailbox as not selectable by anyone. * Example folders at the roots of hierarchies, e. #mail for each user. * * @param state true if folder is not selectable by anyone */ void setNotSelectableByAnyone( boolean state ); boolean isNotSelectableByAnyone(); /** * Gets map of users to number of unseen messages. User key will only be * present if getOldestUnseen() has been called, usually as a result of * an IMAP SELECT or EXAMINE. */ Map getUnseenByUser(); /** * Returns true if the named user is subscribed to this Mailbox. */ boolean isSubscribed( String userName ); /** * Subscribes a user to this Mailbox. */ void subscribe( String userName ); /** * Unsubscrive a user from this Mailbox. */ void unsubscribe( String userName );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -