org.apache.wicket.pageStore
Class DiskDataStore

java.lang.Object
  extended by org.apache.wicket.pageStore.DiskDataStore
All Implemented Interfaces:
IDataStore

public class DiskDataStore
extends Object
implements IDataStore

A data store implementation which stores the data on disk (in a file system)


Nested Class Summary
protected static class DiskDataStore.SessionEntry
           
 
Constructor Summary
DiskDataStore(String applicationName, File fileStoreFolder, int maxSizePerSession, int fileChannelPoolCapacity)
          Construct.
DiskDataStore(String applicationName, int maxSizePerSession, int fileChannelPoolCapacity)
          Construct.
 
Method Summary
 void destroy()
          Properly close the data store and possibly open resource handles
 byte[] getData(String sessionId, int id)
          Get data associated with the session id and page id.
protected  File getSessionFolder(String sessionId, boolean create)
          Returns the folder for the specified sessions.
 boolean isReplicated()
           
 void removeData(String sessionId)
          Remove all page data for the session id
 void removeData(String sessionId, int id)
          Remove all persisted data related to the session id and page id
 void storeData(String sessionId, int id, byte[] data)
          Store the page data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiskDataStore

public DiskDataStore(String applicationName,
                     File fileStoreFolder,
                     int maxSizePerSession,
                     int fileChannelPoolCapacity)
Construct.

Parameters:
applicationName -
fileStoreFolder -
maxSizePerSession -
fileChannelPoolCapacity -

DiskDataStore

public DiskDataStore(String applicationName,
                     int maxSizePerSession,
                     int fileChannelPoolCapacity)
Construct.

Parameters:
applicationName -
maxSizePerSession -
fileChannelPoolCapacity -
Method Detail

destroy

public void destroy()
Description copied from interface: IDataStore
Properly close the data store and possibly open resource handles

Specified by:
destroy in interface IDataStore
See Also:
IDataStore.destroy()

getData

public byte[] getData(String sessionId,
                      int id)
Description copied from interface: IDataStore
Get data associated with the session id and page id.

Specified by:
getData in interface IDataStore
Parameters:
sessionId - Session ID
id - Page ID
Returns:
All the page data persisted
See Also:
IDataStore.getData(java.lang.String, int)

isReplicated

public boolean isReplicated()
Specified by:
isReplicated in interface IDataStore
Returns:
See Also:
IDataStore.isReplicated()

removeData

public void removeData(String sessionId,
                       int id)
Description copied from interface: IDataStore
Remove all persisted data related to the session id and page id

Specified by:
removeData in interface IDataStore
Parameters:
sessionId - Session ID
id - Page ID
See Also:
IDataStore.removeData(java.lang.String, int)

removeData

public void removeData(String sessionId)
Description copied from interface: IDataStore
Remove all page data for the session id

Specified by:
removeData in interface IDataStore
Parameters:
sessionId - Session ID
See Also:
IDataStore.removeData(java.lang.String)

storeData

public void storeData(String sessionId,
                      int id,
                      byte[] data)
Description copied from interface: IDataStore
Store the page data

Specified by:
storeData in interface IDataStore
Parameters:
sessionId - Session ID
id - Page ID
data - Page data
See Also:
IDataStore.storeData(java.lang.String, int, byte[])

getSessionFolder

protected File getSessionFolder(String sessionId,
                                boolean create)
Returns the folder for the specified sessions. If the folder doesn't exist and the create flag is set, the folder will be created.

Parameters:
sessionId -
create -
Returns:
folder used to store session data


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.