org.szegedi.spring.web.jsflow
Class ClientSideFlowStateStorage

java.lang.Object
  extended by org.szegedi.spring.web.jsflow.support.FlowStateSerializer
      extended by org.szegedi.spring.web.jsflow.support.AbstractFlowStateStorage
          extended by org.szegedi.spring.web.jsflow.ClientSideFlowStateStorage
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, FlowStateStorage

public class ClientSideFlowStateStorage
extends AbstractFlowStateStorage

An implementation of the flowstate storage that returns the BASE64-encoded serialized state as the ID. This way, the ID encapsulates the whole state, and the client will store it as part of the rendered HTML page, with no state whatsoever remaining on the server, allowing for truly massive scalability. Note however that in order to prevent the users from tampering with the flowstates while they are on the client side, or forging false flowstates, you should install at least a digital signature providing IntegrityCodec into this storage instance, although you can go for a full codec stack including compression, encryption, and digital signature by using a CompositeCodec (that you can further enhance with pooling).

Version:
$Id: ClientSideFlowStateStorage.java 10 2006-05-16 09:49:48Z szegedia $
Author:
Attila Szegedi

Nested Class Summary
 
Nested classes/interfaces inherited from class org.szegedi.spring.web.jsflow.support.FlowStateSerializer
FlowStateSerializer.StubProvider, FlowStateSerializer.StubResolver
 
Constructor Summary
ClientSideFlowStateStorage()
           
 
Method Summary
protected  byte[] getSerializedState(javax.servlet.http.HttpServletRequest request, java.lang.String id)
          Implement in subclasses to retrieve the serialized state.
protected  java.lang.String storeSerializedState(javax.servlet.http.HttpServletRequest request, byte[] state)
          Implement in subclasses to store the serialized state.
 
Methods inherited from class org.szegedi.spring.web.jsflow.support.AbstractFlowStateStorage
getState, setBinaryStateCodec, storeState
 
Methods inherited from class org.szegedi.spring.web.jsflow.support.FlowStateSerializer
afterPropertiesSet, deserializeContinuation, getScriptStorage, serializeContinuation, setApplicationContext, setScriptStorage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientSideFlowStateStorage

public ClientSideFlowStateStorage()
Method Detail

getSerializedState

protected byte[] getSerializedState(javax.servlet.http.HttpServletRequest request,
                                    java.lang.String id)
                             throws java.io.IOException
Description copied from class: AbstractFlowStateStorage
Implement in subclasses to retrieve the serialized state.

Specified by:
getSerializedState in class AbstractFlowStateStorage
Parameters:
request - the HTTP request that triggered the retrieval. Can be used to implement session-private storages for states.
id - the id of the state
Returns:
the byte array representing the serialized state
Throws:
java.io.IOException

storeSerializedState

protected java.lang.String storeSerializedState(javax.servlet.http.HttpServletRequest request,
                                                byte[] state)
Description copied from class: AbstractFlowStateStorage
Implement in subclasses to store the serialized state.

Specified by:
storeSerializedState in class AbstractFlowStateStorage
Parameters:
request - the HTTP request that triggered the store operation. Can be used to implement session-private storages for states.
state - byte array representing the serialized state
Returns:
the id of the state