|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.webflow.execution.repository.support.AbstractFlowExecutionRepository
org.springframework.webflow.execution.repository.support.AbstractConversationFlowExecutionRepository
org.springframework.webflow.execution.repository.continuation.ClientContinuationFlowExecutionRepository
public class ClientContinuationFlowExecutionRepository
Stores flow execution state client side, requiring no use of server-side state.
More specifically, instead of putting FlowExecution
objects in a server-side store this repository encodes
them directly into the continuationId
of the generated FlowExecutionKey
. When asked to load a
flow execution by its key this repository decodes the serialized continuationId
, restoring the
FlowExecution
object at the state it was in when encoded.
Note: currently this repository implementation does not by default support conversation management. This has two consequences. First, there is no conversation invalidation after completion, which enables automatic prevention of duplicate submission after a conversation has completed. Secondly, The contents of conversation scope will not be maintained across requests. Support for these features requires tracking active conversations using a conversation service backed by some centralized storage medium like a database table. If you want to have proper conversation management, configure this class with an appropriate conversation manager (the default conversation manager used does nothing).
Warning: storing state (a flow execution continuation) on the client entails a certain security risk. This
implementation does not provide a secure way of storing state on the client, so a malicious client could reverse
engineer a continuation and get access to possible sensitive data stored in the flow execution. If you need more
security and still want to store continuations on the client, subclass this class and override the methods
encode(FlowExecution)
and decode(String)
, implementing them with a secure encoding/decoding
algorithm, e.g. based on public/private key encryption.
Base64
Field Summary |
---|
Fields inherited from class org.springframework.webflow.execution.repository.support.AbstractConversationFlowExecutionRepository |
---|
logger |
Constructor Summary | |
---|---|
ClientContinuationFlowExecutionRepository(FlowExecutionStateRestorer executionStateRestorer)
Creates a new client continuation repository. |
|
ClientContinuationFlowExecutionRepository(FlowExecutionStateRestorer executionStateRestorer,
ConversationManager conversationManager)
Creates a new client continuation repository. |
Method Summary | |
---|---|
protected FlowExecutionContinuation |
decode(java.lang.String encodedContinuation)
Decode given data, received from the client, and return the corresponding flow execution object. |
protected java.io.Serializable |
encode(FlowExecution flowExecution)
Encode given flow execution object into data that can be stored on the client. |
protected java.io.Serializable |
generateContinuationId(FlowExecution flowExecution)
Template method used to generate a new continuation id for given flow execution. |
protected FlowExecutionContinuationFactory |
getContinuationFactory()
Returns the continuation factory in use by this repository. |
FlowExecution |
getFlowExecution(FlowExecutionKey key)
Return the FlowExecution indexed by the provided key. |
protected java.io.Serializable |
parseContinuationId(java.lang.String encodedId)
Template method to parse the continuation id from the encoded string. |
void |
putFlowExecution(FlowExecutionKey key,
FlowExecution flowExecution)
Place the FlowExecution in this repository under the provided key. |
void |
setContinuationFactory(FlowExecutionContinuationFactory continuationFactory)
Sets the continuation factory used by this repository. |
Methods inherited from class org.springframework.webflow.execution.repository.support.AbstractConversationFlowExecutionRepository |
---|
createConversationParameters, generateKey, getContinuationId, getConversation, getConversationId, getConversationManager, getConversationScope, getLock, getNextKey, onBegin, onEnd, parseFlowExecutionKey, putConversationScope, removeFlowExecution |
Methods inherited from class org.springframework.webflow.execution.repository.support.AbstractFlowExecutionRepository |
---|
getExecutionStateRestorer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClientContinuationFlowExecutionRepository(FlowExecutionStateRestorer executionStateRestorer)
executionStateRestorer
- the transient flow execution state restorerpublic ClientContinuationFlowExecutionRepository(FlowExecutionStateRestorer executionStateRestorer, ConversationManager conversationManager)
executionStateRestorer
- the transient flow execution state restorerconversationManager
- the conversation manager for managing centralized conversational stateMethod Detail |
---|
protected FlowExecutionContinuationFactory getContinuationFactory()
public void setContinuationFactory(FlowExecutionContinuationFactory continuationFactory)
public FlowExecution getFlowExecution(FlowExecutionKey key)
FlowExecutionRepository
FlowExecution
indexed by the provided key. The returned flow execution represents the
restored state of an executing flow from a point in time. This should be called to resume a persistent flow
execution.
Before calling this method, you should aquire the lock for the keyed flow execution.
getFlowExecution
in interface FlowExecutionRepository
getFlowExecution
in class AbstractConversationFlowExecutionRepository
key
- the flow execution key
public void putFlowExecution(FlowExecutionKey key, FlowExecution flowExecution)
FlowExecutionRepository
FlowExecution
in this repository under the provided key. This should be called to save
or update the persistent state of an active (but paused) flow execution.
Before calling this method, you should aquire the lock for the keyed flow execution.
putFlowExecution
in interface FlowExecutionRepository
putFlowExecution
in class AbstractConversationFlowExecutionRepository
key
- the flow execution keyflowExecution
- the flow executionprotected final java.io.Serializable generateContinuationId(FlowExecution flowExecution)
AbstractConversationFlowExecutionRepository
generateContinuationId
in class AbstractConversationFlowExecutionRepository
flowExecution
- the flow execution
protected final java.io.Serializable parseContinuationId(java.lang.String encodedId)
AbstractConversationFlowExecutionRepository
parseContinuationId
in class AbstractConversationFlowExecutionRepository
encodedId
- the string identifier
protected java.io.Serializable encode(FlowExecution flowExecution)
Subclasses can override this to change the encoding algorithm. This class just does a BASE64 encoding of the serialized flow execution.
flowExecution
- the flow execution instance
protected FlowExecutionContinuation decode(java.lang.String encodedContinuation)
Subclasses can override this to change the decoding algorithm. This class just does a BASE64
decoding and then deserializes the flow execution.
encodedContinuation
- the encoded flow execution data
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |