|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||

public interface IHttpRequestHeader
Http Request Header
| Field Summary |
|---|
| Fields inherited from interface org.xlightweb.IHttpMessageHeader |
|---|
DEFAULT_ENCODING |
| Method Summary | |
|---|---|
void |
addMatrixParameter(String parameterName,
String parameterValue)
adds a matrix parameter |
void |
addParameter(String parameterName,
String parameterValue)
adds a parameter |
IHttpRequestHeader |
copy()
creates a copy of this header |
List<ContentType> |
getAccept()
returns the list of the accepted content types, ordered by the quality factory |
Boolean |
getBooleanParameter(String name)
Get an Boolean parameter, or null if not present. |
boolean |
getBooleanParameter(String name,
boolean defaultVal)
Get an boolean parameter, with a fallback value. |
String |
getContextPath()
Returns the portion of the request URI that indicates the context of the request. |
Double |
getDoubleParameter(String name)
Get an Double parameter, or null if not present. |
double |
getDoubleParameter(String name,
double defaultVal)
Get an double parameter, with a fallback value. |
Float |
getFloatParameter(String name)
Get an Float parameter, or null if not present. |
float |
getFloatParameter(String name,
float defaultVal)
Get an float parameter, with a fallback value. |
String |
getHost()
returns the Host header parameter or null if the header is not set |
Integer |
getIntParameter(String name)
Get an Integer parameter, or null if not present. |
int |
getIntParameter(String name,
int defaultVal)
Get an int parameter, with a fallback value. |
Long |
getLongParameter(String name)
Get an Long parameter, or null if not present. |
long |
getLongParameter(String name,
long defaultVal)
Get an long parameter, with a fallback value. |
String |
getMatrixParameter(String name)
Returns the value of a request matrix parameter as a String, or null if the parameter does not exist. |
Set<String> |
getMatrixParameterNameSet()
returns the matrix parameter name set |
String[] |
getMatrixParameterValues(String name)
Returns an array of String objects containing all of the values the given request matrix parameter has, or null if the parameter does not exist. |
String |
getMethod()
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT. |
String |
getParameter(String name)
Returns the value of a request parameter as a String, or null if the parameter does not exist. |
String |
getParameter(String name,
String defaultVal)
Get an String parameter, with a fallback value. |
Enumeration |
getParameterNames()
Returns an Enumeration of String objects containing the names of the parameters contained in this request. |
Set<String> |
getParameterNameSet()
returns the parameter name set |
String[] |
getParameterValues(String name)
Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist. |
String |
getPathInfo()
Returns any extra path information associated with the URL. |
String |
getPathInfo(boolean removeSurroundingSlashs)
Returns any extra path information associated with the URL. |
String |
getQueryString()
Returns the query string that is contained in the request URL after the path. |
String |
getRemoteAddr()
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request. |
String |
getRemoteHost()
Returns the fully qualified name of the client or the last proxy that sent the request. |
int |
getRemotePort()
Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request. |
String |
getRequestHandlerPath()
returns the request handler path. |
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. |
URL |
getRequestUrl()
Reconstructs the URL the client used to make the request. |
boolean |
getRequiredBooleanParameter(String name)
Get an boolean parameter or throws an exception if parameter is not present |
double |
getRequiredDoubleParameter(String name)
Get an double parameter or throws an exception if parameter is not present |
float |
getRequiredFloatParameter(String name)
Get an float parameter or throws an exception if parameter is not present |
int |
getRequiredIntParameter(String name)
Get an int parameter or throws an exception if parameter is not present |
long |
getRequiredLongParameter(String name)
Get an long parameter or throws an exception if parameter is not present |
String |
getRequiredStringParameter(String name)
Get an string parameter or throws an exception if parameter is not present |
String |
getScheme()
Returns the name of the scheme used to make this request, for example, http or https. |
String |
getServerName()
Returns the host name of the server to which the request was sent. |
int |
getServerPort()
Returns the port number to which the request was sent. |
String |
getUserAgent()
returns the User-Agent header parameter or null if the header is not set |
boolean |
isSecure()
Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS. |
void |
removeMatrixParameter(String parameterName)
removes a matrix parameter |
void |
removeParameter(String parameterName)
remove a parameter |
void |
setContextPath(String contextPath)
sets the context path. |
void |
setHost(String host)
sets the Host header (e.g. www.gmx.com or www.gmx.com:9900). |
void |
setMatrixParameter(String parameterName,
String parameterValue)
sets a matrix parameter |
void |
setMethod(String method)
Sets the name of the HTTP method |
void |
setParameter(String parameterName,
String parameterValue)
sets a parameter |
void |
setRequestHandlerPath(String requestHandlerPath)
sets the request handler path |
void |
setRequestURI(String requestUri)
set the request uri part of this request's URL from the protocol name up to the query string in the first line of the HTTP request. |
void |
setRequestUrl(URL url)
set the request url |
void |
setUserAgent(String userAgent)
sets the User-Agent header |
| Methods inherited from interface org.xlightweb.IHttpMessageHeader |
|---|
copyHeaderFrom, getAttribute, getAttributeNames, getAttributeNameSet, getContentLength, getProtocol, getProtocolVersion, removeHopByHopHeaders, setAttribute, setContentLength |
| Methods inherited from interface org.xlightweb.IHeader |
|---|
addHeader, addHeaderLine, addHeaderlines, containsHeader, getCharacterEncoding, getContentType, getDisposition, getDispositionParam, getDispositionType, getHeader, getHeader, getHeaderList, getHeaderNames, getHeaderNameSet, getHeaders, getTransferEncoding, removeHeader, setContentType, setHeader, setTransferEncoding |
| Method Detail |
|---|
String getRemoteHost()
int getRemotePort()
String getRemoteAddr()
String getQueryString()
null
if the URL does not have a query string.
String getContextPath()
IHttpRequest.getRequestHandlerPath()void setContextPath(String contextPath)
contextPath - the context pathString getPathInfo()
null if the URL does not have any extra path informationString getPathInfo(boolean removeSurroundingSlashs)
removeSurroundingSlashs - true, if surrounding slashs wil lbe removed
null if the URL does not have any extra path informationString getRequestURI()
String getRequestHandlerPath()
void setRequestHandlerPath(String requestHandlerPath)
requestHandlerPath - the request handler pathvoid setRequestURI(String requestUri)
requestUri - the request uriURL getRequestUrl()
void setRequestUrl(URL url)
url - the request urlboolean isSecure()
String getMethod()
void setMethod(String method)
method - a String specifying the name of the methodString getHost()
null if the header is not set
null if the header is not setvoid setHost(String host)
host - the Host headerString getUserAgent()
null if the header is not set
null if the header is not setvoid setUserAgent(String userAgent)
userAgent - the User-Agent headerString getServerName()
int getServerPort()
List<ContentType> getAccept()
String getScheme()
Set<String> getMatrixParameterNameSet()
String getMatrixParameter(String name)
name - a String specifying the name of the matrix parameter
String[] getMatrixParameterValues(String name)
name - a String specifying the name of the matrix parameter
void setMatrixParameter(String parameterName,
String parameterValue)
parameterName - the parameter nameparameterValue - the parameter value
void addMatrixParameter(String parameterName,
String parameterValue)
parameterName - the parameter nameparameterValue - the parameter valuevoid removeMatrixParameter(String parameterName)
parameterName - the parameter namevoid removeParameter(String parameterName)
parameterName - the parameter nameparameterValue - the parameter value
void setParameter(String parameterName,
String parameterValue)
parameterName - the parameter nameparameterValue - the parameter value
void addParameter(String parameterName,
String parameterValue)
parameterName - the parameter nameparameterValue - the parameter valueEnumeration getParameterNames()
Set<String> getParameterNameSet()
String getParameter(String name)
name - a String specifying the name of the parameter
String getParameter(String name,
String defaultVal)
name - the name of the parameterdefaultVal - the default value to use as fallback
String[] getParameterValues(String name)
name - a String specifying the name of the parameter
String getRequiredStringParameter(String name)
throws BadMessageException
name - the parameter name
BadMessageException - if the parameter is not present
Integer getIntParameter(String name)
throws BadMessageException
name - the name of the parameter
null
BadMessageException - if the parameter value is not a number
int getRequiredIntParameter(String name)
throws BadMessageException
name - the parameter name
BadMessageException - if the parameter is not present or the parameter is not a number
int getIntParameter(String name,
int defaultVal)
name - the name of the parameterdefaultVal - the default value to use as fallback
Long getLongParameter(String name)
throws BadMessageException
name - the name of the parameter
null
BadMessageException - if the parameter value is not a number
long getRequiredLongParameter(String name)
throws BadMessageException
name - the parameter name
BadMessageException - if the parameter is not present or the parameter is not a number
long getLongParameter(String name,
long defaultVal)
name - the name of the parameterdefaultVal - the default value to use as fallback
Double getDoubleParameter(String name)
throws BadMessageException
name - the name of the parameter
null
BadMessageException - if the parameter is not a number
double getRequiredDoubleParameter(String name)
throws BadMessageException
name - the parameter name
BadMessageException - if the parameter is not present or the parameter value is not a number
double getDoubleParameter(String name,
double defaultVal)
name - the name of the parameterdefaultVal - the default value to use as fallback
Float getFloatParameter(String name)
throws BadMessageException
name - the name of the parameter
null
BadMessageException - if the parameter value is not a number
float getRequiredFloatParameter(String name)
throws BadMessageException
name - the parameter name
BadMessageException - if the parameter is not present or the parameter value is not a number
float getFloatParameter(String name,
float defaultVal)
name - the name of the parameterdefaultVal - the default value to use as fallback
Boolean getBooleanParameter(String name)
name - the name of the parameter
null
boolean getRequiredBooleanParameter(String name)
throws BadMessageException
name - the parameter name
BadMessageException - if the parameter is not present
boolean getBooleanParameter(String name,
boolean defaultVal)
name - the name of the parameterdefaultVal - the default value to use as fallback
IHttpRequestHeader copy()
copy in interface IHttpMessageHeader
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||