|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectAcme.Serve.Serve.ServeConnection
public static class Serve.ServeConnection
provides request/response
| Field Summary | |
|---|---|
static java.lang.String |
ACCEPT_LANGUAGE
|
static java.lang.String |
CHUNKED
|
static java.lang.String |
CONNECTION
|
static java.lang.String |
CONTENT_ENCODING
|
static java.lang.String |
CONTENTLENGTH
|
static java.lang.String |
CONTENTTYPE
|
static java.lang.String |
COOKIE
|
static java.lang.String |
HOST
|
protected boolean |
keepAlive
|
static java.lang.String |
KEEPALIVE
|
protected long |
lastRun
|
protected long |
lastWait
|
protected java.lang.String |
reqQuery
|
static java.lang.String |
SESSION_COOKIE_NAME
|
static java.lang.String |
SESSION_URL_NAME
|
static java.lang.String |
SETCOOKIE
|
protected int |
timesRequested
|
static java.lang.String |
TRANSFERENCODING
|
static java.lang.String |
WWWFORMURLENCODE
|
| Fields inherited from interface javax.servlet.http.HttpServletRequest |
|---|
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
| Fields inherited from interface javax.servlet.http.HttpServletResponse |
|---|
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_FOUND, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY |
| Constructor Summary | |
|---|---|
Serve.ServeConnection(java.net.Socket socket,
Serve serve)
|
|
| Method Summary | |
|---|---|
void |
addCookie(javax.servlet.http.Cookie cookie)
|
void |
addDateHeader(java.lang.String header,
long date)
|
void |
addHeader(java.lang.String header,
java.lang.String value)
|
void |
addIntHeader(java.lang.String header,
int value)
|
void |
closeSocket()
|
void |
closeStreams()
it closes stream awaring of keep -alive |
boolean |
containsHeader(java.lang.String name)
|
java.lang.String |
encodeRedirectUrl(java.lang.String url)
|
java.lang.String |
encodeRedirectURL(java.lang.String url)
|
java.lang.String |
encodeUrl(java.lang.String url)
|
java.lang.String |
encodeURL(java.lang.String url)
|
void |
flushBuffer()
|
java.lang.Object |
getAttribute(java.lang.String name)
|
java.util.Enumeration |
getAttributeNames()
|
java.lang.String |
getAuthType()
|
int |
getBufferSize()
|
java.lang.String |
getCharacterEncoding()
|
int |
getContentLength()
|
java.lang.String |
getContentType()
|
java.lang.String |
getContextPath()
|
javax.servlet.http.Cookie[] |
getCookies()
|
long |
getDateHeader(java.lang.String name)
|
java.lang.String |
getHeader(java.lang.String name)
|
java.util.Enumeration |
getHeaderNames()
|
java.util.Enumeration |
getHeaders(java.lang.String header)
|
javax.servlet.ServletInputStream |
getInputStream()
|
int |
getIntHeader(java.lang.String name)
|
java.lang.String |
getLocalAddr()
Returns the Internet Protocol (IP) address of the interface on which the request was received. |
java.util.Locale |
getLocale()
For request: Returns the preferred Locale that the client will accept content in, based on the Accept-Language header. |
java.util.Enumeration |
getLocales()
Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header. |
java.lang.String |
getLocalName()
Returns the host name of the Internet Protocol (IP) interface on which the request was received. |
int |
getLocalPort()
Returns the Internet Protocol (IP) port number of the interface on which the request was received. |
java.lang.String |
getMethod()
|
javax.servlet.ServletOutputStream |
getOutputStream()
|
java.lang.String |
getParameter(java.lang.String name)
|
java.util.Map |
getParameterMap()
Returns a java.util.Map of the parameters of this request. |
java.util.Enumeration |
getParameterNames()
|
java.lang.String[] |
getParameterValues(java.lang.String name)
|
java.lang.String |
getPathInfo()
|
java.lang.String |
getPathTranslated()
|
java.lang.String |
getProtocol()
|
java.lang.String |
getQueryString()
|
java.io.BufferedReader |
getReader()
|
java.lang.String |
getRealPath(java.lang.String path)
|
java.lang.String |
getRemoteAddr()
|
java.lang.String |
getRemoteHost()
|
int |
getRemotePort()
Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request. |
java.lang.String |
getRemoteUser()
|
javax.servlet.RequestDispatcher |
getRequestDispatcher(java.lang.String urlpath)
|
java.lang.String |
getRequestedSessionId()
|
java.lang.String |
getRequestURI()
**************************************************************************************************************************************************** Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request. |
java.lang.StringBuffer |
getRequestURL()
Reconstructs the URL the client used to make the request. |
java.lang.String |
getScheme()
|
java.lang.String |
getServerName()
|
int |
getServerPort()
|
java.lang.String |
getServletPath()
|
javax.servlet.http.HttpSession |
getSession()
|
javax.servlet.http.HttpSession |
getSession(boolean create)
|
java.net.Socket |
getSocket()
|
java.security.Principal |
getUserPrincipal()
|
java.io.PrintWriter |
getWriter()
|
boolean |
isCommitted()
Returns a boolean indicating if the response has been committed. |
boolean |
isRequestedSessionIdFromCookie()
Checks whether the session id specified by this request came in as a cookie. |
boolean |
isRequestedSessionIdFromUrl()
|
boolean |
isRequestedSessionIdFromURL()
|
boolean |
isRequestedSessionIdValid()
|
boolean |
isSecure()
|
boolean |
isUserInRole(java.lang.String user)
|
void |
removeAttribute(java.lang.String name)
|
void |
reset()
Clears any data that exists in the buffer as well as the status code and headers. |
void |
resetBuffer()
Clears the content of the underlying buffer in the response without clearing headers or status code. |
void |
run()
|
void |
sendError(int resCode)
|
void |
sendError(int resCode,
java.lang.String resMessage)
|
void |
sendRedirect(java.lang.String location)
|
void |
setAttribute(java.lang.String key,
java.lang.Object o)
Stores an attribute in this request. |
void |
setBufferSize(int size)
|
void |
setCharacterEncoding(java.lang.String _enc)
Overrides the name of the character encoding used in the body of this request. |
void |
setContentLength(int length)
|
void |
setContentType(java.lang.String type)
|
void |
setDateHeader(java.lang.String header,
long value)
|
void |
setHeader(java.lang.String header,
java.lang.String value)
|
void |
setInInclude(boolean set)
|
void |
setIntHeader(java.lang.String header,
int value)
|
void |
setLocale(java.util.Locale locale)
Sets the locale of the response, setting the headers (including the Content-Type's charset) as appropriate. |
void |
setLongHeader(java.lang.String header,
long value)
|
void |
setStatus(int resCode)
|
void |
setStatus(int resCode,
java.lang.String resMessage)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String WWWFORMURLENCODE
public static final java.lang.String TRANSFERENCODING
public static final java.lang.String KEEPALIVE
public static final java.lang.String CONTENT_ENCODING
public static final java.lang.String CONNECTION
public static final java.lang.String CHUNKED
public static final java.lang.String CONTENTLENGTH
public static final java.lang.String CONTENTTYPE
public static final java.lang.String SETCOOKIE
public static final java.lang.String HOST
public static final java.lang.String COOKIE
public static final java.lang.String ACCEPT_LANGUAGE
public static final java.lang.String SESSION_COOKIE_NAME
public static final java.lang.String SESSION_URL_NAME
protected boolean keepAlive
protected int timesRequested
protected long lastRun
protected long lastWait
protected java.lang.String reqQuery
| Constructor Detail |
|---|
public Serve.ServeConnection(java.net.Socket socket,
Serve serve)
| Method Detail |
|---|
public void closeStreams()
throws java.io.IOException
java.io.IOExceptionpublic void closeSocket()
public void run()
run in interface java.lang.Runnablepublic int getContentLength()
getContentLength in interface javax.servlet.ServletRequestpublic java.lang.String getContentType()
getContentType in interface javax.servlet.ServletRequestgetContentType in interface javax.servlet.ServletResponsepublic java.lang.String getProtocol()
getProtocol in interface javax.servlet.ServletRequestpublic java.lang.String getScheme()
getScheme in interface javax.servlet.ServletRequestpublic java.lang.String getServerName()
getServerName in interface javax.servlet.ServletRequestpublic int getServerPort()
getServerPort in interface javax.servlet.ServletRequestpublic java.lang.String getRemoteAddr()
getRemoteAddr in interface javax.servlet.ServletRequestpublic java.lang.String getRemoteHost()
getRemoteHost in interface javax.servlet.ServletRequestpublic java.lang.String getRealPath(java.lang.String path)
getRealPath in interface javax.servlet.ServletRequest
public javax.servlet.ServletInputStream getInputStream()
throws java.io.IOException
getInputStream in interface javax.servlet.ServletRequestjava.io.IOExceptionpublic java.io.BufferedReader getReader()
getReader in interface javax.servlet.ServletRequestpublic java.util.Enumeration getParameterNames()
getParameterNames in interface javax.servlet.ServletRequestpublic java.lang.String getParameter(java.lang.String name)
getParameter in interface javax.servlet.ServletRequestpublic java.lang.String[] getParameterValues(java.lang.String name)
getParameterValues in interface javax.servlet.ServletRequestpublic java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface javax.servlet.ServletRequestpublic javax.servlet.http.Cookie[] getCookies()
getCookies in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getMethod()
getMethod in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getRequestURI()
getRequestURI in interface javax.servlet.http.HttpServletRequestpublic java.lang.StringBuffer getRequestURL()
getRequestURL in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getServletPath()
getServletPath in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getPathInfo()
getPathInfo in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getPathTranslated()
getPathTranslated in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getQueryString()
getQueryString in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getRemoteUser()
getRemoteUser in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getAuthType()
getAuthType in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getHeader(java.lang.String name)
getHeader in interface javax.servlet.http.HttpServletRequestpublic int getIntHeader(java.lang.String name)
getIntHeader in interface javax.servlet.http.HttpServletRequestpublic long getDateHeader(java.lang.String name)
getDateHeader in interface javax.servlet.http.HttpServletRequestpublic java.util.Enumeration getHeaderNames()
getHeaderNames in interface javax.servlet.http.HttpServletRequestpublic javax.servlet.http.HttpSession getSession(boolean create)
getSession in interface javax.servlet.http.HttpServletRequestpublic javax.servlet.http.HttpSession getSession()
getSession in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL in interface javax.servlet.http.HttpServletRequestpublic java.util.Enumeration getAttributeNames()
getAttributeNames in interface javax.servlet.ServletRequest
public void setAttribute(java.lang.String key,
java.lang.Object o)
Attribute names should follow the same conventions as package names. Names beginning with java.*, javax.*, and com.sun.*, are reserved for use by Sun Microsystems. If the object passed in is null, the effect is the same as calling removeAttribute(java.lang.String).
It is warned that when the request is dispatched from the servlet resides in a different web application by RequestDispatcher, the object set by this method may not be correctly retrieved in the caller servlet.
setAttribute in interface javax.servlet.ServletRequestname - - a String specifying the name of the attributeo - - the Object to be storedpublic java.lang.String getRequestedSessionId()
getRequestedSessionId in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdValid()
isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl in interface javax.servlet.http.HttpServletRequestpublic void setContentLength(int length)
setContentLength in interface javax.servlet.ServletResponsepublic void setContentType(java.lang.String type)
setContentType in interface javax.servlet.ServletResponsepublic javax.servlet.ServletOutputStream getOutputStream()
getOutputStream in interface javax.servlet.ServletResponse
public java.io.PrintWriter getWriter()
throws java.io.IOException
getWriter in interface javax.servlet.ServletResponsejava.io.IOExceptionpublic java.lang.String getCharacterEncoding()
getCharacterEncoding in interface javax.servlet.ServletRequestgetCharacterEncoding in interface javax.servlet.ServletResponse
public void flushBuffer()
throws java.io.IOException
flushBuffer in interface javax.servlet.ServletResponsejava.io.IOExceptionpublic void resetBuffer()
resetBuffer in interface javax.servlet.ServletResponsepublic int getBufferSize()
getBufferSize in interface javax.servlet.ServletResponsepublic void setBufferSize(int size)
setBufferSize in interface javax.servlet.ServletResponsepublic boolean isCommitted()
isCommitted in interface javax.servlet.ServletResponsesetBufferSize(int), getBufferSize(), flushBuffer(), reset()
public void reset()
throws java.lang.IllegalStateException
reset in interface javax.servlet.ServletResponsejava.lang.IllegalStateException - -
if the response has already been committedsetBufferSize(int), getBufferSize(), flushBuffer(), isCommitted()public void setLocale(java.util.Locale locale)
setLocale in interface javax.servlet.ServletResponseloc - -
the locale of the responsegetLocale()public java.util.Locale getLocale()
getLocale in interface javax.servlet.ServletRequestgetLocale in interface javax.servlet.ServletResponsepublic java.util.Enumeration getLocales()
getLocales in interface javax.servlet.ServletRequestpublic void setCharacterEncoding(java.lang.String _enc)
setCharacterEncoding in interface javax.servlet.ServletRequestsetCharacterEncoding in interface javax.servlet.ServletResponsea - -
String containing the name of the chararacter encoding.
java.io.UnsupportedEncodingException - -
if this is not a valid encoding
public void addDateHeader(java.lang.String header,
long date)
addDateHeader in interface javax.servlet.http.HttpServletResponse
public void addHeader(java.lang.String header,
java.lang.String value)
addHeader in interface javax.servlet.http.HttpServletResponse
public void addIntHeader(java.lang.String header,
int value)
addIntHeader in interface javax.servlet.http.HttpServletResponsepublic javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String urlpath)
getRequestDispatcher in interface javax.servlet.ServletRequestpublic boolean isSecure()
isSecure in interface javax.servlet.ServletRequestpublic void removeAttribute(java.lang.String name)
removeAttribute in interface javax.servlet.ServletRequestpublic java.lang.String getContextPath()
getContextPath in interface javax.servlet.http.HttpServletRequestpublic java.util.Enumeration getHeaders(java.lang.String header)
getHeaders in interface javax.servlet.http.HttpServletRequestpublic java.security.Principal getUserPrincipal()
getUserPrincipal in interface javax.servlet.http.HttpServletRequestpublic boolean isUserInRole(java.lang.String user)
isUserInRole in interface javax.servlet.http.HttpServletRequestpublic java.util.Map getParameterMap()
getParameterMap in interface javax.servlet.ServletRequestpublic void addCookie(javax.servlet.http.Cookie cookie)
addCookie in interface javax.servlet.http.HttpServletResponsepublic boolean containsHeader(java.lang.String name)
containsHeader in interface javax.servlet.http.HttpServletResponsepublic java.lang.String encodeURL(java.lang.String url)
encodeURL in interface javax.servlet.http.HttpServletResponsepublic java.lang.String encodeRedirectURL(java.lang.String url)
encodeRedirectURL in interface javax.servlet.http.HttpServletResponsepublic int getRemotePort()
getRemotePort in interface javax.servlet.ServletRequestpublic java.lang.String getLocalName()
getLocalName in interface javax.servlet.ServletRequestString containing the host name of the IP on which the request was received.public java.lang.String getLocalAddr()
getLocalAddr in interface javax.servlet.ServletRequestString containing the IP address on which the request was received.public int getLocalPort()
getLocalPort in interface javax.servlet.ServletRequest
public void setStatus(int resCode,
java.lang.String resMessage)
setStatus in interface javax.servlet.http.HttpServletResponsepublic void setStatus(int resCode)
setStatus in interface javax.servlet.http.HttpServletResponse
public void setHeader(java.lang.String header,
java.lang.String value)
setHeader in interface javax.servlet.http.HttpServletResponse
public void setIntHeader(java.lang.String header,
int value)
setIntHeader in interface javax.servlet.http.HttpServletResponse
public void setLongHeader(java.lang.String header,
long value)
public void setDateHeader(java.lang.String header,
long value)
setDateHeader in interface javax.servlet.http.HttpServletResponse
public void sendError(int resCode,
java.lang.String resMessage)
throws java.io.IOException
sendError in interface javax.servlet.http.HttpServletResponsejava.io.IOException
public void sendError(int resCode)
throws java.io.IOException
sendError in interface javax.servlet.http.HttpServletResponsejava.io.IOExceptionpublic void setInInclude(boolean set)
public void sendRedirect(java.lang.String location)
throws java.io.IOException
sendRedirect in interface javax.servlet.http.HttpServletResponsejava.io.IOExceptionpublic java.lang.String encodeUrl(java.lang.String url)
encodeUrl in interface javax.servlet.http.HttpServletResponsepublic java.lang.String encodeRedirectUrl(java.lang.String url)
encodeRedirectUrl in interface javax.servlet.http.HttpServletResponsepublic java.net.Socket getSocket()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||