Class JpaImportVendorVisibilityHandler

java.lang.Object
com.broadleafcommerce.dataimport.provider.marketplace.vendor.JpaImportVendorVisibilityHandler
All Implemented Interfaces:
com.broadleafcommerce.common.extension.data.DataRoutePartitionAware, com.broadleafcommerce.data.tracking.core.marketplace.vendor.visibility.VendorVisibilityHandler, org.springframework.core.Ordered

public class JpaImportVendorVisibilityHandler extends Object implements com.broadleafcommerce.data.tracking.core.marketplace.vendor.visibility.VendorVisibilityHandler
Responsible for performing vendor-visibility operations on JpaImport entities.
  • Constructor Details

    • JpaImportVendorVisibilityHandler

      public JpaImportVendorVisibilityHandler()
  • Method Details

    • canHandle

      public boolean canHandle(Class<?> persistedDomainEntityType)
      Specified by:
      canHandle in interface com.broadleafcommerce.data.tracking.core.marketplace.vendor.visibility.VendorVisibilityHandler
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered
      Specified by:
      getOrder in interface com.broadleafcommerce.data.tracking.core.marketplace.vendor.visibility.VendorVisibilityHandler
    • getDataRoutePartition

      public String getDataRoutePartition()
      Specified by:
      getDataRoutePartition in interface com.broadleafcommerce.common.extension.data.DataRoutePartitionAware
    • isEntityMutableByVendorRestrictions

      public boolean isEntityMutableByVendorRestrictions(Object persistedDomainEntity, Set<String> restrictedVendorRefs, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      NOTE: Since imports are not Trackable, persistence-related operations on them don't accept a ContextInfo or perform extra policy validation. For this reason, this method doesn't actually get called in most situations and is only implemented here for completeness. Any validation that must be done should occur in ImportManager.initiateImport(ImportRequest, InputStreamSource, ContextInfo).
      Specified by:
      isEntityMutableByVendorRestrictions in interface com.broadleafcommerce.data.tracking.core.marketplace.vendor.visibility.VendorVisibilityHandler
      Parameters:
      persistedDomainEntity - the persisted-domain entity to validate mutability for. This is guaranteed to only be an entity for which canHandle(Class) returns true.
      restrictedVendorRefs - the "vendorRef" (typically a vendor ID or code) of all vendors that mutability should be restricted to. Will never be empty.
      contextInfo - context information surrounding sandboxing/multitenant state
      Returns:
      true if the entity is mutable by the given vendor restrictions, false otherwise
    • createVendorNarrowingFilter

      public String createVendorNarrowingFilter(Set<String> restrictedVendorRefs, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Specified by:
      createVendorNarrowingFilter in interface com.broadleafcommerce.data.tracking.core.marketplace.vendor.visibility.VendorVisibilityHandler
    • getAssociatedVendorRef

      @Nullable public String getAssociatedVendorRef(Object persistedDomainEntity, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Specified by:
      getAssociatedVendorRef in interface com.broadleafcommerce.data.tracking.core.marketplace.vendor.visibility.VendorVisibilityHandler