public abstract class ServletCall
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,java.lang.String> |
parameters
The parameters of the URL.
Result of the parsing of the query string : "?a=b&c=d&..." |
| Constructor and Description |
|---|
ServletCall(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
countParameters()
Count the number of parameters passed in the URL
|
java.lang.Object |
deserialize(byte[] bytes) |
abstract void |
doDelete()
Entry point for DELETE
|
abstract void |
doGet()
Entry point for GET and SEARCH
|
abstract void |
doPost()
Entry point for CREATE
|
abstract void |
doPut()
Entry point for UPDATE
|
protected void |
error(java.lang.String message,
int errorCode) |
java.util.List<byte[]> |
getBinaryParameters() |
javax.servlet.http.HttpSession |
getHttpSession()
Get the current call's HttpSession
|
java.lang.String |
getInputStream()
Read the input stream and set it in a String
|
java.lang.String |
getParameter(java.lang.String name)
Get a parameter first value by its name
|
java.lang.String |
getParameter(java.lang.String name,
java.lang.String defaultValue)
Get a parameter first value by its name
|
java.util.List<java.lang.String> |
getParameterAsList(java.lang.String name)
Get a parameter values by its name
|
java.util.List<java.lang.String> |
getParameterAsList(java.lang.String name,
java.lang.String defaultValue)
Get a parameter values by its name
|
java.lang.String |
getQueryString() |
java.lang.String |
getRequestURL()
Reconstruct the URL the client used to make the request.
|
protected java.lang.String |
getResponseContentType() |
protected void |
head(java.lang.String name,
java.lang.String value)
Write into the output header.
|
protected void |
output(java.io.File file)
Output a file
|
protected void |
output(java.io.InputStream stream)
Output a stream as a file
|
protected void |
output(java.io.InputStream stream,
java.lang.String filename)
Output a stream as a file
|
protected void |
output(java.lang.Object object)
Write into the output
|
protected void |
output(java.lang.String string)
Write into the output
|
byte[] |
serialize(java.lang.Object obj) |
protected java.util.Map<java.lang.String,java.lang.String> parameters
public ServletCall(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws org.apache.commons.fileupload.FileUploadException,
java.io.IOException
request - The request made to access this servletCall.response - The response to return.java.io.IOExceptionorg.apache.commons.fileupload.FileUploadExceptionpublic java.util.List<byte[]> getBinaryParameters()
public byte[] serialize(java.lang.Object obj)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.Object deserialize(byte[] bytes)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic javax.servlet.http.HttpSession getHttpSession()
public java.lang.String getQueryString()
HttpServletRequest.getQueryString()public final java.lang.String getRequestURL()
public final java.lang.String getInputStream()
public final int countParameters()
public final java.util.List<java.lang.String> getParameterAsList(java.lang.String name)
name - The name of the parameter (case sensitive)public final java.util.List<java.lang.String> getParameterAsList(java.lang.String name,
java.lang.String defaultValue)
name - The name of the parameter (case sensitive)defaultValue - The value to return if the parameter isn't definepublic final java.lang.String getParameter(java.lang.String name)
name - The name of the parameter (case sensitive)public final java.lang.String getParameter(java.lang.String name,
java.lang.String defaultValue)
name - The name of the parameter (case sensitive)defaultValue - The value to return if the parameter isn't defineprotected final void head(java.lang.String name,
java.lang.String value)
name - The name of the header to write.value - The value of the header to write.protected final void output(java.io.File file)
file - The file to outputprotected void output(java.io.InputStream stream,
java.lang.String filename)
stream - The stream to outputfilename - The name of the file to retrieve with the stream.protected void output(java.io.InputStream stream)
stream - The stream to outputprotected void error(java.lang.String message,
int errorCode)
protected final void output(java.lang.String string)
string - The string to outputprotected final void output(java.lang.Object object)
object - An object that will be transform into JSonprotected java.lang.String getResponseContentType()
public abstract void doGet()
public abstract void doPost()
public abstract void doPut()
public abstract void doDelete()