Interface ChangeSummaryGroupService<P extends ChangeSummaryGroup>
- All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.MappableCrudEntityService<P>,com.broadleafcommerce.data.tracking.core.service.RsqlMappableCrudEntityService<P>
- All Known Implementing Classes:
DefaultChangeSummaryGroupService
public interface ChangeSummaryGroupService<P extends ChangeSummaryGroup>
extends com.broadleafcommerce.data.tracking.core.service.RsqlMappableCrudEntityService<P>
Service for working with
instances. Primarily involves CRUD operations
going through ChangeSummaryGroupRepository.- Author:
- Jeff Fischer
-
Method Summary
Modifier and TypeMethodDescriptionvoidarchiveChangeSummaryGroupsForSandbox(String sandboxId) Archives the group ofChangeSummaryfor the specified sandbox id.booleanbatchTransition(PromoteBatchFlushContext flushContext) Add all the members identified inSummaryBasedFlushContext.getSummaryUpdates()to theChangeSummaryGroup.getChangeSummaryIds()collection via theChangeSummaryGroupidentified inPromoteBatchFlushContext.getGroupUpdate().booleanbatchTransition(StateChangeOnlyBatchFlushContext flushContext) UpdateChangeSummaryGroupinstances in bulk (identified byPromoteBatchFlushContext.getGroupUpdate()) in order to mutate state (such asChangeSummaryGroup.getState()).TakesChangeSummaryGroup.getArchived()into account when retrieving a group with the given ID.readByIdAndNotArchived(String id, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) TakesChangeSummaryGroup.getArchived()into account when retrieving a group with the given ID.readChangeSummaryGroupByIdsCount(List<String> changeSummaryGroupIds, List<String> states, List<String> statuses, String sandbox) Given a list ofChangeSummaryGroupids, find the count of groups that match the state requirements defined in the params.org.springframework.data.domain.Page<P>readChangeSummaryGroups(String state, String sandbox, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable) Deprecated.org.springframework.data.domain.Page<P>readChangeSummaryGroups(String state, String sandbox, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find a page ofChangeSummaryGrouprecords based on the state and sandbox.readChangeSummaryGroupsByIds(List<String> changeSummaryGroupIds) Find allChangeSummaryGroupinstances matching primarily a list of ids.readChangeSummaryGroupsByIds(List<String> changeSummaryGroupIds, List<String> states, List<String> statuses, String sandbox) Find allChangeSummaryGroupinstances matching primarily a list of ids.readChangeSummaryGroupsByIds(List<String> changeSummaryGroupIds, List<String> states, List<String> statuses, String sandbox, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find allChangeSummaryGroupinstances matching primarily a list of ids.readChangeSummaryGroupsBySandbox(String sandbox, String state, List<String> status) Deprecated.since 1.3, replaced byreadChangeSummaryGroupsBySandbox(String, String, List, boolean, ContextInfo)readChangeSummaryGroupsBySandbox(String sandbox, String state, List<String> status, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find allChangeSummaryGroupinstances matching primarily the sandbox.org.springframework.data.domain.Page<P>readChangeSummaryGroupsForUser(String state, String sandbox, String author, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable) Deprecated.since 1.3, replaced byreadChangeSummaryGroupsForUser(String, String, String, Node, Pageable, boolean, ContextInfo)org.springframework.data.domain.Page<P>readChangeSummaryGroupsForUser(String state, String sandbox, String author, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find a page ofChangeSummaryGrouprecords based on the state and sandbox.booleanremoveFromAffectedVendors(String changeSummaryGroupId, String vendorRef) Atomically removes the givenvendorReffromChangeSummaryGroup.getAffectedVendorRefs()of the givenchangeSummaryGroupIdif present.booleanupdateVals(String changeSummaryGroupId, List<String> whereStates, List<String> whereStatus, Map<String, Object> vals, boolean enforceArchive) Update the fields for a record matching the idMethods inherited from interface com.broadleafcommerce.data.tracking.core.service.MappableCrudEntityService
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByIds, readById, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccessMethods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlMappableCrudEntityService
readAll, readAll, readAll, readAll
-
Method Details
-
readByIdAndNotArchived
TakesChangeSummaryGroup.getArchived()into account when retrieving a group with the given ID.- Parameters:
id- ID of the group to retrieve- Returns:
- A
ChangeSummaryGroupmatching the given ID and not archived
-
readByIdAndNotArchived
P readByIdAndNotArchived(@NonNull String id, 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 retrievevendorNarrowing- 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 archived
-
readChangeSummaryGroups
@Deprecated org.springframework.data.domain.Page<P> readChangeSummaryGroups(@NonNull String state, @NonNull String sandbox, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable pageable) Deprecated.since 1.3, replaced byreadChangeSummaryGroups(String, String, Node, Pageable, boolean, ContextInfo)Find a page ofChangeSummaryGrouprecords based on the state and sandbox. This primarily drives visibility of state related toChangeState.PROMOTEDandChangeState.APPROVED. However, other states are possible and can be retrieved here as well.- Parameters:
state-ChangeSummaryGroup.getState()sandbox-ChangeSummaryGroup.getSandbox()filters- the RSQLNodeused to restrict resultpageable- Page setup information- Returns:
- page of matching records
-
readChangeSummaryGroups
org.springframework.data.domain.Page<P> readChangeSummaryGroups(@NonNull String state, @NonNull String sandbox, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable pageable, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find a page ofChangeSummaryGrouprecords based on the state and sandbox. This primarily drives visibility of state related toChangeState.PROMOTEDandChangeState.APPROVED. However, other states are possible and can be retrieved here as well.- Parameters:
state-ChangeSummaryGroup.getState()sandbox-ChangeSummaryGroup.getSandbox()filters- the RSQLNodeused to restrict resultpageable- 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:
- page of matching records
-
readChangeSummaryGroupsForUser
@Deprecated org.springframework.data.domain.Page<P> readChangeSummaryGroupsForUser(@NonNull String state, @NonNull String sandbox, @Nullable String author, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable pageable) Deprecated.since 1.3, replaced byreadChangeSummaryGroupsForUser(String, String, String, Node, Pageable, boolean, ContextInfo)Find a page ofChangeSummaryGrouprecords based on the state and sandbox. This primarily drives visibility of state related toChangeState.PROMOTEDfor a specific author.- Parameters:
state- TheChangeStatevalue for whichChangeSummaryGroup.getState()should matchsandbox-ChangeSummaryGroup.getSandbox()author-ChangeSummaryGroup.getAuthor()filters- the RSQLNodeused to restrict resultpageable- Page setup information- Returns:
- page of matching records
-
readChangeSummaryGroupsForUser
org.springframework.data.domain.Page<P> readChangeSummaryGroupsForUser(@NonNull String state, @NonNull String sandbox, @Nullable String author, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable pageable, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find a page ofChangeSummaryGrouprecords based on the state and sandbox. This primarily drives visibility of state related toChangeState.PROMOTEDfor a specific author.- Parameters:
state- TheChangeStatevalue for whichChangeSummaryGroup.getState()should matchsandbox-ChangeSummaryGroup.getSandbox()author-ChangeSummaryGroup.getAuthor()filters- the RSQLNodeused to restrict resultpageable- 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:
- page of matching records
-
readChangeSummaryGroupsBySandbox
@Deprecated Stream<P> readChangeSummaryGroupsBySandbox(@NonNull String sandbox, @NonNull String state, List<String> status) Deprecated.since 1.3, replaced byreadChangeSummaryGroupsBySandbox(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 or records
-
readChangeSummaryGroupsBySandbox
Stream<P> readChangeSummaryGroupsBySandbox(@NonNull String sandbox, @NonNull String state, 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 or records
-
readChangeSummaryGroupsByIds
Stream<P> readChangeSummaryGroupsByIds(List<String> changeSummaryGroupIds, List<String> states, List<String> statuses, @NonNull String sandbox) Find allChangeSummaryGroupinstances matching primarily a list of ids.- Parameters:
changeSummaryGroupIds- The list ofChangeSummaryGroup.getId()values to matchstates- TheChangeStatevalues for whichChangeSummaryGroup.getState()should matchstatuses- The list ofChangeStatusTypevalues for whichChangeSummaryGroup.getStatus()should match one of more of. Can be emptysandbox- The sandbox for which theChangeSummaryGroup.getSandbox()should match- Returns:
- A Stream that can be iterated, possibly containing a large number or records
-
readChangeSummaryGroupsByIds
Stream<P> readChangeSummaryGroupsByIds(List<String> changeSummaryGroupIds, List<String> states, List<String> statuses, @NonNull String sandbox, 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 matchstates- TheChangeStatevalues for whichChangeSummaryGroup.getState()should matchstatuses- The list ofChangeStatusTypevalues for whichChangeSummaryGroup.getStatus()should match one of more of. Can be emptysandbox- The sandbox for which theChangeSummaryGroup.getSandbox()should 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 Stream that can be iterated, possibly containing a large number or records
-
readChangeSummaryGroupsByIds
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 or records
-
readChangeSummaryGroupByIdsCount
Long readChangeSummaryGroupByIdsCount(@NonNull 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.- Parameters:
changeSummaryGroupIds- The group ids to checkstates- TheChangeStatevalue for whichChangeSummaryGroup.getState()should match. Cannot be emptystatuses- The 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
-
updateVals
boolean updateVals(@NonNull String changeSummaryGroupId, List<String> whereStates, List<String> whereStatus, Map<String, Object> vals, boolean enforceArchive) Update the fields for a record matching the id- Parameters:
changeSummaryGroupId- The id requested to mutatewhereStates- all validChangeStatevalues for whichChangeSummaryGroup.getState()should matchwhereStatus- The list ofChangeStatusTypevalues for whichChangeSummaryGroup.getStatus()should match one or more of. Can be emptyvals- 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.
-
batchTransition
Add all the members identified inSummaryBasedFlushContext.getSummaryUpdates()to theChangeSummaryGroup.getChangeSummaryIds()collection via theChangeSummaryGroupidentified inPromoteBatchFlushContext.getGroupUpdate().- Parameters:
flushContext- Context object containing the change summary list to add to the group
-
batchTransition
UpdateChangeSummaryGroupinstances in bulk (identified byPromoteBatchFlushContext.getGroupUpdate()) in order to mutate state (such asChangeSummaryGroup.getState()).- Parameters:
flushContext- Context object containing the change summary group transition information to commit
-
archiveChangeSummaryGroupsForSandbox
@Transactional("sandboxTransactionManager") void archiveChangeSummaryGroupsForSandbox(String sandboxId) Archives the group ofChangeSummaryfor the specified sandbox id.- Parameters:
sandboxId- the sandbox id associated to the change summary groups
-
removeFromAffectedVendors
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
-
readChangeSummaryGroups(String, String, Node, Pageable, boolean, ContextInfo)