Top Description Fields Constructors Methods
io.undertow.server.session

public Class PathParameterSessionConfig

extends Object
implements SessionConfig
Class Inheritance
All Implemented Interfaces
io.undertow.server.session.SessionConfig
Imports
java.util.Deque, .Locale, io.undertow.UndertowLogger, io.undertow.server.HttpServerExchange

Session config that is based on a path parameter and URL rewriting
Author
Stuart Douglas

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
clearSession(final HttpServerExchange
The exchange
exchange
,
final String
The session id
sessionId
)

Implements io.undertow.server.session.SessionConfig.clearSession.

Clears this session from the exchange, removing the attachment and making any changes to the response necessary, such as clearing cookies.

public String
findSessionId(final HttpServerExchange
The exchange
exchange
)

Implements io.undertow.server.session.SessionConfig.findSessionId.

Retrieves a session id of an existing session from an exchange.

public String
rewriteUrl(final String
URL to be encoded with the session id
url
,
final String
Session id to be included in the encoded URL
sessionId
)

Implements io.undertow.server.session.SessionConfig.rewriteUrl.

Return the specified URL with the specified session identifier suitably encoded.

public SessionConfig.SessionCookieSource
public void
setSessionId(final HttpServerExchange
The exchange
exchange
,
final String
The session
sessionId
)

Implements io.undertow.server.session.SessionConfig.setSessionId.

Attaches the session to the exchange.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nameback to summary
private final String name

Constructor Detail

PathParameterSessionConfigback to summary
public PathParameterSessionConfig(final String name)
PathParameterSessionConfigback to summary
public PathParameterSessionConfig()

Method Detail

clearSessionback to summary
public void clearSession(final HttpServerExchange exchange, final String sessionId)

Implements io.undertow.server.session.SessionConfig.clearSession.

Doc from io.undertow.server.session.SessionConfig.clearSession.

Clears this session from the exchange, removing the attachment and making any changes to the response necessary, such as clearing cookies.

Parameters
exchange:HttpServerExchange

The exchange

sessionId:String

The session id

Annotations
@Override
findSessionIdback to summary
public String findSessionId(final HttpServerExchange exchange)

Implements io.undertow.server.session.SessionConfig.findSessionId.

Doc from io.undertow.server.session.SessionConfig.findSessionId.

Retrieves a session id of an existing session from an exchange.

Parameters
exchange:HttpServerExchange

The exchange

Returns:String

The session id, or null

Annotations
@Override
rewriteUrlback to summary
public String rewriteUrl(final String url, final String sessionId)

Implements io.undertow.server.session.SessionConfig.rewriteUrl.

Return the specified URL with the specified session identifier suitably encoded.

Parameters
url:String

URL to be encoded with the session id

sessionId:String

Session id to be included in the encoded URL

Annotations
@Override
sessionCookieSourceback to summary
public SessionConfig.SessionCookieSource sessionCookieSource(HttpServerExchange exchange)

Implements io.undertow.server.session.SessionConfig.sessionCookieSource.

Annotations
@Override
setSessionIdback to summary
public void setSessionId(final HttpServerExchange exchange, final String sessionId)

Implements io.undertow.server.session.SessionConfig.setSessionId.

Doc from io.undertow.server.session.SessionConfig.setSessionId.

Attaches the session to the exchange. The method should attach the exchange under an attachment key, and should also modify the exchange to allow the session to be re-attached on the next request.

Generally this will involve setting a cookie

Once a session has been attached it must be possible to retrieve it via findSessionId(io.undertow.server.HttpServerExchange)

Parameters
exchange:HttpServerExchange

The exchange

sessionId:String

The session

Annotations
@Override