@Singleton public class HeaderTokenSessionMapper extends java.lang.Object implements SessionMapper
Implement SessionMapper
using HTTP header
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEF_HEADER_PREFIX |
static java.lang.String |
DEF_PAYLOAD_PREFIX |
Constructor and Description |
---|
HeaderTokenSessionMapper(AppConfig config) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
readFlash(org.osgl.http.H.Request request)
Read the incoming HTTP request and extract serialized flash state.
|
java.lang.String |
readSession(org.osgl.http.H.Request request)
Read the incoming HTTP request and extract serialized session state.
|
void |
write(java.lang.String session,
java.lang.String flash,
org.osgl.http.H.Response response)
Write serialized session and flash state into
response . |
public static final java.lang.String DEF_HEADER_PREFIX
public static final java.lang.String DEF_PAYLOAD_PREFIX
@Inject public HeaderTokenSessionMapper(AppConfig config)
public void write(java.lang.String session, java.lang.String flash, org.osgl.http.H.Response response)
SessionMapper
Write serialized session and flash state into response
.
write
in interface SessionMapper
session
- the session state (a string) to be written to the responseflash
- the flash state (a string) to be written to the responseresponse
- the HTTP responsepublic java.lang.String readSession(org.osgl.http.H.Request request)
SessionMapper
Read the incoming HTTP request and extract serialized session state.
readSession
in interface SessionMapper
request
- the incoming HTTP requestnull
if not session state found in the request using this mapperpublic java.lang.String readFlash(org.osgl.http.H.Request request)
SessionMapper
Read the incoming HTTP request and extract serialized flash state.
readFlash
in interface SessionMapper
request
- the incoming HTTP requestnull
if not flash state found in the request using this mapperCopyright © 2014–2017 ActFramework. All rights reserved.