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 Summary
FieldsModifier and TypeFieldDescriptionprivate AmqpControllerAmqp controller.private StringSpring application name.private com.hazelcast.core.HazelcastInstanceHazelcastInstance hazelcastInstance.private KafkaControllerKafka Controller.private ProductCancelledMapperProduct cancelled mapper.private static final StringEvent version.Fields inherited from class es.kukenan.smartfi.microservice.contracts.service.events.backoffice.AbstractBackofficeEvent
productRepository, userBackofficeRepository -
Constructor Summary
ConstructorsConstructorDescriptionBackofficeProductEventHandlerV1(ProductRepository productRepository, SubsystemRepository subsystemRepository, UserBackofficeRepository userBackofficeRepository) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckHandler(es.kukenan.smartfi.microservice.backoffice.events.cancelled.BackOfficeProductCancelledEvent backOfficeProductCancelledEvent) Determine handler to execute.booleancheckHandler(es.kukenan.smartfi.microservice.backoffice.events.created.BackOfficeProductCreatedEvent backOfficeProductCreatedEvent) Determine handler to execute.booleancheckHandler(es.kukenan.smartfi.microservice.backoffice.events.update.BackOfficeProductUpdatedEvent backOfficeProductUpdatedEvent) Determine handler to execute.voidhandleBackOfficeProductCancelledEvent(es.kukenan.smartfi.microservice.backoffice.events.cancelled.BackOfficeProductCancelledEvent backOfficeProductCancelledEvent) Backoffice product cancelled event handler.voidhandleBackOfficeProductCreatedEvent(es.kukenan.smartfi.microservice.backoffice.events.created.BackOfficeProductCreatedEvent backOfficeProductCreatedEvent) Backoffice product created event handler.voidhandleBackOfficeProductUpdatedEvent(es.kukenan.smartfi.microservice.backoffice.events.update.BackOfficeProductUpdatedEvent backOfficeProductUpdatedEvent) Backoffice product updated event handler.private voidupdatedCacheForCancelledProducts(es.kukenan.smartfi.microservice.backoffice.events.cancelled.BackOfficeProductCancelledEvent backOfficeProductCancelledEvent) Updated cache due to cancelled product.Methods inherited from class es.kukenan.smartfi.microservice.contracts.service.events.backoffice.AbstractBackofficeEvent
getProductsByUserBackoffice, gettingSubsystem, saveProduct
-
Field Details
-
VERSION
Event version.- See Also:
-
hazelcastInstance
@Autowired @Qualifier("hazelcastInstance") private com.hazelcast.core.HazelcastInstance hazelcastInstanceHazelcastInstance hazelcastInstance. -
appName
Spring application name. -
amqpController
Amqp controller. -
kafkaController
Kafka Controller. -
productCancelledMapper
Product cancelled mapper.
-
-
Constructor Details
-
BackofficeProductEventHandlerV1
public BackofficeProductEventHandlerV1(ProductRepository productRepository, SubsystemRepository subsystemRepository, UserBackofficeRepository userBackofficeRepository) Constructor.- Parameters:
productRepository- Product repositorysubsystemRepository- Subsystem repositoryuserBackofficeRepository- User backoffice repository
-
-
Method Details
-
checkHandler
public boolean checkHandler(es.kukenan.smartfi.microservice.backoffice.events.created.BackOfficeProductCreatedEvent backOfficeProductCreatedEvent) Description copied from interface:BackofficeEventDetermine handler to execute.- Specified by:
checkHandlerin interfaceBackofficeEvent- 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:BackofficeEventDetermine handler to execute.- Specified by:
checkHandlerin interfaceBackofficeEvent- 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:BackofficeEventDetermine handler to execute.- Specified by:
checkHandlerin interfaceBackofficeEvent- 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:BackofficeEventBackoffice product created event handler.- Specified by:
handleBackOfficeProductCreatedEventin interfaceBackofficeEvent- Parameters:
backOfficeProductCreatedEvent- event
-
handleBackOfficeProductUpdatedEvent
public void handleBackOfficeProductUpdatedEvent(es.kukenan.smartfi.microservice.backoffice.events.update.BackOfficeProductUpdatedEvent backOfficeProductUpdatedEvent) Description copied from interface:BackofficeEventBackoffice product updated event handler.- Specified by:
handleBackOfficeProductUpdatedEventin interfaceBackofficeEvent- Parameters:
backOfficeProductUpdatedEvent- event
-
handleBackOfficeProductCancelledEvent
public void handleBackOfficeProductCancelledEvent(es.kukenan.smartfi.microservice.backoffice.events.cancelled.BackOfficeProductCancelledEvent backOfficeProductCancelledEvent) Description copied from interface:BackofficeEventBackoffice product cancelled event handler.- Specified by:
handleBackOfficeProductCancelledEventin interfaceBackofficeEvent- 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.
-