Top Description Inners Fields Constructors Methods
org.glassfish.grizzly.http.server.http2

public Class PushEvent

extends Object
implements FilterChainEvent
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.filterchain.FilterChainEvent
Imports
org.glassfish.grizzly.ThreadCache, org.glassfish.grizzly.filterchain.FilterChainEvent, org.glassfish.grizzly.http.HttpHeader, .HttpRequestPacket, .Method, org.glassfish.grizzly.http.util.MimeHeaders

A FilterChainEvent to trigger an HTTP/2 push promise and trigger a new request to be sent upstream to generate a response for said push promise.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private static final ThreadCache.CachedTypeIndex<PushEvent>
private MimeHeaders
private HttpRequestPacket
private String
private String
public static final Object

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static PushEvent.PushEventBuilder
builder()

Returns: a new PushEventBuilder for constructing a PushEvent with all of the necessary values to generate a push and container request.

public static PushEvent
create(final PushBuilder builder)

Construct a new PushEvent based on the values contained within the provided PushBuilder.

private static PushEvent
public MimeHeaders
getHeaders()

Returns: the headers of the push request.

public HttpHeader
getHttpRequest()

Returns: the HttpRequestPacket of the original request.

public String
getMethod()

Returns: the HTTP Method of the push request.

public String
getPath()

Returns: the path of the push request.

private PushEvent
init(final PushBuilder builder)

private PushEvent
public void
recycle()

This should be called by the entity generating the actual push and container requests.

public Object
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CACHE_IDXback to summary
private static final ThreadCache.CachedTypeIndex<PushEvent> CACHE_IDX
headersback to summary
private MimeHeaders headers
httpRequestback to summary
private HttpRequestPacket httpRequest
methodback to summary
private String method
pathback to summary
private String path
TYPEback to summary
public static final Object TYPE

Constructor Detail

PushEventback to summary
private PushEvent()

Method Detail

builderback to summary
public static PushEvent.PushEventBuilder builder()
Returns:PushEvent.PushEventBuilder

a new PushEventBuilder for constructing a PushEvent with all of the necessary values to generate a push and container request.

createback to summary
public static PushEvent create(final PushBuilder builder)

Construct a new PushEvent based on the values contained within the provided PushBuilder.

createback to summary
private static PushEvent create(final PushEvent.PushEventBuilder builder)
getHeadersback to summary
public MimeHeaders getHeaders()
Returns:MimeHeaders

the headers of the push request.

getHttpRequestback to summary
public HttpHeader getHttpRequest()
Returns:HttpHeader

the HttpRequestPacket of the original request. This is necessary in order to lookup the parent stream.

getMethodback to summary
public String getMethod()
Returns:String

the HTTP Method of the push request.

getPathback to summary
public String getPath()
Returns:String

the path of the push request.

initback to summary
private PushEvent init(final PushBuilder builder)
initback to summary
private PushEvent init(final PushEvent.PushEventBuilder builder)
recycleback to summary
public void recycle()

This should be called by the entity generating the actual push and container requests. Developers using this event can ignore this.

typeback to summary
public Object type()

Implements org.glassfish.grizzly.filterchain.FilterChainEvent.type.

Annotations
@Override
org.glassfish.grizzly.http.server.http2 back to summary

public final Class PushEvent.PushEventBuilder

extends Object
Class Inheritance
  • java.lang.Object
  • org.glassfish.grizzly.http.server.http2.PushEvent.PushEventBuilder

Construct a new PushEvent. Any missing required values will result in an exception when build() is invoked;

Field Summary

Modifier and TypeField and Description
private MimeHeaders
private HttpRequestPacket
private String
private String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public PushEvent
build()

Returns: a new PushEvent based on the provided values.

public PushEvent.PushEventBuilder

Returns:

this
headers
(final MimeHeaders val)

The headers of the push request.

public PushEvent.PushEventBuilder

Returns:

this
httpRequest
(final HttpRequestPacket val)

The HttpRequestPacket of the original request.

public PushEvent.PushEventBuilder

Returns:

this
method
(final String val)

The push method.

public PushEvent.PushEventBuilder

Returns:

this
path
(final String val)

The path of the push request.

private static String
validate(final String val)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

headersback to summary
private MimeHeaders headers
httpRequestback to summary
private HttpRequestPacket httpRequest
methodback to summary
private String method
pathback to summary
private String path

Constructor Detail

PushEventBuilderback to summary
private PushEventBuilder()

Method Detail

buildback to summary
public PushEvent build()
Returns:PushEvent

a new PushEvent based on the provided values.

Exceptions
IllegalArgumentException:
if no value has been provided by invoking path(String), httpRequest(HttpRequestPacket), or headers(MimeHeaders).
headersback to summary
public PushEvent.PushEventBuilder headers(final MimeHeaders val)

The headers of the push request.

Returns:PushEvent.PushEventBuilder

this

Exceptions
NullPointerException:
if no MimeHeaders is provided.
httpRequestback to summary
public PushEvent.PushEventBuilder httpRequest(final HttpRequestPacket val)

The HttpRequestPacket of the original request. This is necessary in order to lookup the parent stream.

Returns:PushEvent.PushEventBuilder

this

Exceptions
NullPointerException:
if no HttpRequestPacket is provided.
methodback to summary
public PushEvent.PushEventBuilder method(final String val)

The push method. Defaults to Method#GET.

Returns:PushEvent.PushEventBuilder

this

Exceptions
NullPointerException:
if no value is provided.
IllegalArgumentException:
if the argument is the empty String, or any non-cacheable or unsafe methods defined in RFC 7231, which are POST, PUT, DELETE, CONNECT, OPTIONS and TRACE.
pathback to summary
public PushEvent.PushEventBuilder path(final String val)

The path of the push request.

Returns:PushEvent.PushEventBuilder

this

validateback to summary
private static String validate(final String val)