Changeset 9:7cdb54e3b07d

Updated files and fixed checkstyle issues
author unexist
date Sat, 03 Apr 2021 16:03:23 +0200
parents 986979736bae
children 0fc58f949978
files checkstyle/file.header src/main/java/dev/unexist/showcase/todo/adapters/TodoConsumer.java src/main/java/dev/unexist/showcase/todo/adapters/TodoProducer.java src/main/java/dev/unexist/showcase/todo/adapters/TodoResource.java src/main/java/dev/unexist/showcase/todo/application/RestApplication.java src/main/java/dev/unexist/showcase/todo/domain/todo/DueDate.java src/main/java/dev/unexist/showcase/todo/domain/todo/Todo.java src/main/java/dev/unexist/showcase/todo/domain/todo/TodoDto.java src/main/java/dev/unexist/showcase/todo/domain/todo/TodoDtoAssembler.java src/main/java/dev/unexist/showcase/todo/domain/todo/TodoRepository.java src/main/java/dev/unexist/showcase/todo/domain/todo/events/TodoConverted.java src/main/java/dev/unexist/showcase/todo/domain/todo/events/TodoCreated.java src/main/java/dev/unexist/showcase/todo/domain/todo/events/TodoSaved.java src/main/java/dev/unexist/showcase/todo/domain/todo/filters/TodoConversionFilter.java src/main/java/dev/unexist/showcase/todo/domain/todo/filters/TodoPersistenceFilter.java src/main/java/dev/unexist/showcase/todo/infrastructure/base/AbstractBaseEvent.java src/main/java/dev/unexist/showcase/todo/infrastructure/base/AbstractBaseFilter.java src/main/java/dev/unexist/showcase/todo/infrastructure/deserializer/TodoDtoDeserializer.java src/main/java/dev/unexist/showcase/todo/infrastructure/serializer/DateSerializer.java src/main/resources/application.properties src/test/java/dev/unexist/showcase/todo/.gitkeep
diffstat 20 files changed, 31 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/checkstyle/file.header	Wed Mar 10 10:37:28 2021 +0100
+++ b/checkstyle/file.header	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
 ^ \* @copyright (\d\d\d\d)(-(\d\d\d\d))? ([^<]*) <([^@]*)@(.*)>$
 ^ \* @version \$Id
 ^ \*$
-^ \* This program can be distributed under the terms of the GNU GPLv2.$
+^ \* This program can be distributed under the terms of the GNU GPLv3.$
 ^ \* See the file LICENSE for details.$
 ^ \*\*/$
 ^$
--- a/src/main/java/dev/unexist/showcase/todo/adapters/TodoConsumer.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/adapters/TodoConsumer.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/adapters/TodoProducer.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/adapters/TodoProducer.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
@@ -28,9 +28,11 @@
 public class TodoProducer {
     private static final Logger LOGGER = LoggerFactory.getLogger(TodoConsumer.class);
 
-    private TodoDto dto;
+    @Outgoing("todo-out")
+    @Broadcast
+    public TodoDto process(@Observes TodoSaved event) {
+        TodoDto dto = null;
 
-    public void process(@Observes TodoSaved event) {
         LOGGER.info("Received event={}", event.getClass().getSimpleName());
 
         Optional<Todo> payload = event.getPayload();
@@ -40,15 +42,9 @@
 
             LOGGER.info("Received event payload={}", todo);
 
-            this.dto = TodoDtoAssembler.fromTodoToDto(todo);
-
-            this.send();
+            dto = TodoDtoAssembler.fromTodoToDto(todo);
         }
-    }
 
-    @Outgoing("todo-out")
-    @Broadcast
-    public TodoDto send() {
-        return this.dto;
+        return dto;
     }
 }
\ No newline at end of file
--- a/src/main/java/dev/unexist/showcase/todo/adapters/TodoResource.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/adapters/TodoResource.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
@@ -13,7 +13,6 @@
 
 import dev.unexist.showcase.todo.domain.todo.TodoDto;
 import dev.unexist.showcase.todo.domain.todo.events.TodoCreated;
-import dev.unexist.showcase.todo.infrastructure.base.AbstractBaseFilter;
 import org.eclipse.microprofile.openapi.annotations.Operation;
 import org.eclipse.microprofile.openapi.annotations.responses.APIResponse;
 import org.eclipse.microprofile.openapi.annotations.responses.APIResponses;
