Class DefaultCommonCatalogService<P extends Catalog>

    • Constructor Detail

    • Method Detail

      • readByContextId

        @Cacheable(value="trackingCacheByCatalogContextId",
                   keyGenerator="trackingCacheByCatalogContextId",
                   condition="@cacheStateManager.isEnabled(#root.caches, #root.args)")
        public P readByContextId​(@NonNull
                                 String contextId,
                                 ContextInfo context)
        Description copied from interface: CrudEntityService
        Read a single instance of an entity in the form of a business domain.
        Specified by:
        readByContextId in interface CrudEntityService<P extends Catalog>
        Overrides:
        readByContextId in class BaseCrudEntityService<P extends Catalog>
        Parameters:
        contextId - The context id for the entity. This is the id by which the business recognizes the item.
        context - Context information used to discriminate the correct version of an entity by context id when multiple verions may be available across sandboxes, catalogs and applications.
        Returns:
        The narrowed entity instance in the form of a business instance
      • readCatalogInheritanceGraph

        @Cacheable(value="trackingCacheByCatalogInheritanceGraph",
                   condition="@cacheStateManager.isEnabled(#root.caches, #root.args)")
        public InheritanceLines readCatalogInheritanceGraph​(@NonNull
                                                            List<org.springframework.data.util.Pair<String,​String>> catalogRefs)
        Description copied from interface: CommonCatalogService
        Given a list of catalog ids, find all parent catalog ids up the inheritance graph. This should demonstrate the full tree of catalogs up to the originating root nodes.
        Specified by:
        readCatalogInheritanceGraph in interface CommonCatalogService<P extends Catalog>
        Parameters:
        catalogRefs - A list of catalog ids and immediate assigned mutabilities (see MutabilityType).
        Returns:
        All parent catalog ids up the inheritance graph
      • readTopDownCatalogInheritanceGraph

        @Cacheable(value="trackingCacheByCatalogTopDownInheritance",
                   condition="@cacheStateManager.isEnabled(#root.caches, #root.args)")
        public InheritanceLines readTopDownCatalogInheritanceGraph​(@NonNull
                                                                   List<String> catalogRefs)
        Description copied from interface: CommonCatalogService
        Given a list of catalog ids, find all child catalog ids down the inheritance graph. This should demonstrate the full tree of catalogs down to leaf nodes.
        Specified by:
        readTopDownCatalogInheritanceGraph in interface CommonCatalogService<P extends Catalog>
        Parameters:
        catalogRefs - A list of catalog ids.
        Returns:
        All parent catalog ids up the inheritance graph
      • readCatalogChildren

        @Cacheable(value="trackingCacheByCatalogChildren",
                   condition="@cacheStateManager.isEnabled(#root.caches, #root.args)")
        public List<String> readCatalogChildren​(@NonNull
                                                String startingCatalogId)
        Description copied from interface: CommonCatalogService
        Find one level deep of child catalogs whose Catalog.getParents() includes this catalog.
        Specified by:
        readCatalogChildren in interface CommonCatalogService<P extends Catalog>
        Parameters:
        startingCatalogId - The parent catalog whose immediate children will be returned
        Returns:
        The immediate children
      • readApplicationOwnedInheritedCatalog

        @Nullable
        @Cacheable(value="trackingCacheByCatalogApplicationOwned",
                   condition="@cacheStateManager.isEnabled(#root.caches, #root.args)")
        public P readApplicationOwnedInheritedCatalog​(@NonNull
                                                      String startingCatalogId,
                                                      @NonNull
                                                      String applicationId)
        Description copied from interface: CommonCatalogService
        Find any application owned catalog that inherits from the starting catalog based on the requested application.
        Specified by:
        readApplicationOwnedInheritedCatalog in interface CommonCatalogService<P extends Catalog>
        Parameters:
        startingCatalogId - The ancestor catalog from which to check inheritance
        applicationId - The id of the application that should own the inherited catalog
        Returns:
        The id of the application owned catalog
      • readLevel

        @Cacheable(value="trackingCacheByCatalogLevel",
                   condition="@cacheStateManager.isEnabled(#root.caches, #root.args)")
        public Long readLevel​(@NonNull
                              String catalogContextId)
        Description copied from interface: CommonCatalogService
        Find the calculated sorting level for the given catalog
        Specified by:
        readLevel in interface CommonCatalogService<P extends Catalog>
        Parameters:
        catalogContextId - The contextId for the catalog
        Returns:
        The sorting level
      • readByVendorRefs

        public List<P> readByVendorRefs​(@NonNull
                                        @NonNull Set<String> vendorRefs,
                                        @Nullable
                                        ContextInfo contextInfo)
        Description copied from interface: CommonCatalogService
        Finds all catalogs associated to the given vendorRefs via Catalog.getVendorRef().
        Specified by:
        readByVendorRefs in interface CommonCatalogService<P extends Catalog>
        Parameters:
        vendorRefs - the set of vendor refs to find associated catalogs for. Must be non-empty.
        contextInfo - context information surrounding sandboxing and multitenant state
        Returns:
        all catalogs found for the given vendor refs
      • getCacheStateManager

        @Nullable
        protected com.broadleafcommerce.common.extension.cache.CacheStateManager getCacheStateManager()