Class CodeGenerationPersistenceHandler

java.lang.Object
com.broadleafcommerce.promotion.offer.service.persistence.CodeGenerationPersistenceHandler
All Implemented Interfaces:
com.broadleafcommerce.common.messaging.PersistenceHandler

public class CodeGenerationPersistenceHandler extends Object implements com.broadleafcommerce.common.messaging.PersistenceHandler
Author:
Chad Harchar (charchar)
  • Field Summary

    Fields inherited from interface com.broadleafcommerce.common.messaging.PersistenceHandler

    log
  • Constructor Summary

    Constructors
    Constructor
    Description
    CodeGenerationPersistenceHandler(CodeGeneratorRepository<com.broadleafcommerce.data.tracking.core.Trackable> codeGeneratorRepository, CodeGenerationService codeGenerationService, com.broadleafcommerce.data.tracking.core.mapping.DomainMapperManager trackingMapper, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, IdempotentPersistenceNotificationConsumptionService idempotentConsumptionService, com.broadleafcommerce.common.extension.data.DataRouteSupporting route)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.fasterxml.jackson.databind.ObjectMapper
     
     
    void
    hook(String entityJson)
     
    protected com.broadleafcommerce.data.tracking.core.context.ContextRequest
    hydrateContextRequest(com.broadleafcommerce.data.tracking.core.Trackable trackable)
     
    protected com.broadleafcommerce.data.tracking.core.Trackable
    hydrateFromJson(com.fasterxml.jackson.databind.JsonNode entityJson, Class<?> domainType, com.fasterxml.jackson.databind.ObjectMapper mapper)
    Create a repository-specific entity instance given a JSON representation.
    void
    processStateChange(com.fasterxml.jackson.databind.JsonNode entityJson)
     
    protected void
    processStateChangeInternal(com.fasterxml.jackson.databind.JsonNode entityJson)
     
    void
    validate(com.fasterxml.jackson.databind.JsonNode entityJson)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.broadleafcommerce.common.messaging.PersistenceHandler

    handle, isValidType
  • Constructor Details

    • CodeGenerationPersistenceHandler

      public CodeGenerationPersistenceHandler(CodeGeneratorRepository<com.broadleafcommerce.data.tracking.core.Trackable> codeGeneratorRepository, CodeGenerationService codeGenerationService, com.broadleafcommerce.data.tracking.core.mapping.DomainMapperManager trackingMapper, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, IdempotentPersistenceNotificationConsumptionService idempotentConsumptionService, com.broadleafcommerce.common.extension.data.DataRouteSupporting route)
  • Method Details

    • hook

      @StreamListener("persistenceInputCodeGeneration") public void hook(String entityJson)
      Specified by:
      hook in interface com.broadleafcommerce.common.messaging.PersistenceHandler
    • processStateChange

      public void processStateChange(com.fasterxml.jackson.databind.JsonNode entityJson)
      Specified by:
      processStateChange in interface com.broadleafcommerce.common.messaging.PersistenceHandler
    • processStateChangeInternal

      protected void processStateChangeInternal(com.fasterxml.jackson.databind.JsonNode entityJson)
    • hydrateContextRequest

      protected com.broadleafcommerce.data.tracking.core.context.ContextRequest hydrateContextRequest(com.broadleafcommerce.data.tracking.core.Trackable trackable)
    • getSupportedSimpleTypeNames

      public String[] getSupportedSimpleTypeNames()
      Specified by:
      getSupportedSimpleTypeNames in interface com.broadleafcommerce.common.messaging.PersistenceHandler
    • getObjectMapper

      public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
      Specified by:
      getObjectMapper in interface com.broadleafcommerce.common.messaging.PersistenceHandler
    • validate

      public void validate(com.fasterxml.jackson.databind.JsonNode entityJson)
      Specified by:
      validate in interface com.broadleafcommerce.common.messaging.PersistenceHandler
    • hydrateFromJson

      protected com.broadleafcommerce.data.tracking.core.Trackable hydrateFromJson(com.fasterxml.jackson.databind.JsonNode entityJson, Class<?> domainType, com.fasterxml.jackson.databind.ObjectMapper mapper)
      Create a repository-specific entity instance given a JSON representation.
      Parameters:
      entityJson - The JSON representation of the entity
      domainType - The repository specific domain class type
      mapper - The Jackson mapper instance that can facilitate conversion
      Returns:
      The instantiated and fully-populated entity instance