Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions jpo-ode-core/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down Expand Up @@ -37,19 +39,13 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
</dependency>

<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-graphite</artifactId>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
<version>1.19.4</version>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
Expand Down Expand Up @@ -89,6 +85,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.15.1</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
Expand Down
45 changes: 25 additions & 20 deletions jpo-ode-svcs/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>usdot.jpo.ode</groupId>
Expand Down Expand Up @@ -32,10 +34,10 @@
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
</exclusions>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -46,9 +48,9 @@
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>4.0.0</version>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -99,7 +101,7 @@
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator</artifactId>
<version>0.40</version>
<version>0.40</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
Expand All @@ -114,6 +116,7 @@
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.7.1</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
Expand Down Expand Up @@ -146,9 +149,9 @@
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
Expand Down Expand Up @@ -185,17 +188,19 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>build-info</id>
<goals>
<goal>build-info</goal>
</goals>
</execution>
</executions>
<execution>
<id>build-info</id>
<goals>
<goal>build-info</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>
<!-- profile to output only source code and not include any spring boot dependencies in published jar -->
<!-- profile to output only source code and not include any spring boot dependencies in published
jar -->
<profiles>
<profile>
<id>package-jar</id>
Expand Down Expand Up @@ -229,4 +234,4 @@
</build>
</profile>
</profiles>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ private Map<String, Object> getKafkaConsumerProperties() {
}
return props;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ private Map<String, Object> buildProducerProperties() {
producerProps.put(ProducerConfig.RETRIES_CONFIG, odeKafkaProperties.getProducer().getRetries());
return producerProps;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,49 +1,55 @@
package us.dot.its.jpo.ode.udp;

import lombok.extern.slf4j.Slf4j;

import java.net.DatagramSocket;
import java.net.SocketException;
import lombok.extern.slf4j.Slf4j;

/**
* Abstract base class for UDP receiver publishers that handle incoming UDP messages. Provides
* common functionality for creating and managing UDP sockets.
*/
@Slf4j
public abstract class AbstractUdpReceiverPublisher implements Runnable {

public class UdpReceiverException extends Exception {
private static final long serialVersionUID = 1L;
/**
* Exception thrown when there is an error in UDP receiver operations.
*/
public class UdpReceiverException extends Exception {
private static final long serialVersionUID = 1L;

public UdpReceiverException(String string, Exception e) {
super(string, e);
}
public UdpReceiverException(String string, Exception e) {
super(string, e);
}
}

protected DatagramSocket socket;
protected DatagramSocket socket;

protected String senderIp;
protected int senderPort;
protected String senderIp;
protected int senderPort;

protected int port;
protected int bufferSize;
protected int port;
protected int bufferSize;

private boolean stopped = false;
private boolean stopped = false;

public boolean isStopped() {
return stopped;
}
public boolean isStopped() {
return stopped;
}

public void setStopped(boolean stopped) {
this.stopped = stopped;
}
public void setStopped(boolean stopped) {
this.stopped = stopped;
}

protected AbstractUdpReceiverPublisher(int port, int bufferSize) {
this.port = port;
this.bufferSize = bufferSize;
protected AbstractUdpReceiverPublisher(int port, int bufferSize) {
this.port = port;
this.bufferSize = bufferSize;

try {
this.socket = new DatagramSocket(this.port);
log.info("Created UDP socket bound to port {}", this.port);
} catch (SocketException e) {
log.error("Error creating socket with port {}", this.port, e);
}
try {
this.socket = new DatagramSocket(this.port);
log.info("Created UDP socket bound to port {}", this.port);
} catch (SocketException e) {
log.error("Error creating socket with port {}", this.port, e);
}
}

}
}
2 changes: 1 addition & 1 deletion jpo-ode-svcs/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ management:
enabled: true
metrics:
tags:
enabled: true
enabled: true
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ void testAsn1DecodedDataRouter_MAPDataFlow() throws IOException {
}
consumer.close();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
SerializationConfig.class, TestMetricsConfig.class},
properties = {"ode.kafka.disabled-topics="})
@EnableConfigurationProperties
@ContextConfiguration(classes = {UDPReceiverProperties.class, OdeKafkaProperties.class,
KafkaProperties.class})
@ContextConfiguration(
classes = {UDPReceiverProperties.class, OdeKafkaProperties.class, KafkaProperties.class})
@DirtiesContext
@TestPropertySource(properties = "logging.level.org.springframework.kafka=DEBUG")
class Asn1DecodedDataRouterTest {
Expand Down Expand Up @@ -83,8 +83,7 @@ void testAsn1DecodedDataRouterBSMDataFlow() throws IOException {
var testConsumer = consumerFactory.createConsumer();
embeddedKafka.consumeFromEmbeddedTopics(testConsumer, topics);

String baseExpectedBsm =
loadFromResource("us/dot/its/jpo/ode/services/asn1/expected-bsm.json");
String baseExpectedBsm = loadFromResource("us/dot/its/jpo/ode/services/asn1/expected-bsm.json");
for (String recordType : new String[] {"bsmTx", "rxMsg", "bsmLogDuringEvent"}) {
String inputData = replaceRecordType(baseTestData, "bsmTx", recordType);
var uniqueKey = UUID.randomUUID().toString();
Expand Down Expand Up @@ -488,8 +487,7 @@ void testAsn1DecodedDataRouter_RSMDataFlow() throws IOException {
var testConsumer = consumerFactory.createConsumer();
embeddedKafka.consumeFromEmbeddedTopics(testConsumer, topics);

String baseExpectedRsm =
loadFromResource("us/dot/its/jpo/ode/services/asn1/expected-rsm.json");
String baseExpectedRsm = loadFromResource("us/dot/its/jpo/ode/services/asn1/expected-rsm.json");
for (String recordType : new String[] {"rsmTx", "unsupported"}) {
String inputData = replaceRecordType(baseTestData, "rsmTx", recordType);
var uniqueKey = UUID.randomUUID().toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ void testListen() throws JSONException, IOException {
assertEquals(expectedBsm, odeBsmData);
testConsumer.close();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ void testProcess_ApprovalTest() throws IOException {
}
testConsumer.close();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ void testListen() throws JSONException, IOException {
assertEquals(expectedPsm, odePsmData);
testConsumer.close();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ void testListen() throws JSONException, IOException {
assertEquals(expectedRSM, consumedRSM.value());
testConsumer.close();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ void testListen() throws JSONException, IOException {
assertEquals(expectedRTCM, consumedRTCM.value());
testConsumer.close();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ void testListen() throws JSONException, IOException {
assertEquals(expectedSpat, consumedSpat.value());
testConsumer.close();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ void testListen() throws JSONException, IOException {
assertEquals(expectedSrm, producedSrm.value());
testConsumer.close();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ void testListen() throws JSONException, IOException {
assertEquals(expectedSSM, consumedSSM.value());
testConsumer.close();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ void testListen() throws JSONException, IOException {
assertEquals(expectedTim, produced.value());
testConsumer.close();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*============================================================================
* Copyright 2018 572682
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
******************************************************************************/
* Copyright 2018 572682
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
******************************************************************************/

package us.dot.its.jpo.ode.services.asn1;

Expand Down Expand Up @@ -423,4 +423,4 @@ public SignatureResultModel signMessage(String message, int sigValidityOverride)
return signatureResponse;
}
}
}
}
Loading