Class CodeGenerationPersistenceHandler

  • All Implemented Interfaces:
    com.broadleafcommerce.common.messaging.PersistenceHandler

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

      • 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 Detail

      • 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