public class Call
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
addCookie(Cookie c)
Adds a cookie to the call, so it will be send to the client
|
void |
addCookie(java.lang.String name,
java.lang.String value)
Adds a new cookie to the call, so it will be send to the client.
|
void |
cancel(int code,
java.lang.String message)
Cancels the current call, as far as possible.
|
Cookie |
createCookie(java.lang.String name,
java.lang.String value)
Creates a new completely initialized HTTP cookie, which is not yet assigned to the call.
|
java.lang.String |
getClient()
Returns the IP adress of the request client
|
Cookie |
getCookie(java.lang.String name)
Returns a HTTP cookie
|
java.util.List<java.lang.String> |
getCookieNames()
Returns the names of all available Cookies
|
java.lang.String |
getFormField(java.lang.String name)
Returns the value of a multipart/form-data fields posted on this request
This method can also read fields posted on WebTML forms.
|
java.lang.String |
getFormField(java.lang.String name,
java.lang.String encoding)
Returns the value of a multipart/form-data fields posted on this request
This method can also read fields posted on WebTML forms.
|
java.util.List<java.lang.String> |
getFormFieldNames()
Returns the names of multipart/form-data fields posted on this request
This method can also read fields posted on WebTML forms.
|
javax.servlet.http.HttpServletRequest |
getJavaRequest()
Returns the JavaEE request object
Throws
UnavailableResourceException if no request is available. |
javax.servlet.http.HttpServletResponse |
getJavaResponse()
Returns the JavaEE response object
Throws
UnavailableResourceException if no response is available. |
Context |
getMainContext()
Returns the main WebTML context of this request
|
java.lang.String |
getMediaKey()
Returns the WebTML media key of the outer layout of this request
|
java.lang.String |
getOriginalURL()
Returns the complete original URL by which this request was called
Some request filters may modify the URL that was originally sent to OpenWGA before it actually gets parsed.
|
java.lang.String |
getOuterLayout()
Returns then resource name of the outer layout of this request
|
java.io.OutputStream |
getOutput()
Returns the output to which to write response data, as binary stream
|
java.lang.String |
getParam(java.lang.String name)
Returns the (first) value of a request parameter
This is either a URL parameter or the form value of a POSTed URL-encoded HTML form
|
java.util.List<java.lang.String> |
getParamNames()
Returns the names of all available call parameters
These are either URL parameters or the form fields of a POSTed URL-encoded HTML form
|
java.util.List<java.lang.String> |
getParamValues(java.lang.String name)
Returns all values of a call parameter
This is either a URL parameter or the form value of a POSTed URL-encoded HTML form
|
int |
getPort()
Returns the TCP port on which OpenWGA received this request
|
TMLForm |
getPostedPorm() |
java.lang.String |
getQueryString()
Returns the query string of this requests URL
|
java.lang.String |
getReferrer()
Returns the referrer URL of this request
|
java.lang.String |
getRequestHeader(java.lang.String name)
Returns the content of a HTTP header from the request
|
java.util.List<java.lang.String> |
getRequestHeaderNames()
Returns the names of all available HTTP headers
|
java.lang.String |
getRequestMethod()
Returns the HTTP method of the request
|
java.lang.String |
getURL()
Returns the complete URL by which this request was called
|
java.lang.String |
getUserAgent()
Returns the user agent of the calling client
|
java.lang.String |
getVirtualHostName()
Returns the name of the OpenWGA virtual host that was used to handle this request.
|
java.io.Writer |
getWriter()
Returns the output to which to write response data, as character writer
|
boolean |
isAjax()
Returns if the call is an AJAX request
|
boolean |
isAvailable()
Returns if an actual call is available
If this is false the Call object will not give out any data.
|
void |
removeCookie(Cookie c)
Removes a cookie from the call, so it will be deleted on the client.
|
void |
setResponseHeader(java.lang.String name,
java.lang.String value)
Sets a header on the HTTP response
|
public java.lang.String getParam(java.lang.String name) throws de.innovationgate.webgate.api.WGException
name
- Name of the parameterde.innovationgate.webgate.api.WGException
public java.util.List<java.lang.String> getParamNames() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public TMLForm getPostedPorm() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public java.util.List<java.lang.String> getParamValues(java.lang.String name) throws de.innovationgate.webgate.api.WGException
name
- Name of the parameterde.innovationgate.webgate.api.WGException
public java.lang.String getRequestHeader(java.lang.String name) throws de.innovationgate.webgate.api.WGException
name
- Name of the headerde.innovationgate.webgate.api.WGException
public java.util.List<java.lang.String> getRequestHeaderNames() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public Cookie getCookie(java.lang.String name) throws de.innovationgate.webgate.api.WGException
name
- Name of the cookiede.innovationgate.webgate.api.WGException
public java.util.List<java.lang.String> getCookieNames() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public java.lang.String getURL() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public java.lang.String getOriginalURL() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public java.lang.String getMediaKey() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public java.lang.String getOuterLayout() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public Context getMainContext() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public boolean isAvailable()
public boolean isAjax() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public java.lang.String getUserAgent() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public java.lang.String getReferrer() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public java.lang.String getQueryString() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public java.lang.String getVirtualHostName() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public int getPort() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public java.lang.String getClient() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public java.util.List<java.lang.String> getFormFieldNames() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public java.lang.String getFormField(java.lang.String name) throws de.innovationgate.webgate.api.WGException
name
- Name of the fieldde.innovationgate.webgate.api.WGException
public java.lang.String getFormField(java.lang.String name, java.lang.String encoding) throws de.innovationgate.webgate.api.WGException
name
- Name of the fieldencoding
- The encoding used to decode the field valuede.innovationgate.webgate.api.WGException
public javax.servlet.http.HttpServletRequest getJavaRequest() throws de.innovationgate.webgate.api.WGException
UnavailableResourceException
if no request is available.de.innovationgate.webgate.api.WGException
public javax.servlet.http.HttpServletResponse getJavaResponse() throws de.innovationgate.webgate.api.WGException
UnavailableResourceException
if no response is available.de.innovationgate.webgate.api.WGException
public java.lang.String getRequestMethod() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public Cookie createCookie(java.lang.String name, java.lang.String value) throws de.innovationgate.webgate.api.WGException
addCookie(Cookie)
to do so and send it to the client.
The cookie is initialized with path (the OpenWGA context path), type/maxage (transient),
domain (either request host or host from configured server base url) and security
flag (true if the current call is HTTPS).name
- Name of the cookievalue
- Value of the cookiede.innovationgate.webgate.api.WGException
public void addCookie(Cookie c) throws de.innovationgate.webgate.api.WGException
c
- de.innovationgate.webgate.api.WGException
public void addCookie(java.lang.String name, java.lang.String value) throws de.innovationgate.webgate.api.WGException
createCookie(String, String)
followed by addCookie(Cookie)
. The cookie is initialized
according to what is documented on createCookie(String, String)
.name
- Name of the cookievalue
- Value of the cookiede.innovationgate.webgate.api.WGException
public void removeCookie(Cookie c) throws de.innovationgate.webgate.api.WGException
c
- The cookie to delete.de.innovationgate.webgate.api.WGException
public java.io.OutputStream getOutput() throws de.innovationgate.webgate.api.WGException, java.io.IOException
de.innovationgate.webgate.api.WGException
java.io.IOException
public java.io.Writer getWriter() throws de.innovationgate.webgate.api.WGException, java.io.IOException
de.innovationgate.webgate.api.WGException
java.io.IOException
public void setResponseHeader(java.lang.String name, java.lang.String value) throws de.innovationgate.webgate.api.WGException
name
- Name of the headervalue
- Value of the headerde.innovationgate.webgate.api.WGException
public void cancel(int code, java.lang.String message) throws de.innovationgate.webgate.api.WGException, HttpErrorException
code
- The HTTP error code to send.message
- The message for the HTTP error.de.innovationgate.webgate.api.WGException
java.io.IOException
HttpErrorException