Interface CMSVersionSessionContextProvider
- All Known Implementing Classes:
DefaultCMSVersionSessionContextProvider
public interface CMSVersionSessionContextProvider
Service to cache elements related to versioning in session.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddContentSlotForPageToCache(ContentSlotForPageModel contentSlotForPageModel) Add a content slot for page to cache.voidaddGeneratedItemToCache(ItemModel itemModel, CMSVersionModel versionModel) Add anItemModelto a cache of generated items and useCMSVersionModelas a key.voidaddPageVersionedInTransactionToCache(Optional<AbstractPageModel> abstractPageModel) Adds theAbstractPageModelassociated to the transaction being processed to the cache.voidaddUnsavedVersionedItemToCache(CMSVersionModel versionModel) Add anItemModelto a cache of unsaved but versioned items and useCMSVersionModelas a key.Return all cached content slots for page from cache.Return all generated cachedItemModel.Return all cached unsaved versioned itemsCMSItemData.Returns theAbstractPageModelassociated to the transaction being processed from the cache.default voidbooleanChecks if theAbstractPageModelassociated to the transaction being processed has been added to the cache.voidRemove allContentSlotForPageModelfrom cache.voidRemove all generated items from cache.voidRemoves all cached unsaved versioned items.voidremoveContentSlotForPageFromCache(ContentSlotForPageModel contentSlotForPageModel) Remove aContentSlotForPageModelfrom cache.voidremoveGeneratedItemFromCache(CMSVersionModel versionModel) Remove generated cached item based onCMSVersionModel.voidRemoves theAbstractPageModelassociated to the transaction being processed from the cache.
-
Method Details
-
initCache
default void initCache() -
addGeneratedItemToCache
Add anItemModelto a cache of generated items and useCMSVersionModelas a key.- Parameters:
itemModel- theItemModelto cacheversionModel- theCMSVersionModelthat represents a key.
-
getAllGeneratedItemsFromCached
Map<CMSVersionModel,ItemModel> getAllGeneratedItemsFromCached()Return all generated cachedItemModel.- Returns:
- the
Mapof key (CMSVersionModel) and value (ItemModel)
-
removeGeneratedItemFromCache
Remove generated cached item based onCMSVersionModel.- Parameters:
versionModel- theCMSVersionModelto find a cached element.
-
removeAllGeneratedItemsFromCache
void removeAllGeneratedItemsFromCache()Remove all generated items from cache. -
addContentSlotForPageToCache
Add a content slot for page to cache.- Parameters:
contentSlotForPageModel- theContentSlotForPageModelto add.
-
getAllCachedContentSlotsForPage
List<ContentSlotForPageModel> getAllCachedContentSlotsForPage()Return all cached content slots for page from cache.- Returns:
- the
ListofContentSlotForPageModel.
-
removeContentSlotForPageFromCache
Remove aContentSlotForPageModelfrom cache.- Parameters:
contentSlotForPageModel- theContentSlotForPageModelto delete.
-
removeAllContentSlotsForPageFromCache
void removeAllContentSlotsForPageFromCache()Remove allContentSlotForPageModelfrom cache. -
addUnsavedVersionedItemToCache
Add anItemModelto a cache of unsaved but versioned items and useCMSVersionModelas a key.- Parameters:
versionModel- theCMSVersionModelthat represents a key.
-
getAllUnsavedVersionedItemsFromCached
Set<CMSItemData> getAllUnsavedVersionedItemsFromCached()Return all cached unsaved versioned itemsCMSItemData.- Returns:
- the set of
CMSItemData
-
removeAllUnsavedVersionedItemsFromCache
void removeAllUnsavedVersionedItemsFromCache()Removes all cached unsaved versioned items. -
isPageVersionedInTransactionCached
boolean isPageVersionedInTransactionCached()Checks if theAbstractPageModelassociated to the transaction being processed has been added to the cache.- Returns:
- true if the
AbstractPageModelhas already been added to the cache. false otherwise.
-
addPageVersionedInTransactionToCache
Adds theAbstractPageModelassociated to the transaction being processed to the cache.- Parameters:
abstractPageModel- - (optional) TheAbstractPageModelto add to the cache.
-
getPageVersionedInTransactionFromCache
Optional<AbstractPageModel> getPageVersionedInTransactionFromCache()Returns theAbstractPageModelassociated to the transaction being processed from the cache.- Returns:
- the optional
AbstractPageModelversioned in the current transaction
-
removePageVersionedInTransactionFromCache
void removePageVersionedInTransactionFromCache()Removes theAbstractPageModelassociated to the transaction being processed from the cache.
-