|
|||||||||
| 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.
This class depends on the Jakarta Commons Codec library to do
BASE64 encoding. Codec code must be available in the classpath
when using this implementation.
Base64| 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 restorer
public ClientContinuationFlowExecutionRepository(FlowExecutionStateRestorer executionStateRestorer,
ConversationManager conversationManager)
executionStateRestorer - the transient flow execution state restorerconversationManager - the conversation manager for managing centralized conversational state| Method Detail |
|---|
protected FlowExecutionContinuationFactory getContinuationFactory()
public void setContinuationFactory(FlowExecutionContinuationFactory continuationFactory)
public FlowExecution getFlowExecution(FlowExecutionKey key)
FlowExecutionRepositoryFlowExecution 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.
getFlowExecution in interface FlowExecutionRepositorygetFlowExecution in class AbstractConversationFlowExecutionRepositorykey - the flow execution key
public void putFlowExecution(FlowExecutionKey key,
FlowExecution flowExecution)
FlowExecutionRepositoryFlowExecution 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.
putFlowExecution in interface FlowExecutionRepositoryputFlowExecution in class AbstractConversationFlowExecutionRepositorykey - the flow execution keyflowExecution - the flow executionprotected final java.io.Serializable generateContinuationId(FlowExecution flowExecution)
AbstractConversationFlowExecutionRepository
generateContinuationId in class AbstractConversationFlowExecutionRepositoryflowExecution - the flow execution
protected final java.io.Serializable parseContinuationId(java.lang.String encodedId)
AbstractConversationFlowExecutionRepository
parseContinuationId in class AbstractConversationFlowExecutionRepositoryencodedId - 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 | ||||||||