com.openexchange.mail.transport
Class TransportProvider

java.lang.Object
  extended by com.openexchange.mail.transport.TransportProvider

public abstract class TransportProvider
extends java.lang.Object

TransportProvider - Provider for mail transport

Author:
Thorben Betten

Method Summary
abstract  MailTransport createNewMailTransport(com.openexchange.session.Session session)
          Gets a newly created mail transport
abstract  MailTransport createNewMailTransport(com.openexchange.session.Session session, int accountId)
          Gets a newly created mail transport
 boolean equals(java.lang.Object obj)
           
abstract  ComposedMailMessage getNewComposedMailMessage(com.openexchange.session.Session session, com.openexchange.groupware.contexts.Context ctx)
          Gets a new instance of ComposedMailMessage
abstract  DataMailPart getNewDataPart(java.lang.Object data, java.util.Map<java.lang.String,java.lang.String> dataProperties, com.openexchange.session.Session session)
          Gets a new instance of DataMailPart
abstract  InfostoreDocumentMailPart getNewDocumentPart(java.lang.String documentId, com.openexchange.session.Session session)
          Gets a new instance of InfostoreDocumentMailPart
abstract  UploadFileMailPart getNewFilePart(com.openexchange.groupware.upload.UploadFile uploadFile)
          Gets a new instance of UploadFileMailPart
abstract  ReferencedMailPart getNewReferencedMail(MailMessage referencedMail, com.openexchange.session.Session session)
          Gets a new instance of ReferencedMailPart
abstract  ReferencedMailPart getNewReferencedPart(MailPart referencedPart, com.openexchange.session.Session session)
          Gets a new instance of ReferencedMailPart
abstract  TextBodyMailPart getNewTextBodyPart(java.lang.String textBody)
          Gets a new instance of TextBodyMailPart
abstract  Protocol getProtocol()
          Gets this transport provider's protocol
 int hashCode()
           
 boolean isDeprecated()
          Checks if this provider is deprecated; any cached references should be discarded
 boolean supportsProtocol(java.lang.String protocol)
          Checks if this transport provider supports the given protocol (which is either in secure or non-secure notation).
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equals

public final boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

isDeprecated

public boolean isDeprecated()
Checks if this provider is deprecated; any cached references should be discarded

Returns:
true if deprecated; otherwise false

getProtocol

public abstract Protocol getProtocol()
Gets this transport provider's protocol

Returns:
The protocol

supportsProtocol

public final boolean supportsProtocol(java.lang.String protocol)
Checks if this transport provider supports the given protocol (which is either in secure or non-secure notation).

This is a convenience method that invokes Protocol.isSupported(String)

Parameters:
protocol - The protocol
Returns:
true if supported; otherwise false

createNewMailTransport

public abstract MailTransport createNewMailTransport(com.openexchange.session.Session session)
                                              throws MailException
Gets a newly created mail transport

Parameters:
session - The session providing needed user data
Returns:
A newly created mail transport
Throws:
MailException - If instantiation fails

createNewMailTransport

public abstract MailTransport createNewMailTransport(com.openexchange.session.Session session,
                                                     int accountId)
                                              throws MailException
Gets a newly created mail transport

Parameters:
session - The session providing needed user data
accountId - The account ID
Returns:
A newly created mail transport
Throws:
MailException - If instantiation fails

getNewComposedMailMessage

public abstract ComposedMailMessage getNewComposedMailMessage(com.openexchange.session.Session session,
                                                              com.openexchange.groupware.contexts.Context ctx)
                                                       throws MailException
Gets a new instance of ComposedMailMessage

Parameters:
session - The session for handling temporary uploaded files which shall be added to composed mail
ctx - The context to load session-related data
Returns:
A new instance of ComposedMailMessage
Throws:
MailException - If a new instance of ComposedMailMessage cannot be created

getNewFilePart

public abstract UploadFileMailPart getNewFilePart(com.openexchange.groupware.upload.UploadFile uploadFile)
                                           throws MailException
Gets a new instance of UploadFileMailPart

Parameters:
uploadFile - The upload file
Returns:
A new instance of UploadFileMailPart
Throws:
MailException - If a new instance of UploadFileMailPart cannot be created

getNewDocumentPart

public abstract InfostoreDocumentMailPart getNewDocumentPart(java.lang.String documentId,
                                                             com.openexchange.session.Session session)
                                                      throws MailException
Gets a new instance of InfostoreDocumentMailPart

Parameters:
documentId - The infostore document's unique ID
session - The session providing needed user data
Returns:
A new instance of InfostoreDocumentMailPart
Throws:
MailException - If a new instance of InfostoreDocumentMailPart cannot be created

getNewDataPart

public abstract DataMailPart getNewDataPart(java.lang.Object data,
                                            java.util.Map<java.lang.String,java.lang.String> dataProperties,
                                            com.openexchange.session.Session session)
                                     throws MailException
Gets a new instance of DataMailPart

Parameters:
data - The data obtained by a data source
dataProperties - The data properties
session - The session providing needed user data
Returns:
A new instance of DataMailPart
Throws:
MailException - If a new instance of DataMailPart cannot be created

getNewTextBodyPart

public abstract TextBodyMailPart getNewTextBodyPart(java.lang.String textBody)
                                             throws MailException
Gets a new instance of TextBodyMailPart

Parameters:
textBody - The text body
Returns:
A new instance of TextBodyMailPart
Throws:
MailException - If a new instance of TextBodyMailPart cannot be created

getNewReferencedPart

public abstract ReferencedMailPart getNewReferencedPart(MailPart referencedPart,
                                                        com.openexchange.session.Session session)
                                                 throws MailException
Gets a new instance of ReferencedMailPart

Parameters:
referencedPart - The referenced part
session - The session providing user data
Returns:
A new instance of ReferencedMailPart
Throws:
MailException - If a new instance of ReferencedMailPart cannot be created

getNewReferencedMail

public abstract ReferencedMailPart getNewReferencedMail(MailMessage referencedMail,
                                                        com.openexchange.session.Session session)
                                                 throws MailException
Gets a new instance of ReferencedMailPart

Parameters:
referencedMail - The referenced mail
session - The session providing user data
Returns:
A new instance of ReferencedMailPart
Throws:
MailException - If a new instance of ReferencedMailPart cannot be created