Interface CMSVersionSessionContextProvider

All Known Implementing Classes:
DefaultCMSVersionSessionContextProvider

public interface CMSVersionSessionContextProvider
Service to cache elements related to versioning in session.
  • Method Details

    • initCache

      default void initCache()
    • addGeneratedItemToCache

      void addGeneratedItemToCache(ItemModel itemModel, CMSVersionModel versionModel)
      Add an ItemModel to a cache of generated items and use CMSVersionModel as a key.
      Parameters:
      itemModel - the ItemModel to cache
      versionModel - the CMSVersionModel that represents a key.
    • getAllGeneratedItemsFromCached

      Map<CMSVersionModel,ItemModel> getAllGeneratedItemsFromCached()
      Return all generated cached ItemModel.
      Returns:
      the Map of key (CMSVersionModel) and value (ItemModel)
    • removeGeneratedItemFromCache

      void removeGeneratedItemFromCache(CMSVersionModel versionModel)
      Remove generated cached item based on CMSVersionModel.
      Parameters:
      versionModel - the CMSVersionModel to find a cached element.
    • removeAllGeneratedItemsFromCache

      void removeAllGeneratedItemsFromCache()
      Remove all generated items from cache.
    • addContentSlotForPageToCache

      void addContentSlotForPageToCache(ContentSlotForPageModel contentSlotForPageModel)
      Add a content slot for page to cache.
      Parameters:
      contentSlotForPageModel - the ContentSlotForPageModel to add.
    • getAllCachedContentSlotsForPage

      List<ContentSlotForPageModel> getAllCachedContentSlotsForPage()
      Return all cached content slots for page from cache.
      Returns:
      the List of ContentSlotForPageModel.
    • removeContentSlotForPageFromCache

      void removeContentSlotForPageFromCache(ContentSlotForPageModel contentSlotForPageModel)
      Remove a ContentSlotForPageModel from cache.
      Parameters:
      contentSlotForPageModel - the ContentSlotForPageModel to delete.
    • removeAllContentSlotsForPageFromCache

      void removeAllContentSlotsForPageFromCache()
      Remove all ContentSlotForPageModel from cache.
    • addUnsavedVersionedItemToCache

      void addUnsavedVersionedItemToCache(CMSVersionModel versionModel)
      Add an ItemModel to a cache of unsaved but versioned items and use CMSVersionModel as a key.
      Parameters:
      versionModel - the CMSVersionModel that represents a key.
    • getAllUnsavedVersionedItemsFromCached

      Set<CMSItemData> getAllUnsavedVersionedItemsFromCached()
      Return all cached unsaved versioned items CMSItemData.
      Returns:
      the set of CMSItemData
    • removeAllUnsavedVersionedItemsFromCache

      void removeAllUnsavedVersionedItemsFromCache()
      Removes all cached unsaved versioned items.
    • isPageVersionedInTransactionCached

      boolean isPageVersionedInTransactionCached()
      Checks if the AbstractPageModel associated to the transaction being processed has been added to the cache.
      Returns:
      true if the AbstractPageModel has already been added to the cache. false otherwise.
    • addPageVersionedInTransactionToCache

      void addPageVersionedInTransactionToCache(Optional<AbstractPageModel> abstractPageModel)
      Adds the AbstractPageModel associated to the transaction being processed to the cache.
      Parameters:
      abstractPageModel - - (optional) The AbstractPageModel to add to the cache.
    • getPageVersionedInTransactionFromCache

      Optional<AbstractPageModel> getPageVersionedInTransactionFromCache()
      Returns the AbstractPageModel associated to the transaction being processed from the cache.
      Returns:
      the optional AbstractPageModel versioned in the current transaction
    • removePageVersionedInTransactionFromCache

      void removePageVersionedInTransactionFromCache()
      Removes the AbstractPageModel associated to the transaction being processed from the cache.