Top Description Fields Constructors Methods
org.glassfish.grizzly.servlet

public Class ServletConnectionImpl

extends Object
implements ServletConnection
Class Inheritance
All Implemented Interfaces
jakarta.servlet.ServletConnection
Imports
jakarta.servlet.ServletConnection, org.glassfish.grizzly.http.Protocol

Trivial implementation of the ServletConnection
Author
David Matejcek

Field Summary

Modifier and TypeField and Description
private final String
private final Protocol
private final boolean

Constructor Summary

AccessConstructor and Description
public
ServletConnectionImpl(String
- see getConnectionId(), can be null.
connectionId
,
Protocol
- see getProtocol() and Protocol, can be null.
protocol
,
boolean
- true if the connection was encrypted.
secure
)

Just sets all fields.

Method Summary

Modifier and TypeMethod and Description
public String
getConnectionId()

Implements jakarta.servlet.ServletConnection.getConnectionId.

Obtain a unique (within the lifetime of the JVM) identifier string for the network connection to the JVM that is being used for the ServletRequest from which this ServletConnection was obtained.

public String
getProtocol()

Implements jakarta.servlet.ServletConnection.getProtocol.

Obtain the name of the protocol as presented to the server after the removal, if present, of any TLS or similar encryption.

public String
getProtocolConnectionId()

Implements jakarta.servlet.ServletConnection.getProtocolConnectionId.

Obtain the connection identifier for the network connection to the server that is being used for the ServletRequest from which this ServletConnection was obtained as defined by the protocol in use.

public boolean
isSecure()

Implements jakarta.servlet.ServletConnection.isSecure.

Determine whether or not the incoming network connection to the server used encryption or not.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

connectionIdback to summary
private final String connectionId
protocolback to summary
private final Protocol protocol
secureback to summary
private final boolean secure

Constructor Detail

ServletConnectionImplback to summary
public ServletConnectionImpl(String connectionId, Protocol protocol, boolean secure)

Just sets all fields.

Parameters
connectionId:String

- see getConnectionId(), can be null.

protocol:Protocol

- see getProtocol() and Protocol, can be null.

secure:boolean

- true if the connection was encrypted.

Method Detail

getConnectionIdback to summary
public String getConnectionId()

Implements jakarta.servlet.ServletConnection.getConnectionId.

Doc from jakarta.servlet.ServletConnection.getConnectionId.

Obtain a unique (within the lifetime of the JVM) identifier string for the network connection to the JVM that is being used for the ServletRequest from which this ServletConnection was obtained.

There is no defined format for this string. The format is implementation dependent.

Annotations
@Override
getProtocolback to summary
public String getProtocol()

Implements jakarta.servlet.ServletConnection.getProtocol.

Doc from jakarta.servlet.ServletConnection.getProtocol.

Obtain the name of the protocol as presented to the server after the removal, if present, of any TLS or similar encryption. This may not be the same as the protocol seen by the application. For example, a reverse proxy may present AJP whereas the application will see HTTP 1.1.

If the protocol has an entry in the IANA registry for ALPN names then the identification sequence, in string form, must be returned. Registered identification sequences MUST only be used for the associated protocol. Return values for other protocols are implementation dependent. Unknown protocols should return the string "unknown".

Annotations
@Override
getProtocolConnectionIdback to summary
public String getProtocolConnectionId()

Implements jakarta.servlet.ServletConnection.getProtocolConnectionId.

Doc from jakarta.servlet.ServletConnection.getProtocolConnectionId.

Obtain the connection identifier for the network connection to the server that is being used for the ServletRequest from which this ServletConnection was obtained as defined by the protocol in use. Note that some protocols do not define such an identifier.

Examples of protocol provided connection identifiers include:

HTTP 1.x
None, so the empty string should be returned
HTTP 2
None, so the empty string should be returned
HTTP 3
The QUIC connection ID
AJP
None, so the empty string should be returned
Annotations
@Override
isSecureback to summary
public boolean isSecure()

Implements jakarta.servlet.ServletConnection.isSecure.

Doc from jakarta.servlet.ServletConnection.isSecure.

Determine whether or not the incoming network connection to the server used encryption or not. Note that where a reverse proxy is used, the application may have a different view as to whether encryption is being used due to the use of headers like X-Forwarded-Proto.

Annotations
@Override