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.

Version:
$Id: ConnectorExtension.java,v 1.14 2010-03-10 06:46:29 cvsimp Exp $
Author:
Ilkka Priha

Field Summary
static String KEY
          The extension key.
 
Method Summary
 void busy()
          Keeps this request busy.
 int commentCount()
          Returns the number of comments.
 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<String,String> getCommentMap()
          Gets a map of comments.
 Connection getConnection()
          Gets the connection of this request.
 long getConnectionTime()
          Gets the connection time of this request.
 String getHttpRequest()
          Gets the HTTP request of this connection.
 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 isConnected()
          Checks whether the connection is connected.
 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 setHttpRequest(String req)
          Sets the HTTP request of this connection.
 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.

isConnected

boolean isConnected()
Checks whether the connection is connected.

Returns:
true if connected, false otherwise.

connected

void connected()
Marks this request as connected.


busy

void busy()
Keeps this request busy.


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.

getHttpRequest

String getHttpRequest()
Gets the HTTP request of this connection.

Returns:
the HTTP request.

setHttpRequest

void setHttpRequest(String req)
Sets the HTTP request of this connection.

Parameters:
req - the HTTP request.

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.

commentCount

int commentCount()
Returns the number of comments.

Returns:
the comment count.

getCommentMap

Map<String,String> getCommentMap()
Gets a map of comments.

Returns:
a cloned 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.