Interface CustomizedSandboxRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
- All Known Subinterfaces:
JpaSandboxRepository<D>
,SandboxRepository<D>
- All Known Implementing Classes:
JpaCustomizedSandboxRepository
public interface CustomizedSandboxRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
Additional persistence operations to perform on the
Sandbox
repository domain.- Author:
- Samarth Dhruva (samarthd)
-
Method Summary
Modifier and TypeMethodDescriptioncleanupBatch
(String startingId, Object source) Check a bag of Sandbox entities for completion state.createIfDoesNotExist
(D sandbox, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Performs an atomic upsert, only creating the given sandbox if not already present.
-
Method Details
-
createIfDoesNotExist
@Nullable @Policy(operationTypes={UPDATE,CREATE,READ}, param=0) D createIfDoesNotExist(@NonNull D sandbox, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 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.- Parameters:
sandbox
- the sandbox to createcontextInfo
- context surrounding multitenant sate- Returns:
- the sandbox if it was newly created,
null
otherwise
-
cleanupBatch
@Nullable @Policy(operationTypes=UPDATE) String cleanupBatch(@Nullable String startingId, Object source) Check a bag of Sandbox entities for completion state. If complete, archive. Only applies to temporary sandboxes. SeeSandbox.isTemporarySandbox()
.- Parameters:
startingId
- The Sandbox entity id that represents the start of the collection of entities to check. The size of the collection is determined byCompletionCleanupProperties.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.
-