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.ContextInfo
buildContextInfo
(com.broadleafcommerce.data.tracking.core.Trackable application) boolean
canHandle
(com.broadleafcommerce.data.tracking.core.tenant.service.ApplicationChangedEvent event) Determines whether this handler should respond to anApplicationChangedEvent
.protected void
createDefaultSandbox
(com.broadleafcommerce.data.tracking.core.Trackable application, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) void
handle
(com.broadleafcommerce.data.tracking.core.tenant.service.ApplicationChangedEvent event) Responsible for executing actions in response to anApplicationChangedEvent
such as creating a defaultSandbox
for 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:SandboxApplicationChangeEventHandler
Determines whether this handler should respond to anApplicationChangedEvent
.- Specified by:
canHandle
in interfaceSandboxApplicationChangeEventHandler
- Parameters:
event
- A newApplicationChangedEvent
with 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:SandboxApplicationChangeEventHandler
Responsible for executing actions in response to anApplicationChangedEvent
such as creating a defaultSandbox
for new applications.- Specified by:
handle
in interfaceSandboxApplicationChangeEventHandler
- Parameters:
event
- A newApplicationChangedEvent
with 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)
-