org.norther.tammi.spray.protocol
Interface HttpFilter

All Superinterfaces:
Filter
All Known Implementing Classes:
DefaultHttpFilter

public interface HttpFilter
extends Filter

An interface to filters processing HTTP protocol requests.

Author:
Ilkka Priha

Field Summary
static String NO_CHARSET_PARAM
          The optional no charset parameter of a default MIME type.
 
Method Summary
 String getCharacterEncoding()
          Gets the default character encoding for requests and responses if not explicitly specified.
 String getCharacterEncoding(Locale locale, ServletRequest request, ServletResponse response, FilterChain chain)
          Gets the default character encoding for a specific locale and request if not explicitly specified.
 String getContextPath()
          Gets the external context path.
 int getMaxRequestLength()
          Gets the maximum allowed length of the first line of the request.
 int getResponseBufferSize()
          Gets the response buffer size.
 boolean isAbsoluteURLLinks()
          Gets the absolute URL links option.
 boolean isFormDataParsed()
          Gets the form data to be parsed as parameters option.
 boolean isPathInfoParsed()
          Gets the path info to be parsed as parameters option.
 boolean isSessionCookiesDiscarded()
          Checks whether session cookies are discarded.
 boolean isVaryingClientsPermitted()
          Checks whether varying clients are permitted.
 void setAbsoluteURLLinks(boolean flag)
          Sets the absolute URL links option to use absolute links for local addresses also.
 void setCharacterEncoding(String encoding)
          Sets the default character encoding for requests and responses if not explicitly specified.
 void setContextPath(String path)
          Sets the external context path.
 void setFormDataParsed(boolean flag)
          Sets the form data to be parsed as parameters option.
 void setMaxRequestLength(int length)
          Sets the maximum allowed length of the first line of the request.
 void setPathInfoParsed(boolean flag)
          Sets the path info to be parsed as parameters option.
 void setResponseBufferSize(int size)
          Sets the response buffer size.
 void setSessionCookiesDiscarded(boolean flag)
          Sets whether session cookies are discarded.
 void setVaryingClientsPermitted(boolean flag)
          Sets whether varying clients are permitted.
 
Methods inherited from interface javax.servlet.Filter
destroy, doFilter, init
 

Field Detail

NO_CHARSET_PARAM

static final String NO_CHARSET_PARAM
The optional no charset parameter of a default MIME type.

See Also:
Constant Field Values
Method Detail

getContextPath

String getContextPath()
Gets the external context path.

Returns:
the context path.

setContextPath

void setContextPath(String path)
Sets the external context path.

The external context path may be applied in proxies and relays where the protocol filter can't parse the URI components correctly without hints.

Parameters:
path - the context path.

isAbsoluteURLLinks

boolean isAbsoluteURLLinks()
Gets the absolute URL links option.

Returns:
the absolute URL links option.

setAbsoluteURLLinks

void setAbsoluteURLLinks(boolean flag)
Sets the absolute URL links option to use absolute links for local addresses also.

Parameters:
flag - the absolute URL links option.

isVaryingClientsPermitted

boolean isVaryingClientsPermitted()
Checks whether varying clients are permitted.

Returns:
true if permitted, false otherwise.

setVaryingClientsPermitted

void setVaryingClientsPermitted(boolean flag)
Sets whether varying clients are permitted.

Varying clients may change their IP address without losing their session as long as the session id remains valid.

Parameters:
flag - true if permitted, false otherwise.

isSessionCookiesDiscarded

boolean isSessionCookiesDiscarded()
Checks whether session cookies are discarded.

Returns:
true if discarded, false otherwise.

setSessionCookiesDiscarded

void setSessionCookiesDiscarded(boolean flag)
Sets whether session cookies are discarded.

When session cookies are discarded the session id is encoded within the request URL.

Parameters:
flag - true if discarded, false otherwise.

isPathInfoParsed

boolean isPathInfoParsed()
Gets the path info to be parsed as parameters option.

Returns:
the path info parsed option.

setPathInfoParsed

void setPathInfoParsed(boolean flag)
Sets the path info to be parsed as parameters option.

Parameters:
flag - the path info parsed option.

isFormDataParsed

boolean isFormDataParsed()
Gets the form data to be parsed as parameters option.

Returns:
the form data parsed option.

setFormDataParsed

void setFormDataParsed(boolean flag)
Sets the form data to be parsed as parameters option.

Parameters:
flag - the form data parsed option.

getMaxRequestLength

int getMaxRequestLength()
Gets the maximum allowed length of the first line of the request.

Returns:
the maximum length of the request.

setMaxRequestLength

void setMaxRequestLength(int length)
Sets the maximum allowed length of the first line of the request. -1 is unlimited.

Parameters:
length - the maximum length of the request.

getResponseBufferSize

int getResponseBufferSize()
Gets the response buffer size.

Returns:
the buffer size in bytes.

setResponseBufferSize

void setResponseBufferSize(int size)
Sets the response buffer size. -1 uses the default.

Parameters:
size - the response buffer size.

getCharacterEncoding

String getCharacterEncoding()
Gets the default character encoding for requests and responses if not explicitly specified.

Returns:
the default character encoding or null.

setCharacterEncoding

void setCharacterEncoding(String encoding)
                          throws UnsupportedEncodingException
Sets the default character encoding for requests and responses if not explicitly specified.

Parameters:
encoding - the default character encoding.
Throws:
UnsupportedEncodingException - if not supported.

getCharacterEncoding

String getCharacterEncoding(Locale locale,
                            ServletRequest request,
                            ServletResponse response,
                            FilterChain chain)
Gets the default character encoding for a specific locale and request if not explicitly specified.

Note that the default character encoding of this filter is returned if defined, otherwise one of the accepted charsets of the request corresponding to the specified locale.

Parameters:
locale - the locale to apply.
request - the servlet request.
response - the servlet response.
chain - the filter chain.
Returns:
the locale specific character encoding.


Copyright © 2004 The Norther Organization. All rights reserved.