org.subethamail.smtp.server
Class ConnectionHandler.Context

java.lang.Object
  extended by org.subethamail.smtp.server.ConnectionHandler.Context
All Implemented Interfaces:
MessageContext, BaseContext, ConnectionContext
Enclosing class:
ConnectionHandler

public class ConnectionHandler.Context
extends java.lang.Object
implements ConnectionContext, MessageContext


Constructor Summary
ConnectionHandler.Context(SMTPServer server, org.apache.mina.common.IoSession ioSession)
           
 
Method Summary
 Credential getCredential()
           
 java.io.InputStream getInputStream()
           
 org.apache.mina.common.IoSession getIOSession()
           
 java.net.SocketAddress getRemoteAddress()
           
 Session getSession()
           
 SMTPServer getSMTPServer()
           
 void sendResponse(java.lang.String response)
           
 void setCredential(Credential credential)
           
 void setInputStream(java.io.InputStream inputStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionHandler.Context

public ConnectionHandler.Context(SMTPServer server,
                                 org.apache.mina.common.IoSession ioSession)
Method Detail

getInputStream

public java.io.InputStream getInputStream()
Specified by:
getInputStream in interface BaseContext
Returns:
the original data stream.

setInputStream

public void setInputStream(java.io.InputStream inputStream)

getSession

public Session getSession()
Specified by:
getSession in interface ConnectionContext

sendResponse

public void sendResponse(java.lang.String response)
                  throws java.io.IOException
Specified by:
sendResponse in interface ConnectionContext
Throws:
java.io.IOException

getRemoteAddress

public java.net.SocketAddress getRemoteAddress()
Specified by:
getRemoteAddress in interface BaseContext
Returns:
the IP address of the remote server.

getSMTPServer

public SMTPServer getSMTPServer()
Specified by:
getSMTPServer in interface BaseContext
Returns:
the SMTPServer object.

getIOSession

public org.apache.mina.common.IoSession getIOSession()
Specified by:
getIOSession in interface ConnectionContext

getCredential

public Credential getCredential()
Specified by:
getCredential in interface MessageContext
Returns:
the logged identity. Can be null if connection is still in authorization state or if authentication isn't required.

setCredential

public void setCredential(Credential credential)
Specified by:
setCredential in interface ConnectionContext


Copyright © 2011 SubEthaSMTP. All Rights Reserved. Build version: UNVERSIONED