public final class ImapSessionImpl extends Object implements ImapSession
| Constructor and Description |
|---|
ImapSessionImpl(ImapHostManager imapHost,
UserManager users,
ImapHandler handler,
String clientAddress) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeConnection()
Closes the connection for this session.
|
void |
closeConnection(String byeMessage)
Closes the connection for this session with a final good-bye message.
|
void |
deselect()
Moves the session out of
ImapSessionState.SELECTED state and back into
ImapSessionState.AUTHENTICATED state. |
String |
getClientIP() |
ImapHostManager |
getHost()
Provides the Imap host for this server, which is used for all access to mail
storage and subscriptions.
|
ImapSessionFolder |
getSelected()
Provides the selected mailbox for this session, or
null if this
session is not in ImapSessionState.SELECTED state. |
ImapSessionState |
getState() |
GreenMailUser |
getUser()
Provides the authenticated user for this session, or
null if this
session is not in ImapSessionState.AUTHENTICATED or
ImapSessionState.SELECTED state. |
UserManager |
getUserManager()
Provides the UserManager for this session, to allow session
to validate logins.
|
void |
setAuthenticated(GreenMailUser user)
Moves the session into
ImapSessionState.AUTHENTICATED state with
the supplied user. |
void |
setSelected(MailFolder folder,
boolean readOnly)
Moves this session into
ImapSessionState.SELECTED state and sets the
supplied mailbox to be the currently selected mailbox. |
void |
unsolicitedResponses(ImapResponse request)
Sends any unsolicited responses to the client, such as EXISTS and FLAGS
responses when the selected mailbox is modified by another user.
|
void |
unsolicitedResponses(ImapResponse response,
boolean omitExpunged) |
public ImapSessionImpl(ImapHostManager imapHost, UserManager users, ImapHandler handler, String clientAddress)
public ImapHostManager getHost()
ImapSessiongetHost in interface ImapSessionpublic void unsolicitedResponses(ImapResponse request) throws FolderException
ImapSessionunsolicitedResponses in interface ImapSessionrequest - The response to write toFolderExceptionpublic void unsolicitedResponses(ImapResponse response, boolean omitExpunged) throws FolderException
unsolicitedResponses in interface ImapSessionFolderExceptionpublic void closeConnection(String byeMessage)
ImapSessioncloseConnection in interface ImapSessionbyeMessage - the good-bye message.public void closeConnection()
ImapSessioncloseConnection in interface ImapSessionpublic UserManager getUserManager()
ImapSessiongetUserManager in interface ImapSessionpublic String getClientIP()
getClientIP in interface ImapSessionpublic void setAuthenticated(GreenMailUser user)
ImapSessionImapSessionState.AUTHENTICATED state with
the supplied user.setAuthenticated in interface ImapSessionuser - The user who is authenticated for this session.public GreenMailUser getUser()
ImapSessionnull if this
session is not in ImapSessionState.AUTHENTICATED or
ImapSessionState.SELECTED state.getUser in interface ImapSessionpublic void deselect()
ImapSessionImapSessionState.SELECTED state and back into
ImapSessionState.AUTHENTICATED state. The selected mailbox is cleared.deselect in interface ImapSessionpublic void setSelected(MailFolder folder, boolean readOnly)
ImapSessionImapSessionState.SELECTED state and sets the
supplied mailbox to be the currently selected mailbox.setSelected in interface ImapSessionfolder - The selected mailbox.readOnly - If true, the selection is set to be read only.public ImapSessionFolder getSelected()
ImapSessionnull if this
session is not in ImapSessionState.SELECTED state.getSelected in interface ImapSessionpublic ImapSessionState getState()
getState in interface ImapSessionCopyright © 2006–2022 Icegreen Technologies. All rights reserved.