Class AbstractConsumerPersistenceManagerService<S extends Serializable>
java.lang.Object
org.gatein.pc.portlet.impl.state.consumer.AbstractConsumerPersistenceManagerService<S>
- All Implemented Interfaces:
ConsumerPersistenceManager<S>
- Direct Known Subclasses:
ConsumerPersistenceManagerService
public abstract class AbstractConsumerPersistenceManagerService<S extends Serializable>
extends Object
implements ConsumerPersistenceManager<S>
- Version:
- $Revision: 1.1 $
- Author:
- Julien Viet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateState(ConsumerState<S> state) Create the initial state.voiddestroyState(String stateId) Destroy the state.protected abstract ConsumerStateContext<S>intgetSize()Load the state.protected abstract voidput(String stateId, ConsumerStateContext<S> state) protected abstract voidprotected abstract intsize()voidupdateState(String stateId, ConsumerState<S> state) Update the state.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gatein.pc.portlet.state.consumer.ConsumerPersistenceManager
getStateType
-
Constructor Details
-
AbstractConsumerPersistenceManagerService
public AbstractConsumerPersistenceManagerService()
-
-
Method Details
-
get
-
put
-
remove
-
size
protected abstract int size() -
loadState
public ConsumerStateContext<S> loadState(String stateId) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException Description copied from interface:ConsumerPersistenceManagerLoad the state.- Specified by:
loadStatein interfaceConsumerPersistenceManager<S extends Serializable>- Parameters:
stateId- the state id- Returns:
- the value map or null if it does not exist
- Throws:
IllegalArgumentException- if the state id is nullNoSuchStateException- is the specified state does not existInvalidStateIdException- if the state id is not valid
-
createState
Description copied from interface:ConsumerPersistenceManagerCreate the initial state.- Specified by:
createStatein interfaceConsumerPersistenceManager<S extends Serializable>- Parameters:
state- the state- Returns:
- the id of the state created
- Throws:
IllegalArgumentException- if the portlet id is null
-
updateState
public void updateState(String stateId, ConsumerState<S> state) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException Description copied from interface:ConsumerPersistenceManagerUpdate the state.- Specified by:
updateStatein interfaceConsumerPersistenceManager<S extends Serializable>- Parameters:
stateId- the state idstate- the updated state- Throws:
IllegalArgumentException- if the state id is null or the values are nullNoSuchStateException- is the specified state does not existInvalidStateIdException- if the state id is not valid
-
destroyState
public void destroyState(String stateId) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException Description copied from interface:ConsumerPersistenceManagerDestroy the state.- Specified by:
destroyStatein interfaceConsumerPersistenceManager<S extends Serializable>- Parameters:
stateId- the state id- Throws:
IllegalArgumentException- if the state id is nullNoSuchStateException- is the specified state does not existInvalidStateIdException- if the state id is not valid
-
getSize
public int getSize()
-