Interface ChangeDeployService<P extends ChangeDeploy>
- All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.MappableCrudEntityService<P>
,com.broadleafcommerce.data.tracking.core.service.RsqlMappableCrudEntityService<P>
- All Known Implementing Classes:
DefaultChangeDeployService
public interface ChangeDeployService<P extends ChangeDeploy>
extends com.broadleafcommerce.data.tracking.core.service.RsqlMappableCrudEntityService<P>
Service for working with
instances
. Primarily involves CRUD operations going
through ChangeDeployRepository
.- Author:
- Nathan Moore (nathandmoore)
-
Method Summary
Modifier and TypeMethodDescriptionTakesChangeDeploy.getArchived()
into account when retrieving a deployment with the given ID.readByIdAndNotArchived
(String id, 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<P>
readChangeDeploys
(String applicationId, String state, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable) Deprecated.org.springframework.data.domain.Page<P>
readChangeDeploys
(String sandbox, String state, 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 ofChangeDeploy
records based on the sandbox and state.boolean
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.boolean
updateVals
(String changeDeployId, List<String> whereStates, List<String> whereStatus, String notificationStateName, Map<String, Object> vals) Update the fields for a record matching the id.boolean
updateVals
(String changeDeployId, List<String> whereStates, List<String> whereStatus, 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 id.boolean
updateVals
(String changeDeployId, List<String> whereStates, List<String> whereStatus, String notificationStateName, Map<String, Object> vals, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Update the fields for a record matching the id.updateValsAndReturn
(String changeDeployId, List<String> whereStates, List<String> whereStatus, String notificationStateName, Map<String, Object> vals) Update the fields for a record matching the id, and return anOptional
containing the value if it was successfully updated,Optional.empty()
otherwise.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
-
Method Details
-
readByIdAndNotArchived
TakesChangeDeploy.getArchived()
into account when retrieving a deployment with the given ID.- Parameters:
id
- ID of the deployment to retrieve- Returns:
- A
ChangeDeploy
matching the given ID and not archived
-
readByIdAndNotArchived
P readByIdAndNotArchived(@NonNull String id, 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 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
ChangeDeploy
matching the given ID and not archived
-
updateVals
boolean updateVals(@NonNull String changeDeployId, List<String> whereStates, List<String> whereStatus, @Nullable String notificationStateName, @NonNull Map<String, Object> vals) Update the fields for a record matching the id.- Parameters:
changeDeployId
- the ID of the deployment which should be updatedwhereStates
- theChangeState
values whichChangeDeploy.getState()
should match one or more of to qualify for this updatewhereStatus
- the list ofChangeStatusType
values whichChangeDeploy.getStatus()
should match one or more of to qualify for this update. Can be empty.notificationStateName
- (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 ChangeDeploy instance- Returns:
- Whether or not an update was performed. If no record found matching the id and state, will return false.
-
updateVals
boolean updateVals(@NonNull String changeDeployId, List<String> whereStates, List<String> whereStatus, @Nullable String notificationStateName, @NonNull 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 of the deployment which should be updatedwhereStates
- theChangeState
values whichChangeDeploy.getState()
should match one or more of to qualify for this updatewhereStatus
- the list ofChangeStatusType
values whichChangeDeploy.getStatus()
should match one or more of to qualify for this update. Can be empty.notificationStateName
- (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 ChangeDeploy instancevendorNarrowing
- 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:
- Whether or not an update was performed. If no record found matching the id and state, will return false.
-
updateVals
boolean updateVals(@NonNull String changeDeployId, List<String> whereStates, List<String> whereStatus, @Nullable String notificationStateName, @NonNull 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 of the deployment which should be updatedwhereStates
- theChangeState
values whichChangeDeploy.getState()
should match one or more of to qualify for this updatewhereStatus
- the list ofChangeStatusType
values whichChangeDeploy.getStatus()
should match one or more of to qualify for this update. Can be empty.notificationStateName
- (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 ChangeDeploy instancevendorNarrowing
- 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:
- Whether or not an update was performed. If no record found matching the id and state, will return false.
- Since:
- Sandbox Service 2.0.6, Sandbox Service 2.1.3, Release Train 2.1.4, Release Train 2.2.0
- See Also:
-
updateValsAndReturn
Optional<P> updateValsAndReturn(@NonNull String changeDeployId, List<String> whereStates, List<String> whereStatus, @Nullable String notificationStateName, @NonNull Map<String, Object> vals) Update the fields for a record matching the id, and return anOptional
containing the value if it was successfully updated,Optional.empty()
otherwise.- Parameters:
changeDeployId
- the ID of the deployment which should be updatedwhereStates
- theChangeState
values whichChangeDeploy.getState()
should match one or more of to qualify for this updatewhereStatus
- the list ofChangeStatusType
values whichChangeDeploy.getStatus()
should match one or more of to qualify for this update. Can be empty.notificationStateName
- (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 ChangeDeploy instance- Returns:
Optional.empty()
if no record found matching the id and state, or if found and updated, anOptional
containing the updated deployment
-
readChangeDeploys
@Deprecated @NonNull org.springframework.data.domain.Page<P> readChangeDeploys(@Nullable String applicationId, @NonNull String state, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable pageable) Deprecated.since 1.3, replaced byreadChangeDeploys(String, String, Node, Pageable, boolean, ContextInfo)
Find a page ofChangeDeploy
records based on the application and state. This drives visibility of state related toChangeState.SCHEDULED
andChangeState.DEPLOYED
.- Parameters:
applicationId
- The application to filter deploysstate
-ChangeDeploy.getState()
filters
- the RSQLNode
used to restrict resultpageable
- Page setup information- Returns:
- page of matching records
-
readChangeDeploys
@NonNull org.springframework.data.domain.Page<P> readChangeDeploys(@NonNull String sandbox, @NonNull String state, @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 ofChangeDeploy
records based on the sandbox and state. This drives visibility of state related toChangeState.SCHEDULED
andChangeState.DEPLOYED
.- Parameters:
sandbox
-ChangeDeploy.getSandbox()
state
-ChangeDeploy.getState()
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
-
setAffectedVendors
@Nullable P 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
-
readChangeDeploys(String, String, Node, Pageable, boolean, ContextInfo)