From 0bc948a2b9fdb33b0a9010566bd52d2c130a2fb7 Mon Sep 17 00:00:00 2001 From: Matt Cook Date: Thu, 26 Dec 2024 16:53:48 -0700 Subject: [PATCH] docs: simplify comments and remove redundant JavaDoc. Removed verbose and redundant JavaDoc comments, replacing them with concise inline comments to improve code readability. This change ensures that key processing logic remains documented without unnecessary detail duplication. --- .../services/asn1/Asn1EncodedDataRouter.java | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/services/asn1/Asn1EncodedDataRouter.java b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/services/asn1/Asn1EncodedDataRouter.java index e43739dd5..887aeb8fe 100644 --- a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/services/asn1/Asn1EncodedDataRouter.java +++ b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/services/asn1/Asn1EncodedDataRouter.java @@ -131,14 +131,6 @@ public Asn1EncodedDataRouter(Asn1CoderTopics asn1CoderTopics, /** * Listens for messages from the specified Kafka topic and processes them. * - *

Cases: - * - CASE 1: no SDW in metadata (SNMP deposit only) - sign MF - send to RSU - CASE 2: SDW in - * metadata but no ASD in body (send back for another encoding) - sign MF - send to RSU - craft - * ASD object - publish back to encoder stream - CASE 3: If SDW in metadata and ASD in body - * (double encoding complete) - send to SDX - * - *

- * * @param consumerRecord The Kafka consumer record containing the key and value of the consumed * message. */ @@ -171,14 +163,6 @@ public void listen(ConsumerRecord consumerRecord) } } - - /** - * Gets the service request based on the consumed JSONObject. - * - * @param metadataJson The metadata JSON object to retrieve the service request for - * - * @return The service request - */ private ServiceRequest getServiceRequest(JSONObject metadataJson) throws JsonProcessingException { String serviceRequestJson = metadataJson.getJSONObject(TimTransmogrifier.REQUEST_STRING).toString(); log.debug("ServiceRequest: {}", serviceRequestJson); @@ -196,6 +180,7 @@ private void processSignedMessage(ServiceRequest request, JSONObject dataObj) { kafkaTemplate.send(this.sdxDepositTopic, deposit.toString()); } + // no SDW in metadata (SNMP deposit only) -> sign MF -> send to RSU private void processUnsignedMessage(ServiceRequest request, JSONObject metadataJson, JSONObject payloadJson) { @@ -217,6 +202,8 @@ private void processUnsignedMessage(ServiceRequest request, publishForSecondEncoding(request, encodedTimWithoutHeaders); } + // SDW in metadata but no ASD in body (send back for another encoding) -> sign MessageFrame + // -> send to RSU -> craft ASD object -> publish back to encoder stream private void processEncodedTimUnsigned(ServiceRequest request, JSONObject metadataJson, JSONObject payloadJson) { log.debug("Unsigned ASD received. Depositing it to SDW."); @@ -245,6 +232,7 @@ private void processEncodedTimUnsigned(ServiceRequest request, JSONObject metada } } + // If SDW in metadata and ASD in body (double encoding complete) -> send to SDX private void depositToSdx(ServiceRequest request, String asdBytes) { try { JSONObject deposit = new JSONObject();