Class DefaultDeploymentRequestHandler
java.lang.Object
com.broadleafcommerce.sandbox.service.DefaultDeploymentRequestHandler
- All Implemented Interfaces:
DeploymentRequestHandler
Assists in handling the logic for scheduling deployment requests.
- Author:
- Nathan Moore (nathandmoore), Samarth Dhruva (samarthd)
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultDeploymentRequestHandler(ChangeSummaryService<ChangeSummary> summaryService, ChangeSummaryGroupService<ChangeSummaryGroup> groupService, ChangeDeployService<ChangeDeploy> changeDeployService, com.broadleafcommerce.common.messaging.notification.MessageSerializationHelper helper, com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager, ChangeSummaryRepository<?> changeSummaryRepository, ChangeDeployRepository<?> changeDeployRepository, com.broadleafcommerce.common.extension.TypeFactory typeFactory, BatchTransitionService batchTransitionService) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear(String changeDeployId, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Accepts an ID for aChangeDeploythat previously failed and starts the process of clearing the error state of the deployment.voiddeploy(ChangeSummaryGroups scheduleGroups, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String sandbox, int level) Creates a newChangeDeployfor the givenChangeSummaryGroupsand executes immediate deployment.voiddeploy(ChangeSummaryGroups scheduleGroups, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String sandbox, int level, boolean vendorNarrowing) Creates a newChangeDeployfor the givenChangeSummaryGroupsand executes immediate deployment.voiddeploy(ChangeSummaryGroups scheduleGroups, Stream<ChangeSummary> summaries, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String sandbox, int level) Deprecated.voiddeploy(ChangeSummaryGroups scheduleGroups, Stream<ChangeSummary> summaries, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String sandbox, int level, boolean vendorNarrowing) Creates a newChangeDeployfor the givenChangeSummaryGroupsand executes immediate deployment.voidexecuteDeployment(String deployId) Finds an existing, previously scheduledChangeDeployand sends out aWorkflowDeployRequestperChangeSummaryin the deployment via the relevant Spring Cloud channel.protected booleanWhether or not vendor processing is enabled.protected voidIfvendorProcessingEnabled, then updates the datastore such that the temporary placeholder frominitializeVendorFields(ChangeDeploy)is removed from the givendeployId.voidschedule(ChangeSummaryGroups scheduleGroups, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String sandbox, Instant deployTime, int level) Creates a newChangeDeployfor the givenChangeSummaryGroupsand schedules it for the given deployTime.voidschedule(ChangeSummaryGroups scheduleGroups, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String sandbox, Instant deployTime, int level, boolean vendorNarrowing) Creates a newChangeDeployfor the givenChangeSummaryGroupsand schedules it for the given deployTime.voidsetVendorProcessingEnabled(boolean vendorProcessingEnabled) Whether or not vendor processing is enabled.voidunschedule(String changeDeployId) Accepts an ID for aChangeDeploythat was previously scheduled and starts the process of unscheduling the deployment.voidunschedule(String changeDeployId, boolean vendorNarrowing, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Accepts an ID for aChangeDeploythat was previously scheduled and starts the process of unscheduling the deployment.
-
Constructor Details
-
DefaultDeploymentRequestHandler
public DefaultDeploymentRequestHandler(ChangeSummaryService<ChangeSummary> summaryService, ChangeSummaryGroupService<ChangeSummaryGroup> groupService, ChangeDeployService<ChangeDeploy> changeDeployService, com.broadleafcommerce.common.messaging.notification.MessageSerializationHelper helper, com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager, ChangeSummaryRepository<?> changeSummaryRepository, ChangeDeployRepository<?> changeDeployRepository, com.broadleafcommerce.common.extension.TypeFactory typeFactory, BatchTransitionService batchTransitionService)
-
-
Method Details
-
deploy
public void deploy(@NonNull ChangeSummaryGroups scheduleGroups, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @NonNull String sandbox, int level) Description copied from interface:DeploymentRequestHandlerCreates a newChangeDeployfor the givenChangeSummaryGroupsand executes immediate deployment. AWorkflowDeployRequestis emitted per change summary via the relevant Spring Cloud channel, and the givenChangeSummaryGroupsand theirChangeSummariesare marked with statusChangeStatusType.DEPLOYING.- Specified by:
deployin interfaceDeploymentRequestHandler- Parameters:
scheduleGroups- Construct that identifies one or moreChangeSummaryGroupinstances to be scheduled for a future deployment.context- Information about the deploy request containing the ID of the request's author.sandbox- The sandbox ID upon which to filter searches on when retrieving the group instances and their summaries.level- The tracking level from which to perform the deployment (seeTrackingLevel)
-
deploy
public void deploy(@NonNull ChangeSummaryGroups scheduleGroups, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @NonNull String sandbox, int level, boolean vendorNarrowing) Description copied from interface:DeploymentRequestHandlerCreates a newChangeDeployfor the givenChangeSummaryGroupsand executes immediate deployment. AWorkflowDeployRequestis emitted per change summary via the relevant Spring Cloud channel, and the givenChangeSummaryGroupsand theirChangeSummariesare marked with statusChangeStatusType.DEPLOYING.- Specified by:
deployin interfaceDeploymentRequestHandler- Parameters:
scheduleGroups- Construct that identifies one or moreChangeSummaryGroupinstances to be scheduled for a future deployment.context- Information about the deploy request containing the ID of the request's author.sandbox- The sandbox ID upon which to filter searches on when retrieving the group instances and their summaries.level- The tracking level from which to perform the deployment (seeTrackingLevel)vendorNarrowing- whether or not to filter results based on the current authentication's vendor restrictions if vendor processing is enabled
-
deploy
@Deprecated public void deploy(@NonNull ChangeSummaryGroups scheduleGroups, @NonNull Stream<ChangeSummary> summaries, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @NonNull String sandbox, int level) Deprecated.Description copied from interface:DeploymentRequestHandlerCreates a newChangeDeployfor the givenChangeSummaryGroupsand executes immediate deployment. AWorkflowDeployRequestis emitted per change summary via the relevant Spring Cloud channel, and the givenChangeSummaryGroupsand theirChangeSummariesare marked with statusChangeStatusType.DEPLOYING.- Specified by:
deployin interfaceDeploymentRequestHandler- Parameters:
scheduleGroups- Construct that identifies one or moreChangeSummaryGroupinstances to be scheduled for a future deployment.summaries- The stream ofChangeSummaryinstances to deploy. Usually supplied as part of aTransitionRequestManager#promoteDeploy(PromoteSummaries, ContextInfo, String, boolean)style operation where user level changes are passed directly to deployment.context- Information about the deploy request containing the ID of the request's author.sandbox- The sandbox ID upon which to filter searches on when retrieving the group instances and their summaries.level- The tracking level from which to perform the deployment (seeTrackingLevel)
-
deploy
public void deploy(@NonNull ChangeSummaryGroups scheduleGroups, @NonNull Stream<ChangeSummary> summaries, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @NonNull String sandbox, int level, boolean vendorNarrowing) Description copied from interface:DeploymentRequestHandlerCreates a newChangeDeployfor the givenChangeSummaryGroupsand executes immediate deployment. AWorkflowDeployRequestis emitted per change summary via the relevant Spring Cloud channel, and the givenChangeSummaryGroupsand theirChangeSummariesare marked with statusChangeStatusType.DEPLOYING.- Specified by:
deployin interfaceDeploymentRequestHandler- Parameters:
scheduleGroups- Construct that identifies one or moreChangeSummaryGroupinstances to be scheduled for a future deployment.summaries- The stream ofChangeSummaryinstances to deploy. Usually supplied as part of aTransitionRequestManager#promoteDeploy(PromoteSummaries, ContextInfo, String, boolean)style operation where user level changes are passed directly to deployment.context- Information about the deploy request containing the ID of the request's author.sandbox- The sandbox ID upon which to filter searches on when retrieving the group instances and their summaries.level- The tracking level from which to perform the deployment (seeTrackingLevel)vendorNarrowing- whether or not to filter results based on the current authentication's vendor restrictions if vendor processing is enabled
-
unschedule
Description copied from interface:DeploymentRequestHandlerAccepts an ID for aChangeDeploythat was previously scheduled and starts the process of unscheduling the deployment. The deployment, its groups, and their associated summaries have their statuses updated toChangeStatusType.UNSCHEDULING, and aWorkflowJobUnschedulingRequestis published to actually unschedule the job.- Specified by:
unschedulein interfaceDeploymentRequestHandler- Parameters:
changeDeployId- the ID of the previously scheduledChangeDeploywhich should be unscheduled- See Also:
-
unschedule
public void unschedule(@NonNull String changeDeployId, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:DeploymentRequestHandlerAccepts an ID for aChangeDeploythat was previously scheduled and starts the process of unscheduling the deployment. The deployment, its groups, and their associated summaries have their statuses updated toChangeStatusType.UNSCHEDULING, and aWorkflowJobUnschedulingRequestis published to actually unschedule the job.- Specified by:
unschedulein interfaceDeploymentRequestHandler- Parameters:
changeDeployId- the ID of the previously scheduledChangeDeploywhich should be unscheduledvendorNarrowing- whether to filter results based on the current authentication's vendor restrictions if vendor processing is enabledcontextInfo- context information about sandboxing and multitenant state- See Also:
-
clear
public void clear(@NonNull String changeDeployId, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:DeploymentRequestHandlerAccepts an ID for aChangeDeploythat previously failed and starts the process of clearing the error state of the deployment. This includes notifying (via special deployment case) all resource tier services with impacted entities. The resource tier service is responsible for rectifying theChangeDetailstate to obsolete for deployment version matches in the tracking information for affected entities.- Specified by:
clearin interfaceDeploymentRequestHandler- Parameters:
changeDeployId- The ID of the previously failed deploymentvendorNarrowing- whether to filter results based on the current authentication's vendor restrictions if vendor processing is enabledcontextInfo- context information about sandboxing and multitenant state
-
schedule
public void schedule(@NonNull ChangeSummaryGroups scheduleGroups, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @NonNull String sandbox, @NonNull Instant deployTime, int level) Description copied from interface:DeploymentRequestHandlerCreates a newChangeDeployfor the givenChangeSummaryGroupsand schedules it for the given deployTime. The givenChangeSummaryGroupsand theirChangeSummariesare marked with statusChangeStatusType.SCHEDULING, and aWorkflowJobSchedulingRequestis published to actually schedule the job- Specified by:
schedulein interfaceDeploymentRequestHandler- Parameters:
scheduleGroups- Construct that identifies one or moreChangeSummaryGroupinstances to be scheduled for a future deployment.context- Information about the deploy request containing the ID of the request's author.sandbox- The sandbox ID upon which to filter searches on when retrieving the group instances and their summaries.deployTime- Time at which to deploy the items identified by the scheduleGroups param- See Also:
-
schedule
public void schedule(@NonNull ChangeSummaryGroups scheduleGroups, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @NonNull String sandbox, @NonNull Instant deployTime, int level, boolean vendorNarrowing) Description copied from interface:DeploymentRequestHandlerCreates a newChangeDeployfor the givenChangeSummaryGroupsand schedules it for the given deployTime. The givenChangeSummaryGroupsand theirChangeSummariesare marked with statusChangeStatusType.SCHEDULING, and aWorkflowJobSchedulingRequestis published to actually schedule the job- Specified by:
schedulein interfaceDeploymentRequestHandler- Parameters:
scheduleGroups- Construct that identifies one or moreChangeSummaryGroupinstances to be scheduled for a future deployment.context- Information about the deploy request containing the ID of the request's author.sandbox- The sandbox ID upon which to filter searches on when retrieving the group instances and their summaries.deployTime- Time at which to deploy the items identified by the scheduleGroups paramvendorNarrowing- whether or not to filter results based on the current authentication's vendor restrictions if vendor processing is enabled- See Also:
-
executeDeployment
Description copied from interface:DeploymentRequestHandlerFinds an existing, previously scheduledChangeDeployand sends out aWorkflowDeployRequestperChangeSummaryin the deployment via the relevant Spring Cloud channel. It will also mark the deployment'sChangeSummaryGroupsandChangeSummarieswith statusChangeStatusType.DEPLOYING.- Specified by:
executeDeploymentin interfaceDeploymentRequestHandler- Parameters:
deployId- Id of an existing, scheduledChangeDeploy.
-
removeTemporaryPlaceholderFromAffectedVendors
IfvendorProcessingEnabled, then updates the datastore such that the temporary placeholder frominitializeVendorFields(ChangeDeploy)is removed from the givendeployId.- Parameters:
deployId- the ID of the deployment from which to remove the temporary placeholder from affected vendors- See Also:
-
initializeVendorFields(ChangeDeploy)
-
isVendorProcessingEnabled
protected boolean isVendorProcessingEnabled()Whether or not vendor processing is enabled. This will determine how certain vendor-related fields on domains are initialized. -
setVendorProcessingEnabled
@Autowired public void setVendorProcessingEnabled(@Value("${broadleaf.sandbox.propagation.enabled:false}") boolean vendorProcessingEnabled) Whether or not vendor processing is enabled. This will determine how certain vendor-related fields on domains are initialized.
-