com.funambol.email.transport
Class ImapMailServerWrapper

java.lang.Object
  extended by com.funambol.email.transport.CommonMailServerWrapper
      extended by com.funambol.email.transport.ImapMailServerWrapper
All Implemented Interfaces:
IMailServerWrapper

public class ImapMailServerWrapper
extends CommonMailServerWrapper
implements IMailServerWrapper

Create a connection with a Mail Server using the IMAP protocol


Field Summary
 com.sun.mail.imap.IMAPFolder folderInboxOpened
           
 javax.mail.Message[] messagesInboxOpened
          used in the getMessageByUID method.
 
Fields inherited from class com.funambol.email.transport.CommonMailServerWrapper
defaultFolder, locale, log, mailDefaultFolder, serverOut, serverType, session, store, userAddress
 
Constructor Summary
ImapMailServerWrapper()
           
 
Method Summary
 com.sun.mail.imap.IMAPFolder getDraftsFolder()
          returns Drafts Folder Instance
 com.sun.mail.imap.IMAPFolder getInboxFolder()
          returns Inbox Folder Instance
 com.sun.mail.imap.IMAPFolder getOutboxFolder()
          returns Outbox Folder Instance
 com.sun.mail.imap.IMAPFolder getSentFolder()
          returns Sent Folder Instance
 com.sun.mail.imap.IMAPFolder getTrashFolder()
          returns Trash Folder Instance
 void openConnection(java.lang.String serverType, java.lang.String outgoingServer, java.lang.String outgoingPort, boolean smtpAuth, java.lang.String incomingServer, java.lang.String incomingPort, DefaultFolder df, java.lang.String user, java.lang.String password, boolean isSSLIn, boolean isSSLOut, java.lang.String keystorePath, java.lang.String keystorePassphrase)
          opens the connection with the mail server
 void releaseConnection()
          closes the connection with the mail server
protected  void setConnectionNormalIn(java.util.Properties props, java.lang.String incomingServer, java.lang.String incomingPort)
           
protected  void setConnectionNormalOut(java.util.Properties props, java.lang.String outgoingServer, java.lang.String outgoingPort, boolean smtpAuth)
           
protected  void setConnectionSSLIn(java.util.Properties props, java.lang.String incomingServer, java.lang.String incomingPort, com.sun.net.ssl.internal.ssl.Provider provider, java.lang.String keystorePath, java.lang.String keystorePassphrase)
           
protected  void setConnectionSSLOut(java.util.Properties props, java.lang.String outgoingServer, java.lang.String outgoingPort, boolean smtpAuth, com.sun.net.ssl.internal.ssl.Provider provider, java.lang.String keystorePath, java.lang.String keystorePassphrase)
           
 
Methods inherited from class com.funambol.email.transport.CommonMailServerWrapper
checkUser, getDefaultFolder, getLocale, getMailDefaultFolder, getServerOut, getSession, getStore, getUserAddress, multipleOpenConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.funambol.email.transport.IMailServerWrapper
checkUser, getDefaultFolder, getLocale, getMailDefaultFolder, getSession, getStore
 

Field Detail

messagesInboxOpened

public javax.mail.Message[] messagesInboxOpened
used in the getMessageByUID method. in the POP protocol there is no the method "folder.getMessageByUID(String) At the end of the sync session the server calls the getSyncItem In this method we open and close the folder every time. Using this propreties we can leave the folder open for alle the calls to the getSyncItem method. In the EndSync we close this folder if it's open


folderInboxOpened

public com.sun.mail.imap.IMAPFolder folderInboxOpened
Constructor Detail

ImapMailServerWrapper

public ImapMailServerWrapper()
Method Detail

openConnection

public void openConnection(java.lang.String serverType,
                           java.lang.String outgoingServer,
                           java.lang.String outgoingPort,
                           boolean smtpAuth,
                           java.lang.String incomingServer,
                           java.lang.String incomingPort,
                           DefaultFolder df,
                           java.lang.String user,
                           java.lang.String password,
                           boolean isSSLIn,
                           boolean isSSLOut,
                           java.lang.String keystorePath,
                           java.lang.String keystorePassphrase)
                    throws EmailAccessException
