public class ODFPageCache extends AbstractLogEnabled implements Serviceable, Contextualizable, Component
Modifier and Type | Class and Description |
---|---|
private static class |
ODFPageCache.LevelComparator |
Modifier and Type | Field and Description |
---|---|
private static String |
__ATT_CACHE_PREFIX |
private static String |
__ATT_CACHE_PROGRAM_PREFIX |
private static String |
__NO_FIRST_DATA_KEY |
private static String |
__NO_SECOND_DATA_KEY |
private AmetysObjectFactoryExtensionPoint |
_ametysObjectFactoryEP |
private Context |
_context |
private OdfPageHandler |
_odfPageHandler |
private WorkspaceSelector |
_workspaceSelector |
static String |
ROLE
Avalon role.
|
Constructor and Description |
---|
ODFPageCache() |
Modifier and Type | Method and Description |
---|---|
private Program |
_getProgramWithRestrictions(Page rootPage,
String level1,
String level2,
String programCode,
String programName) |
void |
clearCache(Page rootPage)
Clear page cache
|
void |
contextualize(Context context) |
(package private) Page |
getChildProgramPage(Page rootPage,
Page parentPage,
String level1,
String level2,
String path)
Get the child page from its relative path.
|
(package private) Program |
getProgram(Page rootPage,
String level1,
String level2,
String programCode,
String programName)
Get cached program
|
(package private) Map<String,Map<String,Collection<Program>>> |
getProgramCache(Page rootPage,
boolean computeIfNotPresent) |
(package private) Optional<Program> |
getProgramFromPageName(Page rootPage,
String level1,
String level2,
String pageName)
Get cached program corresponding to the page name
|
(package private) Optional<AmetysObjectIterable<Program>> |
getPrograms(Page rootPage,
String level1,
String level2,
boolean computeIfNotPresent)
Get programs to given levels
|
void |
service(ServiceManager manager) |
getLogger, setLogger
private static final String __NO_FIRST_DATA_KEY
private static final String __NO_SECOND_DATA_KEY
private static final String __ATT_CACHE_PREFIX
private static final String __ATT_CACHE_PROGRAM_PREFIX
private OdfPageHandler _odfPageHandler
private WorkspaceSelector _workspaceSelector
private AmetysObjectFactoryExtensionPoint _ametysObjectFactoryEP
public ODFPageCache()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
Map<String,Map<String,Collection<Program>>> getProgramCache(Page rootPage, boolean computeIfNotPresent)
Optional<AmetysObjectIterable<Program>> getPrograms(Page rootPage, String level1, String level2, boolean computeIfNotPresent)
rootPage
- The ODF root pagelevel1
- The value of first level or null
if there is no first levellevel2
- The value of second level or null
if there is no second levelcomputeIfNotPresent
- When false, no result will be returned if the root page in not already in the cachePage getChildProgramPage(Page rootPage, Page parentPage, String level1, String level2, String path) throws UnknownAmetysObjectException
rootPage
- The ODF root pageparentPage
- The parent pagelevel1
- The value of first level or null
if there is no first levellevel2
- The value of second level or null
if there is no second levelpath
- the path of the child pageUnknownAmetysObjectException
- if no child page was found at the given pathOptional<Program> getProgramFromPageName(Page rootPage, String level1, String level2, String pageName)
rootPage
- The ODF root pagelevel1
- The value of first level or null
if there is no first levellevel2
- The value of second level or null
if there is no second levelpageName
- the page's nameProgram getProgram(Page rootPage, String level1, String level2, String programCode, String programName)
rootPage
- The ODF root pagelevel1
- The value of first level or null
if there is no first levellevel2
- The value of second level or null
if there is no second levelprogramCode
- The code of program. Can be null if programName is not null.programName
- The name of program. Can be null if programCode is not null.private Program _getProgramWithRestrictions(Page rootPage, String level1, String level2, String programCode, String programName)
public void clearCache(Page rootPage)
rootPage
- The ODF root page