- All Known Implementing Classes:
DefaultPageContext
,MockPageContext
public interface IPageContext
Context of a
IManageablePage
when it is stored in an IPageStore
, decoupling it
from request cycle and session.- Author:
- Matej Knopp, svenmeier
-
Method Summary
Modifier and TypeMethodDescription<T> T
getRequestData
(MetaDataKey<T> key, Supplier<T> defaultValue) Get data from the current request cycle.<T extends Serializable>
TgetSessionAttribute
(String key, Supplier<T> defaultValue) Get an attribute from the session.<T extends Serializable>
TgetSessionData
(MetaDataKey<T> key, Supplier<T> defaultValue) Get metadata from the session.getSessionId
(boolean bind) Get the identifier of the session.
-
Method Details
-
getRequestData
Get data from the current request cycle.- Parameters:
key
- keydefaultValue
- default value to use if not present- See Also:
-
getSessionAttribute
Get an attribute from the session.
Binds the session if not already set and supplier is notnull
. Sets the session attribute if supplier is notnull
.- Parameters:
key
- keydefaultValue
- default value to use if not present- Returns:
- value
- See Also:
-
getSessionData
Get metadata from the session.
Binds the session if not already set and supplier is notnull
. Sets the session attribute if supplier is notnull
.- Parameters:
key
- keydefaultValue
- optional supplier of a default value to use if not present- Returns:
- value
- See Also:
-
getSessionId
Get the identifier of the session.- Parameters:
bind
- should the session be bound- Returns:
- session id, might be
null
if not bound yet
-