opens the connection with the mail server

Specified by:
openConnection in interface IMailServerWrapper
Specified by:
openConnection in class CommonMailServerWrapper
Parameters:
outgoingServer - SMPT address i.e. 192.168.0.1
outgoingPort - 25 def.
incomingServer - IMAP address i.e. 192.168.0.1
incomingPort - 143 / 993 IMAP def.
df - inbox, outbox, sent items,...
user - String
password - String
isSSL - true/false
Throws:
EmailAccessException

releaseConnection

public void releaseConnection()
                       throws EmailAccessException
closes the connection with the mail server

Specified by:
releaseConnection in interface IMailServerWrapper
Specified by:
releaseConnection in class CommonMailServerWrapper
Throws:
EmailAccessException

getInboxFolder

public com.sun.mail.imap.IMAPFolder getInboxFolder()
                                            throws EmailAccessException
returns Inbox Folder Instance

Returns:
IMAPFolder
Throws:
EmailAccessException

getOutboxFolder

public com.sun.mail.imap.IMAPFolder getOutboxFolder()
                                             throws EmailAccessException
returns Outbox Folder Instance

Returns:
IMAPFolder
Throws:
EmailAccessException

getSentFolder

public com.sun.mail.imap.IMAPFolder getSentFolder()
                                           throws EmailAccessException
returns Sent Folder Instance

Returns:
IMAPFolder
Throws:
EmailAccessException

getDraftsFolder

public com.sun.mail.imap.IMAPFolder getDraftsFolder()
                                             throws EmailAccessException
returns Drafts Folder Instance

Returns:
IMAPFolder
Throws:
EmailAccessException

getTrashFolder

public com.sun.mail.imap.IMAPFolder getTrashFolder()
                                            throws EmailAccessException
returns Trash Folder Instance

Returns:
IMAPFolder
Throws:
EmailAccessException

setConnectionSSLIn

protected void setConnectionSSLIn(java.util.Properties props,
                                  java.lang.String incomingServer,
                                  java.lang.String incomingPort,
                                  com.sun.net.ssl.internal.ssl.Provider provider,
                                  java.lang.String keystorePath,
                                  java.lang.String keystorePassphrase)
Specified by:
setConnectionSSLIn in class CommonMailServerWrapper
Parameters:
props - Properties
outgoingServer - String
outgoingPort - String
incomingServer - String
incomingPort - String
provider - Provider

setConnectionSSLOut

protected void setConnectionSSLOut(java.util.Properties props,
                                   java.lang.String outgoingServer,
                                   java.lang.String outgoingPort,
                                   boolean smtpAuth,
                                   com.sun.net.ssl.internal.ssl.Provider provider,
                                   java.lang.String keystorePath,
                                   java.lang.String keystorePassphrase)
Specified by:
setConnectionSSLOut in class CommonMailServerWrapper
Parameters:
props - Properties
outgoingServer - String
outgoingPort - String
incomingServer - String
incomingPort - String
provider - Provider

setConnectionNormalIn

protected void setConnectionNormalIn(java.util.Properties props,
                                     java.lang.String incomingServer,
                                     java.lang.String incomingPort)
Specified by:
setConnectionNormalIn in class CommonMailServerWrapper
Parameters:
props - Properties
outgoingServer - String
outgoingPort - String
incomingServer - String
incomingPort - String

setConnectionNormalOut

protected void setConnectionNormalOut(java.util.Properties props,
                                      java.lang.String outgoingServer,
                                      java.lang.String outgoingPort,
                                      boolean smtpAuth)
Specified by:
setConnectionNormalOut in class CommonMailServerWrapper
Parameters:
props - Properties
outgoingServer - String
outgoingPort - String
incomingServer - String
incomingPort - String


Copyright © 2005-2006 Funambol.