org.jboss.portal.portlet.impl.state.consumer
Class ConsumerPersistenceManagerService

java.lang.Object
  extended by org.jboss.portal.portlet.impl.state.consumer.ConsumerPersistenceManagerService
All Implemented Interfaces:
ConsumerPersistenceManager

public class ConsumerPersistenceManagerService
extends java.lang.Object
implements ConsumerPersistenceManager

Version:
$Revision: 1.1 $
Author:
Julien Viet

Constructor Summary
ConsumerPersistenceManagerService()
           
 
Method Summary
 java.lang.String createState(ConsumerState state)
          Create the initial state.
 void destroyState(java.lang.String stateId)
          Destroy the state.
 int getSize()
           
 ConsumerStateContext loadState(java.lang.String stateId)
          Load the state.
 void updateState(java.lang.String stateId, ConsumerState state)
          Update the state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsumerPersistenceManagerService

public ConsumerPersistenceManagerService()
Method Detail

loadState

public ConsumerStateContext loadState(java.lang.String stateId)
                               throws java.lang.IllegalArgumentException,
                                      NoSuchStateException,
                                      InvalidStateIdException
Description copied from interface: ConsumerPersistenceManager
Load the state.

Specified by:
loadState in interface ConsumerPersistenceManager
Parameters:
stateId - the state id
Returns:
the value map or null if it does not exist
Throws:
java.lang.IllegalArgumentException - if the state id is null
NoSuchStateException - is the specified state does not exist
InvalidStateIdException - if the state id is not valid

createState

public java.lang.String createState(ConsumerState state)
                             throws java.lang.IllegalArgumentException
Description copied from interface: ConsumerPersistenceManager
Create the initial state.

Specified by:
createState in interface ConsumerPersistenceManager
Returns:
the id of the state created
Throws:
java.lang.IllegalArgumentException - if the portlet id is null

updateState

public void updateState(java.lang.String stateId,
                        ConsumerState state)
                 throws java.lang.IllegalArgumentException,
                        NoSuchStateException,
                        InvalidStateIdException
Description copied from interface: ConsumerPersistenceManager
Update the state.

Specified by:
updateState in interface ConsumerPersistenceManager
state - the updated state
Throws:
java.lang.IllegalArgumentException - if the state id is null or the values are null
NoSuchStateException - is the specified state does not exist
InvalidStateIdException - if the state id is not valid

destroyState

public void destroyState(java.lang.String stateId)
                  throws java.lang.IllegalArgumentException,
                         NoSuchStateException,
                         InvalidStateIdException
Description copied from interface: ConsumerPersistenceManager
Destroy the state.

Specified by:
destroyState in interface ConsumerPersistenceManager
Throws:
java.lang.IllegalArgumentException - if the state id is null
NoSuchStateException - is the specified state does not exist
InvalidStateIdException - if the state id is not valid

getSize

public int getSize()