Skip to content

Commit

Permalink
Merge pull request #392 from usdot-jpo-ode/release/1.2.0
Browse files Browse the repository at this point in the history
Release/1.2.0
  • Loading branch information
jtbaird authored Oct 30, 2020
2 parents 540b79f + 3a5c5cf commit 02916e6
Show file tree
Hide file tree
Showing 20 changed files with 584 additions and 147 deletions.
53 changes: 53 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version: 2.1

# Copyright (C) 2018-2020 LEIDOS.
#
# 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.

jobs:
build:
docker:
- image: 'circleci/openjdk:8u252-jdk'
steps:
- checkout
- run:
name: Initialize Submodules
command: |
set -x
pwd
ls
git submodule init
git submodule update
cd asn1_codec
git submodule init
git submodule update
- run:
name: Analyze on SonarCloud
command: |
if [ -z "${CIRCLE_PULL_REQUEST}" ]; then
mvn -e -X clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar
fi
echo "PR branch ${CIRCLE_BRANCH}"
echo "Repo name ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"
echo "URL ${CIRCLE_PULL_REQUEST}"
export PR_NUM=`echo ${CIRCLE_PULL_REQUEST} | cut -d'/' -f7`
echo "PR number ${PR_NUM}"
export BASE_BRANCH_URL="https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${PR_NUM}"
export TARGET_BRANCH=$(curl "$BASE_BRANCH_URL" | jq '.base.ref' | tr -d '"')
echo "Target Branch = ${TARGET_BRANCH}"
mvn -e -X clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.pullrequest.base=${TARGET_BRANCH} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM}
workflows:
main:
jobs:
- build:
context: SonarCloud
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[submodule "jpo-s3-deposit"]
path = jpo-s3-deposit
url = https://github.com/usdot-jpo-ode/jpo-s3-deposit.git
branch = master
[submodule "jpo-security-svcs"]
path = jpo-security-svcs
url = https://github.com/usdot-jpo-ode/jpo-security-svcs
Expand Down
40 changes: 40 additions & 0 deletions .sonarqube/sonar-scanner.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

sonar.modules= asn1_codec, \
jpo-cvdp, \
jpo-ode-common, \
jpo-ode-consumer-example, \
jpo-ode-core, \
jpo-ode-plugins, \
jpo-ode-svcs, \
jpo-s3-deposit, \
jpo-sdw-depositor, \
jpo-security-svcs

asn1_codec.sonar.projectBaseDir = /home/circleci/project/asn1_codec
jpo-cvdp.sonar.projectBaseDir = /home/circleci/project/jpo-cvdp
jpo-ode-common.sonar.projectBaseDir = /home/circleci/project/jpo-ode-common
jpo-ode-consumer-example.sonar.projectBaseDir = /home/circleci/project/jpo-ode-consumer-example
jpo-ode-core.sonar.projectBaseDir = /home/circleci/project/jpo-ode-core
jpo-ode-plugins.sonar.projectBaseDir = /home/circleci/project/jpo-ode-plugins
jpo-ode-svcs.sonar.projectBaseDir = /home/circleci/project/jpo-ode-svcs
jpo-s3-deposit.sonar.projectBaseDir = /home/circleci/project/jpo-s3-deposit
jpo-sdw-depositor.sonar.projectBaseDir = /home/circleci/project/jpo-sdw-depositor
jpo-security-svcs.sonar.projectBaseDir = /home/circleci/project/jpo-security-svcs

asn1_codec.sonar.sources = src
jpo-cvdp.sonar.sources = src
jpo-ode-common.sonar.sources = src
jpo-ode-consumer-example.sonar.sources = src
jpo-ode-core.sonar.sources = src
jpo-ode-plugins.sonar.sources = src
jpo-ode-svcs.sonar.sources = src
jpo-s3-deposit.sonar.sources = src
jpo-sdw-depositor.sonar.sources = src
jpo-security-svcs.sonar.sources = src

jpo-ode-common.sonar.tests = src/test
jpo-ode-consumer-example.sonar.tests = src/test
jpo-ode-core.sonar.tests = src/test
jpo-ode-plugins.sonar.tests = src/test
jpo-ode-svcs.sonar.tests = src/test
jpo-sdw-depositor.sonar.tests = src/test
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

