Package cloud.piranha.http.impl
Class DefaultHttpServerRequest
- java.lang.Object
-
- cloud.piranha.http.impl.DefaultHttpServerRequest
-
- All Implemented Interfaces:
HttpServerRequest
public class DefaultHttpServerRequest extends Object implements HttpServerRequest
The default implementation of HTTP Server Request.- Author:
- Manfred Riem ([email protected])
-
-
Constructor Summary
Constructors Constructor Description DefaultHttpServerRequest(Socket socket)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHeader(String name, String value)
Add the header.String
getHeader(String name)
Get the header.Iterator<String>
getHeaderNames()
Get the header names.InputStream
getInputStream()
Get the input stream.String
getLocalAddress()
Get the local address.String
getLocalHostname()
Get the local hostname.int
getLocalPort()
Get the local port.String
getMethod()
Get the method.String
getQueryParameter(String name)
Get the query parameter.String
getQueryString()
Get the query string.String
getRemoteAddress()
Get the remote address.String
getRemoteHostname()
Get the remote hostname.int
getRemotePort()
Get the remote port.String
getRequestTarget()
Get the request target.void
setMethod(String method)
Set the method.void
setRequestTarget(String requestTarget)
Set the request target.
-
-
-
Constructor Detail
-
DefaultHttpServerRequest
public DefaultHttpServerRequest(Socket socket)
Constructor.- Parameters:
socket
- the socket.
-
-
Method Detail
-
addHeader
public void addHeader(String name, String value)
Add the header.- Parameters:
name
- the name.value
- the value.
-
getHeader
public String getHeader(String name)
Description copied from interface:HttpServerRequest
Get the header.- Specified by:
getHeader
in interfaceHttpServerRequest
- Parameters:
name
- the name of the header.- Returns:
- the value, or null.
- See Also:
HttpServerRequest.getHeader(java.lang.String)
-
getHeaderNames
public Iterator<String> getHeaderNames()
Description copied from interface:HttpServerRequest
Get the header names.- Specified by:
getHeaderNames
in interfaceHttpServerRequest
- Returns:
- the header names.
- See Also:
HttpServerRequest.getHeaderNames()
-
getInputStream
public InputStream getInputStream()
Description copied from interface:HttpServerRequest
Get the input stream.- Specified by:
getInputStream
in interfaceHttpServerRequest
- Returns:
- the input stream.
- See Also:
HttpServerRequest.getInputStream()
-
getLocalAddress
public String getLocalAddress()
Description copied from interface:HttpServerRequest
Get the local address.- Specified by:
getLocalAddress
in interfaceHttpServerRequest
- Returns:
- the local address.
- See Also:
HttpServerRequest.getLocalAddress()
-
getLocalHostname
public String getLocalHostname()
Description copied from interface:HttpServerRequest
Get the local hostname.- Specified by:
getLocalHostname
in interfaceHttpServerRequest
- Returns:
- the local hostname.
- See Also:
HttpServerRequest.getLocalHostname()
-
getLocalPort
public int getLocalPort()
Description copied from interface:HttpServerRequest
Get the local port.- Specified by:
getLocalPort
in interfaceHttpServerRequest
- Returns:
- the local port.
- See Also:
HttpServerRequest.getLocalPort()
-
getMethod
public String getMethod()
Description copied from interface:HttpServerRequest
Get the method.- Specified by:
getMethod
in interfaceHttpServerRequest
- Returns:
- the method.
- See Also:
HttpServerRequest.getMethod()
-
getQueryParameter
public String getQueryParameter(String name)
Description copied from interface:HttpServerRequest
Get the query parameter.- Specified by:
getQueryParameter
in interfaceHttpServerRequest
- Parameters:
name
- the name.- Returns:
- the value, or null if not found.
- See Also:
HttpServerRequest.getQueryParameter(java.lang.String)
-
getQueryString
public String getQueryString()
Description copied from interface:HttpServerRequest
Get the query string.- Specified by:
getQueryString
in interfaceHttpServerRequest
- Returns:
- the query string.
- See Also:
HttpServerRequest.getQueryString()
-
getRemoteAddress
public String getRemoteAddress()
Get the remote address.- Specified by:
getRemoteAddress
in interfaceHttpServerRequest
- Returns:
- the remote address.
-
getRemoteHostname
public String getRemoteHostname()
Description copied from interface:HttpServerRequest
Get the remote hostname.- Specified by:
getRemoteHostname
in interfaceHttpServerRequest
- Returns:
- the remote hostname.
- See Also:
HttpServerRequest.getRemoteHostname()
-
getRemotePort
public int getRemotePort()
Description copied from interface:HttpServerRequest
Get the remote port.- Specified by:
getRemotePort
in interfaceHttpServerRequest
- Returns:
- the remote port.
- See Also:
HttpServerRequest.getRemotePort()
-
getRequestTarget
public String getRequestTarget()
Description copied from interface:HttpServerRequest
Get the request target.- Specified by:
getRequestTarget
in interfaceHttpServerRequest
- Returns:
- the request target.
- See Also:
HttpServerRequest.getRequestTarget()
-
setMethod
public void setMethod(String method)
Set the method.- Parameters:
method
- the method.
-
setRequestTarget
public void setRequestTarget(String requestTarget)
Set the request target.- Parameters:
requestTarget
- the request target.
-
-