diff --git a/pom.xml b/pom.xml index ba650b1..d9fbe68 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ UTF-8 quarkus-universe-bom io.quarkus - 2.1.0.Final + 2.1.1.Final 3.0.0-M5 @@ -27,7 +27,7 @@ io.quarkus quarkus-universe-bom - 2.1.0.Final + 2.1.1.Final pom import diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/domain/MachineryDataDTO.java b/src/main/java/io/qiot/manufacturing/edge/machinery/domain/MachineryDataDTO.java index 32b1969..e7ece73 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/domain/MachineryDataDTO.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/domain/MachineryDataDTO.java @@ -2,6 +2,10 @@ import io.quarkus.runtime.annotations.RegisterForReflection; +/** + * @author andreabattaglia + * + */ @RegisterForReflection public class MachineryDataDTO { diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/domain/ProductionCountersDTO.java b/src/main/java/io/qiot/manufacturing/edge/machinery/domain/ProductionCountersDTO.java index 9a70479..8b47fc5 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/domain/ProductionCountersDTO.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/domain/ProductionCountersDTO.java @@ -9,6 +9,10 @@ import io.qiot.manufacturing.commons.domain.production.ProductionChainStageEnum; import io.quarkus.runtime.annotations.RegisterForReflection; +/** + * @author andreabattaglia + * + */ @RegisterForReflection public class ProductionCountersDTO { public UUID productLineId; diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/domain/event/chain/StageCompletedEvent.java b/src/main/java/io/qiot/manufacturing/edge/machinery/domain/event/chain/StageCompletedEvent.java index db14a42..d3e03e6 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/domain/event/chain/StageCompletedEvent.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/domain/event/chain/StageCompletedEvent.java @@ -3,6 +3,10 @@ import io.qiot.manufacturing.commons.domain.production.ItemDTO; import io.quarkus.runtime.annotations.RegisterForReflection; +/** + * @author andreabattaglia + * + */ @RegisterForReflection public class StageCompletedEvent { public ItemDTO item; diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/domain/event/chain/ValidationFailedEvent.java b/src/main/java/io/qiot/manufacturing/edge/machinery/domain/event/chain/ValidationFailedEvent.java index e33796e..e1259cd 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/domain/event/chain/ValidationFailedEvent.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/domain/event/chain/ValidationFailedEvent.java @@ -3,6 +3,10 @@ import io.qiot.manufacturing.commons.domain.productionvalidation.AbstractProductionChainEventDTO; import io.quarkus.runtime.annotations.RegisterForReflection; +/** + * @author andreabattaglia + * + */ @RegisterForReflection public class ValidationFailedEvent extends AbstractProductionChainEventDTO { } diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/domain/event/chain/ValidationSuccessfullEvent.java b/src/main/java/io/qiot/manufacturing/edge/machinery/domain/event/chain/ValidationSuccessfullEvent.java index f3b7e28..20a245b 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/domain/event/chain/ValidationSuccessfullEvent.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/domain/event/chain/ValidationSuccessfullEvent.java @@ -3,6 +3,10 @@ import io.qiot.manufacturing.commons.domain.productionvalidation.AbstractProductionChainEventDTO; import io.quarkus.runtime.annotations.RegisterForReflection; +/** + * @author andreabattaglia + * + */ @RegisterForReflection public class ValidationSuccessfullEvent extends AbstractProductionChainEventDTO { } diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/domain/event/productline/ProductLineChangedEventDTO.java b/src/main/java/io/qiot/manufacturing/edge/machinery/domain/event/productline/ProductLineChangedEventDTO.java index 421fa49..fd52ea7 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/domain/event/productline/ProductLineChangedEventDTO.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/domain/event/productline/ProductLineChangedEventDTO.java @@ -3,6 +3,10 @@ import io.qiot.manufacturing.commons.domain.productline.ProductLineDTO; import io.quarkus.runtime.annotations.RegisterForReflection; +/** + * @author andreabattaglia + * + */ @RegisterForReflection public class ProductLineChangedEventDTO { public ProductLineDTO productLine; diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/core/CoreService.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/core/CoreService.java index 04a5f9d..d9e8db2 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/core/CoreService.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/core/CoreService.java @@ -1,5 +1,9 @@ package io.qiot.manufacturing.edge.machinery.service.core; +/** + * @author andreabattaglia + * + */ public interface CoreService { } diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/core/CoreServiceImpl.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/core/CoreServiceImpl.java index 95bda6c..1273935 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/core/CoreServiceImpl.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/core/CoreServiceImpl.java @@ -45,7 +45,7 @@ public class CoreServiceImpl implements CoreService { Event event; void onStart(@Observes StartupEvent ev) throws DataValidationException { - LOGGER.info("The application is starting...{}"); + LOGGER.debug("The application is starting...{}"); // stationData = scheduler.pause(); machineryService.checkRegistration(); diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/machinery/MachineryService.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/machinery/MachineryService.java index 6396247..d8aea8f 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/machinery/MachineryService.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/machinery/MachineryService.java @@ -3,6 +3,10 @@ import io.qiot.manufacturing.edge.machinery.domain.MachineryDataDTO; import io.qiot.manufacturing.edge.machinery.util.exception.DataValidationException; +/** + * @author andreabattaglia + * + */ public interface MachineryService { MachineryDataDTO checkRegistration() throws DataValidationException; diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/machinery/MachineryServiceImpl.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/machinery/MachineryServiceImpl.java index 302153e..4f1ca2d 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/machinery/MachineryServiceImpl.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/machinery/MachineryServiceImpl.java @@ -55,7 +55,7 @@ public class MachineryServiceImpl implements MachineryService { public MachineryDataDTO checkRegistration() throws DataValidationException { Path dataFilePath = Paths.get(dataFilePathString); if (Files.exists(dataFilePath)) { - LOGGER.info( + LOGGER.debug( "Device is already registered. Loading data from persistent volume..."); try { String datafileContent = Files.readString(dataFilePath); @@ -67,9 +67,9 @@ public MachineryDataDTO checkRegistration() throws DataValidationException { e); throw new DataValidationException(e); } - LOGGER.info("Data loaded successfully: {}", machineryData); + LOGGER.debug("Data loaded successfully: {}", machineryData); } else { - LOGGER.info( + LOGGER.debug( "Device is not registered. Stepping through the registration process..."); machineryData = new MachineryDataDTO(); @@ -87,7 +87,7 @@ public MachineryDataDTO checkRegistration() throws DataValidationException { // ksPassword); // } - LOGGER.info("Received machinery ID: {}", machineryId); + LOGGER.debug("Received machinery ID: {}", machineryId); machineryData.id = machineryId; Files.createFile(dataFilePath); @@ -95,7 +95,7 @@ public MachineryDataDTO checkRegistration() throws DataValidationException { .writeValueAsString(machineryData); Files.writeString(dataFilePath, machineryDataString); - LOGGER.info("Data Created successfully: {}", machineryData); + LOGGER.debug("Data Created successfully: {}", machineryData); } catch (Exception e) { LOGGER.error( "An error occurred registering the measurement machinery.", diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/ConveyorBeltService.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/ConveyorBeltService.java index fabc341..22d490d 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/ConveyorBeltService.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/ConveyorBeltService.java @@ -5,6 +5,10 @@ import io.qiot.manufacturing.commons.domain.production.ItemDTO; import io.qiot.manufacturing.commons.domain.production.ProductionChainStageEnum; +/** + * @author andreabattaglia + * + */ public interface ConveyorBeltService { void createNewItem(UUID productLineId, int itemId); diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/ConveyorBeltServiceImpl.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/ConveyorBeltServiceImpl.java index a2267ef..c568b33 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/ConveyorBeltServiceImpl.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/ConveyorBeltServiceImpl.java @@ -12,6 +12,10 @@ import io.qiot.manufacturing.commons.domain.production.ItemDTO; import io.qiot.manufacturing.commons.domain.production.ProductionChainStageEnum; +/** + * @author andreabattaglia + * + */ @ApplicationScoped public class ConveyorBeltServiceImpl implements ConveyorBeltService { diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/CountersService.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/CountersService.java index a9be7c4..d4b0aa0 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/CountersService.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/CountersService.java @@ -4,6 +4,10 @@ import io.qiot.manufacturing.commons.domain.production.ProductionChainStageEnum; +/** + * @author andreabattaglia + * + */ public interface CountersService { int recordNewItem(UUID productLineId); diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/CountersServiceImpl.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/CountersServiceImpl.java index c1bba3a..0f0603c 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/CountersServiceImpl.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/CountersServiceImpl.java @@ -15,6 +15,10 @@ import io.qiot.manufacturing.commons.domain.production.ProductionChainStageEnum; import io.qiot.manufacturing.edge.machinery.domain.ProductionCountersDTO; +/** + * @author andreabattaglia + * + */ @ApplicationScoped public class CountersServiceImpl implements CountersService { diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/ProductionChainService.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/ProductionChainService.java index 2f71cbb..8f2f8d9 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/ProductionChainService.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/ProductionChainService.java @@ -1,5 +1,9 @@ package io.qiot.manufacturing.edge.machinery.service.production; +/** + * @author andreabattaglia + * + */ public interface ProductionChainService { // void produce(); diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/ProductionChainServiceImpl.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/ProductionChainServiceImpl.java index 00026d8..d09a48a 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/ProductionChainServiceImpl.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/ProductionChainServiceImpl.java @@ -67,7 +67,7 @@ public void produce() { } void onStageCompleted(@Observes StageCompletedEvent event) { - LOGGER.info("Recording changes and notifying..."); + LOGGER.debug("Recording changes and notifying..."); ItemDTO item = event.item; countersService.recordStageEnd(item.id, item.productLineId, item.stage); conveyorBeltService.moveToWaitingQueue(item); diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/chain/AbstractChainService.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/chain/AbstractChainService.java index 1b69c19..7065956 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/chain/AbstractChainService.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/chain/AbstractChainService.java @@ -17,6 +17,10 @@ import io.qiot.manufacturing.edge.machinery.service.production.ConveyorBeltService; import io.qiot.manufacturing.edge.machinery.service.productline.ProductLineService; +/** + * @author andreabattaglia + * + */ public abstract class AbstractChainService implements ChainService { @Inject @@ -40,28 +44,28 @@ void init() { public void doSimulate() { ItemDTO item = poll(getStage()); if (Objects.isNull(item)) { - getLogger().info("No items available in conveyor belt for stage {}", + getLogger().debug("No items available in conveyor belt for stage {}", getStage()); return; } - getLogger().info( + getLogger().debug( "{} process started for Item #{} and Product Line #{}.", getStage(), item.id, item.productLineId); checkProductLineId(item.productLineId); // if (Objects.isNull(item.productLineId)) { - // getLogger().info("No Product Line available."); + // getLogger().debug("No Product Line available."); // return; // } item.stage = getStage(); try { long sleepTime = sleepRandomNumberGenerator.nextLong(); - getLogger().info("Sleeping for {} millis.", sleepTime); + getLogger().debug("Sleeping for {} millis.", sleepTime); Thread.sleep(sleepTime); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } generate(item); - getLogger().info( + getLogger().debug( "{} process completed for Item #{} and Product Line #{}.", getStage(), item.id, item.productLineId); notify(item); diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/chain/ChainService.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/chain/ChainService.java index 2348e9f..bd62611 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/chain/ChainService.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/production/chain/ChainService.java @@ -1,5 +1,9 @@ package io.qiot.manufacturing.edge.machinery.service.production.chain; +/** + * @author andreabattaglia + * + */ public interface ChainService { void simulate(); diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/LatestProductLineMessageConsumer.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/LatestProductLineMessageConsumer.java index 4379efe..456b9a4 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/LatestProductLineMessageConsumer.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/LatestProductLineMessageConsumer.java @@ -23,15 +23,15 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.qiot.manufacturing.commons.domain.event.BootstrapCompletedEventDTO; -import io.qiot.manufacturing.commons.domain.productionvalidation.ValidationResponseDTO; import io.qiot.manufacturing.commons.domain.productline.ProductLineDTO; import io.qiot.manufacturing.commons.util.producer.ProductLineReplyToQueueNameProducer; -import io.qiot.manufacturing.commons.util.producer.ValidationReplyToQueueNameProducer; -import io.qiot.manufacturing.edge.machinery.domain.event.chain.ValidationFailedEvent; -import io.qiot.manufacturing.edge.machinery.domain.event.chain.ValidationSuccessfullEvent; import io.qiot.manufacturing.edge.machinery.domain.event.productline.ProductLineChangedEventDTO; import io.qiot.manufacturing.edge.machinery.service.machinery.MachineryService; +/** + * @author andreabattaglia + * + */ @ApplicationScoped public class LatestProductLineMessageConsumer implements Runnable { @@ -65,7 +65,7 @@ public class LatestProductLineMessageConsumer implements Runnable { .newSingleThreadExecutor(); void init(@Observes BootstrapCompletedEventDTO event) { - LOGGER.info("Bootstrapping new product line durable subscriber..."); + LOGGER.debug("Bootstrapping new product line durable subscriber..."); initSubscriber(); scheduler.submit(this); @@ -99,7 +99,7 @@ public void run() { String messagePayload = message.getBody(String.class); ProductLineDTO productLine = MAPPER.readValue(messagePayload, ProductLineDTO.class); - LOGGER.info("Received latest PRODUCTLINE available from the Factory Controller: \n {}", productLine); + LOGGER.debug("Received latest PRODUCTLINE available from the Factory Controller: \n {}", productLine); ProductLineChangedEventDTO eventDTO = new ProductLineChangedEventDTO(); eventDTO.productLine = productLine; prodictLineChangedEvent.fire(eventDTO); diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/LatestProductLineRequestMessageProducer.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/LatestProductLineRequestMessageProducer.java index 7accb19..192a4cc 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/LatestProductLineRequestMessageProducer.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/LatestProductLineRequestMessageProducer.java @@ -4,7 +4,6 @@ package io.qiot.manufacturing.edge.machinery.service.productline; import java.util.Objects; -import java.util.UUID; import javax.annotation.PostConstruct; import javax.enterprise.context.ApplicationScoped; @@ -47,11 +46,11 @@ public class LatestProductLineRequestMessageProducer { @PostConstruct void init() { - LOGGER.info( + LOGGER.debug( "Bootstrapping latest product line request event producer..."); doInit(); - LOGGER.info("Bootstrap completed"); + LOGGER.debug("Bootstrap completed"); } @@ -66,7 +65,7 @@ private void doInit() { } void requestLatestProductLine(String machineryId) { - LOGGER.info( + LOGGER.debug( "Sending out a request for the latest product line available"); try { String messagePayload = machineryId; diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/NewProductLineMessageConsumer.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/NewProductLineMessageConsumer.java index 287c2e0..53c091c 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/NewProductLineMessageConsumer.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/NewProductLineMessageConsumer.java @@ -4,7 +4,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.enterprise.context.ApplicationScoped; import javax.enterprise.event.Event; @@ -14,9 +13,7 @@ import javax.jms.JMSConsumer; import javax.jms.JMSContext; import javax.jms.JMSException; -import javax.jms.JMSProducer; import javax.jms.Message; -import javax.jms.Queue; import javax.jms.Session; import javax.jms.Topic; @@ -27,14 +24,14 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.qiot.manufacturing.commons.domain.event.BootstrapCompletedEventDTO; -import io.qiot.manufacturing.commons.domain.productionvalidation.ValidationResponseDTO; import io.qiot.manufacturing.commons.domain.productline.ProductLineDTO; -import io.qiot.manufacturing.commons.util.producer.ValidationReplyToQueueNameProducer; -import io.qiot.manufacturing.edge.machinery.domain.event.chain.ValidationFailedEvent; -import io.qiot.manufacturing.edge.machinery.domain.event.chain.ValidationSuccessfullEvent; import io.qiot.manufacturing.edge.machinery.domain.event.productline.ProductLineChangedEventDTO; import io.qiot.manufacturing.edge.machinery.service.machinery.MachineryService; +/** + * @author andreabattaglia + * + */ @ApplicationScoped public class NewProductLineMessageConsumer implements Runnable { @@ -66,7 +63,7 @@ public class NewProductLineMessageConsumer implements Runnable { .newSingleThreadExecutor(); void init(@Observes BootstrapCompletedEventDTO event) { - LOGGER.info("Bootstrapping new product line durable subscriber..."); + LOGGER.debug("Bootstrapping new product line durable subscriber..."); initSubscriber(); scheduler.submit(this); @@ -100,7 +97,7 @@ public void run() { String messagePayload = message.getBody(String.class); ProductLineDTO productLine = MAPPER.readValue(messagePayload, ProductLineDTO.class); - LOGGER.info( + LOGGER.debug( "Received new PRODUCTLINE from the Factory Controller: \n {}", productLine); ProductLineChangedEventDTO eventDTO = new ProductLineChangedEventDTO(); diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/ProductLineService.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/ProductLineService.java index 6bbd921..8121063 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/ProductLineService.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/ProductLineService.java @@ -4,6 +4,10 @@ import io.qiot.manufacturing.commons.domain.productline.ProductLineDTO; +/** + * @author andreabattaglia + * + */ public interface ProductLineService { /** diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/ProductLineServiceImpl.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/ProductLineServiceImpl.java index 4e51caa..9911d5b 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/ProductLineServiceImpl.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/productline/ProductLineServiceImpl.java @@ -1,7 +1,6 @@ package io.qiot.manufacturing.edge.machinery.service.productline; import java.util.Map; -import java.util.Objects; import java.util.TreeMap; import java.util.UUID; import java.util.concurrent.locks.Lock; @@ -19,16 +18,18 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.qiot.manufacturing.commons.domain.event.BootstrapCompletedEventDTO; +import io.qiot.manufacturing.commons.domain.productline.GlobalProductLineDTO; import io.qiot.manufacturing.commons.domain.productline.ProductLineDTO; -import io.qiot.manufacturing.commons.util.producer.SampleProductLineProducer; import io.qiot.manufacturing.edge.machinery.domain.event.productline.ProductLineChangedEventDTO; import io.qiot.manufacturing.edge.machinery.service.machinery.MachineryService; +import io.quarkus.runtime.annotations.RegisterForReflection; /** * @author andreabattaglia * */ @ApplicationScoped +@RegisterForReflection(targets={ GlobalProductLineDTO.class, ProductLineDTO.class}) class ProductLineServiceImpl implements ProductLineService { private ReadWriteLock readWriteLock; @@ -67,7 +68,7 @@ void onStart(@Observes BootstrapCompletedEventDTO event) { void newProductLine(@Observes ProductLineChangedEventDTO event) throws JsonProcessingException { - LOGGER.info("Received notification about a new Product Line:\n\n{}", + LOGGER.debug("Received notification about a new Product Line:\n\n{}", event.productLine.id); ProductLineDTO productLine = event.productLine; handleNewProductLine(productLine); diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/registration/RegisterRequest.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/registration/RegisterRequest.java index 6beed4b..8f20a13 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/registration/RegisterRequest.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/registration/RegisterRequest.java @@ -7,6 +7,10 @@ import io.quarkus.runtime.annotations.RegisterForReflection; +/** + * @author andreabattaglia + * + */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "serial", "name", "longitude", "latitude", "keyStorePassword" }) diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/registration/RegisterResponse.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/registration/RegisterResponse.java index b5ab044..e48e158 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/registration/RegisterResponse.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/registration/RegisterResponse.java @@ -7,8 +7,10 @@ import io.quarkus.runtime.annotations.RegisterForReflection; + /** - * + * @author andreabattaglia + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "id", "truststore", "keystore" }) diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/registration/RegistrationService.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/registration/RegistrationService.java index 326b64c..ced8ef8 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/registration/RegistrationService.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/registration/RegistrationService.java @@ -51,7 +51,7 @@ // registerResponse = registrationClient.register(registerRequest); // LOGGER.debug("Registratior process results: {}", registerResponse); // -// LOGGER.info("Acquired stationID: {}", registerResponse.id); +// LOGGER.debug("Acquired stationID: {}", registerResponse.id); // String encodedTSString = registerResponse.truststore; // String encodedKSString = registerResponse.keystore; // diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/ValidationService.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/ValidationService.java index d72a746..1a46ce1 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/ValidationService.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/ValidationService.java @@ -2,6 +2,10 @@ import io.qiot.manufacturing.commons.domain.production.ItemDTO; +/** + * @author andreabattaglia + * + */ public interface ValidationService { void validateItem(ItemDTO item); } diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/ValidationServiceImpl.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/ValidationServiceImpl.java index a30266b..08de469 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/ValidationServiceImpl.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/ValidationServiceImpl.java @@ -12,6 +12,10 @@ import io.qiot.manufacturing.commons.domain.productionvalidation.WeavingValidationRequestEventDTO; import io.qiot.manufacturing.edge.machinery.service.machinery.MachineryService; +/** + * @author andreabattaglia + * + */ @ApplicationScoped public class ValidationServiceImpl implements ValidationService { diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/consumer/ValidationMessageConsumer.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/consumer/ValidationMessageConsumer.java index 17a72d2..db3eb89 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/consumer/ValidationMessageConsumer.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/consumer/ValidationMessageConsumer.java @@ -29,6 +29,10 @@ import io.qiot.manufacturing.edge.machinery.domain.event.chain.ValidationSuccessfullEvent; import io.qiot.manufacturing.edge.machinery.service.machinery.MachineryService; +/** + * @author andreabattaglia + * + */ @ApplicationScoped public class ValidationMessageConsumer implements Runnable { @@ -96,7 +100,7 @@ public void run() { String messagePayload = message.getBody(String.class); ValidationResponseDTO messageDTO = MAPPER .readValue(messagePayload, ValidationResponseDTO.class); - LOGGER.info("Received validation result " + LOGGER.debug("Received validation result " + "for STAGE {} on ITEM {} / PRODUCTLINE {}", messageDTO.stage, messageDTO.itemId, messageDTO.productLineId); if (messageDTO.valid) { diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/AbstractValidationMessageProducer.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/AbstractValidationMessageProducer.java index ef362c7..f639bad 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/AbstractValidationMessageProducer.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/AbstractValidationMessageProducer.java @@ -70,10 +70,10 @@ protected void doInit() { } protected void doRequestValidation(AbstractValidationRequestEventDTO event) { - getLogger().info("{} stage validation request received.", getStage()); + getLogger().debug("{} stage validation request received.", getStage()); try { String payload = MAPPER.writeValueAsString(event); - getLogger().info("Message payload: {}", payload); + getLogger().debug("Message payload: {}", payload); TextMessage message = context.createTextMessage(); message.setJMSDeliveryMode(DeliveryMode.PERSISTENT); message.setText(payload); diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/ColoringValidationMessageProducer.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/ColoringValidationMessageProducer.java index 1879d6a..2e58f8f 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/ColoringValidationMessageProducer.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/ColoringValidationMessageProducer.java @@ -12,6 +12,10 @@ import io.qiot.manufacturing.commons.domain.production.ProductionChainStageEnum; import io.qiot.manufacturing.commons.domain.productionvalidation.ColoringValidationRequestEventDTO; +/** + * @author andreabattaglia + * + */ @ApplicationScoped public class ColoringValidationMessageProducer extends AbstractValidationMessageProducer { diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/PackagingValidationMessageProducer.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/PackagingValidationMessageProducer.java index 887a6d5..0309dae 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/PackagingValidationMessageProducer.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/PackagingValidationMessageProducer.java @@ -12,6 +12,10 @@ import io.qiot.manufacturing.commons.domain.production.ProductionChainStageEnum; import io.qiot.manufacturing.commons.domain.productionvalidation.PackagingValidationRequestEventDTO; +/** + * @author andreabattaglia + * + */ @ApplicationScoped public class PackagingValidationMessageProducer extends AbstractValidationMessageProducer { diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/PrintingValidationMessageProducer.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/PrintingValidationMessageProducer.java index 320e4f4..dd1aae6 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/PrintingValidationMessageProducer.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/PrintingValidationMessageProducer.java @@ -12,6 +12,10 @@ import io.qiot.manufacturing.commons.domain.production.ProductionChainStageEnum; import io.qiot.manufacturing.commons.domain.productionvalidation.PrintingValidationRequestEventDTO; +/** + * @author andreabattaglia + * + */ @ApplicationScoped public class PrintingValidationMessageProducer extends AbstractValidationMessageProducer { diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/WeavingValidationMessageProducer.java b/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/WeavingValidationMessageProducer.java index 8c5f1b5..fca88ee 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/WeavingValidationMessageProducer.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/service/validation/producer/WeavingValidationMessageProducer.java @@ -14,6 +14,10 @@ import io.qiot.manufacturing.commons.domain.production.ProductionChainStageEnum; import io.qiot.manufacturing.commons.domain.productionvalidation.WeavingValidationRequestEventDTO; +/** + * @author andreabattaglia + * + */ @ApplicationScoped public class WeavingValidationMessageProducer extends AbstractValidationMessageProducer { @@ -42,7 +46,7 @@ public void requestValidation( // String payload; // try { // payload = MAPPER.writeValueAsString(event); -// getLogger().info("Message payload: {}", payload); +// getLogger().debug("Message payload: {}", payload); // } catch (JsonProcessingException e) { // // TODO Auto-generated catch block // e.printStackTrace(); diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/util/qualifier/chain/ColouringChainQualifier.java b/src/main/java/io/qiot/manufacturing/edge/machinery/util/qualifier/chain/ColouringChainQualifier.java index 694db52..416819c 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/util/qualifier/chain/ColouringChainQualifier.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/util/qualifier/chain/ColouringChainQualifier.java @@ -7,6 +7,10 @@ import javax.inject.Qualifier; +/** + * @author andreabattaglia + * + */ @Qualifier @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/util/qualifier/chain/PackagingChainQualifier.java b/src/main/java/io/qiot/manufacturing/edge/machinery/util/qualifier/chain/PackagingChainQualifier.java index 1fb01d5..84bb24e 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/util/qualifier/chain/PackagingChainQualifier.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/util/qualifier/chain/PackagingChainQualifier.java @@ -7,6 +7,10 @@ import javax.inject.Qualifier; +/** + * @author andreabattaglia + * + */ @Qualifier @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/util/qualifier/chain/PrintingChainQualifier.java b/src/main/java/io/qiot/manufacturing/edge/machinery/util/qualifier/chain/PrintingChainQualifier.java index ec42a8f..6b90a3f 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/util/qualifier/chain/PrintingChainQualifier.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/util/qualifier/chain/PrintingChainQualifier.java @@ -7,6 +7,10 @@ import javax.inject.Qualifier; +/** + * @author andreabattaglia + * + */ @Qualifier @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, diff --git a/src/main/java/io/qiot/manufacturing/edge/machinery/util/qualifier/chain/WeavingChainQualifier.java b/src/main/java/io/qiot/manufacturing/edge/machinery/util/qualifier/chain/WeavingChainQualifier.java index 321d306..3b40173 100644 --- a/src/main/java/io/qiot/manufacturing/edge/machinery/util/qualifier/chain/WeavingChainQualifier.java +++ b/src/main/java/io/qiot/manufacturing/edge/machinery/util/qualifier/chain/WeavingChainQualifier.java @@ -7,6 +7,10 @@ import javax.inject.Qualifier; +/** + * @author andreabattaglia + * + */ @Qualifier @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f265d9d..8528bed 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,4 +1,5 @@ quarkus.log.level=${LOGLEVEL\:INFO} +#quarkus.log.category."io.qiot.manufacturing".level=DEBUG %dev.quarkus.log.console.color=true