|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.abstracthorizon.danube.connection.ConnectionWrapper
org.abstracthorizon.mercury.imap.IMAPSession
public class IMAPSession
A class that represents IMAP session. This is connection wrapper.
Field Summary | |
---|---|
protected boolean |
authorised
Is user authenticated and authorised to use some commands |
protected boolean |
cleanInput
Clear flag is set to indicate that skip_line mustn't be called after command. |
protected String |
commandLine
Current command line |
protected long |
commandStarted
Timestamp command started |
protected String |
defaultDomain
Default domain if not specified in username |
protected boolean |
idling
Are we in IDLE mode |
protected LoginContext |
lc
Login context |
protected static org.slf4j.Logger |
logger
Logger |
protected IMAPConnectionHandler |
parent
Handler that created this session |
protected Reader |
reader
Input reader |
protected IMAPScanner |
scanner
IMAP scanner to be used |
protected boolean |
secure
Is secure conneciton |
protected javax.mail.Folder |
selectedFolder
Selected folder |
protected javax.mail.Session |
session
Mail session |
protected Socket |
socket
Cached socket |
protected javax.mail.Store |
store
Mail store |
protected String |
tag
Current tag |
protected Writer |
writer
Output writer |
Fields inherited from class org.abstracthorizon.danube.connection.ConnectionWrapper |
---|
connection |
Constructor Summary | |
---|---|
IMAPSession(org.abstracthorizon.danube.connection.Connection connection,
IMAPConnectionHandler parent)
Constructor |
Method Summary | |
---|---|
boolean |
authorise(String user,
String pass)
Authorises session. |
void |
close()
Closes IMAP session (connection) |
long |
getCommandLasted()
Returns number of millis how long last command execution lasted. |
OutputStream |
getDebugStream()
Returns debug output stream |
String |
getDefaultDomain()
Returns default domain name |
javax.mail.Session |
getJavaMailSession()
Returns JavaMail session |
boolean |
getKeepLog()
Returns should log be kept or not |
IMAPConnectionHandler |
getParent()
Returns imap connection handler that created this object |
IMAPScanner |
getScanner()
IMAP scanner |
javax.mail.Folder |
getSelectedFolder()
Returns selected Folder |
javax.mail.Store |
getStore()
Returns JavaMail store |
String |
getTag()
Returns current tag |
boolean |
isAuthorised()
Is session authorised or not |
boolean |
isCleanInput()
Returns if it is clean input |
boolean |
isIdling()
Returns if IDLE command is allowed |
boolean |
isInsecureAllowed()
Returns if insecure is allowed |
boolean |
isSecure()
Returns if socket is SSL socket if socket available. |
void |
markCommandStarted()
Marks when command has started |
void |
messagesAdded(javax.mail.event.MessageCountEvent event)
Notifies that new message is added |
void |
messagesRemoved(javax.mail.event.MessageCountEvent event)
NOtifies that message is removed |
void |
setCleanInput(boolean cleanInput)
Sets if it is clean input |
void |
setDefaultDomain(String domain)
Sets default domain name to be used with usernames |
void |
setIdling(boolean idling)
Sets if IDLE command is allowed |
void |
setJavaMailSession(javax.mail.Session session)
Sets JavaMail session |
void |
setKeepLog(boolean keepLog)
Sets should log be kept or not |
void |
setSelectedFolder(javax.mail.Folder folder)
Sets selected Folder |
void |
setTag(String tag)
Sets current tag |
void |
switchToTLS()
Switches to TLS (SSL) socket |
void |
unauthorise()
Removes authorisation |
void |
writeLogMessage(String msg)
Writes log message |
Methods inherited from class org.abstracthorizon.danube.connection.ConnectionWrapper |
---|
adapt, isClosed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.slf4j.Logger logger
protected IMAPConnectionHandler parent
protected String tag
protected String commandLine
protected boolean authorised
protected Writer writer
protected Reader reader
protected IMAPScanner scanner
protected javax.mail.Store store
protected javax.mail.Folder selectedFolder
protected javax.mail.Session session
protected LoginContext lc
protected boolean secure
protected boolean idling
protected boolean cleanInput
protected Socket socket
protected long commandStarted
protected String defaultDomain
Constructor Detail |
---|
public IMAPSession(org.abstracthorizon.danube.connection.Connection connection, IMAPConnectionHandler parent)
connection
- connectionparent
- imap connection handler that is creating this objectMethod Detail |
---|
public IMAPConnectionHandler getParent()
public void setKeepLog(boolean keepLog)
keepLog
- should log be keptpublic boolean getKeepLog()
public void writeLogMessage(String msg)
msg
- log messagepublic OutputStream getDebugStream()
public boolean isAuthorised()
public long getCommandLasted()
public void markCommandStarted()
public javax.mail.Store getStore()
public javax.mail.Folder getSelectedFolder()
public void setSelectedFolder(javax.mail.Folder folder)
folder
- selected Folderpublic IMAPScanner getScanner()
public javax.mail.Session getJavaMailSession()
public void setJavaMailSession(javax.mail.Session session)
session
- JavaMail sessionpublic boolean isInsecureAllowed()
public boolean isSecure()
true
public void setIdling(boolean idling)
idling
- if IDLE command is allowedpublic boolean isIdling()
public boolean isCleanInput()
public void setCleanInput(boolean cleanInput)
cleanInput
- is clean inputpublic String getTag()
public void setTag(String tag)
tag
- current tagpublic String getDefaultDomain()
public void setDefaultDomain(String domain)
domain
- public boolean authorise(String user, String pass) throws javax.mail.MessagingException
setDefaultDomain(String)
user
- usernamepass
- password
true
if it succeded
javax.mail.MessagingException
public void unauthorise()
public void close()
close
in interface org.abstracthorizon.danube.connection.Connection
close
in class org.abstracthorizon.danube.connection.ConnectionWrapper
public void switchToTLS() throws IOException
IOException
public void messagesAdded(javax.mail.event.MessageCountEvent event)
messagesAdded
in interface javax.mail.event.MessageCountListener
event
- message count eventpublic void messagesRemoved(javax.mail.event.MessageCountEvent event)
messagesRemoved
in interface javax.mail.event.MessageCountListener
even
- event
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |