Class DefaultChangeDeployService<P extends ChangeDeploy>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseMappableCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlMappableCrudEntityService<P>
com.broadleafcommerce.sandbox.service.DefaultChangeDeployService<P>
- Type Parameters:
- P- The type of the business instance
- All Implemented Interfaces:
- com.broadleafcommerce.data.tracking.core.service.MappableCrudEntityService<P>,- com.broadleafcommerce.data.tracking.core.service.RsqlMappableCrudEntityService<P>,- ChangeDeployService<P>
public class DefaultChangeDeployService<P extends ChangeDeploy>
extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlMappableCrudEntityService<P>
implements ChangeDeployService<P>
- Author:
- Nathan Moore (nathandmoore)
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultChangeDeployService(ChangeDeployRepository<?> repository, com.broadleafcommerce.data.tracking.core.service.RsqlMappableCrudEntityHelper helper) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected ChangeDeployRepository<?>TakesChangeDeploy.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 ofChangeDeployrecords based on the sandbox and state.booleanremoveFromAffectedVendors(@NonNull String deployId, @NonNull String vendorRef) Atomically removes the givenvendorReffromChangeDeploy.getAffectedVendorRefs()of the givendeployIdif present.setAffectedVendors(@NonNull String deployId, boolean affectsNonVendorData, @NonNull Set<String> affectedVendorRefs) Atomically finds theChangeDeploywith the givendeployIdand sets itsChangeDeploy.isAffectsNonVendorData()andChangeDeploy.getAffectedVendorRefs()to the provided values.booleanupdateVals(String changeDeployId, List<String> whereStates, List<String> whereStatus, String noticationStateName, Map<String, Object> vals) Update the fields for a record matching the id.booleanupdateVals(String changeDeployId, List<String> whereStates, List<String> whereStatus, String noticationStateName, 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.booleanupdateVals(String changeDeployId, List<String> whereStates, List<String> whereStatus, String noticationStateName, 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 anOptionalcontaining the value if it was successfully updated,Optional.empty()otherwise.Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlMappableCrudEntityServicegetRsqlHelper, readAll, readAll, readAll, readAllMethods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseMappableCrudEntityServiceconvertFromPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, readAll, readAll, readAll, readAllByIds, readById, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccessMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.service.MappableCrudEntityServicecreate, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByIds, readById, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccessMethods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlMappableCrudEntityServicereadAll, readAll, readAll, readAll
- 
Constructor Details- 
DefaultChangeDeployServicepublic DefaultChangeDeployService(ChangeDeployRepository<?> repository, com.broadleafcommerce.data.tracking.core.service.RsqlMappableCrudEntityHelper helper) 
 
- 
- 
Method Details- 
readByIdAndNotArchivedDescription copied from interface:ChangeDeployServiceTakesChangeDeploy.getArchived()into account when retrieving a deployment with the given ID.- Specified by:
- readByIdAndNotArchivedin interface- ChangeDeployService<P extends ChangeDeploy>
- Parameters:
- id- ID of the deployment to retrieve
- Returns:
- A ChangeDeploymatching the given ID and not archived
 
- 
readByIdAndNotArchivedpublic P readByIdAndNotArchived(@NonNull String id, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ChangeDeployServiceTakesChangeDeploy.getArchived()into account when retrieving a deployment with the given ID.- Specified by:
- readByIdAndNotArchivedin interface- ChangeDeployService<P extends ChangeDeploy>
- Parameters:
- id- ID of the deployment to retrieve
- vendorNarrowing- whether or not to filter results based on the current authentication's vendor restrictions if vendor processing is enabled
- contextInfo- context information about sandboxing and multitenant state
- Returns:
- A ChangeDeploymatching the given ID and not archived
 
- 
updateValspublic boolean updateVals(@NonNull String changeDeployId, List<String> whereStates, List<String> whereStatus, @Nullable String noticationStateName, @NonNull Map<String, Object> vals) Description copied from interface:ChangeDeployServiceUpdate the fields for a record matching the id.- Specified by:
- updateValsin interface- ChangeDeployService<P extends ChangeDeploy>
- Parameters:
- changeDeployId- the ID of the deployment which should be updated
- whereStates- the- ChangeStatevalues which- ChangeDeploy.getState()should match one or more of to qualify for this update
- whereStatus- the list of- ChangeStatusTypevalues which- ChangeDeploy.getStatus()should match one or more of to qualify for this update. Can be empty.
- noticationStateName- (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 in- updateVals
- 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.
 
- 
updateValspublic boolean updateVals(@NonNull String changeDeployId, List<String> whereStates, List<String> whereStatus, @Nullable String noticationStateName, @NonNull Map<String, Object> vals, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ChangeDeployServiceUpdate the fields for a record matching the id. Calling this method is the same as calling ChangeDeployService.updateVals(String, List, List, String, Map, boolean, boolean, ContextInfo), but with theinsertNotificationStateIfMissingparameter set tofalse.- Specified by:
- updateValsin interface- ChangeDeployService<P extends ChangeDeploy>
- Parameters:
- changeDeployId- the ID of the deployment which should be updated
- whereStates- the- ChangeStatevalues which- ChangeDeploy.getState()should match one or more of to qualify for this update
- whereStatus- the list of- ChangeStatusTypevalues which- ChangeDeploy.getStatus()should match one or more of to qualify for this update. Can be empty.
- noticationStateName- (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 in- updateVals
- vals- Map of field to value changes to make to the ChangeDeploy instance
- vendorNarrowing- whether or not to filter results based on the current authentication's vendor restrictions if vendor processing is enabled
- 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.
 
- 
updateValspublic boolean updateVals(@NonNull String changeDeployId, List<String> whereStates, List<String> whereStatus, @Nullable String noticationStateName, @NonNull Map<String, Object> vals, boolean vendorNarrowing, boolean insertNotificationStateIfMissing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ChangeDeployServiceUpdate the fields for a record matching the id.- Specified by:
- updateValsin interface- ChangeDeployService<P extends ChangeDeploy>
- Parameters:
- changeDeployId- the ID of the deployment which should be updated
- whereStates- the- ChangeStatevalues which- ChangeDeploy.getState()should match one or more of to qualify for this update
- whereStatus- the list of- ChangeStatusTypevalues which- ChangeDeploy.getStatus()should match one or more of to qualify for this update. Can be empty.
- noticationStateName- (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 in- updateVals
- vals- Map of field to value changes to make to the ChangeDeploy instance
- vendorNarrowing- whether or not to filter results based on the current authentication's vendor restrictions if vendor processing is enabled
- insertNotificationStateIfMissing- if- valstarget a notification state and- notificationStateNameis 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 in- vals. When this flag is- true, 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.
- See Also:
 
- 
updateValsAndReturnpublic Optional<P> updateValsAndReturn(@NonNull String changeDeployId, List<String> whereStates, List<String> whereStatus, @Nullable String notificationStateName, @NonNull Map<String, Object> vals) Description copied from interface:ChangeDeployServiceUpdate the fields for a record matching the id, and return anOptionalcontaining the value if it was successfully updated,Optional.empty()otherwise.- Specified by:
- updateValsAndReturnin interface- ChangeDeployService<P extends ChangeDeploy>
- Parameters:
- changeDeployId- the ID of the deployment which should be updated
- whereStates- the- ChangeStatevalues which- ChangeDeploy.getState()should match one or more of to qualify for this update
- whereStatus- the list of- ChangeStatusTypevalues which- ChangeDeploy.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 in- updateVals
- 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, an- Optionalcontaining the updated deployment
 
- 
readChangeDeploys@NonNull @Deprecated public 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.Description copied from interface:ChangeDeployServiceFind a page ofChangeDeployrecords based on the application and state. This drives visibility of state related toChangeState.SCHEDULEDandChangeState.DEPLOYED.- Specified by:
- readChangeDeploysin interface- ChangeDeployService<P extends ChangeDeploy>
- Parameters:
- applicationId- The application to filter deploys
- state-- ChangeDeploy.getState()
- filters- the RSQL- Nodeused to restrict result
- pageable- Page setup information
- Returns:
- page of matching records
 
- 
readChangeDeploys@NonNull public 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) Description copied from interface:ChangeDeployServiceFind a page ofChangeDeployrecords based on the sandbox and state. This drives visibility of state related toChangeState.SCHEDULEDandChangeState.DEPLOYED.- Specified by:
- readChangeDeploysin interface- ChangeDeployService<P extends ChangeDeploy>
- Parameters:
- sandbox-- ChangeDeploy.getSandbox()
- state-- ChangeDeploy.getState()
- filters- the RSQL- Nodeused to restrict result
- pageable- Page setup information
- vendorNarrowing- whether or not to filter results based on the current authentication's vendor restrictions if vendor processing is enabled
- contextInfo- context information about sandboxing and multitenant state
- Returns:
- page of matching records
 
- 
setAffectedVendors@Nullable public P setAffectedVendors(@NonNull @NonNull String deployId, boolean affectsNonVendorData, @NonNull @NonNull Set<String> affectedVendorRefs) Description copied from interface:ChangeDeployServiceAtomically finds theChangeDeploywith the givendeployIdand sets itsChangeDeploy.isAffectsNonVendorData()andChangeDeploy.getAffectedVendorRefs()to the provided values.Internally, this method should rely on data-store locking mechanisms to protect against concurrent mutations. - Specified by:
- setAffectedVendorsin interface- ChangeDeployService<P extends ChangeDeploy>
- Parameters:
- deployId- the ID of the deploy to update
- affectsNonVendorData- the new value to set for- ChangeDeploy.isAffectsNonVendorData()
- affectedVendorRefs- the new value to set for- ChangeDeploy.getAffectedVendorRefs(). Cannot be null, but can be empty.
- Returns:
- the updated deployment if the update was successful, nullotherwise
 
- 
removeFromAffectedVendorspublic boolean removeFromAffectedVendors(@NonNull @NonNull String deployId, @NonNull @NonNull String vendorRef) Description copied from interface:ChangeDeployServiceAtomically removes the givenvendorReffromChangeDeploy.getAffectedVendorRefs()of the givendeployIdif present.- Specified by:
- removeFromAffectedVendorsin interface- ChangeDeployService<P extends ChangeDeploy>
- Parameters:
- deployId- the ID of the deploy to update
- vendorRef- the vendor ref to remove from- ChangeDeploy.getAffectedVendorRefs()
- Returns:
- trueif the removal was successful,- falseotherwise
 
- 
getRepository- Overrides:
- getRepositoryin class- com.broadleafcommerce.data.tracking.core.service.BaseMappableCrudEntityService<P extends ChangeDeploy>
 
 
-