org.apache.james.socket
Interface ProtocolHandlerHelper

All Known Implementing Classes:
DelegatingJamesHandler

public interface ProtocolHandlerHelper

This is the helper interface provided to ProtocolHandlers to let them communicate with the outside world.


Method Summary
 void defaultErrorHandler(java.lang.RuntimeException e)
          Provides basic errorhandling cleanup.
 org.apache.avalon.framework.logger.Logger getAvalonLogger()
          Provides logging facility to the handler.
 CRLFTerminatedReader getInputReader()
          Returns a CRLF terminated line reader
 java.io.InputStream getInputStream()
          Returns the raw input stream
 java.lang.String getName()
          The name of this handler.
 java.io.OutputStream getOutputStream()
          Returns the raw outputstream
 java.io.PrintWriter getOutputWriter()
          Returns the printwriter.
 java.lang.String getRemoteHost()
          getter for the remote hostname
 java.lang.String getRemoteIP()
          getter for the remote ip
 java.net.Socket getSocket()
          Provides access to the socket
 Watchdog getWatchdog()
          The watchdog is used to deal with timeouts.
 void writeLoggedFlushedResponse(java.lang.String responseString)
          Writes a response to the client and flush it.
 void writeLoggedResponse(java.lang.String responseString)
          Writes a response to the client without flushing.
 

Method Detail

writeLoggedFlushedResponse

void writeLoggedFlushedResponse(java.lang.String responseString)
Writes a response to the client and flush it.

Parameters:
responseString - the response string

writeLoggedResponse

void writeLoggedResponse(java.lang.String responseString)
Writes a response to the client without flushing.

Parameters:
responseString - the response string

getWatchdog

Watchdog getWatchdog()
The watchdog is used to deal with timeouts.

Returns:
the watchdog instance

getAvalonLogger

org.apache.avalon.framework.logger.Logger getAvalonLogger()
Provides logging facility to the handler.

Returns:
logger instance

getRemoteHost

java.lang.String getRemoteHost()
getter for the remote hostname

Returns:
remote hostname

getRemoteIP

java.lang.String getRemoteIP()
getter for the remote ip

Returns:
remote ip

getInputReader

CRLFTerminatedReader getInputReader()
Returns a CRLF terminated line reader

Returns:
line reader

getInputStream

java.io.InputStream getInputStream()
Returns the raw input stream

Returns:
the raw inputstream

getOutputStream

java.io.OutputStream getOutputStream()
Returns the raw outputstream

Returns:
outputstream

getOutputWriter

java.io.PrintWriter getOutputWriter()
Returns the printwriter.

Returns:
the output printwriter

defaultErrorHandler

void defaultErrorHandler(java.lang.RuntimeException e)
Provides basic errorhandling cleanup.

Parameters:
e - the runtimeexception

getSocket

java.net.Socket getSocket()
Provides access to the socket

Returns:
socket

getName

java.lang.String getName()
The name of this handler. Used for context sensitive logging.

Returns:
the name, not null


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.