Skip to content

Commit

Permalink
Cleaning up commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob6838 committed Jan 6, 2025
1 parent 1eca80b commit 6f36f15
Show file tree
Hide file tree
Showing 26 changed files with 311 additions and 894 deletions.
7 changes: 0 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,3 @@ services:
options:
max-size: "10m"
max-file: "5"
# networks:
# - conflictmonitor

# networks:
# conflictmonitor:
# name: conflictmonitor_network
# external: true
13 changes: 0 additions & 13 deletions jpo-conflictvisualizer-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/target/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
<sonar.language>java</sonar.language>
<!-- <thymeleaf.version>3.0.3.RELEASE</thymeleaf.version>
<thymeleaf-layout-dialect.version>2.2.1</thymeleaf-layout-dialect.version> -->
<!-- Allow override of github organization when publishing artifacts to github -->
<github_organization>usdot-jpo-ode</github_organization>
</properties>
Expand Down Expand Up @@ -92,11 +90,6 @@
<artifactId>spring-kafka-test</artifactId>
<scope>test</scope>
</dependency>
<!-- <dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-mockmvc</artifactId>
<scope>test</scope>
</dependency> -->
<dependency>
<groupId>usdot.jpo.ode</groupId>
<artifactId>jpo-ode-core</artifactId>
Expand Down Expand Up @@ -182,12 +175,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.keycloak</groupId>-->
<!-- <artifactId>keycloak-spring-boot-starter</artifactId>-->
<!-- <version>21.0.2</version>-->
<!-- &lt;!&ndash; <version>20.0.3</version> &ndash;&gt;-->
<!-- </dependency>-->
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-client</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
@EnableWebMvc
@SpringBootApplication
@EnableScheduling
@ComponentScan(basePackages = {"us.dot.its.jpo.ode.api", "us.dot.its.jpo.geojsonconverter.validator"})
@ComponentScan(basePackages = { "us.dot.its.jpo.ode.api", "us.dot.its.jpo.geojsonconverter.validator" })
public class ConflictApiApplication extends SpringBootServletInitializer {

@Autowired DecoderManager manager;
@Autowired
DecoderManager manager;

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
Expand All @@ -28,21 +29,6 @@ public static void main(String[] args) {
SpringApplication.run(ConflictApiApplication.class, args);
System.out.println("Started Conflict Monitor API");
System.out.println("Conflict Monitor API docs page found here: http://localhost:8081/swagger-ui/index.html");
System.out.println("Startup Complete");
System.out.println("Startup Complete");
}

// @Bean
// public WebMvcConfigurer corsConfigurer() {
// return new WebMvcConfigurer() {
// @Override
// public void addCorsMappings(CorsRegistry registry) {
// ConflictMonitorApiProperties props = new ConflictMonitorApiProperties();
// registry.addMapping("/**").allowedOrigins(props.getCors());
// // registry.addMapping("/**").allowedMethods("*");
// }
// };
// }



}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;

import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import us.dot.its.jpo.conflictmonitor.AlwaysContinueProductionExceptionHandler;
import us.dot.its.jpo.geojsonconverter.DateJsonMapper;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -37,7 +36,6 @@
import us.dot.its.jpo.ode.eventlog.EventLogger;
import us.dot.its.jpo.ode.util.CommonUtils;


import org.apache.commons.lang3.SystemUtils;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.common.serialization.Serdes;
Expand Down Expand Up @@ -66,8 +64,10 @@ public class ConflictMonitorApiProperties {
private static final Logger logger = LoggerFactory.getLogger(ConflictMonitorApiProperties.class);

private boolean confluentCloudEnabled = false;
@Getter private String confluentKey = null;
@Getter private String confluentSecret = null;
@Getter
private String confluentKey = null;
@Getter
private String confluentSecret = null;

private String version;
public static final int OUTPUT_SCHEMA_VERSION = 6;
Expand Down Expand Up @@ -103,9 +103,7 @@ public class ConflictMonitorApiProperties {
private int securitySvcsPort = 8090;
private String securitySvcsSignatureEndpoint = "sign";


private int lingerMs = 0;


@Autowired
BuildProperties buildProperties;
Expand Down Expand Up @@ -263,9 +261,6 @@ public void setKafkaTopicsDisabledSet(Set<String> kafkaTopicsDisabledSet) {
this.kafkaTopicsDisabledSet = kafkaTopicsDisabledSet;
}




@Bean
public ObjectMapper defaultMapper() {
ObjectMapper objectMapper = DateJsonMapper.getInstance();
Expand Down Expand Up @@ -392,7 +387,6 @@ public Properties createStreamProperties(String name) {
streamProps.put(ProducerConfig.COMPRESSION_TYPE_CONFIG, "zstd");
streamProps.put(ProducerConfig.LINGER_MS_CONFIG, getKafkaLingerMs());


if (confluentCloudEnabled) {
streamProps.put("ssl.endpoint.identification.algorithm", "https");
streamProps.put("security.protocol", "SASL_SSL");
Expand All @@ -413,7 +407,8 @@ public Properties createStreamProperties(String name) {
// We do not want Kafka Streams default "earliest" for this app
// https://docs.confluent.io/platform/current/streams/developer-guide/config-streams.html#default-values
streamProps.setProperty(StreamsConfig.consumerPrefix(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG), "latest");
// Restore and global consumers also set to latest, instead of streams default "none"
// Restore and global consumers also set to latest, instead of streams default
// "none"
// which would cause exceptions to be thrown if no offset found.
// Ref:
// https://docs.confluent.io/platform/current/streams/developer-guide/config-streams.html#parameters-controlled-by-kstreams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@

@Configuration
@EnableMongoRepositories
public class MongoConfig extends AbstractMongoClientConfiguration{
public class MongoConfig extends AbstractMongoClientConfiguration {
private List<Converter<?, ?>> converters = new ArrayList<Converter<?, ?>>();

// @Value("${spring.data.mongodb.uri}")
// private String uri;

@Value("${spring.data.mongodb.database}")
private String db;

Expand Down Expand Up @@ -53,17 +50,16 @@ protected String getDatabaseName() {

@Override
public void configureClientSettings(MongoClientSettings.Builder builder) {

String uri = "";

if(overrideURI != null && !overrideURI.isEmpty() && !overrideURI.equals("null")){
if (overrideURI != null && !overrideURI.isEmpty() && !overrideURI.equals("null")) {
uri = overrideURI;
}else{
uri = "mongodb://"+username+":"+password+"@"+host+":"+port+"/"+db + "?authSource="+authenticationDatabase;
} else {
uri = "mongodb://" + username + ":" + password + "@" + host + ":" + port + "/" + db + "?authSource="
+ authenticationDatabase;
}


// String uri = "mongodb://"+host+":"+port+"/"+db;
System.out.println("Connecting to MongoDB at: " + uri);
builder.applyConnectionString(new ConnectionString(uri));
}
Expand Down
Loading

0 comments on commit 6f36f15

Please sign in to comment.