Class CatalogFinder<P extends Catalog>

java.lang.Object
com.broadleafcommerce.data.tracking.core.policy.trackable.CatalogFinder<P>

public class CatalogFinder<P extends Catalog> extends Object
Utility class for fetching Catalog instances. Generally, the CommonCatalogService would serve this duty, but there are some circumstances where a separate, lightweight fetch mechanism is called for. Specifically, in DefaultTrackablePolicyUtils, there is a need to resolve catalog instances for tenant related security checks, but to inject CommonCatalogService there creates a circular dependency, since CommonCatalogService also requires PolicyUtils to secure its functions.

In addition, this utility class honors cases where tenancy is not active. In those cases, the CatalogFinder.CatalogResponse returned from method calls will indicate this via CatalogFinder.CatalogResponse.getTenantState(). Callers should check this result and gracefully ignore tenant related checks for catalog state when the tenant state returned is CatalogFinder.TenantState.NOT_AVAILABLE.

Author:
Jeff Fischer