Package cloud.piranha.http.netty
Class NettyHttpServerResponse
- java.lang.Object
-
- cloud.piranha.http.netty.NettyHttpServerResponse
-
- All Implemented Interfaces:
HttpServerResponse
public class NettyHttpServerResponse extends Object implements HttpServerResponse
The Netty implementation of HTTP Server Response.- Author:
- Manfred Riem ([email protected])
-
-
Constructor Summary
Constructors Constructor Description NettyHttpServerResponse(io.netty.handler.codec.http.FullHttpResponse response)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getHeader(String name)
Get the header.OutputStream
getOutputStream()
Get the output stream.void
setHeader(String name, String value)
Set the specified header.void
setStatus(int status)
Set the status.void
writeHeaders()
Write the response headers.void
writeStatusLine()
Write the status line.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cloud.piranha.http.api.HttpServerResponse
closeResponse
-
-
-
-
Method Detail
-
getHeader
public String getHeader(String name)
Description copied from interface:HttpServerResponse
Get the header.- Specified by:
getHeader
in interfaceHttpServerResponse
- Parameters:
name
- the name.- Returns:
- the value, or null if not found.
- See Also:
HttpServerResponse.getHeader(java.lang.String)
-
getOutputStream
public OutputStream getOutputStream()
Description copied from interface:HttpServerResponse
Get the output stream.- Specified by:
getOutputStream
in interfaceHttpServerResponse
- Returns:
- the output stream.
- See Also:
HttpServerResponse.getOutputStream()
-
setHeader
public void setHeader(String name, String value)
Description copied from interface:HttpServerResponse
Set the specified header.- Specified by:
setHeader
in interfaceHttpServerResponse
- Parameters:
name
- the header name.value
- the header value.- See Also:
HttpServerResponse.setHeader(java.lang.String, java.lang.String)
-
setStatus
public void setStatus(int status)
Description copied from interface:HttpServerResponse
Set the status.- Specified by:
setStatus
in interfaceHttpServerResponse
- Parameters:
status
- the status.- See Also:
HttpServerResponse.setStatus(int)
-
writeHeaders
public void writeHeaders() throws IOException
Description copied from interface:HttpServerResponse
Write the response headers.- Specified by:
writeHeaders
in interfaceHttpServerResponse
- Throws:
IOException
- when an I/O error occurs.- See Also:
HttpServerResponse.writeHeaders()
-
writeStatusLine
public void writeStatusLine() throws IOException
Description copied from interface:HttpServerResponse
Write the status line.- Specified by:
writeStatusLine
in interfaceHttpServerResponse
- Throws:
IOException
- when an I/O error occurs.- See Also:
HttpServerResponse.writeStatusLine()
-
-