org.norther.tammi.spray.connector.chain
Interface ConnectorExtension

All Superinterfaces:
Extension
All Known Implementing Classes:
AbstractConnectorRequest.ConnectorRequestExtension, HttpServletRequestDecorator.ConnectorRequestExtension

public interface ConnectorExtension
extends Extension

An interface to a connector specific extension of a servlet request. It is saved as a request attribute using its class name.

Author:
Ilkka Priha

Field Summary
static String KEY
          The extension key.
 
Method Summary
 void connected()
          Marks this request as connected.
 boolean containsComment(String name)
          Checks whether a named comment exists.
 String getComment(String name)
          Gets a named comment.
 Map getCommentMap()
          Gets a map of comments.
 Connection getConnection()
          Gets the connection of this request.
 long getConnectionTime()
          Gets the connection time of this request.
 String getProvider()
          Gets the provider of this connection.
 int getRedirectPort()
          Gets the redirect port of this connection.
 int getStatus()
          Gets the status of the response of this request.
 float getVersion()
          Gets the version of the protocol.
 boolean isKeepConnection()
          Checks whether connections should be kept alive.
 void removeComment(String name)
          Removes a named comment.
 void setComment(String name, String value)
          Sets a named comment.
 void setKeepConnection(boolean alive)
          Sets whether connections should be kept alive.
 void setStatus(int code)
          Sets the status of the response of this request.
 

Field Detail

KEY

static final String KEY
The extension key.

Method Detail

getProvider

String getProvider()
Gets the provider of this connection.

Returns:
the name of the provider.

getVersion

float getVersion()
Gets the version of the protocol.

Returns:
the protocol version.

getRedirectPort

int getRedirectPort()
Gets the redirect port of this connection.

Returns:
the redirect port number.

getConnectionTime

long getConnectionTime()
Gets the connection time of this request.

Returns:
the connection time in msecs.

connected

void connected()
Marks this request as connected.


isKeepConnection

boolean isKeepConnection()
Checks whether connections should be kept alive.

Returns:
true to keep connections alive, false otherwise.

setKeepConnection

void setKeepConnection(boolean alive)
Sets whether connections should be kept alive.

Parameters:
alive - true to keep connections alive, false otherwise.

getComment

String getComment(String name)
Gets a named comment.

Parameters:
name - the name of the comment.
Returns:
the comment value or null.

setComment

void setComment(String name,
                String value)
Sets a named comment. The comments are included in the access log entry of this request.

Parameters:
name - the name of the comment.
value - the value of the comment.

containsComment

boolean containsComment(String name)
Checks whether a named comment exists.

Parameters:
name - the name of the comment.
Returns:
true or false.

removeComment

void removeComment(String name)
Removes a named comment.

Parameters:
name - the name of the comment.

getCommentMap

Map getCommentMap()
Gets a map of comments. The map is a copy of the original comments.

Returns:
the map of comments.

getStatus

int getStatus()
Gets the status of the response of this request.

Returns:
the status code.

setStatus

void setStatus(int code)
Sets the status of the response of this request. Only requests with a status will be logged.

Parameters:
code - the status code.

getConnection

Connection getConnection()
Gets the connection of this request.

Returns:
the connection.


Copyright © 2004 The Norther Organization. All rights reserved.