|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.judoscript.user.httpserver.ServeConnection
public class ServeConnection
provides request/response
Field Summary | |
---|---|
static java.lang.String |
CHUNKED
|
static java.lang.String |
CONTENTLENGTH
|
static java.lang.String |
CONTENTTYPE
|
static java.lang.String |
COOKIE
|
protected static java.text.SimpleDateFormat |
expdatefmt
|
protected static java.text.SimpleDateFormat |
headerdateformat
|
static java.lang.String |
SESSION_COOKIE_NAME
|
static java.lang.String |
SETCOOKIE
|
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_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 | |
---|---|
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)
|
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)
|
long |
getDateHeader(java.lang.String name,
long def)
|
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)
|
int |
getIntHeader(java.lang.String name,
int def)
|
java.util.Locale |
getLocale()
|
java.util.Enumeration |
getLocales()
|
long |
getLongHeader(java.lang.String name,
long def)
|
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()
|
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.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)
|
static void |
putAll(java.util.Map map,
java.util.Map src)
|
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)
|
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 name,
long value)
|
void |
setHeader(java.lang.String name,
java.lang.String value)
|
void |
setIntHeader(java.lang.String name,
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 name,
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 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 COOKIE
public static final java.lang.String SESSION_COOKIE_NAME
protected static final java.text.SimpleDateFormat expdatefmt
protected static final java.text.SimpleDateFormat headerdateformat
Constructor Detail |
---|
public ServeConnection(java.net.Socket socket, Serve serve)
Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
public int getContentLength()
getContentLength
in interface javax.servlet.ServletRequest
public java.lang.String getContentType()
getContentType
in interface javax.servlet.ServletRequest
public java.lang.String getProtocol()
getProtocol
in interface javax.servlet.ServletRequest
public java.lang.String getScheme()
getScheme
in interface javax.servlet.ServletRequest
public java.lang.String getServerName()
getServerName
in interface javax.servlet.ServletRequest
public int getServerPort()
getServerPort
in interface javax.servlet.ServletRequest
public java.lang.String getRemoteAddr()
getRemoteAddr
in interface javax.servlet.ServletRequest
public java.lang.String getRemoteHost()
getRemoteHost
in interface javax.servlet.ServletRequest
public 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.ServletRequest
java.io.IOException
public java.io.BufferedReader getReader()
getReader
in interface javax.servlet.ServletRequest
public static void putAll(java.util.Map map, java.util.Map src)
public java.util.Enumeration getParameterNames()
getParameterNames
in interface javax.servlet.ServletRequest
public java.lang.String getParameter(java.lang.String name)
getParameter
in interface javax.servlet.ServletRequest
public java.lang.String[] getParameterValues(java.lang.String name)
getParameterValues
in interface javax.servlet.ServletRequest
public java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface javax.servlet.ServletRequest
public javax.servlet.http.Cookie[] getCookies()
getCookies
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getMethod()
getMethod
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getRequestURI()
getRequestURI
in interface javax.servlet.http.HttpServletRequest
public java.lang.StringBuffer getRequestURL()
This method is useful for creating redirect messages and for reporting errors.
getRequestURL
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getServletPath()
getServletPath
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getPathInfo()
getPathInfo
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getPathTranslated()
getPathTranslated
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getQueryString()
getQueryString
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getRemoteUser()
getRemoteUser
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getAuthType()
getAuthType
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getHeader(java.lang.String name)
getHeader
in interface javax.servlet.http.HttpServletRequest
public int getIntHeader(java.lang.String name)
getIntHeader
in interface javax.servlet.http.HttpServletRequest
public int getIntHeader(java.lang.String name, int def)
public long getLongHeader(java.lang.String name, long def)
public long getDateHeader(java.lang.String name)
getDateHeader
in interface javax.servlet.http.HttpServletRequest
public long getDateHeader(java.lang.String name, long def)
public java.util.Enumeration getHeaderNames()
getHeaderNames
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.HttpSession getSession(boolean create)
getSession
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.HttpSession getSession()
getSession
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL
in interface javax.servlet.http.HttpServletRequest
public java.util.Enumeration getAttributeNames()
getAttributeNames
in interface javax.servlet.ServletRequest
public void setAttribute(java.lang.String key, java.lang.Object o)
setAttribute
in interface javax.servlet.ServletRequest
public java.lang.String getRequestedSessionId()
getRequestedSessionId
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdValid()
isRequestedSessionIdValid
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl
in interface javax.servlet.http.HttpServletRequest
public void setContentLength(int length)
setContentLength
in interface javax.servlet.ServletResponse
public void setContentType(java.lang.String type)
setContentType
in interface javax.servlet.ServletResponse
public javax.servlet.ServletOutputStream getOutputStream()
getOutputStream
in interface javax.servlet.ServletResponse
public java.io.PrintWriter getWriter() throws java.io.IOException
getWriter
in interface javax.servlet.ServletResponse
java.io.IOException
public java.lang.String getCharacterEncoding()
getCharacterEncoding
in interface javax.servlet.ServletRequest
getCharacterEncoding
in interface javax.servlet.ServletResponse
public void flushBuffer()
flushBuffer
in interface javax.servlet.ServletResponse
public void resetBuffer()
resetBuffer
in interface javax.servlet.ServletResponse
public int getBufferSize()
getBufferSize
in interface javax.servlet.ServletResponse
public void setBufferSize(int size)
setBufferSize
in interface javax.servlet.ServletResponse
public boolean isCommitted()
isCommitted
in interface javax.servlet.ServletResponse
setBufferSize(int), getBufferSize(), flushBuffer(), reset()
public void reset() throws java.lang.IllegalStateException
reset
in interface javax.servlet.ServletResponse
java.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.ServletResponse
loc
- - the locale of the responsegetLocale()
public java.util.Locale getLocale()
getLocale
in interface javax.servlet.ServletRequest
getLocale
in interface javax.servlet.ServletResponse
public java.util.Enumeration getLocales()
getLocales
in interface javax.servlet.ServletRequest
public void setCharacterEncoding(java.lang.String _enc) throws java.io.UnsupportedEncodingException
setCharacterEncoding
in interface javax.servlet.ServletRequest
a
- - String containing the name of the chararacter encoding.
java.io.UnsupportedEncodingException
- - if this is not a valid encodingpublic 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.HttpServletResponse
public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String urlpath)
getRequestDispatcher
in interface javax.servlet.ServletRequest
public boolean isSecure()
isSecure
in interface javax.servlet.ServletRequest
public void removeAttribute(java.lang.String name)
removeAttribute
in interface javax.servlet.ServletRequest
public java.lang.String getContextPath()
getContextPath
in interface javax.servlet.http.HttpServletRequest
public java.util.Enumeration getHeaders(java.lang.String header)
getHeaders
in interface javax.servlet.http.HttpServletRequest
public java.security.Principal getUserPrincipal()
getUserPrincipal
in interface javax.servlet.http.HttpServletRequest
public boolean isUserInRole(java.lang.String user)
isUserInRole
in interface javax.servlet.http.HttpServletRequest
public java.util.Map getParameterMap()
getParameterMap
in interface javax.servlet.ServletRequest
public void addCookie(javax.servlet.http.Cookie cookie)
addCookie
in interface javax.servlet.http.HttpServletResponse
public boolean containsHeader(java.lang.String name)
containsHeader
in interface javax.servlet.http.HttpServletResponse
public java.lang.String encodeURL(java.lang.String url)
encodeURL
in interface javax.servlet.http.HttpServletResponse
public java.lang.String encodeRedirectURL(java.lang.String url)
encodeRedirectURL
in interface javax.servlet.http.HttpServletResponse
public void setStatus(int resCode, java.lang.String resMessage)
setStatus
in interface javax.servlet.http.HttpServletResponse
public void setStatus(int resCode)
setStatus
in interface javax.servlet.http.HttpServletResponse
public void setHeader(java.lang.String name, java.lang.String value)
setHeader
in interface javax.servlet.http.HttpServletResponse
public void setIntHeader(java.lang.String name, int value)
setIntHeader
in interface javax.servlet.http.HttpServletResponse
public void setLongHeader(java.lang.String name, long value)
public void setDateHeader(java.lang.String name, 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.HttpServletResponse
java.io.IOException
public void sendError(int resCode) throws java.io.IOException
sendError
in interface javax.servlet.http.HttpServletResponse
java.io.IOException
public void sendRedirect(java.lang.String location) throws java.io.IOException
sendRedirect
in interface javax.servlet.http.HttpServletResponse
java.io.IOException
public java.lang.String encodeUrl(java.lang.String url)
encodeUrl
in interface javax.servlet.http.HttpServletResponse
public java.lang.String encodeRedirectUrl(java.lang.String url)
encodeRedirectUrl
in interface javax.servlet.http.HttpServletResponse
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |