public class Http2PushPromise extends Http2Frame
Http2PushPromise represents a HTTP/2 PUSH_PROMISE frame.
This represents both HTTP/2 push promises received from a server as well as the push promises suppose to be delivered to a client. A PUSH_PROMISE should not be sent by a client.
| Constructor and Description |
|---|
Http2PushPromise(io.netty.handler.codec.http.HttpRequest httpRequest)
Constructor to create
Http2PushPromise with initial HttpRequest. |
Http2PushPromise(String method,
String uri)
Constructor to create a new
Http2PushPromise with uri and http method. |
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(String name,
String value)
Adds a header to the push promise.
|
String |
getHeader(String name)
Gets a header value for a given header name.
|
String[] |
getHeaders(String name)
Gets all header values for a given header name.
|
io.netty.handler.codec.http.HttpRequest |
getHttpRequest()
Gets the associated
HttpRequest of the push promise. |
String |
getMethod()
Gets the http method associated with the push promise.
|
OutboundMsgHolder |
getOutboundMsgHolder()
Gets the
OutboundMsgHolder associated with this Http2PushPromise. |
String |
getPath()
Gets the path associated with the push promise.
|
int |
getPromisedStreamId()
Gets the promised stream id of the push promise.
|
boolean |
isRejected()
Checks whether push promise is rejected.
|
void |
reject()
Rejects the push promise.
|
void |
removeAllHeaders()
Removes all headers from the push promise.
|
void |
removeHeader(String name)
Remove all headers in for a given header name.
|
void |
setHeader(String name,
String value)
Sets a header value for a given header name.
|
void |
setOutboundMsgHolder(OutboundMsgHolder outboundMsgHolder)
Sets the
OutboundMsgHolder associated with Http2PushPromise. |
void |
setPromisedStreamId(int promisedStreamId)
Sets the promised stream id of the push promise.
|
getStreamId, isEndOfStream, setEndOfStream, setStreamIdpublic Http2PushPromise(io.netty.handler.codec.http.HttpRequest httpRequest)
Http2PushPromise with initial HttpRequest.httpRequest - the HttpRequestpublic io.netty.handler.codec.http.HttpRequest getHttpRequest()
HttpRequest of the push promise.HttpRequestpublic String getMethod()
public String getPath()
public void addHeader(String name, String value)
name - the header namevalue - value of the headerpublic void removeHeader(String name)
name - name of the headerpublic String getHeader(String name)
name - name of the headerpublic String[] getHeaders(String name)
name - name of the headerpublic void setHeader(String name, String value)
name - name of the headervalue - value of the headerpublic void removeAllHeaders()
public int getPromisedStreamId()
public void setPromisedStreamId(int promisedStreamId)
promisedStreamId - promised stream idpublic boolean isRejected()
public void reject()
public OutboundMsgHolder getOutboundMsgHolder()
OutboundMsgHolder associated with this Http2PushPromise.OutboundMsgHolder associated with this Http2PushPromisepublic void setOutboundMsgHolder(OutboundMsgHolder outboundMsgHolder)
OutboundMsgHolder associated with Http2PushPromise.outboundMsgHolder - the OutboundMsgHolder associated with this Http2PushPromiseCopyright © 2021 WSO2. All rights reserved.