summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/kotlin/dev/dnpm/etl/processor/output/KafkaMtbFileSender.kt4
-rw-r--r--src/main/kotlin/dev/dnpm/etl/processor/output/MtbFileSender.kt2
-rw-r--r--src/main/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSender.kt4
-rw-r--r--src/main/kotlin/dev/dnpm/etl/processor/web/ConfigController.kt1
-rw-r--r--src/main/resources/templates/configs.html7
5 files changed, 15 insertions, 3 deletions
diff --git a/src/main/kotlin/dev/dnpm/etl/processor/output/KafkaMtbFileSender.kt b/src/main/kotlin/dev/dnpm/etl/processor/output/KafkaMtbFileSender.kt
index 8c244b8..01c7d43 100644
--- a/src/main/kotlin/dev/dnpm/etl/processor/output/KafkaMtbFileSender.kt
+++ b/src/main/kotlin/dev/dnpm/etl/processor/output/KafkaMtbFileSender.kt
@@ -89,6 +89,10 @@ class KafkaMtbFileSender(
}
}
+ override fun endpoint(): String {
+ return "${this.kafkaTargetProperties.servers} (${this.kafkaTargetProperties.topic}/${this.kafkaTargetProperties.responseTopic})"
+ }
+
private fun key(request: MtbFileSender.MtbFileRequest): String {
return "{\"pid\": \"${request.mtbFile.patient.id}\", " +
"\"eid\": \"${request.mtbFile.episode.id}\"}"
diff --git a/src/main/kotlin/dev/dnpm/etl/processor/output/MtbFileSender.kt b/src/main/kotlin/dev/dnpm/etl/processor/output/MtbFileSender.kt
index de0efaa..aca972b 100644
--- a/src/main/kotlin/dev/dnpm/etl/processor/output/MtbFileSender.kt
+++ b/src/main/kotlin/dev/dnpm/etl/processor/output/MtbFileSender.kt
@@ -28,6 +28,8 @@ interface MtbFileSender {
fun send(request: DeleteRequest): Response
+ fun endpoint(): String
+
data class Response(val status: RequestStatus, val body: String = "")
data class MtbFileRequest(val requestId: String, val mtbFile: MtbFile)
diff --git a/src/main/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSender.kt b/src/main/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSender.kt
index 5a4ae9e..e1aecb7 100644
--- a/src/main/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSender.kt
+++ b/src/main/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSender.kt
@@ -90,4 +90,8 @@ class RestMtbFileSender(
return MtbFileSender.Response(RequestStatus.ERROR, "Sonstiger Fehler bei der Übertragung")
}
+ override fun endpoint(): String {
+ return this.restTargetProperties.uri.orEmpty()
+ }
+
} \ No newline at end of file
diff --git a/src/main/kotlin/dev/dnpm/etl/processor/web/ConfigController.kt b/src/main/kotlin/dev/dnpm/etl/processor/web/ConfigController.kt
index 7bdbb82..82c1fc0 100644
--- a/src/main/kotlin/dev/dnpm/etl/processor/web/ConfigController.kt
+++ b/src/main/kotlin/dev/dnpm/etl/processor/web/ConfigController.kt
@@ -42,6 +42,7 @@ class ConfigController(
fun index(model: Model): String {
model.addAttribute("pseudonymGenerator", pseudonymGenerator.javaClass.simpleName)
model.addAttribute("mtbFileSender", mtbFileSender.javaClass.simpleName)
+ model.addAttribute("mtbFileEndpoint", mtbFileSender.endpoint())
model.addAttribute("connectionAvailable", connectionCheckService.connectionAvailable())
model.addAttribute("transformations", transformationService.getTransformations())
diff --git a/src/main/resources/templates/configs.html b/src/main/resources/templates/configs.html
index a5b56d7..cb78e3d 100644
--- a/src/main/resources/templates/configs.html
+++ b/src/main/resources/templates/configs.html
@@ -29,8 +29,9 @@
<td>[[ ${mtbFileSender} ]]</td>
</tr>
<tr>
- <td>Endpunkt</td>
- <td>[[ ${mtbFileSender} ]]</td>
+ <td th:if="${mtbFileSender.startsWith('Rest')}">REST-Endpunkt</td>
+ <td th:if="${mtbFileSender.startsWith('Kafka')}">Kafka-Broker und Topics</td>
+ <td>[[ ${mtbFileEndpoint} ]]</td>
</tr>
</tbody>
</table>
@@ -43,7 +44,7 @@
<strong th:if="${connectionAvailable}" style="color: green">verfügbar.</strong>
<strong th:if="${not(connectionAvailable)}" style="color: red">nicht verfügbar.</strong>
</div>
- <div class="connection-display">
+ <div class="connection-display border">
<img th:src="@{/server.png}" alt="ETL-Processor" />
<span class="connection" th:styleappend="${connectionAvailable ? 'available' : ''}"></span>
<img th:if="${mtbFileSender.startsWith('Rest')}" th:src="@{/server.png}" alt="bwHC-Backend" />