public class InfinispanResponse extends Object
Modifier and Type | Method and Description |
---|---|
static InfinispanResponse |
asError(InfinispanRequest request,
io.netty.handler.codec.http.HttpResponseStatus status,
String description)
Creates an
InfinispanResponse as an error. |
void |
authenticate(String authenticateHeader)
Adds
www-authenticate header. |
void |
cacheControl(CacheControl cacheControl)
Adds Cache Control headers.
|
void |
charset(Charset charset)
Adds a charset.
|
void |
clusterNodeName(String nodeName)
Adds
Cluster-Node-Name header. |
void |
clusterPrimaryOwner(String primaryOwner)
Adds
Cluster-Primary-Owner header. |
void |
clusterServerAddress(String serverAddress)
Adds
Cluster-Server-Address header. |
void |
contentAsBytes(byte[] content)
Adds content as binary array.
|
void |
contentAsText(String content)
Adds content as text.
|
void |
contentType(String contentType)
Adds
Content-Type header. |
void |
etag(String etag)
Adds ETAG.
|
void |
expires(Date expires)
Adds
expires header. |
void |
httpVersion(io.netty.handler.codec.http.HttpVersion httpVersion)
Adds HTTP version header.
|
static InfinispanResponse |
inReplyTo(InfinispanRequest request)
Creates an
InfinispanResponse as a reply to specific InfinispanRequest . |
boolean |
isKeepAlive()
Checks whether this is a Keep Alive type of response.
|
void |
lastModified(Date lastModified)
Add
last-modified header. |
void |
maxIdle(long maxIdle)
Adds
maxIdleTimeSeconds header. |
void |
status(io.netty.handler.codec.http.HttpResponseStatus httpStatus)
Adds status code.
|
void |
timeToLive(long lifespan) |
io.netty.handler.codec.http.FullHttpResponse |
toNettyHttpResponse()
Renders
FullHttpResponse object. |
public static final InfinispanResponse inReplyTo(InfinispanRequest request)
InfinispanResponse
as a reply to specific InfinispanRequest
.request
- Request to reply to.public static final InfinispanResponse asError(InfinispanRequest request, io.netty.handler.codec.http.HttpResponseStatus status, String description)
InfinispanResponse
as an error.public void contentAsText(String content)
UTF-8
.content
- Content.public void contentAsBytes(byte[] content)
content
- Content.public void contentType(String contentType)
Content-Type
header.contentType
- Content-Type
header.public void httpVersion(io.netty.handler.codec.http.HttpVersion httpVersion)
httpVersion
- HTTP version header.public void status(io.netty.handler.codec.http.HttpResponseStatus httpStatus)
httpStatus
- Status code.public boolean isKeepAlive()
true
if the response contains Keep Alive headers.public io.netty.handler.codec.http.FullHttpResponse toNettyHttpResponse()
FullHttpResponse
object.FullHttpResponse
object based on this InfinispanResponse
.public void etag(String etag)
etag
- ETag value to be added.public void cacheControl(CacheControl cacheControl)
cacheControl
- Cache Control headers.public void lastModified(Date lastModified)
last-modified
header.lastModified
- last-modified
header value.public void expires(Date expires)
expires
header.expires
- expires
header value.public void timeToLive(long lifespan)
public void maxIdle(long maxIdle)
maxIdleTimeSeconds
header.maxIdle
- maxIdleTimeSeconds
header value.public void clusterPrimaryOwner(String primaryOwner)
Cluster-Primary-Owner
header.primaryOwner
- Cluster-Primary-Owner
header value.public void clusterNodeName(String nodeName)
Cluster-Node-Name
header.nodeName
- Cluster-Node-Name
header value.public void clusterServerAddress(String serverAddress)
Cluster-Server-Address
header.serverAddress
- Cluster-Server-Address
header value.public void authenticate(String authenticateHeader)
www-authenticate
header.authenticateHeader
- www-authenticate
header value.public void charset(Charset charset)
charset
- charset value.Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.