38 changes: 29 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
KAFKA_ADVERTISED_HOST_NAME: ${DOCKER_HOST_IP}
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
KAFKA_CREATE_TOPICS: "topic.OdeBsmPojo:1:1,topic.OdeBsmJson:1:1,topic.FilteredOdeBsmJson:1:1,topic.OdeTimJson:1:1,topic.OdeTimBroadcastJson:1:1,topic.J2735TimBroadcastJson:1:1,topic.OdeDriverAlertJson:1:1,topic.Asn1DecoderInput:1:1,topic.Asn1DecoderOutput:1:1,topic.Asn1EncoderInput:1:1,topic.Asn1EncoderOutput:1:1,topic.SDWDepositorInput:1:1"
KAFKA_CREATE_TOPICS: "topic.OdeBsmPojo:1:1,topic.OdeBsmJson:1:1,topic.FilteredOdeBsmJson:1:1,topic.OdeTimJson:1:1,topic.OdeTimBroadcastJson:1:1,topic.J2735TimBroadcastJson:1:1,topic.OdeDriverAlertJson:1:1,topic.Asn1DecoderInput:1:1,topic.Asn1DecoderOutput:1:1,topic.Asn1EncoderInput:1:1,topic.Asn1EncoderOutput:1:1,topic.SDWDepositorInput:1:1,topic.OdeTIMCertExpirationTimeJson:1:1"
KAFKA_DELETE_TOPIC_ENABLED: "true"
KAFKA_CLEANUP_POLICY: "delete" # delete old logs
KAFKA_LOG_RETENTION_HOURS: 2
Expand Down Expand Up @@ -109,51 +109,71 @@ services:
build: ./jpo-s3-deposit
image: jpoode_s3dep:latest
environment:
AWS_ACCESS_KEY_ID: ${CVPEP_BSM_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${CVPEP_BSM_SECRET_ACCESS_KEY}
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
DEPOSIT_BUCKET_NAME: ${CVPEP_BSM_BUCKET_NAME}
DEPOSIT_KEY_NAME: ${CVPEP_BSM_DEPOSIT_KEY}
DEPOSIT_TOPIC: ${CVPEP_BSM_TOPIC}
K_AWS_ACCESS_KEY_ID: ${CVPEP_BSM_K_AWS_ACCESS_KEY_ID}
K_AWS_SECRET_ACCESS_SECRET: ${CVPEP_BSM_K_AWS_SECRET_ACCESS_SECRET}
K_AWS_SESSION_TOKEN: ${CVPEP_BSM_K_AWS_SESSION_TOKEN}
K_AWS_EXPIRATION: ${CVPEP_BSM_K_AWS_EXPIRATION}
API_ENDPOINT: ${CVPEP_BSM_API_ENDPOINT}
HEADER_ACCEPT: ${CVPEP_BSM_HEADER_ACCEPT}
HEADER_X_API_KEY: ${CVPEP_BSM_HEADER_X_API_KEY}
depends_on:
- kafka

rde_bsm_depositor:
build: ./jpo-s3-deposit
image: jpoode_s3dep:latest
environment:
AWS_ACCESS_KEY_ID: ${RDE_BSM_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${RDE_BSM_SECRET_ACCESS_KEY}
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
DEPOSIT_BUCKET_NAME: ${RDE_BSM_BUCKET_NAME}
DEPOSIT_KEY_NAME: ${RDE_BSM_DEPOSIT_KEY}
DEPOSIT_TOPIC: ${RDE_BSM_TOPIC}
K_AWS_ACCESS_KEY_ID: ${RDE_BSM_K_AWS_ACCESS_KEY_ID}
K_AWS_SECRET_ACCESS_SECRET: ${RDE_BSM_K_AWS_SECRET_ACCESS_SECRET}
K_AWS_SESSION_TOKEN: ${RDE_BSM_K_AWS_SESSION_TOKEN}
K_AWS_EXPIRATION: ${RDE_BSM_K_AWS_EXPIRATION}
API_ENDPOINT: ${RDE_BSM_API_ENDPOINT}
HEADER_ACCEPT: ${RDE_BSM_HEADER_ACCEPT}
HEADER_X_API_KEY: ${RDE_BSM_HEADER_X_API_KEY}
depends_on:
- kafka

cvpep_tim_depositor:
build: ./jpo-s3-deposit
image: jpoode_s3dep:latest
environment:
AWS_ACCESS_KEY_ID: ${CVPEP_TIM_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${CVPEP_TIM_SECRET_ACCESS_KEY}
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
DEPOSIT_BUCKET_NAME: ${CVPEP_TIM_BUCKET_NAME}
DEPOSIT_KEY_NAME: ${CVPEP_TIM_DEPOSIT_KEY}
DEPOSIT_TOPIC: ${CVPEP_TIM_TOPIC}
K_AWS_ACCESS_KEY_ID: ${CVPEP_BSM_K_AWS_ACCESS_KEY_ID}
K_AWS_SECRET_ACCESS_SECRET: ${CVPEP_BSM_K_AWS_SECRET_ACCESS_SECRET}
K_AWS_SESSION_TOKEN: ${CVPEP_BSM_K_AWS_SESSION_TOKEN}
K_AWS_EXPIRATION: ${CVPEP_BSM_K_AWS_EXPIRATION}
API_ENDPOINT: ${CVPEP_BSM_API_ENDPOINT}
HEADER_ACCEPT: ${CVPEP_BSM_HEADER_ACCEPT}
HEADER_X_API_KEY: ${CVPEP_BSM_HEADER_X_API_KEY}
depends_on:
- kafka

rde_tim_depositor:
build: ./jpo-s3-deposit
image: jpoode_s3dep:latest
environment:
AWS_ACCESS_KEY_ID: ${RDE_TIM_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${RDE_TIM_SECRET_ACCESS_KEY}
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
DEPOSIT_BUCKET_NAME: ${RDE_TIM_BUCKET_NAME}
DEPOSIT_KEY_NAME: ${RDE_TIM_DEPOSIT_KEY}
DEPOSIT_TOPIC: ${RDE_TIM_TOPIC}
K_AWS_ACCESS_KEY_ID: ${CVPEP_BSM_K_AWS_ACCESS_KEY_ID}
K_AWS_SECRET_ACCESS_SECRET: ${RDE_TIM_K_AWS_SECRET_ACCESS_SECRET}
K_AWS_SESSION_TOKEN: ${RDE_TIM_K_AWS_SESSION_TOKEN}
K_AWS_EXPIRATION: ${RDE_TIM_K_AWS_EXPIRATION}
API_ENDPOINT: ${RDE_TIM_API_ENDPOINT}
HEADER_ACCEPT: ${RDE_TIM_HEADER_ACCEPT}
HEADER_X_API_KEY: ${RDE_TIM_HEADER_X_API_KEY}
depends_on:
- kafka

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public enum GeneratedBy {
private SerialId serialId;
private String odeReceivedAt;
private int schemaVersion;
private int maxDurationTime;
private String odePacketID;
private String odeTimStartDateTime;
private String recordGeneratedAt;
private GeneratedBy recordGeneratedBy;
private boolean sanitized = false;
Expand Down Expand Up @@ -92,8 +95,33 @@ public int getSchemaVersion() {
public void setSchemaVersion(int aSchemaVersion) {
schemaVersion = aSchemaVersion;
}
public int getMaxDurationTime() {
return maxDurationTime;
}

public String getRecordGeneratedAt() {
public void setMaxDurationTime(int maxDurationTime) {
this.maxDurationTime = maxDurationTime;
}

public String getOdePacketID() {
return odePacketID;
}

public void setOdePacketID(String odePacketID) {
this.odePacketID = odePacketID;
}



public String getOdeTimStartDateTime() {
return odeTimStartDateTime;
}

public void setOdeTimStartDateTime(String odeTimStartDateTime) {
this.odeTimStartDateTime = odeTimStartDateTime;
}

public String getRecordGeneratedAt() {
return recordGeneratedAt;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,29 +637,37 @@ private static ObjectNode transformNodeLL(JsonNode oldNode) {
// node-LL6 Node-LL-48B, -- within +- 92.756481 Kmeters of last node
// node-LatLon Node-LLmD-64b, -- node is a full 32b Lat/Lon range
private static String nodeOffsetPointLL(long transformedLat, long transformedLon) {
long transformed = Math.abs(transformedLat) | Math.abs(transformedLon);
if ((transformed & (-1 << 12)) == 0) {
// 12 bit value
return "node-LL1";
} else if ((transformed & (-1 << 14)) == 0) {
// 14 bit value
return "node-LL2";
} else if ((transformed & (-1 << 16)) == 0) {
// 16 bit value
return "node-LL3";
} else if ((transformed & (-1 << 18)) == 0) {
// 18 bit value
return "node-LL4";
} else if ((transformed & (-1 << 22)) == 0) {
// 22 bit value
return "node-LL5";
} else if ((transformed & (-1 << 24)) == 0) {
// 24 bit value
return "node-LL6";
} else {
throw new IllegalArgumentException("Invalid node lat/long offset: " + transformedLat + "/" + transformedLon
+ ". Values must be between a range of -0.8388608/+0.8388607 degrees.");
}
long transformedLatabs = Math.abs(transformedLat);
long transformedLonabs = Math.abs(transformedLon);
if (((transformedLatabs & (-1 << 11)) == 0 || (transformedLat<0 && (transformedLatabs ^ (1 << 11)) == 0))
&& (transformedLonabs & (-1 << 11)) == 0 || (transformedLon<0 && ((transformedLonabs ^ (1 << 11)) == 0))) {
// 11 bit value
return "node-LL1";
} else if (((transformedLatabs & (-1 << 13)) == 0 || (transformedLat<0 && (transformedLatabs ^ (1 << 13)) == 0))
&& (transformedLonabs & (-1 << 13)) == 0 || (transformedLon<0 && ((transformedLonabs ^ (1 << 13)) == 0))){
// 13 bit value
return "node-LL2";
} else if (((transformedLatabs & (-1 << 15)) == 0 || (transformedLat<0 && (transformedLatabs ^ (1 << 15)) == 0))
&& (transformedLonabs & (-1 << 15)) == 0 || (transformedLon<0 && ((transformedLonabs ^ (1 << 15)) == 0))) {
// 15 bit value
return "node-LL3";
} else if (((transformedLatabs & (-1 << 17)) == 0 || (transformedLat<0 && (transformedLatabs ^ (1 << 17)) == 0))
&& (transformedLonabs & (-1 << 17)) == 0 || (transformedLon<0 && ((transformedLonabs ^ (1 << 17)) == 0))) {
// 17 bit value
return "node-LL4";
} else if (((transformedLatabs & (-1 << 21)) == 0 || (transformedLat<0 && (transformedLatabs ^ (1 << 21)) == 0))
&& (transformedLonabs & (-1 << 21)) == 0 || (transformedLon<0 && ((transformedLonabs ^ (1 << 21)) == 0))) {
// 21 bit value
return "node-LL5";
} else if (((transformedLatabs & (-1 << 23)) == 0 || (transformedLat<0 && (transformedLatabs ^ (1 << 23)) == 0))
&& (transformedLonabs & (-1 << 23)) == 0 || (transformedLon<0 && ((transformedLonabs ^ (1 << 23)) == 0))){
// 23 bit value
return "node-LL6";
} else {
throw new IllegalArgumentException("Invalid node lat/long offset: " + transformedLat + "/" + transformedLon
+ ". Values must be between a range of -0.8388608/+0.8388607 degrees.");
}

}

public static void replaceGeometry(ObjectNode geometry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ public class OdeProperties implements EnvironmentAware {
// SDW Depositor Module
private String kafkaTopicSdwDepositorInput = "topic.SDWDepositorInput";

//Signed Tim with expiration
private String kafkaTopicSignedOdeTimJsonExpiration = "topic.OdeTIMCertExpirationTimeJson";
/*
* Security Properties
*/
Expand Down Expand Up @@ -619,5 +621,10 @@ public boolean shouldDepositSdwMessagesOverWebsocket() {
public void setDepositSdwMessagesOverWebsocket(boolean depositSdwMessagesOverWebsocket) {
this.depositSdwMessagesOverWebsocket = depositSdwMessagesOverWebsocket;
}

public String getKafkaTopicSignedOdeTimJsonExpiration() {
return kafkaTopicSignedOdeTimJsonExpiration;
}
public void setKafkaTopicSignedOdeTimJsonExpiration(String kafkaTopicSignedOdeTimJsonExpiration) {
this.kafkaTopicSignedOdeTimJsonExpiration = kafkaTopicSignedOdeTimJsonExpiration;
}
}
Loading

0 comments on commit 02916e6

Please sign in to comment.