Package org.apache.wicket.settings
Class StoreSettings
- java.lang.Object
-
- org.apache.wicket.settings.StoreSettings
-
public class StoreSettings extends Object
A class for settings related to the the storages where page instances are persisted, used byIPageStore
IPageManager
.For more information about page storages read Page Storage - Wiki page
- Since:
- 1.5
-
-
Constructor Summary
Constructors Constructor Description StoreSettings(Application application)
Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAsynchronousQueueCapacity()
Supplier<ICrypter>
getCrypter()
File
getFileStoreFolder()
Bytes
getMaxSizePerSession()
boolean
isAsynchronous()
boolean
isEncrypted()
StoreSettings
setAsynchronous(boolean async)
Sets a flag whether to wrap the configuredIPageStore
withAsynchronousPageStore
.StoreSettings
setAsynchronousQueueCapacity(int queueCapacity)
Sets the capacity of the queue used to store the pages which will be stored asynchronouslyStoreSettings
setCrypter(Supplier<ICrypter> crypter)
Sets the supplier for theICrypter
used by aCryptingPageStore
.StoreSettings
setEncrypted(boolean encrypted)
Sets a flag whether to wrap the configuredIPageStore
withCryptingPageStore
.StoreSettings
setFileStoreFolder(File fileStoreFolder)
Sets the folder whereDiskPageStore
will store the files with page instances per sessionStoreSettings
setMaxSizePerSession(Bytes maxSizePerSession)
Sets the maximum size of theFile
where page instances per session are stored.
-
-
-
Constructor Detail
-
StoreSettings
public StoreSettings(Application application)
Construct.- Parameters:
application
-
-
-
Method Detail
-
getMaxSizePerSession
public Bytes getMaxSizePerSession()
- Returns:
- maximum page size. After this size is exceeded,
the
DiskPageStore
will start saving the pages at the beginning of file.
-
setMaxSizePerSession
public StoreSettings setMaxSizePerSession(Bytes maxSizePerSession)
Sets the maximum size of theFile
where page instances per session are stored. After reaching this size theDiskPageStore
will start overriding the oldest pages at the beginning of the file.- Parameters:
maxSizePerSession
- the maximum size of the file where page instances are stored per session. In bytes.- Returns:
this
object for chaining
-
getFileStoreFolder
public File getFileStoreFolder()
- Returns:
- the location of the folder where
DiskPageStore
will store the files with page instances per session
-
setFileStoreFolder
public StoreSettings setFileStoreFolder(File fileStoreFolder)
Sets the folder whereDiskPageStore
will store the files with page instances per session- Parameters:
fileStoreFolder
- the new location- Returns:
this
object for chaining
-
getAsynchronousQueueCapacity
public int getAsynchronousQueueCapacity()
- Returns:
- the capacity of the queue used to store the pages which will be stored asynchronously
- See Also:
AsynchronousPageStore
-
setAsynchronousQueueCapacity
public StoreSettings setAsynchronousQueueCapacity(int queueCapacity)
Sets the capacity of the queue used to store the pages which will be stored asynchronously- Parameters:
queueCapacity
- the capacity of the queue- Returns:
this
object for chaining- See Also:
AsynchronousPageStore
-
setAsynchronous
public StoreSettings setAsynchronous(boolean async)
Sets a flag whether to wrap the configuredIPageStore
withAsynchronousPageStore
. By doing this the HTTP worker thread will not wait for the actual write of the page's bytes into the wrappedIPageStore
.- Parameters:
async
-true
to make it asynchronous,false
- otherwise- Returns:
this
object for chaining
-
isAsynchronous
public boolean isAsynchronous()
- Returns:
true
if the storing of page is asynchronous
-
setEncrypted
public StoreSettings setEncrypted(boolean encrypted)
Sets a flag whether to wrap the configuredIPageStore
withCryptingPageStore
.- Parameters:
encrypted
-true
to encrypt,false
- otherwise- Returns:
this
object for chaining
-
isEncrypted
public boolean isEncrypted()
- Returns:
true
if the storing of page is encrypted
-
setCrypter
public StoreSettings setCrypter(Supplier<ICrypter> crypter)
Sets the supplier for theICrypter
used by aCryptingPageStore
.- Parameters:
crypter
- The new supplier for anICrypter
.- Returns:
this
object for chaining
-
getCrypter
public Supplier<ICrypter> getCrypter()
- Returns:
- the supplier used to create a
ICrypter
for aCryptingPageStore
. The default isDefaultCrypter
.
-
-