Interface CustomizedChangeSummaryGroupRepository<D>
- All Superinterfaces:
com.broadleafcommerce.common.extension.DomainTypeAware
- All Known Subinterfaces:
ChangeSummaryGroupRepository<D>,JpaChangeSummaryGroupRepository<D>
- All Known Implementing Classes:
JpaCustomizedChangeSummaryGroupRepository
public interface CustomizedChangeSummaryGroupRepository<D>
extends com.broadleafcommerce.common.extension.DomainTypeAware
Additional persistence operations to perform on ChangeSummaryGroup repository domain.
- Author:
- Jeff Fischer
-
Method Summary
Modifier and TypeMethodDescriptionvoidarchiveChangeSummaryGroupsForSandbox(String sandboxId) Archives the group ofChangeSummaryfor the specified sandbox id.booleanbatchTransition(PromoteBatchFlushContext flushContext) Given aPromoteBatchFlushContextcontainingChangeSummaryGrouptransition information, update the state of the group, especially as it relates to transitionedChangeSummaryinstances.booleanbatchTransition(StateChangeOnlyBatchFlushContext flushContext) Given aStateChangeOnlyBatchFlushContextcontainingChangeSummaryGroupandChangeSummarystate change information, perform a batch update of the prescribed state.cleanupBatch(String startingId, boolean archive, List<ChangeStatusType> detectStatuses, List<ChangeState> detectStates, ChangeStatusType targetStatus, ChangeState targetState, List<ChangeStatusType> summaryDetectStatuses, List<ChangeState> summaryDetectStates, Object source) Check a bag of ChangeSummaryGroup entities for completion state.findChangeSummaryGroupByIdsCount(List<String> changeSummaryGroupIds, List<String> states, List<String> statuses, @NonNull String sandbox) Given a list ofChangeSummaryGroupids, find the count of groups that match the state requirements defined in the params.findChangeSummaryGroupsByIds(List<String> changeSummaryGroupIds) Find allChangeSummaryGroupinstances matching primarily a list of ids.findChangeSummaryGroupsByIds(List<String> changeSummaryGroupIds, String sandbox, List<String> whereStates, List<String> whereStatuses) Deprecated.findChangeSummaryGroupsByIds(List<String> changeSummaryGroupIds, String sandbox, List<String> whereStates, List<String> whereStatuses, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find allChangeSummaryGroupinstances matching primarily a list of ids.findChangeSummaryGroupsBySandbox(String sandbox, String state, List<String> status) Deprecated.since 1.3, replaced byfindChangeSummaryGroupsBySandbox(String, String, List, boolean, ContextInfo)findChangeSummaryGroupsBySandbox(String sandbox, String state, List<String> status, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find allChangeSummaryGroupinstances matching primarily the sandbox.readByIdAndArchivedNot(String id, boolean archived, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) TakesChangeSummaryGroup.getArchived()into account when retrieving a group with the given ID.org.springframework.data.domain.Page<D>readPageByStateAndSandboxAndArchivedNot(String state, String sandbox, Boolean archived, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable) Deprecated.org.springframework.data.domain.Page<D>readPageByStateAndSandboxAndArchivedNot(String state, String sandbox, Boolean archived, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve a page of records filtered by state and sandboxorg.springframework.data.domain.Page<D>readPageByStateAndSandboxAndAuthorAndArchivedNot(String state, String sandbox, String author, Boolean archived, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable) Deprecated.org.springframework.data.domain.Page<D>readPageByStateAndSandboxAndAuthorAndArchivedNot(String state, String sandbox, String author, Boolean archived, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve a page of records filtered by state, sandbox, and authorbooleanremoveFromAffectedVendors(String changeSummaryGroupId, String vendorRef) Atomically removes the givenvendorReffromChangeSummaryGroup.getAffectedVendorRefs()of the givenchangeSummaryGroupIdif present.booleanupdateVals(@NonNull String changeSummaryGroupId, List<String> whereStates, List<String> whereStatus, @NonNull Map<String, Object> vals, boolean enforceArchive) Update the fields for a record matching the idvoidupdateVals(@NonNull List<String> changeSummaryGroupIds, String whereState, List<String> whereStatus, @NonNull Map<String, Object> vals) Update the fields for multiple records matching the idsMethods inherited from interface com.broadleafcommerce.common.extension.DomainTypeAware
getDomainType
-
Method Details
-
readByIdAndArchivedNot
@Policy(operationTypes=READ) Optional<D> readByIdAndArchivedNot(String id, boolean archived, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) TakesChangeSummaryGroup.getArchived()into account when retrieving a group with the given ID.- Parameters:
id- ID of the group to retrievearchived-ChangeSummaryGroup.getArchived()value to not matchvendorNarrowing- whether or not to filter results based on the current authentication's vendor restrictions if vendor processing is enabledcontextInfo- context information about sandboxing and multitenant state- Returns:
- A
ChangeSummaryGroupmatching the given ID and not matching the given archived status
-
updateVals
@Policy(operationTypes=UPDATE) boolean updateVals(@NonNull @NonNull String changeSummaryGroupId, @Nullable List<String> whereStates, @Nullable List<String> whereStatus, @NonNull @NonNull Map<String, Object> vals, boolean enforceArchive) Update the fields for a record matching the id- Parameters:
changeSummaryGroupId- The id requested to mutatewhereStates- The list of validChangeStatevalues for whichChangeSummaryGroup.getState()should matchwhereStatus- The list ofChangeStatusTypevalues for whichChangeSummaryGroup.getStatus()should match one or more of. Can be empty to indicate no filtrationvals- Map of field to value changes to make to the ChangeSummaryGroup instanceenforceArchive- Whether archive status should be checked before updating- Returns:
- Whether or not an update was performed. If no record found matching the id and state, will return false.
- Throws:
IllegalArgumentException- if vals is empty
-
updateVals
@Policy(operationTypes=UPDATE) void updateVals(@NonNull @NonNull List<String> changeSummaryGroupIds, @Nullable String whereState, @Nullable List<String> whereStatus, @NonNull @NonNull Map<String, Object> vals) Update the fields for multiple records matching the ids- Parameters:
changeSummaryGroupIds- The ids requested to mutatewhereState- The validChangeStatevalue for whichChangeSummaryGroup.getState()should matchwhereStatus- The list ofChangeStatusTypevalues for whichChangeSummaryGroup.getStatus()should match one or more of. Can be empty to indicate no filtrationvals- Map of field to value changes to make to the ChangeSummaryGroup instance- Throws:
IllegalArgumentException- if vals is empty
-
batchTransition
Given aPromoteBatchFlushContextcontainingChangeSummaryGrouptransition information, update the state of the group, especially as it relates to transitionedChangeSummaryinstances.- Parameters:
flushContext- Context object containing the change summary group transition information to commit
-
batchTransition
@Policy(operationTypes=UPDATE) boolean batchTransition(StateChangeOnlyBatchFlushContext flushContext) Given aStateChangeOnlyBatchFlushContextcontainingChangeSummaryGroupandChangeSummarystate change information, perform a batch update of the prescribed state. This does not involved changes to notification states and does not result in state related to sending messages.- Parameters:
flushContext- Context containingChangeSummaryGroupandChangeSummarystate change information- Returns:
- Whether or not the transition was performed
-
findChangeSummaryGroupsBySandbox
@Deprecated @Policy(operationTypes=READ) Stream<D> findChangeSummaryGroupsBySandbox(String sandbox, String state, @Nullable List<String> status) Deprecated.since 1.3, replaced byfindChangeSummaryGroupsBySandbox(String, String, List, boolean, ContextInfo)Find allChangeSummaryGroupinstances matching primarily the sandbox.- Parameters:
sandbox- The sandbox for which theChangeSummaryGroup.getSandbox()should matchstate- TheChangeStatevalue for whichChangeSummaryGroup.getState()should matchstatus- The list ofChangeStatusTypevalues for whichChangeSummaryGroup.getStatus()should match one or more of. Can be empty- Returns:
- A Stream that can be iterated, possibly containing a large number of records or an empty stream if no matches
-
findChangeSummaryGroupsBySandbox
@Policy(operationTypes=READ) Stream<D> findChangeSummaryGroupsBySandbox(String sandbox, String state, @Nullable List<String> status, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find allChangeSummaryGroupinstances matching primarily the sandbox.- Parameters:
sandbox- The sandbox for which theChangeSummaryGroup.getSandbox()should matchstate- TheChangeStatevalue for whichChangeSummaryGroup.getState()should matchstatus- The list ofChangeStatusTypevalues for whichChangeSummaryGroup.getStatus()should match one or more of. Can be emptyvendorNarrowing- whether or not to filter results based on the current authentication's vendor restrictions if vendor processing is enabledcontextInfo- context information about sandboxing and multitenant state- Returns:
- A Stream that can be iterated, possibly containing a large number of records or an empty stream if no matches
-
findChangeSummaryGroupsByIds
@Deprecated @Policy(operationTypes=READ) Stream<D> findChangeSummaryGroupsByIds(List<String> changeSummaryGroupIds, String sandbox, List<String> whereStates, @Nullable List<String> whereStatuses) Deprecated.since 1.3, replaced byfindChangeSummaryGroupsByIds(List, String, List, List, boolean, ContextInfo)Find allChangeSummaryGroupinstances matching primarily a list of ids.- Parameters:
changeSummaryGroupIds- The list ofChangeSummaryGroup.getId()values to matchsandbox- The sandbox for which theChangeSummaryGroup.getSandbox()should matchwhereStates- TheChangeStatevalue for whichChangeSummaryGroup.getState()should match. Cannot be emptywhereStatuses- The list ofChangeStatusTypevalues for whichChangeSummaryGroup.getStatus()should match one of more of. Can be empty to indiciate no filtration- Returns:
- A Stream that can be iterated, possibly containing a large number of records or an empty stream if no matches
- Throws:
IllegalArgumentException- if nowhereStatesorchangeSummaryGroupIdsgiven
-
findChangeSummaryGroupsByIds
@Policy(operationTypes=READ) Stream<D> findChangeSummaryGroupsByIds(List<String> changeSummaryGroupIds, String sandbox, List<String> whereStates, @Nullable List<String> whereStatuses, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find allChangeSummaryGroupinstances matching primarily a list of ids.- Parameters:
changeSummaryGroupIds- The list ofChangeSummaryGroup.getId()values to matchsandbox- The sandbox for which theChangeSummaryGroup.getSandbox()should matchwhereStates- TheChangeStatevalue for whichChangeSummaryGroup.getState()should match. Cannot be emptywhereStatuses- The list ofChangeStatusTypevalues for whichChangeSummaryGroup.getStatus()should match one of more of. Can be empty to indiciate no filtrationvendorNarrowing- whether or not to filter results based on the current authentication's vendor restrictions if vendor processing is enabledcontextInfo- context information about sandboxing and multitenant state- Returns:
- A Stream that can be iterated, possibly containing a large number of records or an empty stream if no matches
- Throws:
IllegalArgumentException- if nowhereStatesorchangeSummaryGroupIdsgiven
-
findChangeSummaryGroupsByIds
@Policy(operationTypes=READ) Stream<D> findChangeSummaryGroupsByIds(List<String> changeSummaryGroupIds) Find allChangeSummaryGroupinstances matching primarily a list of ids.- Parameters:
changeSummaryGroupIds- The list ofChangeSummaryGroup.getId()values to match- Returns:
- A Stream that can be iterated, possibly containing a large number of records or an empty stream if no matches
- Throws:
IllegalArgumentException- if nochangeSummaryGroupIdsgiven
-
findChangeSummaryGroupByIdsCount
@Policy(operationTypes=READ) Long findChangeSummaryGroupByIdsCount(List<String> changeSummaryGroupIds, List<String> states, @Nullable List<String> statuses, @NonNull @NonNull String sandbox) Given a list ofChangeSummaryGroupids, find the count of groups that match the state requirements defined in the params.- Parameters:
changeSummaryGroupIds- The group ids to checkstates- TheChangeStatevalue for whichChangeSummaryGroup.getState()should match. Cannot be emptystatuses- he list ofChangeStatusTypevalues for whichChangeSummaryGroup.getStatus()should match one of more of. Can be empty to indicate no filtrationsandbox- The sandbox for which theChangeSummaryGroup.getSandbox()should match- Returns:
- The count of entities matching the requested params
-
readPageByStateAndSandboxAndArchivedNot
@Deprecated @Policy(operationTypes=READ) org.springframework.data.domain.Page<D> readPageByStateAndSandboxAndArchivedNot(String state, String sandbox, @Nullable Boolean archived, @Nullable cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable) Deprecated.Retrieve a page of records filtered by state and sandbox- Parameters:
state- TheChangeSummaryGroup.getState()value to filter results bysandbox- TheChangeSummaryGroup.getSandbox()()} value to filter results byarchived-ChangeSummaryGroup.getArchived()value to not matchfilters- the RSQLNodeused to restrict resultpageable- The page setup information- Returns:
- The page of records
-
readPageByStateAndSandboxAndArchivedNot
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> readPageByStateAndSandboxAndArchivedNot(String state, String sandbox, @Nullable Boolean archived, @Nullable cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve a page of records filtered by state and sandbox- Parameters:
state- TheChangeSummaryGroup.getState()value to filter results bysandbox- TheChangeSummaryGroup.getSandbox()()} value to filter results byarchived-ChangeSummaryGroup.getArchived()value to not matchfilters- the RSQLNodeused to restrict resultpageable- The page setup informationvendorNarrowing- whether or not to filter results based on the current authentication's vendor restrictions if vendor processing is enabledcontextInfo- context information about sandboxing and multitenant state- Returns:
- The page of records
-
readPageByStateAndSandboxAndAuthorAndArchivedNot
@Deprecated @Policy(operationTypes=READ) org.springframework.data.domain.Page<D> readPageByStateAndSandboxAndAuthorAndArchivedNot(String state, String sandbox, String author, @Nullable Boolean archived, @Nullable cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable) Deprecated.Retrieve a page of records filtered by state, sandbox, and author- Parameters:
state- TheChangeSummaryGroup.getState()value to filter results bysandbox- TheChangeSummaryGroup.getSandbox()value to filter results byauthor- TheChangeSummaryGroup.getAuthor()value to filter records byarchived-ChangeSummaryGroup.getArchived()value to not matchfilters- the RSQLNodeused to restrict resultpageable- The page setup information- Returns:
- The page of records
-
readPageByStateAndSandboxAndAuthorAndArchivedNot
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> readPageByStateAndSandboxAndAuthorAndArchivedNot(String state, String sandbox, String author, @Nullable Boolean archived, @Nullable cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve a page of records filtered by state, sandbox, and author- Parameters:
state- TheChangeSummaryGroup.getState()value to filter results bysandbox- TheChangeSummaryGroup.getSandbox()value to filter results byauthor- TheChangeSummaryGroup.getAuthor()value to filter records byarchived-ChangeSummaryGroup.getArchived()value to not matchfilters- the RSQLNodeused to restrict resultpageable- The page setup informationvendorNarrowing- whether or not to filter results based on the current authentication's vendor restrictions if vendor processing is enabledcontextInfo- context information about sandboxing and multitenant state- Returns:
- The page of records
-
archiveChangeSummaryGroupsForSandbox
Archives the group ofChangeSummaryfor the specified sandbox id.- Parameters:
sandboxId- the sandbox id associated to the change summary groups
-
removeFromAffectedVendors
@Policy(operationTypes=UPDATE) boolean removeFromAffectedVendors(String changeSummaryGroupId, String vendorRef) Atomically removes the givenvendorReffromChangeSummaryGroup.getAffectedVendorRefs()of the givenchangeSummaryGroupIdif present.- Parameters:
changeSummaryGroupId- the ID of the group to updatevendorRef- the vendor ref to remove fromChangeSummaryGroup.getAffectedVendorRefs()- Returns:
trueif the removal was successful,falseotherwise
-
cleanupBatch
@Policy(operationTypes=UPDATE) @Nullable String cleanupBatch(@Nullable String startingId, boolean archive, List<ChangeStatusType> detectStatuses, List<ChangeState> detectStates, ChangeStatusType targetStatus, ChangeState targetState, List<ChangeStatusType> summaryDetectStatuses, List<ChangeState> summaryDetectStates, Object source) Check a bag of ChangeSummaryGroup entities for completion state. If complete, update status and state.- Parameters:
startingId- The ChangeSummaryGroup entity id that represents the start of the collection of entities to check. The size of the collection is determined byCompletionCleanupProperties.getCleanupBatchSize().archive- Whether to archive the ChangeSummaryGroup upon completiondetectStatuses- The list of statuses to match. One of these statuses must match an entity status to be considered as part of the cleanup routine.detectStates- The list of states to match. One of these statuses must match an entity state to be considered as part of the cleanup routine.targetStatus- The status to set on one or more entities if determined to be completetargetState- The state to set on one or more entities if determined to be completesummaryDetectStatuses- The list of associated ChangeSummary statuses to NOT match. Associated ChangeSummary instances must not be in any of these statuses for the related ChangeDeploy to be considered complete.summaryDetectStates- The list of associated ChangeSummary states to NOT match. Associated ChangeSummary instances must not be in any of these states for the related ChangeDeploy to be considered complete.source- The specific cleanup service instance making the call- Returns:
- The last ChangeSummaryGroup entity id used as part of the executed batch. This value
is interesting to provide as the
startingIdfor 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.
-
findChangeSummaryGroupsByIds(List, String, List, List, boolean, ContextInfo)