Class ServletCall
java.lang.Object
org.bonitasoft.engine.api.internal.servlet.ServletCall
- Direct Known Subclasses:
HttpAPIServletCall
- Author:
- Severin Moussel
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe parameters of the URL.
Result of the parsing of the query string : "?a=b&c=d&..." -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedServletCall(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal intCount the number of parameters passed in the URLdeserialize(byte[] bytes) abstract voiddoDelete()Entry point for DELETEabstract voiddoGet()Entry point for GET and SEARCHabstract voiddoPost()Entry point for CREATEabstract voiddoPut()Entry point for UPDATEprotected voidList<byte[]>javax.servlet.http.HttpSessionGet the current call's HttpSessionfinal StringRead the input stream and set it in a Stringfinal StringgetParameter(String name) Get a parameter first value by its namefinal StringgetParameter(String name, String defaultValue) Get a parameter first value by its namegetParameterAsList(String name) Get a parameter values by its namegetParameterAsList(String name, String defaultValue) Get a parameter values by its namefinal StringReconstruct the URL the client used to make the request.protected Stringprotected final voidWrite into the output header.protected final voidOutput a fileprotected voidoutput(InputStream stream) Output a stream as a fileprotected voidoutput(InputStream stream, String filename) Output a stream as a fileprotected final voidWrite into the outputprotected final voidWrite into the outputbyte[]
-
Field Details
-
parameters
The parameters of the URL.
Result of the parsing of the query string : "?a=b&c=d&..."
-
-
Constructor Details
-
ServletCall
protected ServletCall(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws org.apache.commons.fileupload.FileUploadException, IOException Default constructor.- Parameters:
request- The request made to access this servletCall.response- The response to return.- Throws:
IOExceptionorg.apache.commons.fileupload.FileUploadException
-
-
Method Details
-
getBinaryParameters
- Returns:
- the binaryParameters
-
serialize
- Throws:
IOException
-
deserialize
- Throws:
IOExceptionClassNotFoundException
-
getHttpSession
public javax.servlet.http.HttpSession getHttpSession()Get the current call's HttpSession- Returns:
- This method returns the session from the current call.
-
getQueryString
- See Also:
-
HttpServletRequest.getQueryString()
-
getRequestURL
Reconstruct the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.- Returns:
- This method returns the reconstructed URL
-
getInputStream
Read the input stream and set it in a String -
countParameters
public final int countParameters()Count the number of parameters passed in the URL- Returns:
- This method returns the number of parameters in the URL
-
getParameterAsList
Get a parameter values by its name- Parameters:
name- The name of the parameter (case sensitive)- Returns:
- This method returns the values of a parameter as a list of String or null if the parameter isn't defined
-
getParameterAsList
Get a parameter values by its name- Parameters:
name- The name of the parameter (case sensitive)defaultValue- The value to return if the parameter isn't define- Returns:
- This method returns the values of a parameter as a list of String
-
getParameter
Get a parameter first value by its name- Parameters:
name- The name of the parameter (case sensitive)- Returns:
- This method returns the first value of a parameter as a String or null if the parameter isn't define
-
getParameter
Get a parameter first value by its name- Parameters:
name- The name of the parameter (case sensitive)defaultValue- The value to return if the parameter isn't define- Returns:
- This method returns the first value of a parameter as a String
-
head
Write into the output header.- Parameters:
name- The name of the header to write.value- The value of the header to write.
-
output
Output a file- Parameters:
file- The file to output
-
output
Output a stream as a file- Parameters:
stream- The stream to outputfilename- The name of the file to retrieve with the stream.
-
output
Output a stream as a file- Parameters:
stream- The stream to output
-
error
-
output
Write into the output- Parameters:
string- The string to output
-
output
Write into the output- Parameters:
object- An object that will be transform into JSon
-
getResponseContentType
-
doGet
public abstract void doGet()Entry point for GET and SEARCH -
doPost
public abstract void doPost()Entry point for CREATE -
doPut
public abstract void doPut()Entry point for UPDATE -
doDelete
public abstract void doDelete()Entry point for DELETE
-