Class SandboxApplicationCreatedEventHandler
java.lang.Object
com.broadleafcommerce.sandbox.persistence.event.SandboxApplicationCreatedEventHandler
- All Implemented Interfaces:
- SandboxApplicationChangeEventHandler
public class SandboxApplicationCreatedEventHandler
extends Object
implements SandboxApplicationChangeEventHandler
Handles sandbox actions in response to an 
Application being created. By default, this
 will create a default Sandbox for the new application, unless the application already has
 one.- Author:
- Nathan Moore (nathandmoore)
- 
Constructor SummaryConstructorsConstructorDescriptionSandboxApplicationCreatedEventHandler(SandboxService<Sandbox> sandboxService, com.broadleafcommerce.common.extension.TypeFactory sandboxFactory) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected com.broadleafcommerce.data.tracking.core.context.ContextInfobuildContextInfo(com.broadleafcommerce.data.tracking.core.Trackable application) booleancanHandle(com.broadleafcommerce.data.tracking.core.tenant.service.ApplicationChangedEvent event) Determines whether this handler should respond to anApplicationChangedEvent.protected voidcreateDefaultSandbox(com.broadleafcommerce.data.tracking.core.Trackable application, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) voidhandle(com.broadleafcommerce.data.tracking.core.tenant.service.ApplicationChangedEvent event) Responsible for executing actions in response to anApplicationChangedEventsuch as creating a defaultSandboxfor new applications.
- 
Constructor Details- 
SandboxApplicationCreatedEventHandlerpublic SandboxApplicationCreatedEventHandler(SandboxService<Sandbox> sandboxService, com.broadleafcommerce.common.extension.TypeFactory sandboxFactory) 
 
- 
- 
Method Details- 
canHandlepublic boolean canHandle(@NonNull com.broadleafcommerce.data.tracking.core.tenant.service.ApplicationChangedEvent event) Description copied from interface:SandboxApplicationChangeEventHandlerDetermines whether this handler should respond to anApplicationChangedEvent.- Specified by:
- canHandlein interface- SandboxApplicationChangeEventHandler
- Parameters:
- event- A new- ApplicationChangedEventwith information about the application that was changed.
- Returns:
- whether this handler should respond to an ApplicationChangedEvent.
 
- 
handlepublic void handle(@NonNull com.broadleafcommerce.data.tracking.core.tenant.service.ApplicationChangedEvent event) Description copied from interface:SandboxApplicationChangeEventHandlerResponsible for executing actions in response to anApplicationChangedEventsuch as creating a defaultSandboxfor new applications.- Specified by:
- handlein interface- SandboxApplicationChangeEventHandler
- Parameters:
- event- A new- ApplicationChangedEventwith information about the application that was changed.
 
- 
buildContextInfoprotected com.broadleafcommerce.data.tracking.core.context.ContextInfo buildContextInfo(com.broadleafcommerce.data.tracking.core.Trackable application) 
- 
createDefaultSandboxprotected void createDefaultSandbox(com.broadleafcommerce.data.tracking.core.Trackable application, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) 
 
-