org.apache.james.protocols.smtp
Class SMTPSessionImpl

java.lang.Object
  extended by org.apache.james.protocols.api.AbstractSession
      extended by org.apache.james.protocols.smtp.SMTPSessionImpl
All Implemented Interfaces:
ProtocolSession, SMTPSession

public class SMTPSessionImpl
extends AbstractSession
implements SMTPSession

SMTPSession implementation


Field Summary
static String SMTP_SESSION
           
 
Fields inherited from class org.apache.james.protocols.api.AbstractSession
socketAddress, transport, user
 
Fields inherited from interface org.apache.james.protocols.smtp.SMTPSession
CURRENT_HELO_MODE, CURRENT_HELO_NAME, RCPT_LIST, SENDER
 
Constructor Summary
SMTPSessionImpl(SMTPConfiguration theConfigData, org.slf4j.Logger logger, ProtocolTransport transport)
           
 
Method Summary
 String getHelloName()
          Returns the service wide hello name
 long getMaxMessageSize()
          Returns the service wide maximum message size in bytes.
 int getPushedLineHandlerCount()
          Return the size of the pushed LineHandler
 int getRcptCount()
          Returns the recipient count
 String getSMTPGreeting()
          Return the SMTPGreeting which should used.
 boolean isAuthSupported()
          Returns whether Authentication is required or not
 boolean isRelayingAllowed()
          Returns whether Relaying is allowed or not
 boolean isStartTLSSupported()
           
 Response newFatalErrorResponse()
           
 Response newLineTooLongResponse()
           
 void popLineHandler()
          Pop the last command handler
 void pushLineHandler(LineHandler<SMTPSession> overrideCommandHandler)
          Put a new line handler in the chain
 void resetState()
           
 void setRelayingAllowed(boolean relayingAllowed)
          Set if reallying is allowed
 boolean useAddressBracketsEnforcement()
          Return wheter the mailserver will accept addresses without brackets enclosed.
 boolean useHeloEhloEnforcement()
          Returns whether the remote server needs to send a HELO/EHLO of its senders.
 
Methods inherited from class org.apache.james.protocols.api.AbstractSession
getConnectionState, getLogger, getProtocolTransport, getRemoteHost, getRemoteIPAddress, getSessionID, getState, getUser, isTLSStarted, setUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.james.protocols.api.ProtocolSession
getConnectionState, getLogger, getRemoteHost, getRemoteIPAddress, getSessionID, getState, getUser, isTLSStarted, setUser
 

Field Detail

SMTP_SESSION

public static final String SMTP_SESSION
See Also:
Constant Field Values
Constructor Detail

SMTPSessionImpl

public SMTPSessionImpl(SMTPConfiguration theConfigData,
                       org.slf4j.Logger logger,
                       ProtocolTransport transport)
Method Detail

isRelayingAllowed

public boolean isRelayingAllowed()
Description copied from interface: SMTPSession
Returns whether Relaying is allowed or not

Specified by:
isRelayingAllowed in interface SMTPSession
Returns:
the relaying status
See Also:
SMTPSession.isRelayingAllowed()

resetState

public void resetState()
Specified by:
resetState in interface ProtocolSession
See Also:
ProtocolSession.resetState()

popLineHandler

public void popLineHandler()
Description copied from interface: SMTPSession
Pop the last command handler

Specified by:
popLineHandler in interface SMTPSession
See Also:
SMTPSession.popLineHandler()

pushLineHandler

public void pushLineHandler(LineHandler<SMTPSession> overrideCommandHandler)
Description copied from interface: SMTPSession
Put a new line handler in the chain

Specified by:
pushLineHandler in interface SMTPSession
See Also:
SMTPSession.pushLineHandler(LineHandler)

getHelloName

public String getHelloName()
Description copied from interface: SMTPSession
Returns the service wide hello name

Specified by:
getHelloName in interface SMTPSession
Returns:
the hello name
See Also:
SMTPSession.getHelloName()

getMaxMessageSize

public long getMaxMessageSize()
Description copied from interface: SMTPSession
Returns the service wide maximum message size in bytes.

Specified by:
getMaxMessageSize in interface SMTPSession
Returns:
the maximum message size
See Also:
SMTPSession.getMaxMessageSize()

getRcptCount

public int getRcptCount()
Description copied from interface: SMTPSession
Returns the recipient count

Specified by:
getRcptCount in interface SMTPSession
Returns:
recipient count
See Also:
SMTPSession.getRcptCount()

getSMTPGreeting

public String getSMTPGreeting()
Description copied from interface: SMTPSession
Return the SMTPGreeting which should used.

Specified by:
getSMTPGreeting in interface SMTPSession
Returns:
the SMTPGreeting
See Also:
SMTPSession.getSMTPGreeting()

isAuthSupported

public boolean isAuthSupported()
Description copied from interface: SMTPSession
Returns whether Authentication is required or not

Specified by:
isAuthSupported in interface SMTPSession
Returns:
authentication required or not
See Also:
SMTPSession.isAuthSupported()

setRelayingAllowed

public void setRelayingAllowed(boolean relayingAllowed)
Description copied from interface: SMTPSession
Set if reallying is allowed

Specified by:
setRelayingAllowed in interface SMTPSession
See Also:
SMTPSession.setRelayingAllowed(boolean)

useAddressBracketsEnforcement

public boolean useAddressBracketsEnforcement()
Description copied from interface: SMTPSession
Return wheter the mailserver will accept addresses without brackets enclosed.

Specified by:
useAddressBracketsEnforcement in interface SMTPSession
Returns:
true or false
See Also:
SMTPSession.useAddressBracketsEnforcement()

useHeloEhloEnforcement

public boolean useHeloEhloEnforcement()
Description copied from interface: SMTPSession
Returns whether the remote server needs to send a HELO/EHLO of its senders.

Specified by:
useHeloEhloEnforcement in interface SMTPSession
Returns:
whether SMTP authentication is on
See Also:
SMTPSession.useHeloEhloEnforcement()

getPushedLineHandlerCount

public int getPushedLineHandlerCount()
Description copied from interface: SMTPSession
Return the size of the pushed LineHandler

Specified by:
getPushedLineHandlerCount in interface SMTPSession
Returns:
size of the pushed line handler
See Also:
SMTPSession.getPushedLineHandlerCount()

newLineTooLongResponse

public Response newLineTooLongResponse()
Specified by:
newLineTooLongResponse in interface ProtocolSession

newFatalErrorResponse

public Response newFatalErrorResponse()
Specified by:
newFatalErrorResponse in interface ProtocolSession

isStartTLSSupported

public boolean isStartTLSSupported()
Specified by:
isStartTLSSupported in interface ProtocolSession
Overrides:
isStartTLSSupported in class AbstractSession


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.