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 TypeMethodDescriptionvoid
archiveChangeSummaryGroupsForSandbox
(String sandboxId) Archives the group ofChangeSummary
for the specified sandbox id.boolean
batchTransition
(PromoteBatchFlushContext flushContext) Add all the members identified inSummaryBasedFlushContext.getSummaryUpdates()
to theChangeSummaryGroup.getChangeSummaryIds()
collection via theChangeSummaryGroup
identified inPromoteBatchFlushContext.getGroupUpdate()
.boolean
batchTransition
(StateChangeOnlyBatchFlushContext flushContext) UpdateChangeSummaryGroup
instances 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 ofChangeSummaryGroup
ids, 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 ofChangeSummaryGroup
records based on the state and sandbox.readChangeSummaryGroupsByIds
(List<String> changeSummaryGroupIds) Find allChangeSummaryGroup
instances matching primarily a list of ids.readChangeSummaryGroupsByIds
(List<String> changeSummaryGroupIds, List<String> states, List<String> statuses, String sandbox) Find allChangeSummaryGroup
instances 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 allChangeSummaryGroup
instances 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 allChangeSummaryGroup
instances 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 ofChangeSummaryGroup
records based on the state and sandbox.boolean
removeFromAffectedVendors
(String changeSummaryGroupId, String vendorRef) Atomically removes the givenvendorRef
fromChangeSummaryGroup.getAffectedVendorRefs()
of the givenchangeSummaryGroupId
if present.boolean
updateVals
(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, updateAllAllowingPartialSuccess
Methods 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
ChangeSummaryGroup
matching 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
ChangeSummaryGroup
matching 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 ofChangeSummaryGroup
records based on the state and sandbox. This primarily drives visibility of state related toChangeState.PROMOTED
andChangeState.APPROVED
. However, other states are possible and can be retrieved here as well.- Parameters:
state
-ChangeSummaryGroup.getState()
sandbox
-ChangeSummaryGroup.getSandbox()
filters
- the RSQLNode
used 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 ofChangeSummaryGroup
records based on the state and sandbox. This primarily drives visibility of state related toChangeState.PROMOTED
andChangeState.APPROVED
. However, other states are possible and can be retrieved here as well.- Parameters:
state
-ChangeSummaryGroup.getState()
sandbox
-ChangeSummaryGroup.getSandbox()
filters
- the RSQLNode
used 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 ofChangeSummaryGroup
records based on the state and sandbox. This primarily drives visibility of state related toChangeState.PROMOTED
for a specific author.- Parameters:
state
- TheChangeState
value for whichChangeSummaryGroup.getState()
should matchsandbox
-ChangeSummaryGroup.getSandbox()
author
-ChangeSummaryGroup.getAuthor()
filters
- the RSQLNode
used 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 ofChangeSummaryGroup
records based on the state and sandbox. This primarily drives visibility of state related toChangeState.PROMOTED
for a specific author.- Parameters:
state
- TheChangeState
value for whichChangeSummaryGroup.getState()
should matchsandbox
-ChangeSummaryGroup.getSandbox()
author
-ChangeSummaryGroup.getAuthor()
filters
- the RSQLNode
used 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 allChangeSummaryGroup
instances matching primarily the sandbox.- Parameters:
sandbox
- The sandbox for which theChangeSummaryGroup.getSandbox()
should matchstate
- TheChangeState
value for whichChangeSummaryGroup.getState()
should matchstatus
- The list ofChangeStatusType
values 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 allChangeSummaryGroup
instances matching primarily the sandbox.- Parameters:
sandbox
- The sandbox for which theChangeSummaryGroup.getSandbox()
should matchstate
- TheChangeState
value for whichChangeSummaryGroup.getState()
should matchstatus
- The list ofChangeStatusType
values 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 allChangeSummaryGroup
instances matching primarily a list of ids.- Parameters:
changeSummaryGroupIds
- The list ofChangeSummaryGroup.getId()
values to matchstates
- TheChangeState
values for whichChangeSummaryGroup.getState()
should matchstatuses
- The list ofChangeStatusType
values 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 allChangeSummaryGroup
instances matching primarily a list of ids.- Parameters:
changeSummaryGroupIds
- The list ofChangeSummaryGroup.getId()
values to matchstates
- TheChangeState
values for whichChangeSummaryGroup.getState()
should matchstatuses
- The list ofChangeStatusType
values 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 allChangeSummaryGroup
instances 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 ofChangeSummaryGroup
ids, find the count of groups that match the state requirements defined in the params.- Parameters:
changeSummaryGroupIds
- The group ids to checkstates
- TheChangeState
value for whichChangeSummaryGroup.getState()
should match. Cannot be emptystatuses
- The list ofChangeStatusType
values 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 validChangeState
values for whichChangeSummaryGroup.getState()
should matchwhereStatus
- The list ofChangeStatusType
values 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 theChangeSummaryGroup
identified inPromoteBatchFlushContext.getGroupUpdate()
.- Parameters:
flushContext
- Context object containing the change summary list to add to the group
-
batchTransition
UpdateChangeSummaryGroup
instances 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 ofChangeSummary
for the specified sandbox id.- Parameters:
sandboxId
- the sandbox id associated to the change summary groups
-
removeFromAffectedVendors
Atomically removes the givenvendorRef
fromChangeSummaryGroup.getAffectedVendorRefs()
of the givenchangeSummaryGroupId
if present.- Parameters:
changeSummaryGroupId
- the ID of the group to updatevendorRef
- the vendor ref to remove fromChangeSummaryGroup.getAffectedVendorRefs()
- Returns:
true
if the removal was successful,false
otherwise
-
readChangeSummaryGroups(String, String, Node, Pageable, boolean, ContextInfo)