Separate entity retrieval from jax-rs Response creation 70/136770/2
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Fri, 8 Dec 2023 15:47:19 +0000 (16:47 +0100)
committerFiete Ostkamp <fiete.ostkamp@telekom.de>
Fri, 8 Dec 2023 16:01:39 +0000 (16:01 +0000)
commit33521592f3a466fd5cb6959340c1ec70e412dfa8
tree659c25943b5eb35da24f4aea09107b6676446a96
parentefe52a581c4a1217ae9117e2177e157841e75ffa
Separate entity retrieval from jax-rs Response creation

- move logic to retrieve entity from db into a separate method
- do not use runner() from AAI core [1][2]
- use global ExceptionHandler to provide a common exception to error response mapping

[1] the runner will spawn a separate thread to process the request. In this change there is nothing to replace this functionality.
The reason that it is removed is that it tightly couples the app with a) aai-common and b) jax-rs and is also catching all exceptions.
Also the timeout mechanism that is implemented is not actually stopping the execution of the thread after the timeout, but rather returning an early response (after 3 minutes(!)).
[2] these changes are also done to make a future full migration to spring boot/the removal of jax-rs easier
Issue-ID: AAI-3693
Change-Id: I177913c5f6295e1cab476e3c206fecacd7620f69
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
aai-traversal/pom.xml
aai-traversal/src/main/java/org/onap/aai/entities/AAIErrorResponse.java [new file with mode: 0644]
aai-traversal/src/main/java/org/onap/aai/entities/RequestError.java [new file with mode: 0644]
aai-traversal/src/main/java/org/onap/aai/entities/ServiceException.java [new file with mode: 0644]
aai-traversal/src/main/java/org/onap/aai/rest/DslConsumer.java
aai-traversal/src/main/java/org/onap/aai/rest/ExceptionHandler.java
aai-traversal/src/main/java/org/onap/aai/rest/QueryConsumer.java
aai-traversal/src/main/java/org/onap/aai/rest/TraversalConsumer.java
aai-traversal/src/main/java/org/onap/aai/web/JerseyConfiguration.java
aai-traversal/src/test/java/org/onap/aai/rest/DslConsumerTest.java
aai-traversal/src/test/java/org/onap/aai/rest/ExceptionHandlerTest.java