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

    Constructors
    Constructor
    Description
    SandboxApplicationCreatedEventHandler(SandboxService<Sandbox> sandboxService, com.broadleafcommerce.common.extension.TypeFactory sandboxFactory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected 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 an ApplicationChangedEvent.
    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 an ApplicationChangedEvent such as creating a default Sandbox for new applications.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 an ApplicationChangedEvent.
      Specified by:
      canHandle in interface SandboxApplicationChangeEventHandler
      Parameters:
      event - A new ApplicationChangedEvent 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 an ApplicationChangedEvent such as creating a default Sandbox for new applications.
      Specified by:
      handle in interface SandboxApplicationChangeEventHandler
      Parameters:
      event - A new ApplicationChangedEvent 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)