private static final class ELFlash.PreviousNextFlashInfoManager
extends java.lang.Object
On any given request, there are actually two maps behind the flash. Which one is actually used on a given Map method depends on the current lifecycle phase at the time the method is invoked. There is a "next" map, and a "previous" map. This class manages the complexities of dealing with these two maps, and does so by relying on another inner class, FlashInfo.
The "next" map is used in only one case, which happens to be a VERY common case: write operations to the flash that happen during render response.
The "previous" map is used for write operations that happen before render response, and for all read operations.
This class knows how to "decode" its state from an incoming cookie, written by a previous call to "encode".
See the docs for FlashInfo for more information.
Modifier and Type | Field and Description |
---|---|
private ByteArrayGuardAESCTR |
guard |
private boolean |
incomingCookieCameFromRedirect |
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> |
innerMap |
private ELFlash.FlashInfo |
nextRequestFlashInfo |
private ELFlash.FlashInfo |
previousRequestFlashInfo |
Modifier | Constructor and Description |
---|---|
private |
PreviousNextFlashInfoManager(ByteArrayGuardAESCTR guard) |
private |
PreviousNextFlashInfoManager(ByteArrayGuardAESCTR guard,
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> innerMap) |
Modifier and Type | Method and Description |
---|---|
protected ELFlash.PreviousNextFlashInfoManager |
copyWithoutInnerMap() |
(package private) void |
decode(javax.faces.context.FacesContext context,
ELFlash flash,
javax.servlet.http.Cookie cookie)
Decode the state of the PreviousNextFlashInfoManager from
a Cookie.
|
(package private) javax.servlet.http.Cookie |
encode()
Encode the current state of the
PreviousNextFlashInfoManager to the cookie.
|
(package private) void |
expireNext_MovePreviousToNext() |
(package private) void |
expirePrevious() |
(package private) ELFlash.FlashInfo |
getNextRequestFlashInfo() |
(package private) ELFlash.FlashInfo |
getNextRequestFlashInfo(ELFlash flash,
boolean create) |
(package private) ELFlash.FlashInfo |
getPreviousRequestFlashInfo() |
(package private) void |
initializeBaseCase(ELFlash flash) |
(package private) boolean |
isIncomingCookieCameFromRedirect() |
(package private) void |
setIncomingCookieCameFromRedirect(boolean incomingCookieCameFromRedirect) |
(package private) void |
setNextRequestFlashInfo(ELFlash.FlashInfo nextRequestFlashInfo) |
(package private) void |
setPreviousRequestFlashInfo(ELFlash.FlashInfo thisRequestFlashInfo) |
java.lang.String |
toString() |
private ELFlash.FlashInfo previousRequestFlashInfo
private ELFlash.FlashInfo nextRequestFlashInfo
private boolean incomingCookieCameFromRedirect
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> innerMap
private ByteArrayGuardAESCTR guard
private PreviousNextFlashInfoManager(ByteArrayGuardAESCTR guard)
private PreviousNextFlashInfoManager(ByteArrayGuardAESCTR guard, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> innerMap)
protected ELFlash.PreviousNextFlashInfoManager copyWithoutInnerMap()
public java.lang.String toString()
toString
in class java.lang.Object
void initializeBaseCase(ELFlash flash)
void expirePrevious()
void expireNext_MovePreviousToNext()
void decode(javax.faces.context.FacesContext context, ELFlash flash, javax.servlet.http.Cookie cookie) throws java.security.InvalidKeyException
Decode the state of the PreviousNextFlashInfoManager from a Cookie. This entire method is wrapped in a try-catch block to prevent any errors from malformed cookies from polluting the system. When any error occurs, the flash is not usable for this request, and a nice error message is logged.
This method is where the LifetimeMarker is incremented, UNLESS the incoming request is the GET after the REDIRECT after POST, in which case we don't increment it because the system will expire the entries in the doLastPhaseActions.
java.security.InvalidKeyException
javax.servlet.http.Cookie encode()
Encode the current state of the PreviousNextFlashInfoManager to the cookie.
ELFlash.FlashInfo getPreviousRequestFlashInfo()
void setPreviousRequestFlashInfo(ELFlash.FlashInfo thisRequestFlashInfo)
ELFlash.FlashInfo getNextRequestFlashInfo()
ELFlash.FlashInfo getNextRequestFlashInfo(ELFlash flash, boolean create)
void setNextRequestFlashInfo(ELFlash.FlashInfo nextRequestFlashInfo)
boolean isIncomingCookieCameFromRedirect()
void setIncomingCookieCameFromRedirect(boolean incomingCookieCameFromRedirect)
Copyright © 2002-2013 Oracle America, Inc. All Rights Reserved.