Package org.apache.wicket.pageStore.disk
Class PageWindowManager
- java.lang.Object
-
- org.apache.wicket.pageStore.disk.PageWindowManager
-
- All Implemented Interfaces:
java.io.Serializable
public class PageWindowManager extends java.lang.Object implements java.io.SerializableManages 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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPageWindowManager.FileWindowContains information about a page inside the file.
-
Constructor Summary
Constructors Constructor Description PageWindowManager(long maxSize)Creates a new PageWindowManager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PageWindowManager.FileWindowcreatePageWindow(int pageId, java.lang.String pageType, int size)Creates and returns a new page window for given page.java.util.List<PageWindowManager.FileWindow>getFileWindows()Returns last n saved page windows.PageWindowManager.FileWindowgetPageWindow(int pageId)Returns the page window for given page or null if no window was found.intgetTotalSize()Returns the size of all saved pagesvoidremovePage(int pageId)Removes the page window for given page.
-
-
-
Method Detail
-
createPageWindow
public PageWindowManager.FileWindow createPageWindow(int pageId, java.lang.String pageType, int size)
Creates and returns a new page window for given page.- Parameters:
pageId-type-size-- Returns:
- page window
-
getPageWindow
public PageWindowManager.FileWindow getPageWindow(int pageId)
Returns the page window for given page or null if no window was found.- Parameters:
pageId-- Returns:
- page window or null
-
removePage
public void removePage(int pageId)
Removes the page window for given page.- Parameters:
pageId-
-
getFileWindows
public java.util.List<PageWindowManager.FileWindow> getFileWindows()
Returns last n saved page windows.- Returns:
- list of page windows
-
getTotalSize
public int getTotalSize()
Returns the size of all saved pages- Returns:
- total size
-
-