diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2023-08-16 07:15:07 +0000 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2023-08-16 08:19:43 +0000 |
commit | 7c0e2f563a18dfe7c8f6c2ad66d01775c9468f37 (patch) | |
tree | 93ec77e83d0eb035c26a7f4e3017a7ee9f2e4f91 /app/src/main | |
parent | 6ae8df1305d1374af3b5ffe8ecb4c5ce3e17260d (diff) |
Consistently use the preferences name in the preferences code base
- rename package name from org.onap.portal.prefs to org.onap.portalng.preferences
- replace all other occurences of portal-prefs with preferences
Other:
- remove Sonarqube plugin
Issue-ID: PORTALNG-39
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Change-Id: Iced79a26460d988c5b22eb5fcac86d350528a1a2
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/org/onap/portalng/preferences/PreferencesApplication.java (renamed from app/src/main/java/org/onap/portal/prefs/PortalPrefsApplication.java) | 10 | ||||
-rw-r--r-- | app/src/main/java/org/onap/portalng/preferences/configuration/BeansConfig.java (renamed from app/src/main/java/org/onap/portal/prefs/configuration/BeansConfig.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/org/onap/portalng/preferences/configuration/LogInterceptor.java (renamed from app/src/main/java/org/onap/portal/prefs/configuration/LogInterceptor.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/org/onap/portalng/preferences/configuration/PreferencesConfig.java (renamed from app/src/main/java/org/onap/portal/prefs/configuration/PortalPrefsConfig.java) | 6 | ||||
-rw-r--r-- | app/src/main/java/org/onap/portalng/preferences/configuration/SecurityConfig.java (renamed from app/src/main/java/org/onap/portal/prefs/configuration/SecurityConfig.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/org/onap/portalng/preferences/controller/PreferencesController.java (renamed from app/src/main/java/org/onap/portal/prefs/controller/PreferencesController.java) | 18 | ||||
-rw-r--r-- | app/src/main/java/org/onap/portalng/preferences/entities/PreferencesDto.java (renamed from app/src/main/java/org/onap/portal/prefs/entities/PreferencesDto.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/org/onap/portalng/preferences/exception/ProblemException.java (renamed from app/src/main/java/org/onap/portal/prefs/exception/ProblemException.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/org/onap/portalng/preferences/repository/PreferencesRepository.java (renamed from app/src/main/java/org/onap/portal/prefs/repository/PreferencesRepository.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/org/onap/portalng/preferences/services/PreferencesService.java (renamed from app/src/main/java/org/onap/portal/prefs/services/PreferencesService.java) | 14 | ||||
-rw-r--r-- | app/src/main/java/org/onap/portalng/preferences/util/IdTokenExchange.java (renamed from app/src/main/java/org/onap/portal/prefs/util/IdTokenExchange.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/org/onap/portalng/preferences/util/Logger.java (renamed from app/src/main/java/org/onap/portal/prefs/util/Logger.java) | 10 | ||||
-rw-r--r-- | app/src/main/resources/application-local.yml | 4 | ||||
-rw-r--r-- | app/src/main/resources/application.yml | 13 |
14 files changed, 47 insertions, 48 deletions
diff --git a/app/src/main/java/org/onap/portal/prefs/PortalPrefsApplication.java b/app/src/main/java/org/onap/portalng/preferences/PreferencesApplication.java index 092c533..67171cd 100644 --- a/app/src/main/java/org/onap/portal/prefs/PortalPrefsApplication.java +++ b/app/src/main/java/org/onap/portalng/preferences/PreferencesApplication.java @@ -19,19 +19,19 @@ * */ -package org.onap.portal.prefs; +package org.onap.portalng.preferences; -import org.onap.portal.prefs.configuration.PortalPrefsConfig; +import org.onap.portalng.preferences.configuration.PreferencesConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.EnableConfigurationProperties; -@EnableConfigurationProperties(PortalPrefsConfig.class) +@EnableConfigurationProperties(PreferencesConfig.class) @SpringBootApplication -public class PortalPrefsApplication { +public class PreferencesApplication { public static void main(String[] args) { - SpringApplication.run(PortalPrefsApplication.class, args); + SpringApplication.run(PreferencesApplication.class, args); } } diff --git a/app/src/main/java/org/onap/portal/prefs/configuration/BeansConfig.java b/app/src/main/java/org/onap/portalng/preferences/configuration/BeansConfig.java index 77ef7f0..f35d43c 100644 --- a/app/src/main/java/org/onap/portal/prefs/configuration/BeansConfig.java +++ b/app/src/main/java/org/onap/portalng/preferences/configuration/BeansConfig.java @@ -19,7 +19,7 @@ * */ -package org.onap.portal.prefs.configuration; +package org.onap.portalng.preferences.configuration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/app/src/main/java/org/onap/portal/prefs/configuration/LogInterceptor.java b/app/src/main/java/org/onap/portalng/preferences/configuration/LogInterceptor.java index b653fe3..7ceee06 100644 --- a/app/src/main/java/org/onap/portal/prefs/configuration/LogInterceptor.java +++ b/app/src/main/java/org/onap/portalng/preferences/configuration/LogInterceptor.java @@ -19,9 +19,9 @@ * */ -package org.onap.portal.prefs.configuration; +package org.onap.portalng.preferences.configuration; -import org.onap.portal.prefs.util.Logger; +import org.onap.portalng.preferences.util.Logger; import org.springframework.stereotype.Component; import org.springframework.web.filter.reactive.ServerWebExchangeContextFilter; import org.springframework.web.server.ServerWebExchange; diff --git a/app/src/main/java/org/onap/portal/prefs/configuration/PortalPrefsConfig.java b/app/src/main/java/org/onap/portalng/preferences/configuration/PreferencesConfig.java index 2d415cd..1394fd5 100644 --- a/app/src/main/java/org/onap/portal/prefs/configuration/PortalPrefsConfig.java +++ b/app/src/main/java/org/onap/portalng/preferences/configuration/PreferencesConfig.java @@ -19,7 +19,7 @@ * */ -package org.onap.portal.prefs.configuration; +package org.onap.portalng.preferences.configuration; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -27,8 +27,8 @@ import jakarta.validation.constraints.NotBlank; import lombok.Data; @Data -@ConfigurationProperties("portal-prefs") -public class PortalPrefsConfig { +@ConfigurationProperties("preferences") +public class PreferencesConfig { @NotBlank private final String realm; diff --git a/app/src/main/java/org/onap/portal/prefs/configuration/SecurityConfig.java b/app/src/main/java/org/onap/portalng/preferences/configuration/SecurityConfig.java index 531e90b..31866fe 100644 --- a/app/src/main/java/org/onap/portal/prefs/configuration/SecurityConfig.java +++ b/app/src/main/java/org/onap/portalng/preferences/configuration/SecurityConfig.java @@ -19,7 +19,7 @@ * */ -package org.onap.portal.prefs.configuration; +package org.onap.portalng.preferences.configuration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/app/src/main/java/org/onap/portal/prefs/controller/PreferencesController.java b/app/src/main/java/org/onap/portalng/preferences/controller/PreferencesController.java index f2ae7f9..02357e4 100644 --- a/app/src/main/java/org/onap/portal/prefs/controller/PreferencesController.java +++ b/app/src/main/java/org/onap/portalng/preferences/controller/PreferencesController.java @@ -19,13 +19,13 @@ * */ -package org.onap.portal.prefs.controller; -import org.onap.portal.prefs.exception.ProblemException; -import org.onap.portal.prefs.openapi.api.PreferencesApi; -import org.onap.portal.prefs.openapi.model.Preferences; -import org.onap.portal.prefs.services.PreferencesService; -import org.onap.portal.prefs.util.IdTokenExchange; -import org.onap.portal.prefs.util.Logger; +package org.onap.portalng.preferences.controller; +import org.onap.portalng.preferences.exception.ProblemException; +import org.onap.portalng.preferences.openapi.api.PreferencesApi; +import org.onap.portalng.preferences.openapi.model.Preferences; +import org.onap.portalng.preferences.services.PreferencesService; +import org.onap.portalng.preferences.util.IdTokenExchange; +import org.onap.portalng.preferences.util.Logger; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; @@ -51,7 +51,7 @@ public class PreferencesController implements PreferencesApi { preferencesService.getPreferences(userid) .map(ResponseEntity::ok)) .onErrorResume(ProblemException.class, ex -> { - Logger.errorLog(xRequestId,"user preferences", null, "portal-prefs" ); + Logger.errorLog(xRequestId,"user preferences", null, "preferences" ); return Mono.error(ex); }) .onErrorReturn(new ResponseEntity<>(HttpStatus.BAD_REQUEST)); @@ -70,7 +70,7 @@ public class PreferencesController implements PreferencesApi { .savePreferences(xRequestId, userid, pref))) .map( ResponseEntity::ok) .onErrorResume(ProblemException.class, ex -> { - Logger.errorLog(xRequestId,"user preferences", null, "portal-prefs" ); + Logger.errorLog(xRequestId,"user preferences", null, "preferences" ); return Mono.error(ex); }) .onErrorReturn(new ResponseEntity<>(HttpStatus.BAD_REQUEST)); diff --git a/app/src/main/java/org/onap/portal/prefs/entities/PreferencesDto.java b/app/src/main/java/org/onap/portalng/preferences/entities/PreferencesDto.java index 45616a9..a86c229 100644 --- a/app/src/main/java/org/onap/portal/prefs/entities/PreferencesDto.java +++ b/app/src/main/java/org/onap/portalng/preferences/entities/PreferencesDto.java @@ -19,7 +19,7 @@ * */ -package org.onap.portal.prefs.entities; +package org.onap.portalng.preferences.entities; import lombok.Getter; import lombok.Setter; diff --git a/app/src/main/java/org/onap/portal/prefs/exception/ProblemException.java b/app/src/main/java/org/onap/portalng/preferences/exception/ProblemException.java index b9d2a3d..da7872f 100644 --- a/app/src/main/java/org/onap/portal/prefs/exception/ProblemException.java +++ b/app/src/main/java/org/onap/portalng/preferences/exception/ProblemException.java @@ -19,7 +19,7 @@ * */ -package org.onap.portal.prefs.exception; +package org.onap.portalng.preferences.exception; import lombok.AllArgsConstructor; import lombok.Builder; @@ -33,7 +33,7 @@ import org.zalando.problem.StatusType; import java.net.URI; -/** The default portal-prefs exception */ +/** The default preferences exception */ @Data @Builder @AllArgsConstructor diff --git a/app/src/main/java/org/onap/portal/prefs/repository/PreferencesRepository.java b/app/src/main/java/org/onap/portalng/preferences/repository/PreferencesRepository.java index 461ee1d..264cdf5 100644 --- a/app/src/main/java/org/onap/portal/prefs/repository/PreferencesRepository.java +++ b/app/src/main/java/org/onap/portalng/preferences/repository/PreferencesRepository.java @@ -19,9 +19,9 @@ * */ -package org.onap.portal.prefs.repository; +package org.onap.portalng.preferences.repository; -import org.onap.portal.prefs.entities.PreferencesDto; +import org.onap.portalng.preferences.entities.PreferencesDto; import org.springframework.data.mongodb.repository.ReactiveMongoRepository; public interface PreferencesRepository extends ReactiveMongoRepository<PreferencesDto, String> { diff --git a/app/src/main/java/org/onap/portal/prefs/services/PreferencesService.java b/app/src/main/java/org/onap/portalng/preferences/services/PreferencesService.java index f96dfea..4e7dfb3 100644 --- a/app/src/main/java/org/onap/portal/prefs/services/PreferencesService.java +++ b/app/src/main/java/org/onap/portalng/preferences/services/PreferencesService.java @@ -19,13 +19,13 @@ * */ -package org.onap.portal.prefs.services; +package org.onap.portalng.preferences.services; -import org.onap.portal.prefs.entities.PreferencesDto; -import org.onap.portal.prefs.exception.ProblemException; -import org.onap.portal.prefs.openapi.model.Preferences; -import org.onap.portal.prefs.repository.PreferencesRepository; -import org.onap.portal.prefs.util.Logger; +import org.onap.portalng.preferences.entities.PreferencesDto; +import org.onap.portalng.preferences.exception.ProblemException; +import org.onap.portalng.preferences.openapi.model.Preferences; +import org.onap.portalng.preferences.repository.PreferencesRepository; +import org.onap.portalng.preferences.util.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -54,7 +54,7 @@ public class PreferencesService { .save(preferencesDto) .map(this::toPreferences) .onErrorResume(ProblemException.class, ex -> { - Logger.errorLog(xRequestId,"user prefrences", userId, "portal-prefs" ); + Logger.errorLog(xRequestId,"user prefrences", userId, "preferences" ); return Mono.error(ex); }); diff --git a/app/src/main/java/org/onap/portal/prefs/util/IdTokenExchange.java b/app/src/main/java/org/onap/portalng/preferences/util/IdTokenExchange.java index 9ac2794..7349d53 100644 --- a/app/src/main/java/org/onap/portal/prefs/util/IdTokenExchange.java +++ b/app/src/main/java/org/onap/portalng/preferences/util/IdTokenExchange.java @@ -19,7 +19,7 @@ * */ -package org.onap.portal.prefs.util; +package org.onap.portalng.preferences.util; import com.nimbusds.jwt.JWTClaimsSet; import com.nimbusds.jwt.JWTParser; diff --git a/app/src/main/java/org/onap/portal/prefs/util/Logger.java b/app/src/main/java/org/onap/portalng/preferences/util/Logger.java index 4026b9f..ed8eae3 100644 --- a/app/src/main/java/org/onap/portal/prefs/util/Logger.java +++ b/app/src/main/java/org/onap/portalng/preferences/util/Logger.java @@ -19,7 +19,7 @@ * */ -package org.onap.portal.prefs.util; +package org.onap.portalng.preferences.util; import java.net.URI; @@ -34,22 +34,22 @@ public class Logger { private Logger(){} public static void requestLog(String xRequestId, HttpMethod methode, URI path) { - log.info("Portal-prefs - request - X-Request-Id {} {} {}", xRequestId, methode, path); + log.info("Preferences - request - X-Request-Id {} {} {}", xRequestId, methode, path); } public static void responseLog(String xRequestId, HttpStatusCode httpStatusCode) { - log.info("Portal-prefs - response - X-Request-Id {} {}", xRequestId, httpStatusCode); + log.info("Preferences - response - X-Request-Id {} {}", xRequestId, httpStatusCode); } public static void errorLog(String xRequestId, String msg, String id, String app) { log.info( - "Portal-prefs - error - X-Request-Id {} {} {} not found in {}", xRequestId, msg, id, app); + "Preferences - error - X-Request-Id {} {} {} not found in {}", xRequestId, msg, id, app); } public static void errorLog( String xRequestId, String msg, String id, String app, String errorDetails) { log.info( - "Portal-prefs - error - X-Request-Id {} {} {} not found in {} error message: {}", + "Preferences - error - X-Request-Id {} {} {} not found in {} error message: {}", xRequestId, msg, id, diff --git a/app/src/main/resources/application-local.yml b/app/src/main/resources/application-local.yml index 71fe8db..1ca695e 100644 --- a/app/src/main/resources/application-local.yml +++ b/app/src/main/resources/application-local.yml @@ -14,13 +14,13 @@ spring: jwk-set-uri: http://localhost:8080/auth/realms/ONAP/protocol/openid-connect/certs #Keycloak Endpoint data: mongodb: - database: portal_prefs + database: portal_preferences host: localhost port: 27017 username: root password: password -portal-prefs: +preferences: realm: ONAP management: diff --git a/app/src/main/resources/application.yml b/app/src/main/resources/application.yml index eb5b313..c7afccb 100644 --- a/app/src/main/resources/application.yml +++ b/app/src/main/resources/application.yml @@ -14,15 +14,14 @@ spring: jwk-set-uri: ${KEYCLOAK_URL}/auth/realms/${KEYCLOAK_REALM}/protocol/openid-connect/certs #Keycloak Endpoint data: mongodb: - database: ${PORTALPREFS_DATABASE} - host: ${PORTALPREFS_HOST} - port: ${PORTALPREFS_PORT} - username: ${PORTALPREFS_USERNAME} - password: ${PORTALPREFS_PASSWORD} + database: ${PREFERENCES_DATABASE} + host: ${PREFERENCES_HOST} + port: ${PREFERENCES_PORT} + username: ${PREFERENCES_USERNAME} + password: ${PREFERENCES_PASSWORD} -portal-prefs: +preferences: realm: ${KEYCLOAK_REALM} - management: endpoints: web: |