Class DefaultChangeSummaryService<P extends ChangeSummary,D>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseMappableCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlMappableCrudEntityService<P>
com.broadleafcommerce.sandbox.service.DefaultChangeSummaryService<P,D>
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.MappableCrudEntityService<P>
,com.broadleafcommerce.data.tracking.core.service.RsqlMappableCrudEntityService<P>
,ChangeSummaryService<P>
public class DefaultChangeSummaryService<P extends ChangeSummary,D>
extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlMappableCrudEntityService<P>
implements ChangeSummaryService<P>
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultChangeSummaryService
(ChangeSummaryRepository<D> repository, com.broadleafcommerce.data.tracking.core.service.RsqlMappableCrudEntityHelper helper, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
archiveNotActiveChangeSummariesForSandbox
(String sandboxId) Archives theChangeSummary
for the specified sandbox id.void
batchTransition
(StateChangeOnlyBatchFlushContext flushContext) UpdateChangeSummary
instances in bulk (identified bySummaryBasedFlushContext.getSummaryUpdates()
) in order to mutate state (such asChangeSummary.getState()
).void
batchTransition
(SummaryBasedFlushContext flushContext) Given aPromoteBatchFlushContext
containingChangeSummary
transition information, update the state of all change summaries in a batch transaction.boolean
changesOwnedByAuthor
(String author, List<String> changeSummaryIds) Whether or not all the ChangeSummary instances identified by the changeSummaryIds are owned by the requesting author.convertToPersistedDomain
(List<P> summaries) findArchivedBySandbox
(String sandboxId) Find all archivedChangeSummary
for the provided sandbox id.findCompletedTempSandboxByExample
(String changeSummaryId) Based on the example change summary id, check if the change summary refers to a temporary sandbox.protected ChangeSummaryRepository<D>
protected com.broadleafcommerce.common.extension.TypeFactory
protected void
processDivergence
(List<P> summaries) org.springframework.data.domain.Page<P>
readAllByAuthorAndSandbox
(String author, String sandbox, String[] statuses, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page) Find allChangeSummaries
for the provided author and sandbox.org.springframework.data.domain.Page<P>
readAllByAuthorAndSandbox
(String author, String sandbox, String[] statuses, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find allChangeSummaries
for the provided author and sandbox.org.springframework.data.domain.Page<P>
readAllByAuthorAndSandboxWithDivergenceDetection
(String author, String sandbox, String[] statuses, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page) Deprecated.org.springframework.data.domain.Page<P>
readAllByAuthorAndSandboxWithDivergenceDetection
(String author, String sandbox, String[] statuses, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find allChangeSummaries
for the provided author and sandbox.readAllByChangeInfoRequest
(ChangeInfoRequest changeInfoRequest) RetrievesChangeSummaries
for bothChangeState.USER
andChangeState.PROMOTED
states against the providedChangeInfoRequest
.readAllByChangeInfoRequest
(ChangeInfoRequest changeInfoRequest, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) RetrievesChangeSummaries
for bothChangeState.USER
andChangeState.PROMOTED
states against the providedChangeInfoRequest
.TakesChangeSummary.getArchived()
into account when retrieving a summary with the given ID.readByIdAndNotArchived
(String id, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) TakesChangeSummary.getArchived()
into account when retrieving a summary with the given ID.Deprecated.readByIdAndNotArchivedWithDivergenceDetection
(String id, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) TakesChangeSummary.getArchived()
into account when retrieving a summary with the given ID.Deprecated.readChangeSummariesByAuthor
(String author, String sandbox, String state, List<String> status, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all records belonging to the current author, sandbox andChangeState
readChangeSummariesByAuthor
(String author, String sandbox, String state, List<String> status, List<String> ids) Deprecated.readChangeSummariesByAuthor
(String author, String sandbox, String state, List<String> status, List<String> ids, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all records belonging to the current author, sandbox andChangeState
readChangeSummariesByIds
(List<String> changeSummaryIds) Deprecated.readChangeSummariesByIds
(List<String> changeSummaryIds, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all records for the provided list of ids.readChangeSummariesByIds
(List<String> changeSummaryIds, List<String> states, List<String> status, String sandbox) Find all records in the list of ids that also have the requested state.readChangeSummariesByIds
(List<String> changeSummaryIds, List<String> states, List<String> status, String sandbox, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all records in the list of ids that also have the requested state.readChangeSummariesByIdsCount
(List<String> changeSummaryIds, List<String> states, List<String> status, String sandbox) Find the count of all records in the list of ids that also have the requested state.readChangeSummary
(@NonNull ChangeSummaryRequest changeSummaryRequest) Find an existing record with the corresponding matching values that determine uniqueness.Find all record ids belonging to the current author, sandbox andChangeState
readDeployFailedChangeSummaries
(String deployId, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all records marked with statusERROR_DEPLOY
for the requesteddeployId
.readDivergedChangeSummariesByAuthor
(String author, String sandbox) Find all records belonging to the current author and sandbox containing one or moreChangeDetail
values which has become diverged due to another change already promoted by another user.readDivergedChangeSummariesByIds
(List<String> changeSummaryIds, String sandbox) Find all identified records belonging to the current sandbox containing one or moreChangeDetail
values which has become diverged due to another change already promoted by another user.readMatchingChangeSummary
(P changeSummary) Find a matching change summary using the provided instance.readSandboxChangeSummaries
(ChangeInfoRequest changeInfoRequest) Deprecated.readSandboxChangeSummaries
(ChangeInfoRequest changeInfoRequest, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find allChangeSummaries
with corresponding matching values to the providedChangeInfoRequest
that are in theChangeState.PROMOTED
,ChangeState.APPROVED
, orChangeState.SCHEDULED
state.readUserChangeSummaries
(ChangeInfoRequest changeInfoRequest, boolean scheduled) Deprecated.readUserChangeSummaries
(ChangeInfoRequest changeInfoRequest, boolean scheduled, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) boolean
updateVals
(String changeSummaryId, List<String> whereState, List<String> whereStatus, String messageType, Map<String, Object> vals) Update the fields for a record matching the idboolean
updateVals
(String changeSummaryId, List<String> whereState, List<String> whereStatus, String messageType, Map<String, Object> vals, boolean insertNotificationStateIfMissing) Update the fields for a record matching the idvoid
updateVals
(List<String> changeSummaryIds, String whereState, List<String> whereStatus, Map<String, Object> vals) Update the fields for all non-archived records matching the idsMethods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlMappableCrudEntityService
getRsqlHelper, readAll, readAll, readAll, readAll
Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseMappableCrudEntityService
convertFromPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, readAll, readAll, readAll, readAllByIds, readById, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
-
Constructor Details
-
DefaultChangeSummaryService
public DefaultChangeSummaryService(ChangeSummaryRepository<D> repository, com.broadleafcommerce.data.tracking.core.service.RsqlMappableCrudEntityHelper helper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
readByIdAndNotArchived
Description copied from interface:ChangeSummaryService
TakesChangeSummary.getArchived()
into account when retrieving a summary with the given ID.- Specified by:
readByIdAndNotArchived
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
id
- ID of the summary to retrieve- Returns:
- A
ChangeSummary
matching the given ID and not archived
-
readByIdAndNotArchived
public P readByIdAndNotArchived(@NonNull String id, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ChangeSummaryService
TakesChangeSummary.getArchived()
into account when retrieving a summary with the given ID.- Specified by:
readByIdAndNotArchived
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
id
- ID of the summary 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
ChangeSummary
matching the given ID and not archived
-
readByIdAndNotArchivedWithDivergenceDetection
Deprecated.Description copied from interface:ChangeSummaryService
TakesChangeSummary.getArchived()
into account when retrieving a summary with the given ID. Also will populate theChangeSummary.getDivergentStatus()
field.- Specified by:
readByIdAndNotArchivedWithDivergenceDetection
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
id
- ID of the summary to retrieve- Returns:
- A
ChangeSummary
matching the given ID and not archived
-
readByIdAndNotArchivedWithDivergenceDetection
public P readByIdAndNotArchivedWithDivergenceDetection(@NonNull String id, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ChangeSummaryService
TakesChangeSummary.getArchived()
into account when retrieving a summary with the given ID. Also will populate theChangeSummary.getDivergentStatus()
field.- Specified by:
readByIdAndNotArchivedWithDivergenceDetection
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
id
- ID of the summary 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
ChangeSummary
matching the given ID and not archived
-
readChangeSummary
@NonNull public Optional<P> readChangeSummary(@NonNull @NonNull @NonNull ChangeSummaryRequest changeSummaryRequest) Description copied from interface:ChangeSummaryService
Find an existing record with the corresponding matching values that determine uniqueness.- Specified by:
readChangeSummary
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeSummaryRequest
- Request DTO to find a matching change summary- Returns:
- an optional matching record
-
readMatchingChangeSummary
Description copied from interface:ChangeSummaryService
Find a matching change summary using the provided instance. Default implementation will check against the five fields that determine uniqueness for a change summary.- Specified by:
readMatchingChangeSummary
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeSummary
- The change summary to use when looking for an existing match- Returns:
- The existing matching change summary to the one provided
-
readChangeSummariesByAuthor
@NonNull @Deprecated public Stream<P> readChangeSummariesByAuthor(@NonNull String author, @NonNull String sandbox, @NonNull String state, List<String> status) Deprecated.Description copied from interface:ChangeSummaryService
Find all records belonging to the current author, sandbox andChangeState
- Specified by:
readChangeSummariesByAuthor
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
author
-ChangeSummary.getAuthor()
sandbox
-ChangeSummary.getSandbox()
state
-ChangeSummary.getState()
status
- OptionalChangeSummary.getStatus()
- Returns:
- A Stream that can be iterated, possibly containing a large number or records
-
readChangeSummariesByAuthor
@NonNull public Stream<P> readChangeSummariesByAuthor(@NonNull String author, @NonNull String sandbox, @NonNull String state, List<String> status, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ChangeSummaryService
Find all records belonging to the current author, sandbox andChangeState
- Specified by:
readChangeSummariesByAuthor
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
author
-ChangeSummary.getAuthor()
sandbox
-ChangeSummary.getSandbox()
state
-ChangeSummary.getState()
status
- OptionalChangeSummary.getStatus()
vendorNarrowing
- 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
-
readChangeSummariesByAuthor
@NonNull @Deprecated public Stream<P> readChangeSummariesByAuthor(@NonNull String author, @NonNull String sandbox, @NonNull String state, List<String> status, @Nullable List<String> ids) Deprecated.Description copied from interface:ChangeSummaryService
Find all records belonging to the current author, sandbox andChangeState
- Specified by:
readChangeSummariesByAuthor
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
author
-ChangeSummary.getAuthor()
sandbox
-ChangeSummary.getSandbox()
state
-ChangeSummary.getState()
status
- OptionalChangeSummary.getStatus()
ids
- The list of ids to which the fetch should be limited- Returns:
- A Stream that can be iterated, possibly containing a large number or records
-
readChangeSummariesByAuthor
@NonNull public Stream<P> readChangeSummariesByAuthor(@NonNull String author, @NonNull String sandbox, @NonNull String state, List<String> status, @Nullable List<String> ids, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ChangeSummaryService
Find all records belonging to the current author, sandbox andChangeState
- Specified by:
readChangeSummariesByAuthor
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
author
-ChangeSummary.getAuthor()
sandbox
-ChangeSummary.getSandbox()
state
-ChangeSummary.getState()
status
- OptionalChangeSummary.getStatus()
ids
- The list of ids to which the fetch should be limitedvendorNarrowing
- 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
-
readChangeSummaryIdsByAuthor
@NonNull public List<String> readChangeSummaryIdsByAuthor(@NonNull String author, @NonNull String sandbox, @NonNull String state, List<String> status) Description copied from interface:ChangeSummaryService
Find all record ids belonging to the current author, sandbox andChangeState
- Specified by:
readChangeSummaryIdsByAuthor
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
author
-ChangeSummary.getAuthor()
sandbox
-ChangeSummary.getSandbox()
state
-ChangeSummary.getState()
status
- OptionalChangeSummary.getStatus()
- Returns:
- A Stream that can be iterated, possibly containing a large number or records
-
readDeployFailedChangeSummaries
@NonNull public Stream<P> readDeployFailedChangeSummaries(@NonNull String deployId, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ChangeSummaryService
Find all records marked with statusERROR_DEPLOY
for the requesteddeployId
.- Specified by:
readDeployFailedChangeSummaries
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
deployId
- The deployment to which the records are associatedvendorNarrowing
- Whether to filter results based on the current authentication's vendor restrictions if vendor processing is enabledcontextInfo
- Context information about sandboxing and multitenant state- Returns:
- All records marked with status
ERROR_DEPLOY
for the requesteddeployId
as a stream
-
readChangeSummariesByIds
@NonNull public Stream<P> readChangeSummariesByIds(@NonNull List<String> changeSummaryIds, List<String> states, List<String> status, @NonNull String sandbox) Description copied from interface:ChangeSummaryService
Find all records in the list of ids that also have the requested state.- Specified by:
readChangeSummariesByIds
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeSummaryIds
- The requested list ofChangeSummary.getId()
states
- The required matching stateChangeSummary.getState()
, cannot be emptystatus
- OptionalChangeSummary.getStatus()
sandbox
- The sandbox to filter records by- Returns:
- A Stream that can be iterated, possibly containing a large number or records
-
readChangeSummariesByIds
@NonNull public Stream<P> readChangeSummariesByIds(@NonNull List<String> changeSummaryIds, List<String> states, List<String> status, @NonNull String sandbox, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ChangeSummaryService
Find all records in the list of ids that also have the requested state.- Specified by:
readChangeSummariesByIds
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeSummaryIds
- The requested list ofChangeSummary.getId()
states
- The required matching stateChangeSummary.getState()
, cannot be emptystatus
- OptionalChangeSummary.getStatus()
sandbox
- The sandbox to filter records byvendorNarrowing
- 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
-
readChangeSummariesByIdsCount
@NonNull public Long readChangeSummariesByIdsCount(@NonNull List<String> changeSummaryIds, List<String> states, List<String> status, @NonNull String sandbox) Description copied from interface:ChangeSummaryService
Find the count of all records in the list of ids that also have the requested state.- Specified by:
readChangeSummariesByIdsCount
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeSummaryIds
- The requested list ofChangeSummary.getId()
states
- The required matching stateChangeSummary.getState()
, cannot be emptystatus
- OptionalChangeSummary.getStatus()
sandbox
- The sandbox to filter records by- Returns:
- A Stream that can be iterated, possibly containing a large number or records
-
readChangeSummariesByIds
@NonNull @Deprecated public Stream<P> readChangeSummariesByIds(@NonNull List<String> changeSummaryIds) Deprecated.Description copied from interface:ChangeSummaryService
Find all records for the provided list of ids.- Specified by:
readChangeSummariesByIds
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeSummaryIds
- the ids to find Change Summaries against- Returns:
- all matching Change Summaries for the provided ids
-
readChangeSummariesByIds
@NonNull public Stream<P> readChangeSummariesByIds(@NonNull List<String> changeSummaryIds, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ChangeSummaryService
Find all records for the provided list of ids.- Specified by:
readChangeSummariesByIds
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeSummaryIds
- the ids to find Change Summaries againstvendorNarrowing
- 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:
- all matching Change Summaries for the provided ids
-
batchTransition
Description copied from interface:ChangeSummaryService
Given aPromoteBatchFlushContext
containingChangeSummary
transition information, update the state of all change summaries in a batch transaction. This includes updating notification states for durable messaging.- Specified by:
batchTransition
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
flushContext
- Context object containing all change summary transition to batch commit
-
batchTransition
Description copied from interface:ChangeSummaryService
UpdateChangeSummary
instances in bulk (identified bySummaryBasedFlushContext.getSummaryUpdates()
) in order to mutate state (such asChangeSummary.getState()
).- Specified by:
batchTransition
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
flushContext
- Context object containing the change summary transition information to commit
-
updateVals
public boolean updateVals(@NonNull String changeSummaryId, List<String> whereState, @Nullable List<String> whereStatus, @Nullable String messageType, @NonNull Map<String, Object> vals) Description copied from interface:ChangeSummaryService
Update the fields for a record matching the id
Calling this method is effectively the same as calling
ChangeSummaryService.updateVals(String, List, List, String, Map, boolean)
, but with theinsertNotificationStateIfMissing
parameter set tofalse
.- Specified by:
updateVals
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeSummaryId
- The id requested to mutatewhereState
- The current state of the ChangeSummary to match. Optional.whereStatus
- list of status values that a ChangeSummary should match one or more of. Optional.messageType
- if some of thevals
target a notification state of a certain message type, this value should be supplied to filter to that state. Optional.vals
- Map of field to value changes to make to the ChangeSummary instance- Returns:
- Whether or not an update was performed. If no record found matching the id and state, will return false.
-
updateVals
public boolean updateVals(@NonNull String changeSummaryId, List<String> whereState, @Nullable List<String> whereStatus, @Nullable String messageType, @NonNull Map<String, Object> vals, boolean insertNotificationStateIfMissing) Description copied from interface:ChangeSummaryService
Update the fields for a record matching the id- Specified by:
updateVals
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeSummaryId
- The id requested to mutatewhereState
- The current state of the ChangeSummary to match. Optional.whereStatus
- list of status values that a ChangeSummary should match one or more of. Optional.messageType
- if some of thevals
target a notification state of a certain message type, this value should be supplied to filter to that state. Optional.vals
- Map of field to value changes to make to the ChangeSummary instanceinsertNotificationStateIfMissing
- ifvals
target a notification state andmessageType
is provided, this flag determines whether the flow will newly insert the notification state if it does not already exist in the datastore. In other words, when this flag is false, the flow will only try to update an existing notification state with the provided details invals
. When this flag istrue
, if the update attempt is unsuccessful because the notification state is missing, the flow will attempt to newly insert that state into the datastore.- Returns:
- Whether or not an update was performed. If no record found matching the id and state, will return false.
- See Also:
-
updateVals
public void updateVals(@NonNull List<String> changeSummaryIds, @Nullable String whereState, @Nullable List<String> whereStatus, @NonNull Map<String, Object> vals) Description copied from interface:ChangeSummaryService
Update the fields for all non-archived records matching the ids- Specified by:
updateVals
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeSummaryIds
- The ids requested to mutatewhereState
- The current state of the ChangeSummary to match. Optional.whereStatus
- list of status values that a ChangeSummary should match one or more of. Optional.vals
- Map of field to value changes to make to the ChangeSummary instance
-
changesOwnedByAuthor
Description copied from interface:ChangeSummaryService
Whether or not all the ChangeSummary instances identified by the changeSummaryIds are owned by the requesting author.- Specified by:
changesOwnedByAuthor
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
author
- The author making the request.ContextInfo.getAuthor()
changeSummaryIds
- The ids requested to mutate- Returns:
- Whether or not all the requested ids belong to ChangeSummary instances owned by the author
-
readDivergedChangeSummariesByAuthor
@NonNull public List<String> readDivergedChangeSummariesByAuthor(@NonNull String author, @NonNull String sandbox) Description copied from interface:ChangeSummaryService
Find all records belonging to the current author and sandbox containing one or moreChangeDetail
values which has become diverged due to another change already promoted by another user.- Specified by:
readDivergedChangeSummariesByAuthor
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
author
-ChangeSummary.getAuthor()
sandbox
-ChangeSummary.getSandbox()
- Returns:
- The list of diverged
ChangeSummary.getId()
values
-
readDivergedChangeSummariesByIds
@NonNull public List<String> readDivergedChangeSummariesByIds(@NonNull List<String> changeSummaryIds, @NonNull String sandbox) Description copied from interface:ChangeSummaryService
Find all identified records belonging to the current sandbox containing one or moreChangeDetail
values which has become diverged due to another change already promoted by another user.- Specified by:
readDivergedChangeSummariesByIds
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeSummaryIds
- The requested list ofChangeSummary.getId()
sandbox
- The sandbox for which change summaries should be filtered- Returns:
- The list of diverged
ChangeSummary.getId()
values
-
readAllByAuthorAndSandbox
@NonNull public org.springframework.data.domain.Page<P> readAllByAuthorAndSandbox(@NonNull String author, @NonNull String sandbox, @Nullable String[] statuses, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable page) Description copied from interface:ChangeSummaryService
Find allChangeSummaries
for the provided author and sandbox.- Specified by:
readAllByAuthorAndSandbox
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
author
- the author of the change summaries to returnsandbox
- the sandbox associated to the change summaries to returnstatuses
- the list ofChangeStatusType
values for which aChangeSummary.getStatus()
should match one of. Optional.filters
- the RSQLNode
used to restrict resultpage
- pagination information- Returns:
- all Change Summaries for the author and sandbox provided
-
readAllByAuthorAndSandbox
public org.springframework.data.domain.Page<P> readAllByAuthorAndSandbox(@NonNull String author, @NonNull String sandbox, @Nullable String[] statuses, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable page, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ChangeSummaryService
Find allChangeSummaries
for the provided author and sandbox.- Specified by:
readAllByAuthorAndSandbox
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
author
- the author of the change summaries to returnsandbox
- the sandbox associated to the change summaries to returnstatuses
- the list ofChangeStatusType
values for which aChangeSummary.getStatus()
should match one of. Optional.filters
- the RSQLNode
used to restrict resultpage
- pagination 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:
- all Change Summaries for the author and sandbox provided
-
readAllByAuthorAndSandboxWithDivergenceDetection
@Deprecated @NonNull public org.springframework.data.domain.Page<P> readAllByAuthorAndSandboxWithDivergenceDetection(@NonNull String author, @NonNull String sandbox, @Nullable String[] statuses, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable page) Deprecated.Description copied from interface:ChangeSummaryService
Find allChangeSummaries
for the provided author and sandbox. Also will populate theChangeSummary.getDivergentStatus()
field.- Specified by:
readAllByAuthorAndSandboxWithDivergenceDetection
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
author
- the author of the change summaries to returnsandbox
- the sandbox associated to the change summaries to returnstatuses
- the list ofChangeStatusType
values for which aChangeSummary.getStatus()
should match one of. Optional.filters
- the RSQLNode
used to restrict resultpage
- pagination information- Returns:
- all Change Summaries for the author and sandbox provided
-
readAllByAuthorAndSandboxWithDivergenceDetection
@NonNull public org.springframework.data.domain.Page<P> readAllByAuthorAndSandboxWithDivergenceDetection(@NonNull String author, @NonNull String sandbox, @Nullable String[] statuses, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable page, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ChangeSummaryService
Find allChangeSummaries
for the provided author and sandbox. Also will populate theChangeSummary.getDivergentStatus()
field.- Specified by:
readAllByAuthorAndSandboxWithDivergenceDetection
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
author
- the author of the change summaries to returnsandbox
- the sandbox associated to the change summaries to returnstatuses
- the list ofChangeStatusType
values for which aChangeSummary.getStatus()
should match one of. Optional.filters
- the RSQLNode
used to restrict resultpage
- pagination 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:
- all Change Summaries for the author and sandbox provided
-
readSandboxChangeSummaries
@Deprecated @NonNull public List<P> readSandboxChangeSummaries(@NonNull ChangeInfoRequest changeInfoRequest) Deprecated.Description copied from interface:ChangeSummaryService
Find allChangeSummaries
with corresponding matching values to the providedChangeInfoRequest
that are in theChangeState.PROMOTED
,ChangeState.APPROVED
, orChangeState.SCHEDULED
state.- Specified by:
readSandboxChangeSummaries
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeInfoRequest
- the request data for retrievingChangeSummaries
- Returns:
- all records with the corresponding matching values in the
ChangeState.PROMOTED
,ChangeState.APPROVED
, orChangeState.SCHEDULED
state
-
readSandboxChangeSummaries
@NonNull public List<P> readSandboxChangeSummaries(@NonNull ChangeInfoRequest changeInfoRequest, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ChangeSummaryService
Find allChangeSummaries
with corresponding matching values to the providedChangeInfoRequest
that are in theChangeState.PROMOTED
,ChangeState.APPROVED
, orChangeState.SCHEDULED
state.- Specified by:
readSandboxChangeSummaries
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeInfoRequest
- the request data for retrievingChangeSummaries
vendorNarrowing
- 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:
- all records with the corresponding matching values in the
ChangeState.PROMOTED
,ChangeState.APPROVED
, orChangeState.SCHEDULED
state
-
readUserChangeSummaries
@Deprecated @NonNull public List<P> readUserChangeSummaries(@NonNull ChangeInfoRequest changeInfoRequest, boolean scheduled) Deprecated.Description copied from interface:ChangeSummaryService
- Specified by:
readUserChangeSummaries
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeInfoRequest
- the request data for retrievingChangeSummaries
scheduled
- Applies to a user change summary that is in a scheduled for deploy stateChangeState.SCHEDULED
. This state can occur during aTransitionRequestManager#promoteDeploy(PromoteSummaries, ContextInfo, String, boolean)
flow (espcially when there was an error during the deployment).- Returns:
- the
ChangeState.USER
ChangeSummaries
that match the provided criteria
-
readUserChangeSummaries
@NonNull public List<P> readUserChangeSummaries(@NonNull ChangeInfoRequest changeInfoRequest, boolean scheduled, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ChangeSummaryService
- Specified by:
readUserChangeSummaries
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeInfoRequest
- the request data for retrievingChangeSummaries
scheduled
- Applies to a user change summary that is in a scheduled for deploy stateChangeState.SCHEDULED
. This state can occur during aTransitionRequestManager#promoteDeploy(PromoteSummaries, ContextInfo, String, boolean)
flow (espcially when there was an error during the deployment).vendorNarrowing
- 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
ChangeState.USER
ChangeSummaries
that match the provided criteria
-
readAllByChangeInfoRequest
Description copied from interface:ChangeSummaryService
RetrievesChangeSummaries
for bothChangeState.USER
andChangeState.PROMOTED
states against the providedChangeInfoRequest
.- Specified by:
readAllByChangeInfoRequest
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeInfoRequest
- the request data for retrievingChangeSummaries
- Returns:
ChangeSummaries
retrieved from the providedChangeInfoRequest
-
readAllByChangeInfoRequest
@NonNull public List<P> readAllByChangeInfoRequest(@NonNull ChangeInfoRequest changeInfoRequest, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ChangeSummaryService
RetrievesChangeSummaries
for bothChangeState.USER
andChangeState.PROMOTED
states against the providedChangeInfoRequest
.- Specified by:
readAllByChangeInfoRequest
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeInfoRequest
- the request data for retrievingChangeSummaries
vendorNarrowing
- 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:
ChangeSummaries
retrieved from the providedChangeInfoRequest
-
findCompletedTempSandboxByExample
Description copied from interface:ChangeSummaryService
Based on the example change summary id, check if the change summary refers to a temporary sandbox. Return null if not. If so, find the count of remaining active ChangeSummary instances that also refer to that sandbox. A returned sandbox id indicates all ChangeSummary instances have completed their lifecycle and the sandbox can be archived. If there are still active ChangeSummary instances for the sandbox, null is returned. SeeChangeSummary#isTemporarySandbox()
.- Specified by:
findCompletedTempSandboxByExample
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
changeSummaryId
- The id of the ChangeSummary to check for temporary sandbox status.- Returns:
- null if not associated with a temporary sandbox, or some ChangeSummaries are still active against the sandbox. Otherwise, the sandbox id of the Sandbox that can be archived.
-
archiveNotActiveChangeSummariesForSandbox
@Transactional("sandboxTransactionManager") public void archiveNotActiveChangeSummariesForSandbox(String sandboxId) Description copied from interface:ChangeSummaryService
Archives theChangeSummary
for the specified sandbox id.- Specified by:
archiveNotActiveChangeSummariesForSandbox
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
sandboxId
- the sandbox id associated to the change summaries- See Also:
-
findArchivedBySandbox
Description copied from interface:ChangeSummaryService
Find all archivedChangeSummary
for the provided sandbox id.- Specified by:
findArchivedBySandbox
in interfaceChangeSummaryService<P extends ChangeSummary>
- Parameters:
sandboxId
- he sandbox id associated to the change summaries- Returns:
- the list of archived
ChangeSummary
-
processDivergence
-
convertToPersistedDomain
-
getRepository
- Overrides:
getRepository
in classcom.broadleafcommerce.data.tracking.core.service.BaseMappableCrudEntityService<P extends ChangeSummary>
-
getTypeFactory
@NonNull protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-