Skip to content

Commit

Permalink
#138 Refactor com.ironoc.portfolio -> net.ironoc.portfolio (#139)
Browse files Browse the repository at this point in the history
* #138 Refactor com.ironoc.portfolio -> net.ironoc.portfolio

* #138 Update pom.xml
  • Loading branch information
conorheffron authored Oct 13, 2024
1 parent e3c1722 commit 2a6ca9b
Show file tree
Hide file tree
Showing 46 changed files with 146 additions and 136 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>conorheffron</groupId>
<artifactId>ironoc</artifactId>
<version>5.2.3</version>
<version>5.2.4</version>
<packaging>war</packaging>

<distributionManagement>
Expand Down
20 changes: 0 additions & 20 deletions src/main/java/com/ironoc/portfolio/config/Properties.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio;
package net.ironoc.portfolio;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.ironoc.portfolio.aws;
package net.ironoc.portfolio.aws;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ironoc.portfolio.logger.AbstractLogger;
import net.ironoc.portfolio.logger.AbstractLogger;
import org.springframework.stereotype.Component;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.secretsmanager.SecretsManagerClient;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio.aws;
package net.ironoc.portfolio.aws;

public interface SecretManager {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio.client;
package net.ironoc.portfolio.client;

import javax.net.ssl.HttpsURLConnection;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.ironoc.portfolio.client;
package net.ironoc.portfolio.client;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.type.CollectionType;
import com.ironoc.portfolio.aws.SecretManager;
import com.ironoc.portfolio.config.PropertyConfigI;
import com.ironoc.portfolio.logger.AbstractLogger;
import com.ironoc.portfolio.utils.UrlUtils;
import net.ironoc.portfolio.aws.SecretManager;
import net.ironoc.portfolio.config.PropertyConfigI;
import net.ironoc.portfolio.logger.AbstractLogger;
import net.ironoc.portfolio.utils.UrlUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio.config;
package net.ironoc.portfolio.config;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
Expand All @@ -17,7 +17,7 @@
@Configuration
@EnableAsync
@EnableScheduling
@ComponentScan(basePackages = { "com.ironoc.portfolio" })
@ComponentScan(basePackages = { "net.ironoc.portfolio" })
public class IronocConfiguration implements WebMvcConfigurer {

@Override
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/net/ironoc/portfolio/config/Properties.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package net.ironoc.portfolio.config;

import lombok.Getter;

@Getter
public enum Properties {

GIT_API_ENDPOINT_REPOS("net.ironoc.portfolio.github.api.endpoint.repos"),
GIT_API_ENDPOINT_ISSUES("net.ironoc.portfolio.github.api.endpoint.issues"),
GIT_TIMEOUT_CONNECT ("net.ironoc.portfolio.github.timeout.connect"),
GIT_TIMEOUT_READ("net.ironoc.portfolio.github.timeout.read"),
GIT_INSTANCE_FOLLOW_REDIRECTS("net.ironoc.portfolio.github.instance-follow-redirects"),
GIT_FOLLOW_REDIRECTS("net.ironoc.portfolio.github.follow-redirects");

private String key;

Properties(String key) {
this.key = key;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio.config;
package net.ironoc.portfolio.config;

import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio.config;
package net.ironoc.portfolio.config;

public interface PropertyConfigI {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio.config;
package net.ironoc.portfolio.config;

import org.springframework.stereotype.Component;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio.config;
package net.ironoc.portfolio.config;

public interface PropertyKeyI {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ironoc.portfolio.config;
package net.ironoc.portfolio.config;

import com.ironoc.portfolio.logger.AbstractLogger;
import net.ironoc.portfolio.logger.AbstractLogger;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.ironoc.portfolio.controller;
package net.ironoc.portfolio.controller;

import com.ironoc.portfolio.domain.RepositoryDetailDomain;
import com.ironoc.portfolio.domain.RepositoryIssueDomain;
import com.ironoc.portfolio.dto.RepositoryDetailDto;
import com.ironoc.portfolio.dto.RepositoryIssueDto;
import com.ironoc.portfolio.logger.AbstractLogger;
import com.ironoc.portfolio.service.GitDetailsService;
import net.ironoc.portfolio.domain.RepositoryDetailDomain;
import net.ironoc.portfolio.domain.RepositoryIssueDomain;
import net.ironoc.portfolio.dto.RepositoryDetailDto;
import net.ironoc.portfolio.dto.RepositoryIssueDto;
import net.ironoc.portfolio.logger.AbstractLogger;
import net.ironoc.portfolio.service.GitDetailsService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio.domain;
package net.ironoc.portfolio.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio.domain;
package net.ironoc.portfolio.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio.dto;
package net.ironoc.portfolio.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio.dto;
package net.ironoc.portfolio.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio.dto;
package net.ironoc.portfolio.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ironoc.portfolio.job;
package net.ironoc.portfolio.job;

import com.ironoc.portfolio.service.GitRepoCache;
import com.ironoc.portfolio.service.GitDetails;
import net.ironoc.portfolio.service.GitRepoCache;
import net.ironoc.portfolio.service.GitDetails;
import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.ironoc.portfolio.job;
package net.ironoc.portfolio.job;

import com.ironoc.portfolio.logger.AbstractLogger;
import com.ironoc.portfolio.service.GitRepoCache;
import com.ironoc.portfolio.dto.RepositoryDetailDto;
import com.ironoc.portfolio.service.GitDetails;
import net.ironoc.portfolio.logger.AbstractLogger;
import net.ironoc.portfolio.service.GitRepoCache;
import net.ironoc.portfolio.dto.RepositoryDetailDto;
import net.ironoc.portfolio.service.GitDetails;
import jakarta.annotation.PreDestroy;
import lombok.Getter;

Expand Down Expand Up @@ -39,11 +39,13 @@ private Set<String> populateUserIds() {
@Override
public void run() {
info("GitDetailsRunnable running for userIds={}", getUserIds());
gitRepoCache.clear();
for (String userId : userIds) {
List<RepositoryDetailDto> dtos = gitDetails.getRepoDetails(userId);
info("-----Running GIT details job for userIds={}, repositoryDetailDtos={}", getUserIds(), dtos);
info("Running GIT details job for userIds={}, repositoryDetailDtos={}", getUserIds(), dtos);
gitRepoCache.put(userId, gitDetails.mapRepositoriesToResponse(dtos));
}
info("GitDetailsRunnable completed for userIds={}", getUserIds());
}

@PreDestroy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio.logger;
package net.ironoc.portfolio.logger;

import lombok.extern.slf4j.Slf4j;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio.logger;
package net.ironoc.portfolio.logger;

public interface LoggerI {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.ironoc.portfolio.service;
package net.ironoc.portfolio.service;

import com.ironoc.portfolio.domain.RepositoryDetailDomain;
import com.ironoc.portfolio.domain.RepositoryIssueDomain;
import com.ironoc.portfolio.dto.RepositoryDetailDto;
import com.ironoc.portfolio.dto.RepositoryIssueDto;
import net.ironoc.portfolio.domain.RepositoryDetailDomain;
import net.ironoc.portfolio.domain.RepositoryIssueDomain;
import net.ironoc.portfolio.dto.RepositoryDetailDto;
import net.ironoc.portfolio.dto.RepositoryIssueDto;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.ironoc.portfolio.service;
package net.ironoc.portfolio.service;


import com.ironoc.portfolio.client.Client;
import com.ironoc.portfolio.config.PropertyConfigI;
import com.ironoc.portfolio.domain.RepositoryDetailDomain;
import com.ironoc.portfolio.domain.RepositoryIssueDomain;
import com.ironoc.portfolio.dto.RepositoryDetailDto;
import com.ironoc.portfolio.dto.RepositoryIssueDto;
import com.ironoc.portfolio.job.GitDetailsRunnable;
import com.ironoc.portfolio.logger.AbstractLogger;
import com.ironoc.portfolio.utils.UrlUtils;
import net.ironoc.portfolio.client.Client;
import net.ironoc.portfolio.config.PropertyConfigI;
import net.ironoc.portfolio.domain.RepositoryDetailDomain;
import net.ironoc.portfolio.domain.RepositoryIssueDomain;
import net.ironoc.portfolio.dto.RepositoryDetailDto;
import net.ironoc.portfolio.dto.RepositoryIssueDto;
import net.ironoc.portfolio.job.GitDetailsRunnable;
import net.ironoc.portfolio.logger.AbstractLogger;
import net.ironoc.portfolio.utils.UrlUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.ironoc.portfolio.service;
package net.ironoc.portfolio.service;

import com.ironoc.portfolio.domain.RepositoryDetailDomain;
import com.ironoc.portfolio.dto.RepositoryDetailDto;
import net.ironoc.portfolio.domain.RepositoryDetailDomain;
import org.springframework.stereotype.Service;

import java.util.List;
Expand All @@ -12,4 +11,6 @@ public interface GitRepoCache {
void put(String userId, List<RepositoryDetailDomain> repositoryDetails);

List<RepositoryDetailDomain> get(String userId);

void clear();
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ironoc.portfolio.service;
package net.ironoc.portfolio.service;

import com.ironoc.portfolio.domain.RepositoryDetailDomain;
import net.ironoc.portfolio.domain.RepositoryDetailDomain;
import jakarta.annotation.PreDestroy;
import org.springframework.stereotype.Service;

Expand All @@ -27,8 +27,13 @@ public List<RepositoryDetailDomain> get(String userId) {
return userGitDetails.get(userId);
}

@PreDestroy
public void tearDown() {
@Override
public void clear() {
this.userGitDetails.clear();
}

@PreDestroy
private void tearDown() {
this.clear();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ironoc.portfolio.utils;
package net.ironoc.portfolio.utils;

import com.ironoc.portfolio.logger.AbstractLogger;
import net.ironoc.portfolio.logger.AbstractLogger;
import org.springframework.stereotype.Component;

import java.net.URL;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
com:
net:
ironoc:
portfolio:
github:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio;
package net.ironoc.portfolio;

import org.junit.jupiter.api.Test;
import org.mockito.MockedStatic;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio.aws;
package net.ironoc.portfolio.aws;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.ironoc.portfolio.client;
package net.ironoc.portfolio.client;

import com.ironoc.portfolio.aws.SecretManager;
import com.ironoc.portfolio.config.PropertyConfigI;
import com.ironoc.portfolio.dto.RepositoryDetailDto;
import com.ironoc.portfolio.utils.UrlUtils;
import net.ironoc.portfolio.aws.SecretManager;
import net.ironoc.portfolio.config.PropertyConfigI;
import net.ironoc.portfolio.dto.RepositoryDetailDto;
import net.ironoc.portfolio.utils.UrlUtils;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio.config;
package net.ironoc.portfolio.config;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ironoc.portfolio.config;
package net.ironoc.portfolio.config;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down
Loading

0 comments on commit 2a6ca9b

Please sign in to comment.