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 Summary
ConstructorsConstructorDescriptionSandboxApplicationCreatedEventHandler(SandboxService<Sandbox> sandboxService, com.broadleafcommerce.common.extension.TypeFactory sandboxFactory) -
Method Summary
Modifier 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
-
SandboxApplicationCreatedEventHandler
public SandboxApplicationCreatedEventHandler(SandboxService<Sandbox> sandboxService, com.broadleafcommerce.common.extension.TypeFactory sandboxFactory)
-
-
Method Details
-
canHandle
public 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 interfaceSandboxApplicationChangeEventHandler- Parameters:
event- A newApplicationChangedEventwith information about the application that was changed.- Returns:
- whether this handler should respond to an
ApplicationChangedEvent.
-
handle
public 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 interfaceSandboxApplicationChangeEventHandler- Parameters:
event- A newApplicationChangedEventwith information about the application that was changed.
-
buildContextInfo
protected com.broadleafcommerce.data.tracking.core.context.ContextInfo buildContextInfo(com.broadleafcommerce.data.tracking.core.Trackable application) -
createDefaultSandbox
protected void createDefaultSandbox(com.broadleafcommerce.data.tracking.core.Trackable application, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
-