HDIV API 2.0.4

org.hdiv.session
Class StateCache

java.lang.Object
  extended by org.hdiv.session.StateCache
All Implemented Interfaces:
java.io.Serializable, IStateCache

public class StateCache
extends java.lang.Object
implements IStateCache

It is composed by a data struture limited by a maximun size (maxSize). Map data struture is composed by elements of type IPage (all the possible requests generated in the request processing).

Author:
Roberto Velasco
See Also:
Serialized Form

Constructor Summary
StateCache()
           
 
Method Summary
 java.lang.String addPage(java.lang.String key)
          Adds a new page identifier to the map pageIds.
 java.lang.String cleanBuffer()
          If the map pageIds has reached its maximun size maxSize, the oldest page identifier in the map is deleted.
 int getMaxSize()
           
 java.util.List getPageIds()
           
 void init()
          pageIds map initialization
 void setMaxSize(int maxSize)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StateCache

public StateCache()
Method Detail

init

public void init()
pageIds map initialization


addPage

public java.lang.String addPage(java.lang.String key)
Adds a new page identifier to the map pageIds.

Specified by:
addPage in interface IStateCache
Returns:
If the map pageIds has reached its maximun size maxSize, the oldest page identifier is deleted. Otherwise, null will be returned.

cleanBuffer

public java.lang.String cleanBuffer()
If the map pageIds has reached its maximun size maxSize, the oldest page identifier in the map is deleted.

Returns:
Oldest page identifier in the map pageIds. Null in otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getMaxSize

public int getMaxSize()
Returns:
Returns the maxSize.

setMaxSize

public void setMaxSize(int maxSize)
Parameters:
maxSize - The maxSize to set.

getPageIds

public java.util.List getPageIds()
Specified by:
getPageIds in interface IStateCache
Returns:
the pageIds

HDIV 2.0.4

Copyright © 2008 hdiv.org. All Rights Reserved.