Package org.apache.wicket.pageStore.disk
Class PageWindowManager
java.lang.Object
org.apache.wicket.pageStore.disk.PageWindowManager
- All Implemented Interfaces:
Serializable
Manages positions and size of chunks of data in a file.
The data is stored inside the file in a cyclic way. Newer pages are placed after older ones, until the maximum file size is reached. After that, the next page is stored in the beginning of the file.
- Author:
- Matej Knopp
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Contains information about a page inside the file. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreatePageWindow
(int pageId, String pageType, int size) Creates and returns a new page window for given page.Returns last n saved page windows.getPageWindow
(int pageId) Returns the page window for given page or null if no window was found.int
Returns the size of all saved pagesvoid
removePage
(int pageId) Removes the page window for given page.
-
Constructor Details
-
PageWindowManager
Creates a new PageWindowManager.- Parameters:
maxSize
- maximum page size. After this size is exceeded, the pages will be saved starting at the beginning of file
-
-
Method Details
-
createPageWindow
Creates and returns a new page window for given page.- Parameters:
pageId
-pageType
-size
-- Returns:
- page window
-
getPageWindow
Returns the page window for given page or null if no window was found.- Parameters:
pageId
-- Returns:
- page window or null
-
removePage
Removes the page window for given page.- Parameters:
pageId
-
-
getFileWindows
Returns last n saved page windows.- Returns:
- list of page windows
-
getTotalSize
Returns the size of all saved pages- Returns:
- total size
-