--- a/src/main/java/dev/unexist/showcase/todo/application/RestApplication.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/application/RestApplication.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/domain/todo/DueDate.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/domain/todo/DueDate.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/domain/todo/Todo.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/domain/todo/Todo.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/domain/todo/TodoDto.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/domain/todo/TodoDto.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/domain/todo/TodoDtoAssembler.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/domain/todo/TodoDtoAssembler.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/domain/todo/TodoRepository.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/domain/todo/TodoRepository.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
@@ -65,7 +65,7 @@
             this.list.set(todo.getId(), todo);
 
             ret = true;
-        } catch(IndexOutOfBoundsException e) {
+        } catch (IndexOutOfBoundsException e) {
             LOGGER.warn("update: id={} not found", todo.getId());
         }
 
@@ -114,7 +114,7 @@
      *          A {@link Optional} with the result of the lookup
      **/
 
-    public Optional<Todo> findById(int id ) {
+    public Optional<Todo> findById(int id) {
         return this.list.stream()
                 .filter(t -> t.getId() == id)
                 .findFirst();
--- a/src/main/java/dev/unexist/showcase/todo/domain/todo/events/TodoConverted.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/domain/todo/events/TodoConverted.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/domain/todo/events/TodoCreated.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/domain/todo/events/TodoCreated.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/domain/todo/events/TodoSaved.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/domain/todo/events/TodoSaved.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/domain/todo/filters/TodoConversionFilter.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/domain/todo/filters/TodoConversionFilter.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id: src/main/java/dev/unexist/showcase/todo/domain/todo/TodoRepository.java,v 7
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
@@ -22,8 +22,7 @@
 import java.util.Optional;
 
 public class TodoConversionFilter
-        extends AbstractBaseFilter<TodoCreated, TodoConverted, Todo>
-{
+        extends AbstractBaseFilter<TodoCreated, TodoConverted, Todo> {
     @Override
     public void process(@Observes TodoCreated event) {
         LOGGER.info("Received event={}", event.getClass().getSimpleName());
--- a/src/main/java/dev/unexist/showcase/todo/domain/todo/filters/TodoPersistenceFilter.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/domain/todo/filters/TodoPersistenceFilter.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
@@ -22,8 +22,7 @@
 import java.util.Optional;
 
 public class TodoPersistenceFilter
-        extends AbstractBaseFilter<TodoConverted, TodoSaved, Todo>
-{
+        extends AbstractBaseFilter<TodoConverted, TodoSaved, Todo> {
     @Inject
     TodoRepository repository;
 
--- a/src/main/java/dev/unexist/showcase/todo/infrastructure/base/AbstractBaseEvent.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/infrastructure/base/AbstractBaseEvent.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/infrastructure/base/AbstractBaseFilter.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/infrastructure/base/AbstractBaseFilter.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
@@ -50,7 +50,7 @@
 
             LOGGER.info("Fired event {}", outClazz.getSimpleName());
         } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) {
-            e.printStackTrace();
+            LOGGER.error("Couldn't fire event", e);
         }
     }
 }
--- a/src/main/java/dev/unexist/showcase/todo/infrastructure/deserializer/TodoDtoDeserializer.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/infrastructure/deserializer/TodoDtoDeserializer.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2021 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/infrastructure/serializer/DateSerializer.java	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/infrastructure/serializer/DateSerializer.java	Sat Apr 03 16:03:23 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2021 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/resources/application.properties	Wed Mar 10 10:37:28 2021 +0100
+++ b/src/main/resources/application.properties	Sat Apr 03 16:03:23 2021 +0200
@@ -13,7 +13,7 @@
 mp.openapi.extensions.smallrye.info.contact.email=christoph@unexist.dev
 mp.openapi.extensions.smallrye.info.contact.name=@hg.author@
 mp.openapi.extensions.smallrye.info.contact.url=https://unexist.dev
-mp.openapi.extensions.smallrye.info.license.name=GPLv2
+mp.openapi.extensions.smallrye.info.license.name=GPLv3
 mp.openapi.extensions.smallrye.info.license.url=https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
 
 # Smallrye Messaging