|
||||||||||
| 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 String |
ACCEPT_LANGUAGE
|
static String |
CHUNKED
|
static String |
CONNECTION
|
static String |
CONTENT_ENCODING
|
static String |
CONTENTLENGTH
|
static String |
CONTENTTYPE
|
static String |
COOKIE
|
static String |
HOST
|
protected boolean |
keepAlive
|
static String |
KEEPALIVE
|
protected long |
lastRun
|
protected long |
lastWait
|
protected String |
reqQuery
|
static String |
SESSION_COOKIE_NAME
|
static String |
SESSION_URL_NAME
|
static String |
SETCOOKIE
|
protected int |
timesRequested
|
static String |
TRANSFERENCODING
|
static 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(Socket socket,
Serve serve)
|
|
| Method Summary | |
|---|---|
void |
addCookie(javax.servlet.http.Cookie cookie)
|
void |
addDateHeader(String header,
long date)
|
void |
addHeader(String header,
String value)
|
void |
addIntHeader(String header,
int value)
|
void |
closeSocket()
|
void |
closeStreams()
it closes stream awaring of keep -alive |
boolean |
containsHeader(String name)
|
String |
encodeRedirectUrl(String url)
|
String |
encodeRedirectURL(String url)
|
String |
encodeUrl(String url)
|
String |
encodeURL(String url)
|
void |
flushBuffer()
|
Object |
getAttribute(String name)
|
Enumeration |
getAttributeNames()
|
String |
getAuthType()
|
int |
getBufferSize()
|
String |
getCharacterEncoding()
|
int |
getContentLength()
|
String |
getContentType()
|
String |
getContextPath()
|
javax.servlet.http.Cookie[] |
getCookies()
|
long |
getDateHeader(String name)
|
String |
getHeader(String name)
|
Enumeration |
getHeaderNames()
|
Enumeration |
getHeaders(String header)
|
javax.servlet.ServletInputStream |
getInputStream()
|
int |
getIntHeader(String name)
|
String |
getLocalAddr()
Returns the Internet Protocol (IP) address of the interface on which the request was received. |
Locale |
getLocale()
For request: Returns the preferred Locale that the client will accept content in, based on the Accept-Language header. |
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. |
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. |
String |
getMethod()
|
javax.servlet.ServletOutputStream |
getOutputStream()
|
String |
getParameter(String name)
|
Map |
getParameterMap()
Returns a java.util.Map of the parameters of this request. |
Enumeration |
getParameterNames()
|
String[] |
getParameterValues(String name)
|
String |
getPathInfo()
|
String |
getPathTranslated()
|
String |
getProtocol()
|
String |
getQueryString()
|
BufferedReader |
getReader()
|
String |
getRealPath(String path)
|
String |
getRemoteAddr()
|
String |
getRemoteHost()
|
int |
getRemotePort()
Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request. |
String |
getRemoteUser()
|
javax.servlet.RequestDispatcher |
getRequestDispatcher(String urlpath)
|
String |
getRequestedSessionId()
|
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. |
StringBuffer |
getRequestURL()
Reconstructs the URL the client used to make the request. |
String |
getScheme()
|
String |
getServerName()
|
int |
getServerPort()
|
String |
getServletPath()
|
javax.servlet.http.HttpSession |
getSession()
|
javax.servlet.http.HttpSession |
getSession(boolean create)
|
Socket |
getSocket()
|
Principal |
getUserPrincipal()
|
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(String user)
|
void |
removeAttribute(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,
String resMessage)
|
void |
sendRedirect(String location)
|
void |
setAttribute(String key,
Object o)
Stores an attribute in this request. |
void |
setBufferSize(int size)
|
void |
setCharacterEncoding(String _enc)
Overrides the name of the character encoding used in the body of this request. |
void |
setContentLength(int length)
|
void |
setContentType(String type)
|
void |
setDateHeader(String header,
long value)
|
void |
setHeader(String header,
String value)
|
void |
setInInclude(boolean set)
|
void |
setIntHeader(String header,
int value)
|
void |
setLocale(Locale locale)
Sets the locale of the response, setting the headers (including the Content-Type's charset) as appropriate. |
void |
setLongHeader(String header,
long value)
|
void |
setStatus(int resCode)
|
void |
setStatus(int resCode,
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 String WWWFORMURLENCODE
public static final String TRANSFERENCODING
public static final String KEEPALIVE
public static final String CONTENT_ENCODING
public static final String CONNECTION
public static final String CHUNKED
public static final String CONTENTLENGTH
public static final String CONTENTTYPE
public static final String SETCOOKIE
public static final String HOST
public static final String COOKIE
public static final String ACCEPT_LANGUAGE
public static final String SESSION_COOKIE_NAME
public static final String SESSION_URL_NAME
protected boolean keepAlive
protected int timesRequested
protected long lastRun
protected long lastWait
protected String reqQuery
| Constructor Detail |
|---|
public Serve.ServeConnection(Socket socket,
Serve serve)
| Method Detail |
|---|
public void closeStreams()
throws IOException
IOExceptionpublic void closeSocket()
public void run()
run in interface Runnablepublic int getContentLength()
getContentLength in interface javax.servlet.ServletRequestpublic String getContentType()
getContentType in interface javax.servlet.ServletRequestgetContentType in interface javax.servlet.ServletResponsepublic String getProtocol()
getProtocol in interface javax.servlet.ServletRequestpublic String getScheme()
getScheme in interface javax.servlet.ServletRequestpublic String getServerName()
getServerName in interface javax.servlet.ServletRequestpublic int getServerPort()
getServerPort in interface javax.servlet.ServletRequestpublic String getRemoteAddr()
getRemoteAddr in interface javax.servlet.ServletRequestpublic String getRemoteHost()
getRemoteHost in interface javax.servlet.ServletRequestpublic String getRealPath(String path)
getRealPath in interface javax.servlet.ServletRequest
public javax.servlet.ServletInputStream getInputStream()
throws IOException
getInputStream in interface javax.servlet.ServletRequestIOExceptionpublic BufferedReader getReader()
getReader in interface javax.servlet.ServletRequestpublic Enumeration getParameterNames()
getParameterNames in interface javax.servlet.ServletRequestpublic String getParameter(String name)
getParameter in interface javax.servlet.ServletRequestpublic String[] getParameterValues(String name)
getParameterValues in interface javax.servlet.ServletRequestpublic Object getAttribute(String name)
getAttribute in interface javax.servlet.ServletRequestpublic javax.servlet.http.Cookie[] getCookies()
getCookies in interface javax.servlet.http.HttpServletRequestpublic String getMethod()
getMethod in interface javax.servlet.http.HttpServletRequestpublic String getRequestURI()
getRequestURI in interface javax.servlet.http.HttpServletRequestpublic StringBuffer getRequestURL()
getRequestURL in interface javax.servlet.http.HttpServletRequestpublic String getServletPath()
getServletPath in interface javax.servlet.http.HttpServletRequestpublic String getPathInfo()
getPathInfo in interface javax.servlet.http.HttpServletRequestpublic String getPathTranslated()
getPathTranslated in interface javax.servlet.http.HttpServletRequestpublic String getQueryString()
getQueryString in interface javax.servlet.http.HttpServletRequestpublic String getRemoteUser()
getRemoteUser in interface javax.servlet.http.HttpServletRequestpublic String getAuthType()
getAuthType in interface javax.servlet.http.HttpServletRequestpublic String getHeader(String name)
getHeader in interface javax.servlet.http.HttpServletRequestpublic int getIntHeader(String name)
getIntHeader in interface javax.servlet.http.HttpServletRequestpublic long getDateHeader(String name)
getDateHeader in interface javax.servlet.http.HttpServletRequestpublic 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 Enumeration getAttributeNames()
getAttributeNames in interface javax.servlet.ServletRequest
public void setAttribute(String key,
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 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(String type)
setContentType in interface javax.servlet.ServletResponsepublic javax.servlet.ServletOutputStream getOutputStream()
getOutputStream in interface javax.servlet.ServletResponse
public PrintWriter getWriter()
throws IOException
getWriter in interface javax.servlet.ServletResponseIOExceptionpublic String getCharacterEncoding()
getCharacterEncoding in interface javax.servlet.ServletRequestgetCharacterEncoding in interface javax.servlet.ServletResponse
public void flushBuffer()
throws IOException
flushBuffer in interface javax.servlet.ServletResponseIOExceptionpublic 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 IllegalStateException
reset in interface javax.servlet.ServletResponseIllegalStateException - -
if the response has already been committedsetBufferSize(int), getBufferSize(), flushBuffer(), isCommitted()public void setLocale(Locale locale)
setLocale in interface javax.servlet.ServletResponseloc - -
the locale of the responsegetLocale()public Locale getLocale()
getLocale in interface javax.servlet.ServletRequestgetLocale in interface javax.servlet.ServletResponsepublic Enumeration getLocales()
getLocales in interface javax.servlet.ServletRequestpublic void setCharacterEncoding(String _enc)
setCharacterEncoding in interface javax.servlet.ServletRequestsetCharacterEncoding in interface javax.servlet.ServletResponsea - -
String containing the name of the chararacter encoding.
UnsupportedEncodingException - -
if this is not a valid encoding
public void addDateHeader(String header,
long date)
addDateHeader in interface javax.servlet.http.HttpServletResponse
public void addHeader(String header,
String value)
addHeader in interface javax.servlet.http.HttpServletResponse
public void addIntHeader(String header,
int value)
addIntHeader in interface javax.servlet.http.HttpServletResponsepublic javax.servlet.RequestDispatcher getRequestDispatcher(String urlpath)
getRequestDispatcher in interface javax.servlet.ServletRequestpublic boolean isSecure()
isSecure in interface javax.servlet.ServletRequestpublic void removeAttribute(String name)
removeAttribute in interface javax.servlet.ServletRequestpublic String getContextPath()
getContextPath in interface javax.servlet.http.HttpServletRequestpublic Enumeration getHeaders(String header)
getHeaders in interface javax.servlet.http.HttpServletRequestpublic Principal getUserPrincipal()
getUserPrincipal in interface javax.servlet.http.HttpServletRequestpublic boolean isUserInRole(String user)
isUserInRole in interface javax.servlet.http.HttpServletRequestpublic Map getParameterMap()
getParameterMap in interface javax.servlet.ServletRequestpublic void addCookie(javax.servlet.http.Cookie cookie)
addCookie in interface javax.servlet.http.HttpServletResponsepublic boolean containsHeader(String name)
containsHeader in interface javax.servlet.http.HttpServletResponsepublic String encodeURL(String url)
encodeURL in interface javax.servlet.http.HttpServletResponsepublic String encodeRedirectURL(String url)
encodeRedirectURL in interface javax.servlet.http.HttpServletResponsepublic int getRemotePort()
getRemotePort in interface javax.servlet.ServletRequestpublic String getLocalName()
getLocalName in interface javax.servlet.ServletRequestString containing the host name of the IP on which the request was received.public 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,
String resMessage)
setStatus in interface javax.servlet.http.HttpServletResponsepublic void setStatus(int resCode)
setStatus in interface javax.servlet.http.HttpServletResponse
public void setHeader(String header,
String value)
setHeader in interface javax.servlet.http.HttpServletResponse
public void setIntHeader(String header,
int value)
setIntHeader in interface javax.servlet.http.HttpServletResponse
public void setLongHeader(String header,
long value)
public void setDateHeader(String header,
long value)
setDateHeader in interface javax.servlet.http.HttpServletResponse
public void sendError(int resCode,
String resMessage)
throws IOException
sendError in interface javax.servlet.http.HttpServletResponseIOException
public void sendError(int resCode)
throws IOException
sendError in interface javax.servlet.http.HttpServletResponseIOExceptionpublic void setInInclude(boolean set)
public void sendRedirect(String location)
throws IOException
sendRedirect in interface javax.servlet.http.HttpServletResponseIOExceptionpublic String encodeUrl(String url)
encodeUrl in interface javax.servlet.http.HttpServletResponsepublic String encodeRedirectUrl(String url)
encodeRedirectUrl in interface javax.servlet.http.HttpServletResponsepublic Socket getSocket()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||