Class JpaCustomizedSandboxRepository<D extends JpaSandbox>

java.lang.Object
com.broadleafcommerce.sandbox.provider.jpa.repository.trackable.JpaCustomizedSandboxRepository<D>
All Implemented Interfaces:
CustomizedSandboxRepository<D>

public class JpaCustomizedSandboxRepository<D extends JpaSandbox> extends Object implements CustomizedSandboxRepository<D>
Author:
Jeff Fischer
  • Constructor Details

    • JpaCustomizedSandboxRepository

      public JpaCustomizedSandboxRepository()
  • Method Details

    • setRepository

      @Autowired @Lazy public void setRepository(SandboxRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository)
    • createIfDoesNotExist

      @Nullable public D createIfDoesNotExist(@NonNull D sandbox, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CustomizedSandboxRepository
      Performs an atomic upsert, only creating the given sandbox if not already present.

      This differs from the normal save/create in that whether or not a new entity should be created is based on the Sandbox.getId() contextId} rather than the data-store ID.

      Specified by:
      createIfDoesNotExist in interface CustomizedSandboxRepository<D extends JpaSandbox>
      Parameters:
      sandbox - the sandbox to create
      contextInfo - context surrounding multitenant sate
      Returns:
      the sandbox if it was newly created, null otherwise
    • cleanupBatch

      public String cleanupBatch(@Nullable String startingId, Object source)
      Description copied from interface: CustomizedSandboxRepository
      Check a bag of Sandbox entities for completion state. If complete, archive. Only applies to temporary sandboxes. See Sandbox.isTemporarySandbox().
      Specified by:
      cleanupBatch in interface CustomizedSandboxRepository<D extends JpaSandbox>
      Parameters:
      startingId - The Sandbox entity id that represents the start of the collection of entities to check. The size of the collection is determined by CompletionCleanupProperties.getCleanupBatchSize().
      source - The specific cleanup service instance making the call
      Returns:
      The last Sandbox entity id used as part of the executed batch. This value is interesting to provide as the startingId for subsequent calls to this method when performing a paged style execution approach. May be null if no values were found, or if fewer than the configured batch size were found.
    • setJdbcTemplate

      @Autowired @Qualifier("summaryCompletionJdbcTemplate") public void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
    • setProperties

      @Autowired public void setProperties(CompletionCleanupProperties properties)
    • setSandboxService

      @Autowired @Lazy public void setSandboxService(SandboxService<Sandbox> sandboxService)
    • setEventPublisher

      @Autowired public void setEventPublisher(@Nullable org.springframework.context.ApplicationEventPublisher eventPublisher)