Class BackofficeProductEventHandlerV1

java.lang.Object
es.kukenan.smartfi.microservice.contracts.service.events.backoffice.AbstractBackofficeEvent
es.kukenan.smartfi.microservice.contracts.service.events.backoffice.v1.BackofficeProductEventHandlerV1
All Implemented Interfaces:
BackofficeEvent

@Component public class BackofficeProductEventHandlerV1 extends AbstractBackofficeEvent implements BackofficeEvent
Backoffice product event for version 1.0.
  • Field Details

    • VERSION

      private static final String VERSION
      Event version.
      See Also:
    • hazelcastInstance

      @Autowired @Qualifier("hazelcastInstance") private com.hazelcast.core.HazelcastInstance hazelcastInstance
      HazelcastInstance hazelcastInstance.
    • appName

      @Value("${spring.application.name}") private String appName
      Spring application name.
    • amqpController

      @Autowired private AmqpController amqpController
      Amqp controller.
    • kafkaController

      @Autowired private KafkaController kafkaController
      Kafka Controller.
    • productCancelledMapper

      @Autowired private ProductCancelledMapper productCancelledMapper
      Product cancelled mapper.
  • Constructor Details

    • BackofficeProductEventHandlerV1

      public BackofficeProductEventHandlerV1(ProductRepository productRepository, SubsystemRepository subsystemRepository, UserBackofficeRepository userBackofficeRepository)
      Constructor.
      Parameters:
      productRepository - Product repository
      subsystemRepository - Subsystem repository
      userBackofficeRepository - User backoffice repository
  • Method Details

    • checkHandler

      public boolean checkHandler(es.kukenan.smartfi.microservice.backoffice.events.created.BackOfficeProductCreatedEvent backOfficeProductCreatedEvent)
      Description copied from interface: BackofficeEvent
      Determine handler to execute.
      Specified by:
      checkHandler in interface BackofficeEvent
      Parameters:
      backOfficeProductCreatedEvent - event
      Returns:
      if the service must manage this version
    • checkHandler

      public boolean checkHandler(es.kukenan.smartfi.microservice.backoffice.events.update.BackOfficeProductUpdatedEvent backOfficeProductUpdatedEvent)
      Description copied from interface: BackofficeEvent
      Determine handler to execute.
      Specified by:
      checkHandler in interface BackofficeEvent
      Parameters:
      backOfficeProductUpdatedEvent - event
      Returns:
      if the service must manage this version
    • checkHandler

      public boolean checkHandler(es.kukenan.smartfi.microservice.backoffice.events.cancelled.BackOfficeProductCancelledEvent backOfficeProductCancelledEvent)
      Description copied from interface: BackofficeEvent
      Determine handler to execute.
      Specified by:
      checkHandler in interface BackofficeEvent
      Parameters:
      backOfficeProductCancelledEvent - event
      Returns:
      if the service must manage this version
    • handleBackOfficeProductCreatedEvent

      public void handleBackOfficeProductCreatedEvent(es.kukenan.smartfi.microservice.backoffice.events.created.BackOfficeProductCreatedEvent backOfficeProductCreatedEvent)
      Description copied from interface: BackofficeEvent
      Backoffice product created event handler.
      Specified by:
      handleBackOfficeProductCreatedEvent in interface BackofficeEvent
      Parameters:
      backOfficeProductCreatedEvent - event
    • handleBackOfficeProductUpdatedEvent

      public void handleBackOfficeProductUpdatedEvent(es.kukenan.smartfi.microservice.backoffice.events.update.BackOfficeProductUpdatedEvent backOfficeProductUpdatedEvent)
      Description copied from interface: BackofficeEvent
      Backoffice product updated event handler.
      Specified by:
      handleBackOfficeProductUpdatedEvent in interface BackofficeEvent
      Parameters:
      backOfficeProductUpdatedEvent - event
    • handleBackOfficeProductCancelledEvent

      public void handleBackOfficeProductCancelledEvent(es.kukenan.smartfi.microservice.backoffice.events.cancelled.BackOfficeProductCancelledEvent backOfficeProductCancelledEvent)
      Description copied from interface: BackofficeEvent
      Backoffice product cancelled event handler.
      Specified by:
      handleBackOfficeProductCancelledEvent in interface BackofficeEvent
      Parameters:
      backOfficeProductCancelledEvent - event
    • updatedCacheForCancelledProducts

      private void updatedCacheForCancelledProducts(es.kukenan.smartfi.microservice.backoffice.events.cancelled.BackOfficeProductCancelledEvent backOfficeProductCancelledEvent)
      Updated cache due to cancelled product.
      Parameters:
      backOfficeProductCancelledEvent - cancelled product event.