Interface CustomizedChangeDeployRepository<D>
- All Superinterfaces:
com.broadleafcommerce.common.extension.DomainTypeAware
- All Known Subinterfaces:
ChangeDeployRepository<D>
,JpaChangeDeployRepository<D>
- All Known Implementing Classes:
JpaCustomizedChangeDeployRepository
public interface CustomizedChangeDeployRepository<D>
extends com.broadleafcommerce.common.extension.DomainTypeAware
Additional persistence operations to perform on
ChangeDeploy
repository domain.- Author:
- Nathan Moore (nathandmoore), Phillip Verheyden (phillipuniverse)
-
Method Summary
Modifier and TypeMethodDescriptioncleanupBatch
(String startingId, List<ChangeStatusType> detectStatuses, List<ChangeState> detectStates, ChangeStatusType targetStatus, ChangeState targetState, List<ChangeStatusType> summaryDetectStatuses, List<ChangeState> summaryDetectStates, Object source) Check a bag of ChangeDeploy entities for completion state.readByIdAndArchivedNot
(String id, boolean archived, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) TakesChangeDeploy.getArchived()
into account when retrieving a deployment with the given ID.org.springframework.data.domain.Page<D>
readPageByApplicationAndStateAndArchivedNot
(String applicationId, String state, Boolean archived, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable) Deprecated.org.springframework.data.domain.Page<D>
readPageBySandboxAndStateAndArchivedNot
(String sandbox, String state, 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 sandbox and stateboolean
removeFromAffectedVendors
(String deployId, String vendorRef) Atomically removes the givenvendorRef
fromChangeDeploy.getAffectedVendorRefs()
of the givendeployId
if present.setAffectedVendors
(String deployId, boolean affectsNonVendorData, Set<String> affectedVendorRefs) Atomically finds theChangeDeploy
with the givendeployId
and sets itsChangeDeploy.isAffectsNonVendorData()
andChangeDeploy.getAffectedVendorRefs()
to the provided values.updateVals
(String changeDeployId, List<String> whereStates, List<String> whereStatuses, String notificationStateName, Map<String, Object> vals) Update the fields for a record matching the idupdateVals
(String changeDeployId, List<String> whereStates, List<String> whereStatuses, String notificationStateName, Map<String, Object> vals, boolean vendorNarrowing, boolean insertNotificationStateIfMissing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Update the fields for a record matching the idupdateVals
(String changeDeployId, List<String> whereStates, List<String> whereStatuses, String notificationStateName, Map<String, Object> vals, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Update the fields for a record matching the idMethods 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) TakesChangeDeploy.getArchived()
into account when retrieving a deployment with the given ID.- Parameters:
id
- ID of the deployment to retrievearchived
-ChangeDeploy.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
ChangeDeploy
matching the given ID and not matching the given archived status
-
updateVals
@Policy(operationTypes=UPDATE) Optional<D> updateVals(String changeDeployId, @Nullable List<String> whereStates, @Nullable List<String> whereStatuses, @Nullable String notificationStateName, Map<String, Object> vals) Update the fields for a record matching the id- Parameters:
changeDeployId
- The id requested to mutatewhereStates
- TheChangeState
values for whichChangeDeploy.getState()
can matchwhereStatuses
- The list ofChangeStatusType
values for whichChangeDeploy.getStatus()
should match one or more of, can be emptynotificationStateName
- (optional) the name of the notification state that should be used to filter in the notification states array. This is relevant for update operations that want to modify a specific notification state with update values specified inupdateVals
vals
- Map of field to value changes to make to the ChangeSummaryGroup instance, cannot be empty- Returns:
- An
Optional
containing the updated record if an update was performed,Optional.empty()
otherwise - Throws:
IllegalArgumentException
- ifchangeDeployId
is not provided orvals
is empty
-
updateVals
@Policy(operationTypes=UPDATE) Optional<D> updateVals(String changeDeployId, @Nullable List<String> whereStates, @Nullable List<String> whereStatuses, @Nullable String notificationStateName, Map<String, Object> vals, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Update the fields for a record matching the id
Calling this method is the same as calling
updateVals(String, List, List, String, Map, boolean, boolean, ContextInfo)
, but with theinsertNotificationStateIfMissing
parameter set tofalse
.- Parameters:
changeDeployId
- The id requested to mutatewhereStates
- TheChangeState
values for whichChangeDeploy.getState()
can matchwhereStatuses
- The list ofChangeStatusType
values for whichChangeDeploy.getStatus()
should match one or more of, can be emptynotificationStateName
- (optional) the name of the notification state that should be used to filter in the notification states array. This is relevant for update operations that want to modify a specific notification state with update values specified inupdateVals
vals
- Map of field to value changes to make to the ChangeSummaryGroup instance, cannot 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:
- An
Optional
containing the updated record if an update was performed,Optional.empty()
otherwise - Throws:
IllegalArgumentException
- ifchangeDeployId
is not provided orvals
is empty
-
updateVals
@Policy(operationTypes=UPDATE) Optional<D> updateVals(String changeDeployId, @Nullable List<String> whereStates, @Nullable List<String> whereStatuses, @Nullable String notificationStateName, Map<String, Object> vals, boolean vendorNarrowing, boolean insertNotificationStateIfMissing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Update the fields for a record matching the id- Parameters:
changeDeployId
- The id requested to mutatewhereStates
- TheChangeState
values for whichChangeDeploy.getState()
can matchwhereStatuses
- The list ofChangeStatusType
values for whichChangeDeploy.getStatus()
should match one or more of, can be emptynotificationStateName
- (optional) the name of the notification state that should be used to filter in the notification states array. This is relevant for update operations that want to modify a specific notification state with update values specified inupdateVals
vals
- Map of field to value changes to make to the ChangeSummaryGroup instance, cannot be emptyvendorNarrowing
- whether or not to filter results based on the current authentication's vendor restrictions if vendor processing is enabledinsertNotificationStateIfMissing
- ifvals
target a notification state andnotificationStateName
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.contextInfo
- context information about sandboxing and multitenant state- Returns:
- An
Optional
containing the updated record if an update was performed,Optional.empty()
otherwise - Throws:
IllegalArgumentException
- ifchangeDeployId
is not provided orvals
is empty- Since:
- Sandbox Service 2.0.6, Sandbox Service 2.1.3, Release Train 2.1.4, Release Train 2.2.0
- See Also:
-
readPageByApplicationAndStateAndArchivedNot
@Deprecated @Policy(operationTypes=READ) org.springframework.data.domain.Page<D> readPageByApplicationAndStateAndArchivedNot(@Nullable String applicationId, String state, @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 application and state- Parameters:
applicationId
- TheChangeDeploy.getApplication()
valuke to filter results bystate
- TheChangeDeploy.getState()
value to filter results byarchived
-ChangeDeploy.getArchived()
value to not matchfilters
- the RSQLNode
used to restrict resultpageable
- The page setup information- Returns:
- The page of records
-
readPageBySandboxAndStateAndArchivedNot
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> readPageBySandboxAndStateAndArchivedNot(String sandbox, String state, @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 sandbox and state- Parameters:
sandbox
- TheChangeDeploy.getSandbox()
value to filter results bystate
- TheChangeDeploy.getState()
value to filter results byarchived
-ChangeDeploy.getArchived()
value to not matchfilters
- the RSQLNode
used 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
-
setAffectedVendors
@Policy(operationTypes=UPDATE) @Nullable D setAffectedVendors(String deployId, boolean affectsNonVendorData, Set<String> affectedVendorRefs) Atomically finds theChangeDeploy
with the givendeployId
and sets itsChangeDeploy.isAffectsNonVendorData()
andChangeDeploy.getAffectedVendorRefs()
to the provided values.Internally, this method should rely on data-store locking mechanisms to protect against concurrent mutations.
- Parameters:
deployId
- the ID of the deploy to updateaffectsNonVendorData
- the new value to set forChangeDeploy.isAffectsNonVendorData()
affectedVendorRefs
- the new value to set forChangeDeploy.getAffectedVendorRefs()
. Cannot be null, but can be empty.- Returns:
- the updated deployment if the update was successful,
null
otherwise
-
removeFromAffectedVendors
Atomically removes the givenvendorRef
fromChangeDeploy.getAffectedVendorRefs()
of the givendeployId
if present.- Parameters:
deployId
- the ID of the deploy to updatevendorRef
- the vendor ref to remove fromChangeDeploy.getAffectedVendorRefs()
- Returns:
true
if the removal was successful,false
otherwise
-
cleanupBatch
@Policy(operationTypes=UPDATE) @Nullable String cleanupBatch(@Nullable String startingId, List<ChangeStatusType> detectStatuses, List<ChangeState> detectStates, ChangeStatusType targetStatus, ChangeState targetState, List<ChangeStatusType> summaryDetectStatuses, List<ChangeState> summaryDetectStates, Object source) Check a bag of ChangeDeploy entities for completion state. If complete, update status and state.- Parameters:
startingId
- The ChangeDeploy entity id that represents the start of the collection of entities to check. The size of the collection is determined byCompletionCleanupProperties.getCleanupBatchSize()
.detectStatuses
- 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 ChangeDeploy entity id used as part of the executed batch. This value is
interesting to provide as the
startingId
for subsequent calls to this method when performing a paged style execution approach. May be null if no values were found, or if fewer than the configured batch size were found.
-
readPageBySandboxAndStateAndArchivedNot(String, String, Boolean, Node, Pageable, boolean, ContextInfo)