From 395a2f6bccba5d42130f8d5e1a9b9a7acba68bc3 Mon Sep 17 00:00:00 2001 From: Svetlin Tanyi Date: Tue, 12 Nov 2019 17:47:53 +0000 Subject: [PATCH 001/301] initSQL fix --- scripts/initSQL.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/initSQL.sh b/scripts/initSQL.sh index 6c00fb65f..123f4d41e 100644 --- a/scripts/initSQL.sh +++ b/scripts/initSQL.sh @@ -5,10 +5,11 @@ rm -rf sql mkdir sql cd sql wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/create_empty_arrowhead_db.sql -sed 's/source /& docker-entrypoint-initdb.d\/privileges\//g' create_empty_arrowhead_db.sql +sed -i 's/source /& docker-entrypoint-initdb.d\/privileges\//g' create_empty_arrowhead_db.sql mkdir privileges cd privileges +wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/create_arrowhead_tables.sql wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/service_registry_privileges.sql wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/authorization_privileges.sql wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/orchestrator_privileges.sql From fcdedde6070cd860a491140e81d1b2344e26f30d Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Fri, 3 Jan 2020 11:32:17 +0100 Subject: [PATCH 002/301] added constants for device registry, system registry and onboarding. fixed typos. --- .../eu/arrowhead/common/CommonConstants.java | 49 +++++++--- .../java/eu/arrowhead/common/Defaults.java | 5 +- .../eu/arrowhead/common/core/CoreSystem.java | 91 ++++++++++--------- .../common/core/CoreSystemService.java | 52 +++++++---- .../common/dto/shared/OrchestrationFlags.java | 36 ++++---- .../OrchestratorAccessControlFilter.java | 2 +- .../OrchestratorAccessControlFilterTest.java | 4 +- .../ServiceRegistryController.java | 36 ++++---- 8 files changed, 163 insertions(+), 112 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java index 7ef651842..ac03cb552 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java @@ -22,7 +22,10 @@ public class CommonConstants { public static final String CORE_SYSTEM_GATEWAY = "Gateway"; public static final String CORE_SYSTEM_ORCHESTRATOR = "Orchestrator"; public static final String CORE_SYSTEM_SERVICE_REGISTRY = "Service Registry"; - + public static final String CORE_SYSTEM_SYSTEM_REGISTRY = "System Registry"; + public static final String CORE_SYSTEM_DEVICE_REGISTRY = "Device Registry"; + public static final String CORE_SYSTEM_ONBOARDING = "Onboarding Controller"; + public static final String CORE_SERVICE_AUTH_TOKEN_GENERATION = "token-generation"; public static final String CORE_SERVICE_AUTH_PUBLIC_KEY = "auth-public-key"; public static final String CORE_SERVICE_AUTH_CONTROL_INTRA = "authorization-control-intra"; @@ -41,7 +44,18 @@ public class CommonConstants { public static final String CORE_SERVICE_EVENT_HANDLER_SUBSCRIBE = "event-subscribe"; public static final String CORE_SERVICE_EVENT_HANDLER_UNSUBSCRIBE = "event-unsubscribe"; public static final String CORE_SERVICE_EVENT_HANDLER_PUBLISH_AUTH_UPDATE = "event-publish-auth-update"; - + + public static final String CORE_SERVICE_SERVICE_REGISTRY_REGISTER = "service-register"; + public static final String CORE_SERVICE_SERVICE_REGISTRY_UNREGISTER = "service-unregister"; + + public static final String CORE_SERVICE_SYSTEM_REGISTRY_REGISTER = "system-register"; + public static final String CORE_SERVICE_SYSTEM_REGISTRY_UNREGISTER = "system-unregister"; + + public static final String CORE_SERVICE_DEVICE_REGISTRY_REGISTER = "device-register"; + public static final String CORE_SERVICE_DEVICE_REGISTRY_UNREGISTER = "device-unregister"; + + public static final String CORE_SERVICE_ONBOARDING_PLAIN = "onboarding-plain"; + public static final String COMMON_FIELD_NAME_ID = "id"; public static final String ARROWHEAD_CONTEXT = "arrowheadContext"; @@ -70,7 +84,18 @@ public class CommonConstants { public static final String OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_ADDRESS = "address"; public static final String OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_PORT = "port"; public static final String OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_SERVICE_DEFINITION = "service_definition"; - + + public static final String SYSTEM_REGISTRY_URI = "/systemregistry"; + public static final String OP_SYSTEM_REGISTRY_REGISTER_URI = "/register"; + public static final String OP_SYSTEM_REGISTRY_UNREGISTER_URI = "/unregister"; + + public static final String DEVICE_REGISTRY_URI = "/deviceregistry"; + public static final String OP_DEVICE_REGISTRY_REGISTER_URI = "/register"; + public static final String OP_DEVICE_REGISTRY_UNREGISTER_URI = "/unregister"; + + public static final String ONBOARDING_URI = "/onboarding"; + public static final String OP_ONBOARDING_PLAIN = "/plain"; + public static final String AUTHORIZATION_URI = "/authorization"; public static final String OP_AUTH_TOKEN_URI = "/token"; public static final String OP_AUTH_KEY_URI = "/publickey"; @@ -80,15 +105,15 @@ public class CommonConstants { public static final String ORCHESTRATOR_URI = "/orchestrator"; public static final String OP_ORCH_PROCESS = "/orchestration"; - public static final String ORCHESTRATON_FLAG_MATCHMAKING = "matchmaking"; - public static final String ORCHESTRATON_FLAG_METADATA_SEARCH = "metadataSearch"; - public static final String ORCHESTRATON_FLAG_ONLY_PREFERRED = "onlyPreferred"; - public static final String ORCHESTRATON_FLAG_PING_PROVIDERS = "pingProviders"; - public static final String ORCHESTRATON_FLAG_OVERRIDE_STORE = "overrideStore"; - public static final String ORCHESTRATON_FLAG_TRIGGER_INTER_CLOUD = "triggerInterCloud"; - public static final String ORCHESTRATON_FLAG_EXTERNAL_SERVICE_REQUEST = "externalServiceRequest"; - public static final String ORCHESTRATON_FLAG_ENABLE_INTER_CLOUD = "enableInterCloud"; - public static final String ORCHESTRATON_FLAG_ENABLE_QOS = "enableQoS"; + public static final String ORCHESTRATION_FLAG_MATCHMAKING = "matchmaking"; + public static final String ORCHESTRATION_FLAG_METADATA_SEARCH = "metadataSearch"; + public static final String ORCHESTRATION_FLAG_ONLY_PREFERRED = "onlyPreferred"; + public static final String ORCHESTRATION_FLAG_PING_PROVIDERS = "pingProviders"; + public static final String ORCHESTRATION_FLAG_OVERRIDE_STORE = "overrideStore"; + public static final String ORCHESTRATION_FLAG_TRIGGER_INTER_CLOUD = "triggerInterCloud"; + public static final String ORCHESTRATION_FLAG_EXTERNAL_SERVICE_REQUEST = "externalServiceRequest"; + public static final String ORCHESTRATION_FLAG_ENABLE_INTER_CLOUD = "enableInterCloud"; + public static final String ORCHESTRATION_FLAG_ENABLE_QOS = "enableQoS"; public static final String GATEKEEPER_URI = "/gatekeeper"; public static final String OP_GATEKEEPER_GSD_SERVICE = "/init_gsd"; diff --git a/core-common/src/main/java/eu/arrowhead/common/Defaults.java b/core-common/src/main/java/eu/arrowhead/common/Defaults.java index e5db9ed31..308a742b0 100644 --- a/core-common/src/main/java/eu/arrowhead/common/Defaults.java +++ b/core-common/src/main/java/eu/arrowhead/common/Defaults.java @@ -11,7 +11,10 @@ public class Defaults { public static final int DEFAULT_URI_CRAWLER_INTERVAL = 30; public static final int DEFAULT_AUTH_TOKEN_TTL_IN_MINUTES = -1; // never expires - public static final String DEFAULT_SERVICE_REGISTRY_ADDRESS = CommonConstants.LOCALHOST; + public static final String DEFAULT_SERVICE_REGISTRY_ADDRESS = CommonConstants.LOCALHOST; + public static final int DEFAULT_ONBOARDING_PORT = 8435; + public static final int DEFAULT_DEVICE_REGISTRY_PORT = 8439; + public static final int DEFAULT_SYSTEM_REGISTRY_PORT = 8437; public static final int DEFAULT_SERVICE_REGISTRY_PORT = 8443; public static final int DEFAULT_AUTHORIZATION_PORT = 8445; public static final int DEFAULT_ORCHESTRATOR_PORT = 8441; diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java index 4e39afa2a..f18b6ccf3 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java @@ -1,50 +1,57 @@ package eu.arrowhead.common.core; +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.Defaults; +import org.springframework.util.Assert; + import java.util.Collections; import java.util.List; -import org.springframework.util.Assert; +import static eu.arrowhead.common.core.CoreSystemService.*; -import eu.arrowhead.common.CommonConstants; -import eu.arrowhead.common.Defaults; +public enum CoreSystem +{ + + //================================================================================================= + // elements + + SERVICE_REGISTRY(Defaults.DEFAULT_SERVICE_REGISTRY_PORT, List.of(SERVICE_REGISTRY_REGISTER_SERVICE, SERVICE_REGISTRY_UNREGISTER_SERVICE)), + SYSTEM_REGISTRY(Defaults.DEFAULT_SYSTEM_REGISTRY_PORT, List.of(SYSTEM_REGISTRY_REGISTER_SERVICE, SYSTEM_REGISTRY_UNREGISTER_SERVICE)), + DEVICE_REGISTRY(Defaults.DEFAULT_DEVICE_REGISTRY_PORT, List.of(DEVICE_REGISTRY_REGISTER_SERVICE, DEVICE_REGISTRY_UNREGISTER_SERVICE)), + ONBOARDING(Defaults.DEFAULT_ONBOARDING_PORT, List.of(ONBOARDING_SERVICE)), + AUTHORIZATION(Defaults.DEFAULT_AUTHORIZATION_PORT, List.of(AUTH_CONTROL_INTRA_SERVICE, AUTH_CONTROL_INTER_SERVICE, + AUTH_TOKEN_GENERATION_SERVICE, AUTH_PUBLIC_KEY_SERVICE, + AUTH_CONTROL_SUBSCRIPTION_SERVICE)), + ORCHESTRATOR(Defaults.DEFAULT_ORCHESTRATOR_PORT, List.of(ORCHESTRATION_SERVICE)), + GATEKEEPER(Defaults.DEFAULT_GATEKEEPER_PORT, List.of(GATEKEEPER_GLOBAL_SERVICE_DISCOVERY, GATEKEEPER_INTER_CLOUD_NEGOTIATION)), + EVENT_HANDLER(Defaults.DEFAULT_EVENT_HANDLER_PORT, List.of(EVENT_PUBLISH_SERVICE, EVENT_SUBSCRIBE_SERVICE, + EVENT_UNSUBSCRIBE_SERVICE, EVENT_PUBLISH_AUTH_UPDATE_SERVICE)), + GATEWAY(Defaults.DEFAULT_GATEWAY_PORT, List.of(GATEWAY_PUBLIC_KEY_SERVICE, GATEWAY_PROVIDER_SERVICE, GATEWAY_CONSUMER_SERVICE)), + CHOREOGRAPHER(Defaults.DEFAULT_CHOREOGRAPHER_PORT, List.of()), // TODO: add services + CERTIFICATE_AUTHORITY(Defaults.DEFAULT_CERTIFICATE_AUTHORITY_PORT, List.of()); // TODO: add services + + //================================================================================================= + // members + + private final int defaultPort; + private final List services; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + private CoreSystem(final int defaultPort, final List services) + { + Assert.isTrue(defaultPort > CommonConstants.SYSTEM_PORT_RANGE_MIN && defaultPort < CommonConstants.SYSTEM_PORT_RANGE_MAX, "Default port is invalid."); + this.services = services != null ? Collections.unmodifiableList(services) : List.of(); + this.defaultPort = defaultPort; + } + + //------------------------------------------------------------------------------------------------- + public int getDefaultPort() { return defaultPort; } + + //================================================================================================= + // assistant methods -public enum CoreSystem { - - //================================================================================================= - // elements - - SERVICE_REGISTRY(Defaults.DEFAULT_SERVICE_REGISTRY_PORT, null), - AUTHORIZATION(Defaults.DEFAULT_AUTHORIZATION_PORT, List.of(CoreSystemService.AUTH_CONTROL_INTRA_SERVICE, CoreSystemService.AUTH_CONTROL_INTER_SERVICE, - CoreSystemService.AUTH_TOKEN_GENERATION_SERVICE, CoreSystemService.AUTH_PUBLIC_KEY_SERVICE, - CoreSystemService.AUTH_CONTROL_SUBSCRIPTION_SERVICE)), - ORCHESTRATOR(Defaults.DEFAULT_ORCHESTRATOR_PORT, List.of(CoreSystemService.ORCHESTRATION_SERVICE)), - GATEKEEPER(Defaults.DEFAULT_GATEKEEPER_PORT, List.of(CoreSystemService.GATEKEEPER_GLOBAL_SERVICE_DISCOVERY, CoreSystemService.GATEKEEPER_INTER_CLOUD_NEGOTIATION)), - EVENT_HANDLER(Defaults.DEFAULT_EVENT_HANDLER_PORT, List.of(CoreSystemService.EVENT_PUBLISH_SERVICE, CoreSystemService.EVENT_SUBSCRIBE_SERVICE - , CoreSystemService.EVENT_UNSUBSCRIBE_SERVICE, CoreSystemService.EVENT_PUBLISH_AUTH_UPDATE_SERVICE)), - GATEWAY(Defaults.DEFAULT_GATEWAY_PORT, List.of(CoreSystemService.GATEWAY_PUBLIC_KEY_SERVICE, CoreSystemService.GATEWAY_PROVIDER_SERVICE,CoreSystemService.GATEWAY_CONSUMER_SERVICE)), - CHOREOGRAPHER(Defaults.DEFAULT_CHOREOGRAPHER_PORT, List.of()), // TODO: add services - CERTIFICATE_AUTHORITY(Defaults.DEFAULT_CERTIFICATE_AUTHORITY_PORT, List.of()); // TODO: add services - - //================================================================================================= - // members - - private final int defaultPort; - private final List services; - - //================================================================================================= - // methods - - //------------------------------------------------------------------------------------------------- - public int getDefaultPort() { return defaultPort; } - public List getServices() { return services; } - - //================================================================================================= - // assistant methods - - //------------------------------------------------------------------------------------------------- - private CoreSystem(final int defaultPort, final List services) { - Assert.isTrue(defaultPort > CommonConstants.SYSTEM_PORT_RANGE_MIN && defaultPort < CommonConstants.SYSTEM_PORT_RANGE_MAX, "Default port is invalid."); - this.services = services != null ? Collections.unmodifiableList(services) : List.of(); - this.defaultPort = defaultPort; - } + public List getServices() { return services; } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java index 39f6db738..c06b58f0d 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java @@ -2,39 +2,55 @@ import org.springframework.util.Assert; -import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.Utilities; +import static eu.arrowhead.common.CommonConstants.*; + public enum CoreSystemService { //================================================================================================= // elements // Authorization services - AUTH_CONTROL_INTRA_SERVICE(CommonConstants.CORE_SERVICE_AUTH_CONTROL_INTRA, CommonConstants.AUTHORIZATION_URI + CommonConstants.OP_AUTH_INTRA_CHECK_URI), - AUTH_CONTROL_INTER_SERVICE(CommonConstants.CORE_SERVICE_AUTH_CONTROL_INTER, CommonConstants.AUTHORIZATION_URI + CommonConstants.OP_AUTH_INTER_CHECK_URI), - AUTH_TOKEN_GENERATION_SERVICE(CommonConstants.CORE_SERVICE_AUTH_TOKEN_GENERATION, CommonConstants.AUTHORIZATION_URI + CommonConstants.OP_AUTH_TOKEN_URI), - AUTH_PUBLIC_KEY_SERVICE(CommonConstants.CORE_SERVICE_AUTH_PUBLIC_KEY, CommonConstants.AUTHORIZATION_URI + CommonConstants.OP_AUTH_KEY_URI), - AUTH_CONTROL_SUBSCRIPTION_SERVICE(CommonConstants.CORE_SERVICE_AUTH_CONTROL_SUBSCRIPTION, CommonConstants.AUTHORIZATION_URI + CommonConstants.OP_AUTH_SUBSCRIPTION_CHECK_URI), + AUTH_CONTROL_INTRA_SERVICE(CORE_SERVICE_AUTH_CONTROL_INTRA, AUTHORIZATION_URI + OP_AUTH_INTRA_CHECK_URI), + AUTH_CONTROL_INTER_SERVICE(CORE_SERVICE_AUTH_CONTROL_INTER, AUTHORIZATION_URI + OP_AUTH_INTER_CHECK_URI), + AUTH_TOKEN_GENERATION_SERVICE(CORE_SERVICE_AUTH_TOKEN_GENERATION, AUTHORIZATION_URI + OP_AUTH_TOKEN_URI), + AUTH_PUBLIC_KEY_SERVICE(CORE_SERVICE_AUTH_PUBLIC_KEY, AUTHORIZATION_URI + OP_AUTH_KEY_URI), + AUTH_CONTROL_SUBSCRIPTION_SERVICE(CORE_SERVICE_AUTH_CONTROL_SUBSCRIPTION, AUTHORIZATION_URI + OP_AUTH_SUBSCRIPTION_CHECK_URI), // Orchestrator services - ORCHESTRATION_SERVICE(CommonConstants.CORE_SERVICE_ORCH_PROCESS, CommonConstants.ORCHESTRATOR_URI + CommonConstants.OP_ORCH_PROCESS), + ORCHESTRATION_SERVICE(CORE_SERVICE_ORCH_PROCESS, ORCHESTRATOR_URI + OP_ORCH_PROCESS), // Gatekeeper services - GATEKEEPER_GLOBAL_SERVICE_DISCOVERY(CommonConstants.CORE_SERVICE_GATEKEEPER_GSD, CommonConstants.GATEKEEPER_URI + CommonConstants.OP_GATEKEEPER_GSD_SERVICE), - GATEKEEPER_INTER_CLOUD_NEGOTIATION(CommonConstants.CORE_SERVICE_GATEKEEPER_ICN, CommonConstants.GATEKEEPER_URI + CommonConstants.OP_GATEKEEPER_ICN_SERVICE), + GATEKEEPER_GLOBAL_SERVICE_DISCOVERY(CORE_SERVICE_GATEKEEPER_GSD, GATEKEEPER_URI + OP_GATEKEEPER_GSD_SERVICE), + GATEKEEPER_INTER_CLOUD_NEGOTIATION(CORE_SERVICE_GATEKEEPER_ICN, GATEKEEPER_URI + OP_GATEKEEPER_ICN_SERVICE), // Gateway services - GATEWAY_PUBLIC_KEY_SERVICE(CommonConstants.CORE_SERVICE_GATEWAY_PUBLIC_KEY, CommonConstants.GATEWAY_URI + CommonConstants.OP_GATEWAY_KEY_URI), - GATEWAY_PROVIDER_SERVICE(CommonConstants.CORE_SERVICE_GATEWAY_CONNECT_PROVIDER, CommonConstants.GATEWAY_URI + CommonConstants.OP_GATEWAY_CONNECT_PROVIDER_URI), - GATEWAY_CONSUMER_SERVICE(CommonConstants.CORE_SERVICE_GATEWAY_CONNECT_CONSUMER, CommonConstants.GATEWAY_URI + CommonConstants.OP_GATEWAY_CONNECT_CONSUMER_URI), - - //Eventhandler services - EVENT_PUBLISH_SERVICE(CommonConstants.CORE_SERVICE_EVENT_HANDLER_PUBLISH, CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_PUBLISH), - EVENT_SUBSCRIBE_SERVICE(CommonConstants.CORE_SERVICE_EVENT_HANDLER_SUBSCRIBE, CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_SUBSCRIBE), - EVENT_UNSUBSCRIBE_SERVICE(CommonConstants.CORE_SERVICE_EVENT_HANDLER_UNSUBSCRIBE, CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_UNSUBSCRIBE), - EVENT_PUBLISH_AUTH_UPDATE_SERVICE(CommonConstants.CORE_SERVICE_EVENT_HANDLER_PUBLISH_AUTH_UPDATE, CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE); + GATEWAY_PUBLIC_KEY_SERVICE(CORE_SERVICE_GATEWAY_PUBLIC_KEY, GATEWAY_URI + OP_GATEWAY_KEY_URI), + GATEWAY_PROVIDER_SERVICE(CORE_SERVICE_GATEWAY_CONNECT_PROVIDER, GATEWAY_URI + OP_GATEWAY_CONNECT_PROVIDER_URI), + GATEWAY_CONSUMER_SERVICE(CORE_SERVICE_GATEWAY_CONNECT_CONSUMER, GATEWAY_URI + OP_GATEWAY_CONNECT_CONSUMER_URI), + // Eventhandler services + EVENT_PUBLISH_SERVICE(CORE_SERVICE_EVENT_HANDLER_PUBLISH, EVENT_HANDLER_URI + OP_EVENT_HANDLER_PUBLISH), + EVENT_SUBSCRIBE_SERVICE(CORE_SERVICE_EVENT_HANDLER_SUBSCRIBE, EVENT_HANDLER_URI + OP_EVENT_HANDLER_SUBSCRIBE), + EVENT_UNSUBSCRIBE_SERVICE(CORE_SERVICE_EVENT_HANDLER_UNSUBSCRIBE, EVENT_HANDLER_URI + OP_EVENT_HANDLER_UNSUBSCRIBE), + EVENT_PUBLISH_AUTH_UPDATE_SERVICE(CORE_SERVICE_EVENT_HANDLER_PUBLISH_AUTH_UPDATE, EVENT_HANDLER_URI + OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE), + + // Onboarding services + ONBOARDING_SERVICE(CORE_SERVICE_ONBOARDING_PLAIN, ONBOARDING_URI + OP_ONBOARDING_PLAIN), + + // Device Registry services + DEVICE_REGISTRY_REGISTER_SERVICE(CORE_SERVICE_DEVICE_REGISTRY_REGISTER, DEVICE_REGISTRY_URI + OP_DEVICE_REGISTRY_REGISTER_URI), + DEVICE_REGISTRY_UNREGISTER_SERVICE(CORE_SERVICE_DEVICE_REGISTRY_UNREGISTER, DEVICE_REGISTRY_URI + OP_DEVICE_REGISTRY_UNREGISTER_URI), + + // System Registry services + SYSTEM_REGISTRY_REGISTER_SERVICE(CORE_SERVICE_SYSTEM_REGISTRY_REGISTER, SYSTEM_REGISTRY_URI + OP_SYSTEM_REGISTRY_REGISTER_URI), + SYSTEM_REGISTRY_UNREGISTER_SERVICE(CORE_SERVICE_SYSTEM_REGISTRY_UNREGISTER, SYSTEM_REGISTRY_URI + OP_SYSTEM_REGISTRY_UNREGISTER_URI), + + // Service Registry services + SERVICE_REGISTRY_REGISTER_SERVICE(CORE_SERVICE_SERVICE_REGISTRY_REGISTER, SERVICE_REGISTRY_URI + OP_SERVICE_REGISTRY_REGISTER_URI), + SERVICE_REGISTRY_UNREGISTER_SERVICE(CORE_SERVICE_SERVICE_REGISTRY_UNREGISTER, SERVICE_REGISTRY_URI + OP_SERVICE_REGISTRY_UNREGISTER_URI); + //TODO: additional services //================================================================================================= diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OrchestrationFlags.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OrchestrationFlags.java index 9744eeb4d..2ef72f100 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OrchestrationFlags.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OrchestrationFlags.java @@ -64,15 +64,15 @@ public boolean containsKey(final Flag flag) { //------------------------------------------------------------------------------------------------- private static Map initFlagMap() { final Map result = new HashMap<>(Flag.values().length); - result.put(CommonConstants.ORCHESTRATON_FLAG_MATCHMAKING, Flag.MATCHMAKING); - result.put(CommonConstants.ORCHESTRATON_FLAG_METADATA_SEARCH, Flag.METADATA_SEARCH); - result.put(CommonConstants.ORCHESTRATON_FLAG_ONLY_PREFERRED, Flag.ONLY_PREFERRED); - result.put(CommonConstants.ORCHESTRATON_FLAG_PING_PROVIDERS, Flag.PING_PROVIDERS); - result.put(CommonConstants.ORCHESTRATON_FLAG_OVERRIDE_STORE, Flag.OVERRIDE_STORE); - result.put(CommonConstants.ORCHESTRATON_FLAG_TRIGGER_INTER_CLOUD, Flag.TRIGGER_INTER_CLOUD); - result.put(CommonConstants.ORCHESTRATON_FLAG_EXTERNAL_SERVICE_REQUEST, Flag.EXTERNAL_SERVICE_REQUEST); - result.put(CommonConstants.ORCHESTRATON_FLAG_ENABLE_INTER_CLOUD, Flag.ENABLE_INTER_CLOUD); - result.put(CommonConstants.ORCHESTRATON_FLAG_ENABLE_QOS, Flag.ENABLE_QOS); + result.put(CommonConstants.ORCHESTRATION_FLAG_MATCHMAKING, Flag.MATCHMAKING); + result.put(CommonConstants.ORCHESTRATION_FLAG_METADATA_SEARCH, Flag.METADATA_SEARCH); + result.put(CommonConstants.ORCHESTRATION_FLAG_ONLY_PREFERRED, Flag.ONLY_PREFERRED); + result.put(CommonConstants.ORCHESTRATION_FLAG_PING_PROVIDERS, Flag.PING_PROVIDERS); + result.put(CommonConstants.ORCHESTRATION_FLAG_OVERRIDE_STORE, Flag.OVERRIDE_STORE); + result.put(CommonConstants.ORCHESTRATION_FLAG_TRIGGER_INTER_CLOUD, Flag.TRIGGER_INTER_CLOUD); + result.put(CommonConstants.ORCHESTRATION_FLAG_EXTERNAL_SERVICE_REQUEST, Flag.EXTERNAL_SERVICE_REQUEST); + result.put(CommonConstants.ORCHESTRATION_FLAG_ENABLE_INTER_CLOUD, Flag.ENABLE_INTER_CLOUD); + result.put(CommonConstants.ORCHESTRATION_FLAG_ENABLE_QOS, Flag.ENABLE_QOS); return result; } @@ -86,15 +86,15 @@ public enum Flag { //================================================================================================= // elements - MATCHMAKING(CommonConstants.ORCHESTRATON_FLAG_MATCHMAKING), - METADATA_SEARCH(CommonConstants.ORCHESTRATON_FLAG_METADATA_SEARCH), - ONLY_PREFERRED(CommonConstants.ORCHESTRATON_FLAG_ONLY_PREFERRED), - PING_PROVIDERS(CommonConstants.ORCHESTRATON_FLAG_PING_PROVIDERS), - OVERRIDE_STORE(CommonConstants.ORCHESTRATON_FLAG_OVERRIDE_STORE), - TRIGGER_INTER_CLOUD(CommonConstants.ORCHESTRATON_FLAG_TRIGGER_INTER_CLOUD), - EXTERNAL_SERVICE_REQUEST(CommonConstants.ORCHESTRATON_FLAG_EXTERNAL_SERVICE_REQUEST), - ENABLE_INTER_CLOUD(CommonConstants.ORCHESTRATON_FLAG_ENABLE_INTER_CLOUD), - ENABLE_QOS(CommonConstants.ORCHESTRATON_FLAG_ENABLE_QOS); + MATCHMAKING(CommonConstants.ORCHESTRATION_FLAG_MATCHMAKING), + METADATA_SEARCH(CommonConstants.ORCHESTRATION_FLAG_METADATA_SEARCH), + ONLY_PREFERRED(CommonConstants.ORCHESTRATION_FLAG_ONLY_PREFERRED), + PING_PROVIDERS(CommonConstants.ORCHESTRATION_FLAG_PING_PROVIDERS), + OVERRIDE_STORE(CommonConstants.ORCHESTRATION_FLAG_OVERRIDE_STORE), + TRIGGER_INTER_CLOUD(CommonConstants.ORCHESTRATION_FLAG_TRIGGER_INTER_CLOUD), + EXTERNAL_SERVICE_REQUEST(CommonConstants.ORCHESTRATION_FLAG_EXTERNAL_SERVICE_REQUEST), + ENABLE_INTER_CLOUD(CommonConstants.ORCHESTRATION_FLAG_ENABLE_INTER_CLOUD), + ENABLE_QOS(CommonConstants.ORCHESTRATION_FLAG_ENABLE_QOS); //================================================================================================= // members diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/security/OrchestratorAccessControlFilter.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/security/OrchestratorAccessControlFilter.java index 7539c6116..98f14db1d 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/security/OrchestratorAccessControlFilter.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/security/OrchestratorAccessControlFilter.java @@ -37,7 +37,7 @@ protected void checkClientAuthorized(final String clientCN, final String method, final OrchestrationFormRequestDTO orchestrationFormRequestDTO = Utilities.fromJson(requestJSON, OrchestrationFormRequestDTO.class); final OrchestrationFlags orchestrationFlags = orchestrationFormRequestDTO.getOrchestrationFlags(); - if (orchestrationFlags.getOrDefault(CommonConstants.ORCHESTRATON_FLAG_EXTERNAL_SERVICE_REQUEST, false)) { + if (orchestrationFlags.getOrDefault(CommonConstants.ORCHESTRATION_FLAG_EXTERNAL_SERVICE_REQUEST, false)) { // If this is an external service request, only the local Gatekeeper can use these methods final CoreSystem[] allowedCoreSystems = { CoreSystem.GATEKEEPER }; checkIfClientIsAnAllowedCoreSystem(clientCN, cloudCN, allowedCoreSystems, requestTarget); diff --git a/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/security/OrchestratorAccessControlFilterTest.java b/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/security/OrchestratorAccessControlFilterTest.java index c47b17bb0..69b032ffc 100644 --- a/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/security/OrchestratorAccessControlFilterTest.java +++ b/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/security/OrchestratorAccessControlFilterTest.java @@ -101,7 +101,7 @@ public void testEchoCertificateOtherCloud() throws Exception { @Test public void testExternalOrchestrationWithGatekeeper() throws Exception { final Map flags = new HashMap<>(); - flags.put(CommonConstants.ORCHESTRATON_FLAG_EXTERNAL_SERVICE_REQUEST, true); + flags.put(CommonConstants.ORCHESTRATION_FLAG_EXTERNAL_SERVICE_REQUEST, true); final OrchestrationFormRequestDTO requestDTO = createOrchestrationFromRequestDTO("", flags); this.mockMvc.perform(post(ORCH_ORCHESTRATION) @@ -117,7 +117,7 @@ public void testExternalOrchestrationWithGatekeeper() throws Exception { @Test public void testExternalOrchestrationWithoutGatekeeper() throws Exception { final Map flags = new HashMap<>(); - flags.put(CommonConstants.ORCHESTRATON_FLAG_EXTERNAL_SERVICE_REQUEST, true); + flags.put(CommonConstants.ORCHESTRATION_FLAG_EXTERNAL_SERVICE_REQUEST, true); final OrchestrationFormRequestDTO requestDTO = createOrchestrationFromRequestDTO("", flags); this.mockMvc.perform(post(ORCH_ORCHESTRATION) diff --git a/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/ServiceRegistryController.java b/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/ServiceRegistryController.java index f01b54f9a..52d2bc71a 100644 --- a/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/ServiceRegistryController.java +++ b/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/ServiceRegistryController.java @@ -257,7 +257,7 @@ public String echoService() { }) @DeleteMapping(path = SYSTEMS_BY_ID_URI) public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New System delete request recieved with id: {}", id); + logger.debug("New System delete request received with id: {}", id); if (id < 1) { throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_BY_ID_URI); @@ -281,7 +281,7 @@ public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("New Service Definition get request recieved with page: {} and item_per page: {}", page, size); + logger.debug("New Service Definition get request received with page: {} and item_per page: {}", page, size); int validatedPage; int validatedSize; @@ -314,7 +314,7 @@ public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) }) @GetMapping(path = SERVICES_BY_ID_URI, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public ServiceDefinitionResponseDTO getServiceDefinitionById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New Service Definition get request recieved with id: {}", id); + logger.debug("New Service Definition get request received with id: {}", id); if (id < 1) { throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_BY_ID_URI); @@ -338,7 +338,7 @@ public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) @ResponseBody public ServiceDefinitionResponseDTO addServiceDefinition(@RequestBody final ServiceDefinitionRequestDTO serviceDefinitionRequestDTO) { final String serviceDefinition = serviceDefinitionRequestDTO.getServiceDefinition(); - logger.debug("New Service Definition registration request recieved with definition: {}", serviceDefinition); + logger.debug("New Service Definition registration request received with definition: {}", serviceDefinition); if (Utilities.isEmpty(serviceDefinition)) { throw new BadPayloadException("Service definition is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_URI); @@ -368,7 +368,7 @@ public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) @ResponseBody public ServiceDefinitionResponseDTO putUpdateServiceDefinition(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final ServiceDefinitionRequestDTO serviceDefinitionRequestDTO) { final String serviceDefinition = serviceDefinitionRequestDTO.getServiceDefinition(); - logger.debug("New Service Definition update request recieved with id: {}, definition: {}", id, serviceDefinition); + logger.debug("New Service Definition update request received with id: {}, definition: {}", id, serviceDefinition); if (id < 1) { throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_BY_ID_URI); @@ -401,7 +401,7 @@ public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) @PatchMapping(path = SERVICES_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = "application/json") @ResponseBody public ServiceDefinitionResponseDTO patchUpdateServiceDefinition(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final ServiceDefinitionRequestDTO serviceDefinitionRequestDTO) { - // Currently ServiceDefinition has only one updateable field, therefore PUT and PATCH do the same + // Currently ServiceDefinition has only one updatable field, therefore PUT and PATCH do the same return putUpdateServiceDefinition(id, serviceDefinitionRequestDTO); } @@ -415,7 +415,7 @@ public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) }) @DeleteMapping(path = SERVICES_BY_ID_URI) public void removeServiceDefinition(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New Service Definition delete request recieved with id: {}", id); + logger.debug("New Service Definition delete request received with id: {}", id); if (id < 1) { throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_BY_ID_URI); @@ -439,7 +439,7 @@ public void removeServiceDefinition(@PathVariable(value = PATH_VARIABLE_ID) fina @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("New Service Registry get request recieved with page: {} and item_per page: {}", page, size); + logger.debug("New Service Registry get request received with page: {} and item_per page: {}", page, size); int validatedPage; int validatedSize; @@ -473,7 +473,7 @@ public void removeServiceDefinition(@PathVariable(value = PATH_VARIABLE_ID) fina }) @GetMapping(path = SERVICE_REGISTRY_MGMT_BY_ID_URI) @ResponseBody public ServiceRegistryResponseDTO getServiceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New Service Registry get request recieved with id: {}", id); + logger.debug("New Service Registry get request received with id: {}", id); if (id < 1) { throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICE_REGISTRY_MGMT_BY_ID_URI); @@ -500,7 +500,7 @@ public void removeServiceDefinition(@PathVariable(value = PATH_VARIABLE_ID) fina @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("New Service Registry get by Service Definition request recieved with page: {} and item_per page: {}", page, size); + logger.debug("New Service Registry get by Service Definition request received with page: {} and item_per page: {}", page, size); if (Utilities.isEmpty(serviceDefinition)) { throw new BadPayloadException("Service definition cannot be empty.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICE_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI); @@ -557,7 +557,7 @@ public void removeServiceDefinition(@PathVariable(value = PATH_VARIABLE_ID) fina }) @DeleteMapping(path = SERVICE_REGISTRY_MGMT_BY_ID_URI) public void removeServiceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New Service Registry delete request recieved with id: {}", id); + logger.debug("New Service Registry delete request received with id: {}", id); if (id < 1) { throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICE_REGISTRY_MGMT_BY_ID_URI); @@ -578,7 +578,7 @@ public void removeServiceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_I @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) @PostMapping(path = CommonConstants.OP_SERVICE_REGISTRY_REGISTER_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public ServiceRegistryResponseDTO registerService(@RequestBody final ServiceRegistryRequestDTO request) { - logger.debug("New service registration request recieved"); + logger.debug("New service registration request received"); checkServiceRegistryRequest(request, false); final ServiceRegistryResponseDTO response = serviceRegistryDBService.registerServiceResponse(request); @@ -598,7 +598,7 @@ public void removeServiceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_I @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) @PostMapping(path = CoreCommonConstants.MGMT_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody ServiceRegistryResponseDTO addServiceRegistry(@RequestBody final ServiceRegistryRequestDTO request) { - logger.debug("New service registration request recieved"); + logger.debug("New service registration request received"); checkServiceRegistryRequest(request, CoreCommonConstants.MGMT_URI, true); final ServiceRegistryResponseDTO response = serviceRegistryDBService.registerServiceResponse(request); @@ -617,7 +617,7 @@ public void removeServiceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_I }) @PutMapping(path = SERVICE_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody ServiceRegistryResponseDTO updateServiceRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final ServiceRegistryRequestDTO request) { - logger.debug("New service registry update request recieved"); + logger.debug("New service registry update request received"); checkServiceRegistryUpdateRequest(id, request, CoreCommonConstants.MGMT_URI); final ServiceRegistryResponseDTO response = serviceRegistryDBService.updateServiceByIdResponse(id, request); @@ -637,7 +637,7 @@ public void removeServiceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_I }) @PatchMapping(path = SERVICE_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody ServiceRegistryResponseDTO mergeServiceRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final ServiceRegistryRequestDTO request) { - logger.debug("New service registry merge request recieved"); + logger.debug("New service registry merge request received"); checkServiceRegistryMergeRequest(id, request, CoreCommonConstants.MGMT_URI); final ServiceRegistryResponseDTO response = serviceRegistryDBService.mergeServiceByIdResponse(id, request); @@ -805,7 +805,7 @@ private void checkSystemMergeRequest(final SystemRequestDTO request, final long } if (request.getPort() != null) { - final int validatedPort = request.getPort().intValue(); + final int validatedPort = request.getPort(); if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX +".", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_BY_ID_URI); @@ -862,7 +862,7 @@ private void checkSystemRequest(final SystemRequestDTO request, final String ori throw new BadPayloadException(SYSTEM_PORT_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); } - final int validatedPort = request.getPort().intValue(); + final int validatedPort = request.getPort(); if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, origin); } @@ -981,7 +981,7 @@ private void checkServiceRegistryMergeRequest(final long id, final ServiceRegist } if (request.getProviderSystem() != null && request.getProviderSystem().getPort() != null) { - final int validatedPort = request.getProviderSystem().getPort().intValue(); + final int validatedPort = request.getProviderSystem().getPort(); if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX +".", HttpStatus.SC_BAD_REQUEST, origin); From d22d9faa6fe1218dfe005209184504f910ca7560 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Fri, 3 Jan 2020 21:46:00 +0100 Subject: [PATCH 003/301] added configuration and debian package scripts --- .gitignore | 33 +---- deviceregistry/pom.xml | 136 ++++++++++++++++++ .../src/deb/arrowhead-deviceregistry.service | 15 ++ deviceregistry/src/deb/control/config | 19 +++ deviceregistry/src/deb/control/control | 10 ++ deviceregistry/src/deb/control/postinst | 102 +++++++++++++ deviceregistry/src/deb/control/postrm | 56 ++++++++ deviceregistry/src/deb/control/preinst | 35 +++++ deviceregistry/src/deb/control/prerm | 45 ++++++ ...itional-spring-configuration-metadata.json | 57 ++++++++ .../src/main/resources/application.properties | 75 ++++++++++ .../resources/certificates/deviceregistry.p12 | Bin 0 -> 4686 bytes .../src/main/resources/certificates/sysop.crt | 20 +++ .../src/main/resources/certificates/sysop.p12 | Bin 0 -> 6109 bytes .../resources/certificates/truststore.p12 | Bin 0 -> 1162 bytes deviceregistry/src/main/resources/log4j2.xml | 46 ++++++ .../main/resources/swagger/swagger-ui.html | 75 ++++++++++ onboarding/pom.xml | 136 ++++++++++++++++++ .../src/deb/arrowhead-deviceregistry.service | 15 ++ onboarding/src/deb/control/config | 19 +++ onboarding/src/deb/control/control | 10 ++ onboarding/src/deb/control/postinst | 102 +++++++++++++ onboarding/src/deb/control/postrm | 56 ++++++++ onboarding/src/deb/control/preinst | 35 +++++ onboarding/src/deb/control/prerm | 45 ++++++ ...itional-spring-configuration-metadata.json | 57 ++++++++ .../src/main/resources/application.properties | 75 ++++++++++ .../resources/certificates/onboarding.p12 | Bin 0 -> 6556 bytes .../src/main/resources/certificates/sysop.crt | 20 +++ .../src/main/resources/certificates/sysop.p12 | Bin 0 -> 6109 bytes .../resources/certificates/truststore.p12 | Bin 0 -> 1162 bytes onboarding/src/main/resources/log4j2.xml | 46 ++++++ .../main/resources/swagger/swagger-ui.html | 75 ++++++++++ pom.xml | 5 +- systemregistry/pom.xml | 136 ++++++++++++++++++ .../src/deb/arrowhead-systemegistry.service | 15 ++ systemregistry/src/deb/control/config | 19 +++ systemregistry/src/deb/control/control | 10 ++ systemregistry/src/deb/control/postinst | 102 +++++++++++++ systemregistry/src/deb/control/postrm | 56 ++++++++ systemregistry/src/deb/control/preinst | 35 +++++ systemregistry/src/deb/control/prerm | 45 ++++++ ...itional-spring-configuration-metadata.json | 57 ++++++++ .../src/main/resources/application.properties | 75 ++++++++++ .../src/main/resources/certificates/sysop.crt | 20 +++ .../src/main/resources/certificates/sysop.p12 | Bin 0 -> 6109 bytes .../certificates/system_registry.p12 | Bin 0 -> 4686 bytes .../resources/certificates/truststore.p12 | Bin 0 -> 1162 bytes systemregistry/src/main/resources/log4j2.xml | 46 ++++++ .../main/resources/swagger/swagger-ui.html | 75 ++++++++++ 50 files changed, 2082 insertions(+), 29 deletions(-) create mode 100644 deviceregistry/pom.xml create mode 100644 deviceregistry/src/deb/arrowhead-deviceregistry.service create mode 100644 deviceregistry/src/deb/control/config create mode 100644 deviceregistry/src/deb/control/control create mode 100644 deviceregistry/src/deb/control/postinst create mode 100644 deviceregistry/src/deb/control/postrm create mode 100644 deviceregistry/src/deb/control/preinst create mode 100644 deviceregistry/src/deb/control/prerm create mode 100644 deviceregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json create mode 100644 deviceregistry/src/main/resources/application.properties create mode 100644 deviceregistry/src/main/resources/certificates/deviceregistry.p12 create mode 100644 deviceregistry/src/main/resources/certificates/sysop.crt create mode 100644 deviceregistry/src/main/resources/certificates/sysop.p12 create mode 100644 deviceregistry/src/main/resources/certificates/truststore.p12 create mode 100644 deviceregistry/src/main/resources/log4j2.xml create mode 100644 deviceregistry/src/main/resources/swagger/swagger-ui.html create mode 100644 onboarding/pom.xml create mode 100644 onboarding/src/deb/arrowhead-deviceregistry.service create mode 100644 onboarding/src/deb/control/config create mode 100644 onboarding/src/deb/control/control create mode 100644 onboarding/src/deb/control/postinst create mode 100644 onboarding/src/deb/control/postrm create mode 100644 onboarding/src/deb/control/preinst create mode 100644 onboarding/src/deb/control/prerm create mode 100644 onboarding/src/main/resources/META-INF/additional-spring-configuration-metadata.json create mode 100644 onboarding/src/main/resources/application.properties create mode 100644 onboarding/src/main/resources/certificates/onboarding.p12 create mode 100644 onboarding/src/main/resources/certificates/sysop.crt create mode 100644 onboarding/src/main/resources/certificates/sysop.p12 create mode 100644 onboarding/src/main/resources/certificates/truststore.p12 create mode 100644 onboarding/src/main/resources/log4j2.xml create mode 100644 onboarding/src/main/resources/swagger/swagger-ui.html create mode 100644 systemregistry/pom.xml create mode 100644 systemregistry/src/deb/arrowhead-systemegistry.service create mode 100644 systemregistry/src/deb/control/config create mode 100644 systemregistry/src/deb/control/control create mode 100644 systemregistry/src/deb/control/postinst create mode 100644 systemregistry/src/deb/control/postrm create mode 100644 systemregistry/src/deb/control/preinst create mode 100644 systemregistry/src/deb/control/prerm create mode 100644 systemregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json create mode 100644 systemregistry/src/main/resources/application.properties create mode 100644 systemregistry/src/main/resources/certificates/sysop.crt create mode 100644 systemregistry/src/main/resources/certificates/sysop.p12 create mode 100644 systemregistry/src/main/resources/certificates/system_registry.p12 create mode 100644 systemregistry/src/main/resources/certificates/truststore.p12 create mode 100644 systemregistry/src/main/resources/log4j2.xml create mode 100644 systemregistry/src/main/resources/swagger/swagger-ui.html diff --git a/.gitignore b/.gitignore index 46cdc0f81..1b3bbc961 100644 --- a/.gitignore +++ b/.gitignore @@ -22,40 +22,17 @@ ### VS Code ### .vscode/ wrapper -/authorization/target -/core-common/target -/eventhandler/target -/gatekeeper/target -/gateway/target +/target +/**/target /mvnw /mvnw.cmd -/orchestrator/target -/serviceregistry/target /.settings -/authorization/.settings -/core-common/.settings -/eventhandler/.settings/*.prefs -/eventhandler/.settings +/**/.settings *.prefs -/gatekeeper/.settings -/gateway/.settings -/orchestrator/.settings -/serviceregistry/.settings +/*.log +/**/*.log -/serviceregistry/*.log -/authorization/*.log /.metadata/ -gatekeeper/gatekeeper\.log -/eventhandler/*.log -/orchestrator/*.log -/choreographer/*.log -choreographer.log -serviceregistry.log -authorization.log -/choreographer/target - -*.log -/target /deb-installer/.classpath /deb-installer/.project /deb-installer/.settings diff --git a/deviceregistry/pom.xml b/deviceregistry/pom.xml new file mode 100644 index 000000000..932f9a97c --- /dev/null +++ b/deviceregistry/pom.xml @@ -0,0 +1,136 @@ + + 4.0.0 + + eu.arrowhead + core + ${revision} + + + arrowhead-deviceregistry + jar + Arrowhead Device Registry + SQL-based Device Registry core service + + + + eu.arrowhead + arrowhead-core-common + ${revision} + + + + + + + maven-resources-plugin + ${mvn.resources.version} + + + copy-resources + + validate + + copy-resources + + + ${basedir}/target + + + src/main/resources + + application.properties + log4j2.xml + + + + + + + + + + jdeb + org.vafer + 1.8 + + + package + + jdeb + + + true + + [YYMMddHHmm].${git.commit.id.abbrev} + target/${project.artifactId}_${revision}.deb + true + ${basedir}/src/deb/control + + + file + ${project.build.directory}/${project.build.finalName}.jar + + perm + /usr/share/arrowhead/device_registry + 755 + + + + + link + /usr/share/arrowhead/device_registry/${project.artifactId}.jar + /usr/share/arrowhead/device_registry/${project.build.finalName}.jar + + + + file + ${project.build.directory}/log4j2.xml + + perm + /etc/arrowhead/systems/device_registry + 644 + + + + + file + ${project.build.directory}/application.properties + + perm + /etc/arrowhead/systems/device_registry + 644 + + + + + link + /usr/share/arrowhead/device_registry/application.properties + /etc/arrowhead/systems/device_registry/application.properties + + + + file + ${project.basedir}/src/deb/arrowhead-deviceregistry.service + + perm + /etc/systemd/system + 644 + + + + + file + ${project.basedir}/../scripts/device_registry_privileges.sql + + perm + /usr/share/arrowhead/conf + + + + + + + + + + \ No newline at end of file diff --git a/deviceregistry/src/deb/arrowhead-deviceregistry.service b/deviceregistry/src/deb/arrowhead-deviceregistry.service new file mode 100644 index 000000000..59a800ac1 --- /dev/null +++ b/deviceregistry/src/deb/arrowhead-deviceregistry.service @@ -0,0 +1,15 @@ +[Unit] +Description=arrowhead-deviceregistry +After=network.target mysql.target + +[Service] +WorkingDirectory=/etc/arrowhead/systems/device_registry +ExecStart=/usr/bin/java -Dlog4j.configurationFile=file:/etc/arrowhead/systems/device_registry/log4j2.xml -jar /usr/share/arrowhead/device_registry/arrowhead-deviceregistry.jar +ExecStartPost=/bin/bash -c 'sleep 10' +TimeoutStopSec=5 +Type=simple +User=arrowhead +Group=arrowhead + +[Install] +WantedBy=default.target diff --git a/deviceregistry/src/deb/control/config b/deviceregistry/src/deb/control/config new file mode 100644 index 000000000..bee242d71 --- /dev/null +++ b/deviceregistry/src/deb/control/config @@ -0,0 +1,19 @@ +#!/bin/sh -e + +. /usr/share/debconf/confmodule + +if logname 2>/dev/null; then + USER=$(logname) + HOME=$(eval echo "~$USER") +else + USER="root" + HOME="/root" +fi + +# Get installation type +db_input high arrowhead-core-common/db_host || true +db_input high arrowhead-core-common/mysql_password_sr || true + +# Run dialogs +db_go || true + diff --git a/deviceregistry/src/deb/control/control b/deviceregistry/src/deb/control/control new file mode 100644 index 000000000..f1bd1eeef --- /dev/null +++ b/deviceregistry/src/deb/control/control @@ -0,0 +1,10 @@ +Package: arrowhead-device-registry +Version: [[version]] +Section: contrib/java +Priority: optional +Architecture: all +Maintainer: Mario Zsilak +Homepage: http://www.arrowhead.eu +Description: Arrowhead Device Registry +Distribution: development +Depends: java-runtime-headless, openssl, virtual-mysql-server, arrowhead-core-common diff --git a/deviceregistry/src/deb/control/postinst b/deviceregistry/src/deb/control/postinst new file mode 100644 index 000000000..6afe4019b --- /dev/null +++ b/deviceregistry/src/deb/control/postinst @@ -0,0 +1,102 @@ +#!/bin/sh +# postinst script for arrowhead-deviceregistry +# +# see: dh_installdeb(1) + +set -e + +. /usr/share/debconf/confmodule + +SYSTEM_NAME="device_registry" +PKG_NAME="arrowhead-deviceregistry" + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + configure) + dos2unix -q /etc/systemd/system/${PKG_NAME}.service + + . /usr/share/arrowhead/conf/ahconf.sh + + SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" + + db_get arrowhead-core-common/mysql_password_sr; system_passwd=$RET || true + db_unregister arrowhead-core-common/mysql_password_sr + + # Generate password (if required) + if [ -z "${system_passwd}" ]; then + system_passwd="$(openssl rand -base64 12)" + fi + + echo "Configuring MySQL database..." >&2 + ah_db_tables_and_user ${SYSTEM_NAME} ${SYSTEM_NAME}_privileges.sql ${system_passwd} + + if [ ! -d "${SYSTEM_DIR}" ]; then + mkdir -p ${SYSTEM_DIR} + fi + + domain_name=${AH_DOMAIN_NAME} + if [ -z ${domain_name} ]; then + domain_name=${OWN_IP} + fi + + ah_cert_signed_system ${SYSTEM_NAME} + + if [ ! -d "${AH_SYSTEMS_DIR}/sysop" ]; then + mkdir -p ${AH_SYSTEMS_DIR}/sysop + fi + + ah_cert_signed_system sysop + + # modify log config and application.properties + + ah_transform_log_file ${SYSTEM_DIR} + + db_get arrowhead-core-common/db_host; db_host=$RET || true + + mv ${SYSTEM_DIR}/application.properties ${SYSTEM_DIR}/application.properties.orig + cat ${SYSTEM_DIR}/application.properties.orig | \ + sed -r -e "\#^.*spring\.datasource\.url=#s#.*\$#spring.datasource.url=jdbc:mysql://"${db_host}":3306/arrowhead?serverTimezone=Europe/Budapest#" \ + -e "\#^.*spring\.datasource\.password=#s#.*\$#spring.datasource.password=${system_passwd}#" \ + -e "\#^.*domain\.name=#s#.*\$#domain.name=${domain_name}#" \ + -e "\#^.*server\.ssl\.key-store=#s#.*\$#server.ssl.key-store=file:${SYSTEM_DIR}/${SYSTEM_NAME}.p12#" \ + -e "\#^.*server\.ssl\.key-store-password=#s#.*\$#server.ssl.key-store-password=${AH_PASS_CERT}#" \ + -e "\#^.*server\.ssl\.key-password=#s#.*\$#server.ssl.key-password=${AH_PASS_CERT}#" \ + -e "\#^.*server\.ssl\.trust-store=#s#.*\$#server.ssl.trust-store=file:${AH_CONF_DIR}/truststore.p12#" \ + -e "\#^.*server\.ssl\.trust-store-password=#s#.*\$#server.ssl.trust-store-password=${AH_PASS_CERT}#" > ${SYSTEM_DIR}/application.properties + + rm ${SYSTEM_DIR}/application.properties.orig + chown arrowhead:arrowhead ${SYSTEM_DIR}/application.properties + chmod 640 ${SYSTEM_DIR}/application.properties + + echo "Starting ${PKG_NAME}..." >&2 + systemctl daemon-reload + systemctl enable ${PKG_NAME}.service + systemctl start ${PKG_NAME}.service + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/deviceregistry/src/deb/control/postrm b/deviceregistry/src/deb/control/postrm new file mode 100644 index 000000000..5e9249779 --- /dev/null +++ b/deviceregistry/src/deb/control/postrm @@ -0,0 +1,56 @@ +#!/bin/sh +# postrm script for arrowhead-deviceregistry +# +# see: dh_installdeb(1) + +set -e + +. /usr/share/debconf/confmodule + +SYSTEM_NAME="device_registry" + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge) + AH_CONF_DIR="/etc/arrowhead" + AH_SYSTEMS_DIR="${AH_CONF_DIR}/systems" + SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" + + rm -f \ + /var/log/arrowhead/${SYSTEM_NAME}*.log \ + ${SYSTEM_DIR}/log4j2.xml \ + ${SYSTEM_DIR}/application.properties \ + ${SYSTEM_DIR}/${SYSTEM_NAME}.p12 \ + ${AH_SYSTEMS_DIR}/sysop/sysop.p12 + rmdir ${SYSTEM_DIR} 2>/dev/null || true + rmdir ${AH_SYSTEMS_DIR}/sysop 2>/dev/null || true + db_purge + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/deviceregistry/src/deb/control/preinst b/deviceregistry/src/deb/control/preinst new file mode 100644 index 000000000..e6d28cf8d --- /dev/null +++ b/deviceregistry/src/deb/control/preinst @@ -0,0 +1,35 @@ +#!/bin/sh +# preinst script for arrowhead-deviceregistry +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/deviceregistry/src/deb/control/prerm b/deviceregistry/src/deb/control/prerm new file mode 100644 index 000000000..3e2adee46 --- /dev/null +++ b/deviceregistry/src/deb/control/prerm @@ -0,0 +1,45 @@ +#!/bin/sh +# prerm script for arrowhead-deviceregistry +# +# see: dh_installdeb(1) + +set -e + +PKG_NAME="arrowhead-deviceregistry" + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove) + systemctl stop ${PKG_NAME}.service + systemctl disable ${PKG_NAME}.service + ;; + + upgrade|deconfigure) + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/deviceregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/deviceregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 000000000..8ccdfc698 --- /dev/null +++ b/deviceregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,57 @@ +{"properties": [ + { + "name": "ping_scheduled", + "type": "java.lang.Boolean", + "description": "A description for 'ping_scheduled'" + }, + { + "name": "ping_timeout", + "type": "java.lang.Long", + "description": "A description for 'ping_timeout'" + }, + { + "name": "ping_interval", + "type": "java.lang.Long", + "description": "A description for 'ping_interval'" + }, + { + "name": "ttl_scheduled", + "type": "java.lang.Boolean", + "description": "A description for 'ttl_scheduled'" + }, + { + "name": "ttl_interval", + "type": "java.lang.Long", + "description": "A description for 'ttl_interval'" + }, + { + "name": "disable.hostname.verifier", + "type": "java.lang.Boolean", + "description": "A description for 'disable.hostname.verifier'" + }, + { + "name": "log_all_request_and_response", + "type": "java.lang.Boolean", + "description": "A description for 'log_all_request_and_response'" + }, + { + "name": "use_strict_service_intf_name_verifier", + "type": "java.lang.Boolean", + "description": "A description for 'use_strict_service_intf_name_verifier'" + }, + { + "name": "core_system_name", + "type": "java.lang.String", + "description": "A description for 'core_system_name'" + }, + { + "name": "domain.name", + "type": "java.lang.String", + "description": "A description for 'domain.name'" + }, + { + "name": "domain.port", + "type": "java.lang.Integer", + "description": "A description for 'domain.port'" + } +]} \ No newline at end of file diff --git a/deviceregistry/src/main/resources/application.properties b/deviceregistry/src/main/resources/application.properties new file mode 100644 index 000000000..861ce759b --- /dev/null +++ b/deviceregistry/src/main/resources/application.properties @@ -0,0 +1,75 @@ +############################################ +### APPLICATION PARAMETERS ### +############################################ + +# Database connection (mandatory) +# Change the server timezone if necessary +spring.datasource.url=jdbc:mysql://127.0.0.1:3306/arrowhead?serverTimezone=Europe/Budapest +spring.datasource.username=device_registry +spring.datasource.password=ZzNNpxrbZGVvfJ8 +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +# use true only for debugging +spring.jpa.show-sql=false +spring.jpa.properties.hibernate.format_sql=true +spring.jpa.hibernate.ddl-auto=none + +# Service Registry web-server parameters +server.address=0.0.0.0 +server.port=8443 +domain.name=127.0.0.1 +domain.port=8439 + +############################################ +### CUSTOM PARAMETERS ### +############################################ + +# Name of the core system +core_system_name=DEVICE_REGISTRY + +# Show all request/response in debug log +log_all_request_and_response=false + +# Service Registry has an optional feature to ping service providers in a fixed time interval, +# and remove service offerings where the service provider was not available +# use this feature (true/false) +ping_scheduled=false +# how much time the Service Registry should wait for the ping response (in milliseconds) +ping_timeout=5000 +# how frequently should the ping happen, in minutes +ping_interval=60 + +# Service Registry has an optional feature to automatically remove service offerings, where the endOfValidity +# timestamp field is in the past, meaning the offering expired +# use this feature (true/false) +ttl_scheduled=false +# how frequently the database should be checked for expired services, in minutes +ttl_interval=10 + +# Interface names has to follow this format --, where security can be SECURE or INSECURE and protocol and format must be a sequence of letters, numbers and underscore. +# A regexp checker will verify that. If this setting is set to true then the PROTOCOL and FORMAT must come from a predefined set. +use_strict_service_intf_name_verifier=false + +############################################ +### SECURE MODE ### +############################################ + +# configure secure mode + +# Set this to false to disable https mode +server.ssl.enabled=true + +server.ssl.key-store-type=PKCS12 +server.ssl.key-store=classpath:certificates/onboarding.p12 +server.ssl.key-store-password=123456 +server.ssl.key-alias=onboarding +server.ssl.key-password=123456 +server.ssl.client-auth=need +server.ssl.trust-store-type=PKCS12 +server.ssl.trust-store=classpath:certificates/truststore.p12 +server.ssl.trust-store-password=123456 + +#If true, http client does not check whether the hostname is match one of the server's SAN in its certificate +#Just for testing, DO NOT USE this feature in production environment +disable.hostname.verifier=false diff --git a/deviceregistry/src/main/resources/certificates/deviceregistry.p12 b/deviceregistry/src/main/resources/certificates/deviceregistry.p12 new file mode 100644 index 0000000000000000000000000000000000000000..92301d3d5fbc200b61d2228ecccf7f9419a29d66 GIT binary patch literal 4686 zcmY+EXE+;f+s0$>me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X--E>>L6t0cKGAJZZSJpUEl}&dZL@AOlb}oRglPDx1|D6AEV!y%^mIq z^bSQ7dL;&77p>oxfe+yiD>UmVc25pxIGu}v!cX!~oX(xh)s{kG9+7Z8AuIN|DV7c1 zEO(KKH3wIhKYUFeOIo+yqCgOU{he z!i{eE;VQ1WC(sfw2&0D47*l6qW{rzvv2Y_F+X(PA`HraCxC)_yI&=ktH0wMejyDE< z*R6G~IimpvZFC9&ACtj~U)Db!(hN3i#5R3BSqPxpIKGImON9n8LLvq_m>xpPqP{ZL zl`m>7gZWL)(B>z^@8Vp_YaFlDji)MkeSX};OY?ZZ#`21!0YAU{H?rB8K<&zyg%Rh- zHAnOMest9^iQkf`0==CWZNj2QM*TqO9DT+BUUPktVDt(8aD!f+Fi0Z@UdIv)mw-I- z5G(>==99;{Rltld$19fhEJX(NlaT5$ndU{sRk<+%LjkTVHdXKy67Rbbh;WC#YLt0E z1S}^|2@Qa|08yw+bT|X1$|Rm^X0oo4ad{VMF%U!9f9VO+41sbaj2^JOy<~8?Z>b0_ zeZ4>x1XE8O%BBG_5Pe)*Zu||{3c@j@J!E)Q+Jqqb2g0AB4vE;%k!nO#EWBVBvDL6K z%$ajYQmPg3AANl$aWFnGAutIB1uG5%0vZJX1Qe21ALl_dxi!Xc`r5F&M^_UR(|QCH c!IzHi@;Q3$Pa#3~8XCLIk6cGw0s{etp!w7j3jhEB literal 0 HcmV?d00001 diff --git a/deviceregistry/src/main/resources/log4j2.xml b/deviceregistry/src/main/resources/log4j2.xml new file mode 100644 index 000000000..3076a30b0 --- /dev/null +++ b/deviceregistry/src/main/resources/log4j2.xml @@ -0,0 +1,46 @@ + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex + + INFO + INFO + . + + + + + + + + ${LOG_PATTERN} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/deviceregistry/src/main/resources/swagger/swagger-ui.html b/deviceregistry/src/main/resources/swagger/swagger-ui.html new file mode 100644 index 000000000..b338d2f47 --- /dev/null +++ b/deviceregistry/src/main/resources/swagger/swagger-ui.html @@ -0,0 +1,75 @@ + + + + + + Service Registry + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + diff --git a/onboarding/pom.xml b/onboarding/pom.xml new file mode 100644 index 000000000..d1fa22ec9 --- /dev/null +++ b/onboarding/pom.xml @@ -0,0 +1,136 @@ + + 4.0.0 + + eu.arrowhead + core + ${revision} + + + arrowhead-onboarding + jar + Arrowhead Onboarding Controller + SQL-based Onboarding Controller core service + + + + eu.arrowhead + arrowhead-core-common + ${revision} + + + + + + + maven-resources-plugin + ${mvn.resources.version} + + + copy-resources + + validate + + copy-resources + + + ${basedir}/target + + + src/main/resources + + application.properties + log4j2.xml + + + + + + + + + + jdeb + org.vafer + 1.8 + + + package + + jdeb + + + true + + [YYMMddHHmm].${git.commit.id.abbrev} + target/${project.artifactId}_${revision}.deb + true + ${basedir}/src/deb/control + + + file + ${project.build.directory}/${project.build.finalName}.jar + + perm + /usr/share/arrowhead/onboarding_controller + 755 + + + + + link + /usr/share/arrowhead/onboarding_controller/${project.artifactId}.jar + /usr/share/arrowhead/onboarding_controller/${project.build.finalName}.jar + + + + file + ${project.build.directory}/log4j2.xml + + perm + /etc/arrowhead/systems/onboarding_controller + 644 + + + + + file + ${project.build.directory}/application.properties + + perm + /etc/arrowhead/systems/onboarding_controller + 644 + + + + + link + /usr/share/arrowhead/onboarding_controller/application.properties + /etc/arrowhead/systems/onboarding_controller/application.properties + + + + file + ${project.basedir}/src/deb/arrowhead-onboarding.service + + perm + /etc/systemd/system + 644 + + + + + file + ${project.basedir}/../scripts/onboarding_controller_privileges.sql + + perm + /usr/share/arrowhead/conf + + + + + + + + + + \ No newline at end of file diff --git a/onboarding/src/deb/arrowhead-deviceregistry.service b/onboarding/src/deb/arrowhead-deviceregistry.service new file mode 100644 index 000000000..5f3c12f18 --- /dev/null +++ b/onboarding/src/deb/arrowhead-deviceregistry.service @@ -0,0 +1,15 @@ +[Unit] +Description=arrowhead-onboarding +After=network.target mysql.target + +[Service] +WorkingDirectory=/etc/arrowhead/systems/onboarding_controller +ExecStart=/usr/bin/java -Dlog4j.configurationFile=file:/etc/arrowhead/systems/onboarding_controller/log4j2.xml -jar /usr/share/arrowhead/onboarding_controller/arrowhead-onboarding.jar +ExecStartPost=/bin/bash -c 'sleep 10' +TimeoutStopSec=5 +Type=simple +User=arrowhead +Group=arrowhead + +[Install] +WantedBy=default.target diff --git a/onboarding/src/deb/control/config b/onboarding/src/deb/control/config new file mode 100644 index 000000000..bee242d71 --- /dev/null +++ b/onboarding/src/deb/control/config @@ -0,0 +1,19 @@ +#!/bin/sh -e + +. /usr/share/debconf/confmodule + +if logname 2>/dev/null; then + USER=$(logname) + HOME=$(eval echo "~$USER") +else + USER="root" + HOME="/root" +fi + +# Get installation type +db_input high arrowhead-core-common/db_host || true +db_input high arrowhead-core-common/mysql_password_sr || true + +# Run dialogs +db_go || true + diff --git a/onboarding/src/deb/control/control b/onboarding/src/deb/control/control new file mode 100644 index 000000000..5765d3184 --- /dev/null +++ b/onboarding/src/deb/control/control @@ -0,0 +1,10 @@ +Package: arrowhead-onboarding +Version: [[version]] +Section: contrib/java +Priority: optional +Architecture: all +Maintainer: Mario Zsilak +Homepage: http://www.arrowhead.eu +Description: Arrowhead Onboarding Controller +Distribution: development +Depends: java-runtime-headless, openssl, virtual-mysql-server, arrowhead-core-common diff --git a/onboarding/src/deb/control/postinst b/onboarding/src/deb/control/postinst new file mode 100644 index 000000000..e30330ce5 --- /dev/null +++ b/onboarding/src/deb/control/postinst @@ -0,0 +1,102 @@ +#!/bin/sh +# postinst script for arrowhead-onboarding +# +# see: dh_installdeb(1) + +set -e + +. /usr/share/debconf/confmodule + +SYSTEM_NAME="onboarding_controller" +PKG_NAME="arrowhead-onboarding" + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + configure) + dos2unix -q /etc/systemd/system/${PKG_NAME}.service + + . /usr/share/arrowhead/conf/ahconf.sh + + SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" + + db_get arrowhead-core-common/mysql_password_sr; system_passwd=$RET || true + db_unregister arrowhead-core-common/mysql_password_sr + + # Generate password (if required) + if [ -z "${system_passwd}" ]; then + system_passwd="$(openssl rand -base64 12)" + fi + + echo "Configuring MySQL database..." >&2 + ah_db_tables_and_user ${SYSTEM_NAME} ${SYSTEM_NAME}_privileges.sql ${system_passwd} + + if [ ! -d "${SYSTEM_DIR}" ]; then + mkdir -p ${SYSTEM_DIR} + fi + + domain_name=${AH_DOMAIN_NAME} + if [ -z ${domain_name} ]; then + domain_name=${OWN_IP} + fi + + ah_cert_signed_system ${SYSTEM_NAME} + + if [ ! -d "${AH_SYSTEMS_DIR}/sysop" ]; then + mkdir -p ${AH_SYSTEMS_DIR}/sysop + fi + + ah_cert_signed_system sysop + + # modify log config and application.properties + + ah_transform_log_file ${SYSTEM_DIR} + + db_get arrowhead-core-common/db_host; db_host=$RET || true + + mv ${SYSTEM_DIR}/application.properties ${SYSTEM_DIR}/application.properties.orig + cat ${SYSTEM_DIR}/application.properties.orig | \ + sed -r -e "\#^.*spring\.datasource\.url=#s#.*\$#spring.datasource.url=jdbc:mysql://"${db_host}":3306/arrowhead?serverTimezone=Europe/Budapest#" \ + -e "\#^.*spring\.datasource\.password=#s#.*\$#spring.datasource.password=${system_passwd}#" \ + -e "\#^.*domain\.name=#s#.*\$#domain.name=${domain_name}#" \ + -e "\#^.*server\.ssl\.key-store=#s#.*\$#server.ssl.key-store=file:${SYSTEM_DIR}/${SYSTEM_NAME}.p12#" \ + -e "\#^.*server\.ssl\.key-store-password=#s#.*\$#server.ssl.key-store-password=${AH_PASS_CERT}#" \ + -e "\#^.*server\.ssl\.key-password=#s#.*\$#server.ssl.key-password=${AH_PASS_CERT}#" \ + -e "\#^.*server\.ssl\.trust-store=#s#.*\$#server.ssl.trust-store=file:${AH_CONF_DIR}/truststore.p12#" \ + -e "\#^.*server\.ssl\.trust-store-password=#s#.*\$#server.ssl.trust-store-password=${AH_PASS_CERT}#" > ${SYSTEM_DIR}/application.properties + + rm ${SYSTEM_DIR}/application.properties.orig + chown arrowhead:arrowhead ${SYSTEM_DIR}/application.properties + chmod 640 ${SYSTEM_DIR}/application.properties + + echo "Starting ${PKG_NAME}..." >&2 + systemctl daemon-reload + systemctl enable ${PKG_NAME}.service + systemctl start ${PKG_NAME}.service + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/onboarding/src/deb/control/postrm b/onboarding/src/deb/control/postrm new file mode 100644 index 000000000..ad190c0dd --- /dev/null +++ b/onboarding/src/deb/control/postrm @@ -0,0 +1,56 @@ +#!/bin/sh +# postrm script for arrowhead-onboarding +# +# see: dh_installdeb(1) + +set -e + +. /usr/share/debconf/confmodule + +SYSTEM_NAME="onboarding_controller" + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge) + AH_CONF_DIR="/etc/arrowhead" + AH_SYSTEMS_DIR="${AH_CONF_DIR}/systems" + SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" + + rm -f \ + /var/log/arrowhead/${SYSTEM_NAME}*.log \ + ${SYSTEM_DIR}/log4j2.xml \ + ${SYSTEM_DIR}/application.properties \ + ${SYSTEM_DIR}/${SYSTEM_NAME}.p12 \ + ${AH_SYSTEMS_DIR}/sysop/sysop.p12 + rmdir ${SYSTEM_DIR} 2>/dev/null || true + rmdir ${AH_SYSTEMS_DIR}/sysop 2>/dev/null || true + db_purge + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/onboarding/src/deb/control/preinst b/onboarding/src/deb/control/preinst new file mode 100644 index 000000000..6e36ca318 --- /dev/null +++ b/onboarding/src/deb/control/preinst @@ -0,0 +1,35 @@ +#!/bin/sh +# preinst script for arrowhead-onboarding +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/onboarding/src/deb/control/prerm b/onboarding/src/deb/control/prerm new file mode 100644 index 000000000..1cc84becd --- /dev/null +++ b/onboarding/src/deb/control/prerm @@ -0,0 +1,45 @@ +#!/bin/sh +# prerm script for arrowhead-onboarding +# +# see: dh_installdeb(1) + +set -e + +PKG_NAME="arrowhead-onboarding" + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove) + systemctl stop ${PKG_NAME}.service + systemctl disable ${PKG_NAME}.service + ;; + + upgrade|deconfigure) + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/onboarding/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/onboarding/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 000000000..8ccdfc698 --- /dev/null +++ b/onboarding/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,57 @@ +{"properties": [ + { + "name": "ping_scheduled", + "type": "java.lang.Boolean", + "description": "A description for 'ping_scheduled'" + }, + { + "name": "ping_timeout", + "type": "java.lang.Long", + "description": "A description for 'ping_timeout'" + }, + { + "name": "ping_interval", + "type": "java.lang.Long", + "description": "A description for 'ping_interval'" + }, + { + "name": "ttl_scheduled", + "type": "java.lang.Boolean", + "description": "A description for 'ttl_scheduled'" + }, + { + "name": "ttl_interval", + "type": "java.lang.Long", + "description": "A description for 'ttl_interval'" + }, + { + "name": "disable.hostname.verifier", + "type": "java.lang.Boolean", + "description": "A description for 'disable.hostname.verifier'" + }, + { + "name": "log_all_request_and_response", + "type": "java.lang.Boolean", + "description": "A description for 'log_all_request_and_response'" + }, + { + "name": "use_strict_service_intf_name_verifier", + "type": "java.lang.Boolean", + "description": "A description for 'use_strict_service_intf_name_verifier'" + }, + { + "name": "core_system_name", + "type": "java.lang.String", + "description": "A description for 'core_system_name'" + }, + { + "name": "domain.name", + "type": "java.lang.String", + "description": "A description for 'domain.name'" + }, + { + "name": "domain.port", + "type": "java.lang.Integer", + "description": "A description for 'domain.port'" + } +]} \ No newline at end of file diff --git a/onboarding/src/main/resources/application.properties b/onboarding/src/main/resources/application.properties new file mode 100644 index 000000000..09bfa2c0d --- /dev/null +++ b/onboarding/src/main/resources/application.properties @@ -0,0 +1,75 @@ +############################################ +### APPLICATION PARAMETERS ### +############################################ + +# Database connection (mandatory) +# Change the server timezone if necessary +spring.datasource.url=jdbc:mysql://127.0.0.1:3306/arrowhead?serverTimezone=Europe/Budapest +spring.datasource.username=onboarding +spring.datasource.password=ZzNNpxrbZGVvfJ8 +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +# use true only for debugging +spring.jpa.show-sql=false +spring.jpa.properties.hibernate.format_sql=true +spring.jpa.hibernate.ddl-auto=none + +# Service Registry web-server parameters +server.address=0.0.0.0 +server.port=8443 +domain.name=127.0.0.1 +domain.port=8435 + +############################################ +### CUSTOM PARAMETERS ### +############################################ + +# Name of the core system +core_system_name=ONBOARDING_CONTROLLER + +# Show all request/response in debug log +log_all_request_and_response=false + +# Service Registry has an optional feature to ping service providers in a fixed time interval, +# and remove service offerings where the service provider was not available +# use this feature (true/false) +ping_scheduled=false +# how much time the Service Registry should wait for the ping response (in milliseconds) +ping_timeout=5000 +# how frequently should the ping happen, in minutes +ping_interval=60 + +# Service Registry has an optional feature to automatically remove service offerings, where the endOfValidity +# timestamp field is in the past, meaning the offering expired +# use this feature (true/false) +ttl_scheduled=false +# how frequently the database should be checked for expired services, in minutes +ttl_interval=10 + +# Interface names has to follow this format --, where security can be SECURE or INSECURE and protocol and format must be a sequence of letters, numbers and underscore. +# A regexp checker will verify that. If this setting is set to true then the PROTOCOL and FORMAT must come from a predefined set. +use_strict_service_intf_name_verifier=false + +############################################ +### SECURE MODE ### +############################################ + +# configure secure mode + +# Set this to false to disable https mode +server.ssl.enabled=true + +server.ssl.key-store-type=PKCS12 +server.ssl.key-store=classpath:certificates/onboarding.p12 +server.ssl.key-store-password=123456 +server.ssl.key-alias=onboarding +server.ssl.key-password=123456 +server.ssl.client-auth=need +server.ssl.trust-store-type=PKCS12 +server.ssl.trust-store=classpath:certificates/truststore.p12 +server.ssl.trust-store-password=123456 + +#If true, http client does not check whether the hostname is match one of the server's SAN in its certificate +#Just for testing, DO NOT USE this feature in production environment +disable.hostname.verifier=false diff --git a/onboarding/src/main/resources/certificates/onboarding.p12 b/onboarding/src/main/resources/certificates/onboarding.p12 new file mode 100644 index 0000000000000000000000000000000000000000..7abca5a30f1ab0a9b1430b4939f913dbf6de15eb GIT bin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pQOh4RI`L%TqMeT3gk+p}AIxL?@pWsVtOuKM!Wra!LreLubKEJrjmOfmcz=XHp z-uicox^ThaX--E>>L6t0cKGAJZZSJpUEl}&dZL@AOlb}oRglPDx1|D6AEV!y%^mIq z^bSQ7dL;&77p>oxfe+yiD>UmVc25pxIGu}v!cX!~oX(xh)s{kG9+7Z8AuIN|DV7c1 zEO(KKH3wIhKYUFeOIo+yqCgOU{he z!i{eE;VQ1WC(sfw2&0D47*l6qW{rzvv2Y_F+X(PA`HraCxC)_yI&=ktH0wMejyDE< z*R6G~IimpvZFC9&ACtj~U)Db!(hN3i#5R3BSqPxpIKGImON9n8LLvq_m>xpPqP{ZL zl`m>7gZWL)(B>z^@8Vp_YaFlDji)MkeSX};OY?ZZ#`21!0YAU{H?rB8K<&zyg%Rh- zHAnOMest9^iQkf`0==CWZNj2QM*TqO9DT+BUUPktVDt(8aD!f+Fi0Z@UdIv)mw-I- z5G(>==99;{Rltld$19fhEJX(NlaT5$ndU{sRk<+%LjkTVHdXKy67Rbbh;WC#YLt0E z1S}^|2@Qa|08yw+bT|X1$|Rm^X0oo4ad{VMF%U!9f9VO+41sbaj2^JOy<~8?Z>b0_ zeZ4>x1XE8O%BBG_5Pe)*Zu||{3c@j@J!E)Q+Jqqb2g0AB4vE;%k!nO#EWBVBvDL6K z%$ajYQmPg3AANl$aWFnGAutIB1uG5%0vZJX1Qe21ALl_dxi!Xc`r5F&M^_UR(|QCH c!IzHi@;Q3$Pa#3~8XCLIk6cGw0s{etp!w7j3jhEB literal 0 HcmV?d00001 diff --git a/onboarding/src/main/resources/log4j2.xml b/onboarding/src/main/resources/log4j2.xml new file mode 100644 index 000000000..054f27268 --- /dev/null +++ b/onboarding/src/main/resources/log4j2.xml @@ -0,0 +1,46 @@ + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex + + INFO + INFO + . + + + + + + + + ${LOG_PATTERN} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/onboarding/src/main/resources/swagger/swagger-ui.html b/onboarding/src/main/resources/swagger/swagger-ui.html new file mode 100644 index 000000000..b338d2f47 --- /dev/null +++ b/onboarding/src/main/resources/swagger/swagger-ui.html @@ -0,0 +1,75 @@ + + + + + + Service Registry + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + diff --git a/pom.xml b/pom.xml index 785a20381..a0fb32e85 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,10 @@ gatekeeper gateway choreographer - deb-installer + systemregistry + deviceregistry + onboarding + deb-installer diff --git a/systemregistry/pom.xml b/systemregistry/pom.xml new file mode 100644 index 000000000..d04c4d318 --- /dev/null +++ b/systemregistry/pom.xml @@ -0,0 +1,136 @@ + + 4.0.0 + + eu.arrowhead + core + ${revision} + + + arrowhead-systemregistry + jar + Arrowhead System Registry + SQL-based System Registry core service + + + + eu.arrowhead + arrowhead-core-common + ${revision} + + + + + + + maven-resources-plugin + ${mvn.resources.version} + + + copy-resources + + validate + + copy-resources + + + ${basedir}/target + + + src/main/resources + + application.properties + log4j2.xml + + + + + + + + + + jdeb + org.vafer + 1.8 + + + package + + jdeb + + + true + + [YYMMddHHmm].${git.commit.id.abbrev} + target/${project.artifactId}_${revision}.deb + true + ${basedir}/src/deb/control + + + file + ${project.build.directory}/${project.build.finalName}.jar + + perm + /usr/share/arrowhead/system_registry + 755 + + + + + link + /usr/share/arrowhead/system_registry/${project.artifactId}.jar + /usr/share/arrowhead/system_registry/${project.build.finalName}.jar + + + + file + ${project.build.directory}/log4j2.xml + + perm + /etc/arrowhead/systems/system_registry + 644 + + + + + file + ${project.build.directory}/application.properties + + perm + /etc/arrowhead/systems/system_registry + 644 + + + + + link + /usr/share/arrowhead/system_registry/application.properties + /etc/arrowhead/systems/system_registry/application.properties + + + + file + ${project.basedir}/src/deb/arrowhead-systemregistry.service + + perm + /etc/systemd/system + 644 + + + + + file + ${project.basedir}/../scripts/system_registry_privileges.sql + + perm + /usr/share/arrowhead/conf + + + + + + + + + + \ No newline at end of file diff --git a/systemregistry/src/deb/arrowhead-systemegistry.service b/systemregistry/src/deb/arrowhead-systemegistry.service new file mode 100644 index 000000000..76455e16a --- /dev/null +++ b/systemregistry/src/deb/arrowhead-systemegistry.service @@ -0,0 +1,15 @@ +[Unit] +Description=arrowhead-systemregistry +After=network.target mysql.target + +[Service] +WorkingDirectory=/etc/arrowhead/systems/system_registry +ExecStart=/usr/bin/java -Dlog4j.configurationFile=file:/etc/arrowhead/systems/system_registry/log4j2.xml -jar /usr/share/arrowhead/system_registry/arrowhead-systemregistry.jar +ExecStartPost=/bin/bash -c 'sleep 10' +TimeoutStopSec=5 +Type=simple +User=arrowhead +Group=arrowhead + +[Install] +WantedBy=default.target diff --git a/systemregistry/src/deb/control/config b/systemregistry/src/deb/control/config new file mode 100644 index 000000000..bee242d71 --- /dev/null +++ b/systemregistry/src/deb/control/config @@ -0,0 +1,19 @@ +#!/bin/sh -e + +. /usr/share/debconf/confmodule + +if logname 2>/dev/null; then + USER=$(logname) + HOME=$(eval echo "~$USER") +else + USER="root" + HOME="/root" +fi + +# Get installation type +db_input high arrowhead-core-common/db_host || true +db_input high arrowhead-core-common/mysql_password_sr || true + +# Run dialogs +db_go || true + diff --git a/systemregistry/src/deb/control/control b/systemregistry/src/deb/control/control new file mode 100644 index 000000000..d40708b5b --- /dev/null +++ b/systemregistry/src/deb/control/control @@ -0,0 +1,10 @@ +Package: arrowhead-system-registry +Version: [[version]] +Section: contrib/java +Priority: optional +Architecture: all +Maintainer: Mario Zsilak +Homepage: http://www.arrowhead.eu +Description: Arrowhead System Registry +Distribution: development +Depends: java-runtime-headless, openssl, virtual-mysql-server, arrowhead-core-common diff --git a/systemregistry/src/deb/control/postinst b/systemregistry/src/deb/control/postinst new file mode 100644 index 000000000..53b1e3334 --- /dev/null +++ b/systemregistry/src/deb/control/postinst @@ -0,0 +1,102 @@ +#!/bin/sh +# postinst script for arrowhead-systemregistry +# +# see: dh_installdeb(1) + +set -e + +. /usr/share/debconf/confmodule + +SYSTEM_NAME="system_registry" +PKG_NAME="arrowhead-systemregistry" + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + configure) + dos2unix -q /etc/systemd/system/${PKG_NAME}.service + + . /usr/share/arrowhead/conf/ahconf.sh + + SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" + + db_get arrowhead-core-common/mysql_password_sr; system_passwd=$RET || true + db_unregister arrowhead-core-common/mysql_password_sr + + # Generate password (if required) + if [ -z "${system_passwd}" ]; then + system_passwd="$(openssl rand -base64 12)" + fi + + echo "Configuring MySQL database..." >&2 + ah_db_tables_and_user ${SYSTEM_NAME} ${SYSTEM_NAME}_privileges.sql ${system_passwd} + + if [ ! -d "${SYSTEM_DIR}" ]; then + mkdir -p ${SYSTEM_DIR} + fi + + domain_name=${AH_DOMAIN_NAME} + if [ -z ${domain_name} ]; then + domain_name=${OWN_IP} + fi + + ah_cert_signed_system ${SYSTEM_NAME} + + if [ ! -d "${AH_SYSTEMS_DIR}/sysop" ]; then + mkdir -p ${AH_SYSTEMS_DIR}/sysop + fi + + ah_cert_signed_system sysop + + # modify log config and application.properties + + ah_transform_log_file ${SYSTEM_DIR} + + db_get arrowhead-core-common/db_host; db_host=$RET || true + + mv ${SYSTEM_DIR}/application.properties ${SYSTEM_DIR}/application.properties.orig + cat ${SYSTEM_DIR}/application.properties.orig | \ + sed -r -e "\#^.*spring\.datasource\.url=#s#.*\$#spring.datasource.url=jdbc:mysql://"${db_host}":3306/arrowhead?serverTimezone=Europe/Budapest#" \ + -e "\#^.*spring\.datasource\.password=#s#.*\$#spring.datasource.password=${system_passwd}#" \ + -e "\#^.*domain\.name=#s#.*\$#domain.name=${domain_name}#" \ + -e "\#^.*server\.ssl\.key-store=#s#.*\$#server.ssl.key-store=file:${SYSTEM_DIR}/${SYSTEM_NAME}.p12#" \ + -e "\#^.*server\.ssl\.key-store-password=#s#.*\$#server.ssl.key-store-password=${AH_PASS_CERT}#" \ + -e "\#^.*server\.ssl\.key-password=#s#.*\$#server.ssl.key-password=${AH_PASS_CERT}#" \ + -e "\#^.*server\.ssl\.trust-store=#s#.*\$#server.ssl.trust-store=file:${AH_CONF_DIR}/truststore.p12#" \ + -e "\#^.*server\.ssl\.trust-store-password=#s#.*\$#server.ssl.trust-store-password=${AH_PASS_CERT}#" > ${SYSTEM_DIR}/application.properties + + rm ${SYSTEM_DIR}/application.properties.orig + chown arrowhead:arrowhead ${SYSTEM_DIR}/application.properties + chmod 640 ${SYSTEM_DIR}/application.properties + + echo "Starting ${PKG_NAME}..." >&2 + systemctl daemon-reload + systemctl enable ${PKG_NAME}.service + systemctl start ${PKG_NAME}.service + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/systemregistry/src/deb/control/postrm b/systemregistry/src/deb/control/postrm new file mode 100644 index 000000000..a9e24370e --- /dev/null +++ b/systemregistry/src/deb/control/postrm @@ -0,0 +1,56 @@ +#!/bin/sh +# postrm script for arrowhead-systemregistry +# +# see: dh_installdeb(1) + +set -e + +. /usr/share/debconf/confmodule + +SYSTEM_NAME="system_registry" + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge) + AH_CONF_DIR="/etc/arrowhead" + AH_SYSTEMS_DIR="${AH_CONF_DIR}/systems" + SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" + + rm -f \ + /var/log/arrowhead/${SYSTEM_NAME}*.log \ + ${SYSTEM_DIR}/log4j2.xml \ + ${SYSTEM_DIR}/application.properties \ + ${SYSTEM_DIR}/${SYSTEM_NAME}.p12 \ + ${AH_SYSTEMS_DIR}/sysop/sysop.p12 + rmdir ${SYSTEM_DIR} 2>/dev/null || true + rmdir ${AH_SYSTEMS_DIR}/sysop 2>/dev/null || true + db_purge + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/systemregistry/src/deb/control/preinst b/systemregistry/src/deb/control/preinst new file mode 100644 index 000000000..49a147da0 --- /dev/null +++ b/systemregistry/src/deb/control/preinst @@ -0,0 +1,35 @@ +#!/bin/sh +# preinst script for arrowhead-serviceregistry +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/systemregistry/src/deb/control/prerm b/systemregistry/src/deb/control/prerm new file mode 100644 index 000000000..569aa72d8 --- /dev/null +++ b/systemregistry/src/deb/control/prerm @@ -0,0 +1,45 @@ +#!/bin/sh +# prerm script for arrowhead-systemregistry +# +# see: dh_installdeb(1) + +set -e + +PKG_NAME="arrowhead-systemregistry" + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove) + systemctl stop ${PKG_NAME}.service + systemctl disable ${PKG_NAME}.service + ;; + + upgrade|deconfigure) + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/systemregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/systemregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 000000000..8ccdfc698 --- /dev/null +++ b/systemregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,57 @@ +{"properties": [ + { + "name": "ping_scheduled", + "type": "java.lang.Boolean", + "description": "A description for 'ping_scheduled'" + }, + { + "name": "ping_timeout", + "type": "java.lang.Long", + "description": "A description for 'ping_timeout'" + }, + { + "name": "ping_interval", + "type": "java.lang.Long", + "description": "A description for 'ping_interval'" + }, + { + "name": "ttl_scheduled", + "type": "java.lang.Boolean", + "description": "A description for 'ttl_scheduled'" + }, + { + "name": "ttl_interval", + "type": "java.lang.Long", + "description": "A description for 'ttl_interval'" + }, + { + "name": "disable.hostname.verifier", + "type": "java.lang.Boolean", + "description": "A description for 'disable.hostname.verifier'" + }, + { + "name": "log_all_request_and_response", + "type": "java.lang.Boolean", + "description": "A description for 'log_all_request_and_response'" + }, + { + "name": "use_strict_service_intf_name_verifier", + "type": "java.lang.Boolean", + "description": "A description for 'use_strict_service_intf_name_verifier'" + }, + { + "name": "core_system_name", + "type": "java.lang.String", + "description": "A description for 'core_system_name'" + }, + { + "name": "domain.name", + "type": "java.lang.String", + "description": "A description for 'domain.name'" + }, + { + "name": "domain.port", + "type": "java.lang.Integer", + "description": "A description for 'domain.port'" + } +]} \ No newline at end of file diff --git a/systemregistry/src/main/resources/application.properties b/systemregistry/src/main/resources/application.properties new file mode 100644 index 000000000..5d65990e5 --- /dev/null +++ b/systemregistry/src/main/resources/application.properties @@ -0,0 +1,75 @@ +############################################ +### APPLICATION PARAMETERS ### +############################################ + +# Database connection (mandatory) +# Change the server timezone if necessary +spring.datasource.url=jdbc:mysql://127.0.0.1:3306/arrowhead?serverTimezone=Europe/Budapest +spring.datasource.username=system_registry +spring.datasource.password=ZzNNpxrbZGVvfJ8 +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +# use true only for debugging +spring.jpa.show-sql=false +spring.jpa.properties.hibernate.format_sql=true +spring.jpa.hibernate.ddl-auto=none + +# Service Registry web-server parameters +server.address=0.0.0.0 +server.port=8443 +domain.name=127.0.0.1 +domain.port=8437 + +############################################ +### CUSTOM PARAMETERS ### +############################################ + +# Name of the core system +core_system_name=SYSTEM_REGISTRY + +# Show all request/response in debug log +log_all_request_and_response=false + +# Service Registry has an optional feature to ping service providers in a fixed time interval, +# and remove service offerings where the service provider was not available +# use this feature (true/false) +ping_scheduled=false +# how much time the Service Registry should wait for the ping response (in milliseconds) +ping_timeout=5000 +# how frequently should the ping happen, in minutes +ping_interval=60 + +# Service Registry has an optional feature to automatically remove service offerings, where the endOfValidity +# timestamp field is in the past, meaning the offering expired +# use this feature (true/false) +ttl_scheduled=false +# how frequently the database should be checked for expired services, in minutes +ttl_interval=10 + +# Interface names has to follow this format --, where security can be SECURE or INSECURE and protocol and format must be a sequence of letters, numbers and underscore. +# A regexp checker will verify that. If this setting is set to true then the PROTOCOL and FORMAT must come from a predefined set. +use_strict_service_intf_name_verifier=false + +############################################ +### SECURE MODE ### +############################################ + +# configure secure mode + +# Set this to false to disable https mode +server.ssl.enabled=true + +server.ssl.key-store-type=PKCS12 +server.ssl.key-store=classpath:certificates/system_registry.p12 +server.ssl.key-store-password=123456 +server.ssl.key-alias=system_registry +server.ssl.key-password=123456 +server.ssl.client-auth=need +server.ssl.trust-store-type=PKCS12 +server.ssl.trust-store=classpath:certificates/truststore.p12 +server.ssl.trust-store-password=123456 + +#If true, http client does not check whether the hostname is match one of the server's SAN in its certificate +#Just for testing, DO NOT USE this feature in production environment +disable.hostname.verifier=false diff --git a/systemregistry/src/main/resources/certificates/sysop.crt b/systemregistry/src/main/resources/certificates/sysop.crt new file mode 100644 index 000000000..56eae293d --- /dev/null +++ b/systemregistry/src/main/resources/certificates/sysop.crt @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDLzCCAhegAwIBAgIEXPYrATANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB10 +ZXN0Y2xvdWQyLmFpdGlhLmFycm93aGVhZC5ldTAeFw0xOTA2MDQwODI1MzdaFw0y +MDA2MDMwODI1MzdaMC4xLDAqBgNVBAMMI3N5c29wLnRlc3RjbG91ZDIuYWl0aWEu +YXJyb3doZWFkLmV1MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoCoC +WTjB+UIi8WC8+mynAwDpC74ddxCFRt1ugnTSaW2HGJY57mZRmft/APhy7C+HyXyz +j77K6TCkr9jXxAykrkGhybdJ3ITNulolZImH2Vz8WHbmcvcKotdOvVexNou72LKi +RMrboIxIRJPtTta7RbhmVyIrTVElAVDWFjZHP7K98AhoGa3ADp0xbh0qK1BpuCnP +Km64DbY52zwr58mSaeyL7MgE+dWwWHx9r4X/WI7/2qQIio8DTvx36PHGKurtwpxa +V0o+gQ+Q1YcD1mfSHp3xtYQAnZXRLIjaDd7LGWMG7j3HbqukkjThyKrUCKfrKXQF +ItBUJ58PJJq8sTxoLwIDAQABo1swWTAPBgNVHREECDAGhwR/AAABMCcGA1UdIwQg +MB6AFAQwTQgjkz3eZj0WWqfRyV4jppdPoQCCBFzZYhkwHQYDVR0OBBYEFAVG6MVZ +FFyHQXW6qlQWA4EfXWSIMA0GCSqGSIb3DQEBCwUAA4IBAQBUEExzkf2bH4fF/tyP +r7DxO94aqQOySGJq/25DzfZQOpuK5Ud3MPpXSlxYw+MB5rRDJu0NzGUX+ha4mG3T +dXxd3X2QaDFR0SYUD4J0hTtmYp9TzgCXnU+J7t6sku/LYFJrCl5m4o124ShZXBgR +Dj/gDVd4C6InTPhpIPHaD6D97wKyObbC3V1dGiVs5Z5/+wUJdUFUmnfAb1rbX0nV +0TTKluWTtRT4cjBeIFs7MZiThMx8bgSE4mZIC1ry4PikjAap/oEIQVxbBTbl+5q8 +xhPbPn+JhZwQp39a1oPMEQog0wQhtKvZrYx//H1o3mzRo1ZFzL+R/LCKKElMPMXx +UHKC +-----END CERTIFICATE----- diff --git a/systemregistry/src/main/resources/certificates/sysop.p12 b/systemregistry/src/main/resources/certificates/sysop.p12 new file mode 100644 index 0000000000000000000000000000000000000000..5cb50c7cf666210d8dfdd437622a9638ae9e93aa GIT binary patch literal 6109 zcmY+GRZtuNjE32T#oeJufdWN}ySuZvySrQQ#oc9bmqPKP#ocvrC|aaA6p9tN-p$F} zLnbr-pX4DAU&0njv<3vgvxO3+BBC%x%0=E|0FVGhp+sQ_p+v#|WPi3$kj?+IK)MK_ zAkBZW>c3DzMEmb9bW{MaC=}tDEfnFNjR6t$f8>9|-yz`dcF~IsbIq@@U4vNX`lbs^ z>2r2~@Nk2w2%!jL?^y}Bze_N-cP5Vb%?XVYZwG@yo_S~Vj*dT~1J_WmEajOZgjI|d zhIvV67tdB^0*gSD#pW|UUuCIX+qavFhvRIi82z;t1^bIK&}hUk-B6xcKb>>}Y4on5 zB%=J5}CrfvBOqoM7Qgo^8p2I9jtl<@YdCE_6L6C=00&#T?&=ym6x>J7)(N~&E)Xf>b!h*W)R9x1A_Nrr^USdn^KhsuGC9&+{*0jPb~c(!lkP zKh&AV)U;I$^7QSk2eU=KJKl${_eu~nx=o8us0?FCbvNAVmbMJL1KA&O(RY~W;g;8Q zE<#vFkA$BL=G>>^#`}f* zck7nU`ug51t7=JKT4Lbbl$<{$z1{U5nCX+cD-CHSSu-6U`^H33=0rI$kB z)V3~GIW#LRXxSmkRqyvn1D}M+kUzJ2nr^2rJCmnUl?6EmYg&oj-5P(VU$)yoPtqaS zZxwRMXdM(bOg0DaKM7L|-!6=<(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?xz!%*o! zbcGKiMn5>{a6<>AVk=Cvbq;q&2OX`?+QS$|!WG%0Z%PqaeW-;@Bq{6NJVwV;%Cw{t zzu;Uu{QcUmw;++F`H-BV+|lQ`yp{VR?WFl&8d~<4tksZZj7h{j@71 zw;ArdJTPKsGH?>+(s|&B4@Ib~p~D}R4RX3_^0^m##0JSIknnhww3RFLuR9gTA>*)K zI=H~EnH9SdtsIJb5aL4hrR^D?_S%_pZiez=4jc=XvX? zVtc5rd0sBJ*8zh*|e{r9%A?mwR(sl$jUe1oI>_ST6M!l!fGp1_2J=q$~pTav%(HE8z64)_f? zJEtw+G{E{6yQ?*f2&yTzuo8KGwrq$!x4C8}Er>mgAZUGOg*7>Luk{+ez0oODkr13` z%yX!96`850OEOXUO(r)>FIzeQKU-a@G_JatRw^CI%1&_YfIA_aL2A;QPwB?kc+@BsJUHvUPV51wO$o&okg_)2z=(#&o* fTxw=2tb{YR^J~EFL|R;STbxVE8+;%LCp`CGm?gl9 literal 0 HcmV?d00001 diff --git a/systemregistry/src/main/resources/certificates/truststore.p12 b/systemregistry/src/main/resources/certificates/truststore.p12 new file mode 100644 index 0000000000000000000000000000000000000000..57c1c5f43254b23364a333cb17dab29d31af634e GIT binary patch literal 1162 zcmV;51aZ%2`Yw2hW8Bt2LUiC1_~;MNQU^~>U>f~LJ51Rd``6D?MdK7cL!2Z#p z&86R?Zn&z;gT({uZ?!pu3vczV(QzMrGVj;19 z5A-VUiF+tjA!JR`{RS&;@dYx_BRtTsh)jI_2%G1EVJvXOZpQOh4RI`L%TqMeT3gk+p}AIxL?@pWsVtOuKM!Wra!LreLubKEJrjmOfmcz=XHp z-uicox^ThaX--E>>L6t0cKGAJZZSJpUEl}&dZL@AOlb}oRglPDx1|D6AEV!y%^mIq z^bSQ7dL;&77p>oxfe+yiD>UmVc25pxIGu}v!cX!~oX(xh)s{kG9+7Z8AuIN|DV7c1 zEO(KKH3wIhKYUFeOIo+yqCgOU{he z!i{eE;VQ1WC(sfw2&0D47*l6qW{rzvv2Y_F+X(PA`HraCxC)_yI&=ktH0wMejyDE< z*R6G~IimpvZFC9&ACtj~U)Db!(hN3i#5R3BSqPxpIKGImON9n8LLvq_m>xpPqP{ZL zl`m>7gZWL)(B>z^@8Vp_YaFlDji)MkeSX};OY?ZZ#`21!0YAU{H?rB8K<&zyg%Rh- zHAnOMest9^iQkf`0==CWZNj2QM*TqO9DT+BUUPktVDt(8aD!f+Fi0Z@UdIv)mw-I- z5G(>==99;{Rltld$19fhEJX(NlaT5$ndU{sRk<+%LjkTVHdXKy67Rbbh;WC#YLt0E z1S}^|2@Qa|08yw+bT|X1$|Rm^X0oo4ad{VMF%U!9f9VO+41sbaj2^JOy<~8?Z>b0_ zeZ4>x1XE8O%BBG_5Pe)*Zu||{3c@j@J!E)Q+Jqqb2g0AB4vE;%k!nO#EWBVBvDL6K z%$ajYQmPg3AANl$aWFnGAutIB1uG5%0vZJX1Qe21ALl_dxi!Xc`r5F&M^_UR(|QCH c!IzHi@;Q3$Pa#3~8XCLIk6cGw0s{etp!w7j3jhEB literal 0 HcmV?d00001 diff --git a/systemregistry/src/main/resources/log4j2.xml b/systemregistry/src/main/resources/log4j2.xml new file mode 100644 index 000000000..1309f0e14 --- /dev/null +++ b/systemregistry/src/main/resources/log4j2.xml @@ -0,0 +1,46 @@ + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex + + INFO + INFO + . + + + + + + + + ${LOG_PATTERN} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/systemregistry/src/main/resources/swagger/swagger-ui.html b/systemregistry/src/main/resources/swagger/swagger-ui.html new file mode 100644 index 000000000..b338d2f47 --- /dev/null +++ b/systemregistry/src/main/resources/swagger/swagger-ui.html @@ -0,0 +1,75 @@ + + + + + + Service Registry + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + From c3d15f7e70ebf5b6053a6fd8f260bd9ba9ea60f9 Mon Sep 17 00:00:00 2001 From: mzsilak Date: Tue, 7 Jan 2020 15:16:47 +0100 Subject: [PATCH 004/301] added JPA and main classes --- .../common/database/entity/Device.java | 108 +++++++++++++++ .../database/entity/DeviceRegistry.java | 117 ++++++++++++++++ .../common/database/entity/System.java | 2 +- .../database/entity/SystemRegistry.java | 131 ++++++++++++++++++ .../repository/DeviceRegistryRepository.java | 20 +++ .../database/repository/DeviceRepository.java | 19 +++ .../repository/SystemRegistryRepository.java | 21 +++ .../deviceregistry/DeviceRegistryMain.java | 29 ++++ ...rvice => arrowhead-systemregistry.service} | 0 .../systemregistry/SystemRegistryMain.java | 29 ++++ 10 files changed, 475 insertions(+), 1 deletion(-) create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/entity/DeviceRegistry.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/entity/SystemRegistry.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRegistryRepository.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRepository.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java create mode 100644 deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryMain.java rename systemregistry/src/deb/{arrowhead-systemegistry.service => arrowhead-systemregistry.service} (100%) create mode 100644 systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryMain.java diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java new file mode 100644 index 000000000..e0bfad57f --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java @@ -0,0 +1,108 @@ +package eu.arrowhead.common.database.entity; + +import eu.arrowhead.common.CoreDefaults; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; + +import javax.persistence.*; +import javax.validation.constraints.Size; +import java.time.ZonedDateTime; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@Entity +@Table(name = "device", uniqueConstraints = @UniqueConstraint(columnNames = { "deviceName", "address" })) +@NamedEntityGraph(name = "deviceWithSystemRegistryEntries", + attributeNodes = { + @NamedAttributeNode(value = "serviceRegistryEntries") +}) +public class Device +{ + + //================================================================================================= + // members + + public static final List SORTABLE_FIELDS_BY = List.of("id", "updatedAt", "createdAt", "deviceName", "address"); //NOSONAR + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private long id; + + @Column(nullable = false, length = CoreDefaults.VARCHAR_BASIC) + private String deviceName; + + @Column(nullable = false, length = CoreDefaults.VARCHAR_BASIC) + private String address; + + @Column(nullable = false, length = CoreDefaults.VARCHAR_BASIC) + private String macAddress; + + @Column(nullable = false, length = CoreDefaults.VARCHAR_EXTENDED) + private String authenticationInfo; + + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") + private ZonedDateTime createdAt; + + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") + private ZonedDateTime updatedAt; + + @OneToMany(mappedBy = "system", fetch = FetchType.LAZY, orphanRemoval = true) + @OnDelete(action = OnDeleteAction.CASCADE) + private Set systemRegistryEntries = new HashSet<>(); + + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public Device() {} + + //------------------------------------------------------------------------------------------------- + public Device(final String deviceName, final String address, final String macAddress, final String authenticationInfo) { + this.deviceName = deviceName; + this.address = address; + this.macAddress = macAddress; + this.authenticationInfo = authenticationInfo; + } + + //------------------------------------------------------------------------------------------------- + @PrePersist + public void onCreate() { + this.createdAt = ZonedDateTime.now(); + this.updatedAt = this.createdAt; + } + + //------------------------------------------------------------------------------------------------- + @PreUpdate + public void onUpdate() { + this.updatedAt = ZonedDateTime.now(); + } + + //------------------------------------------------------------------------------------------------- + public long getId() { return id; } + public String getDeviceName() { return deviceName; } + public String getAddress() { return address; } + public String getMacAddress() {return macAddress; } + + public String getAuthenticationInfo() { return authenticationInfo; } + public ZonedDateTime getCreatedAt() { return createdAt; } + public ZonedDateTime getUpdatedAt() { return updatedAt; } + public Set getSystemRegistryEntries() { return systemRegistryEntries; } + + //------------------------------------------------------------------------------------------------- + public void setId(final long id) { this.id = id; } + public void setDeviceName(final String systemName) { this.deviceName = systemName; } + public void setAddress(final String address) { this.address = address; } + public void setMacAddress(final String macAddress) { this.macAddress = macAddress; } + public void setAuthenticationInfo(final String authenticationInfo) { this.authenticationInfo = authenticationInfo; } + public void setCreatedAt(final ZonedDateTime createdAt) { this.createdAt = createdAt; } + public void setUpdatedAt(final ZonedDateTime updatedAt) { this.updatedAt = updatedAt; } + public void setSystemRegistryEntries(final Set serviceRegistryEntries) { this.systemRegistryEntries = serviceRegistryEntries; } + + //------------------------------------------------------------------------------------------------- + @Override + public String toString() { + return "System [id = " + id + ", systemName = " + deviceName + ", address = " + address + ", macAddress = " + macAddress + "]"; + } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/DeviceRegistry.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/DeviceRegistry.java new file mode 100644 index 000000000..c0ba43d5e --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/DeviceRegistry.java @@ -0,0 +1,117 @@ +package eu.arrowhead.common.database.entity; + +import javax.persistence.*; +import java.time.ZonedDateTime; +import java.util.List; +import java.util.Objects; + +@Entity +@Table(uniqueConstraints = @UniqueConstraint(columnNames = {"deviceId"})) +public class DeviceRegistry +{ + + //================================================================================================= + // members + public static final List SORTABLE_FIELDS_BY = List.of("id", "updatedAt", "createdAt"); //NOSONAR + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private long id; + + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "deviceId", referencedColumnName = "id", nullable = false) + private Device device; + + @Column(nullable = true) + private ZonedDateTime endOfValidity; + + @Column(nullable = true, columnDefinition = "TEXT") + private String metadata; + + @Column(nullable = true) + private Integer version = 1; + + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") + private ZonedDateTime createdAt; + + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") + private ZonedDateTime updatedAt; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public DeviceRegistry() {} + + //------------------------------------------------------------------------------------------------- + public DeviceRegistry(final Device device, final ZonedDateTime endOfValidity, + final String metadata, final Integer version) { + this.device = device; + this.endOfValidity = endOfValidity; + this.metadata = metadata; + this.version = version; + } + + //------------------------------------------------------------------------------------------------- + @PrePersist + public void onCreate() { + this.createdAt = ZonedDateTime.now(); + this.updatedAt = this.createdAt; + } + + //------------------------------------------------------------------------------------------------- + @PreUpdate + public void onUpdate() { + this.updatedAt = ZonedDateTime.now(); + } + + //------------------------------------------------------------------------------------------------- + public long getId() { return id; } + public Device getDevice() { return device; } + public ZonedDateTime getEndOfValidity() { return endOfValidity; } + public String getMetadata() { return metadata; } + public Integer getVersion() { return version; } + public ZonedDateTime getCreatedAt() { return createdAt; } + public ZonedDateTime getUpdatedAt() { return updatedAt; } + + //------------------------------------------------------------------------------------------------- + public void setId(final long id) { this.id = id; } + public void setDevice(final Device device) { this.device = device; } + public void setEndOfValidity(final ZonedDateTime endOfValidity) { this.endOfValidity = endOfValidity; } + public void setMetadata(final String metadata) { this.metadata = metadata; } + public void setVersion(final Integer version) { this.version = version; } + public void setCreatedAt(final ZonedDateTime createdAt) { this.createdAt = createdAt; } + public void setUpdatedAt(final ZonedDateTime updatedAt) { this.updatedAt = updatedAt; } + + //------------------------------------------------------------------------------------------------- + @Override + public String toString() { + return "ServiceRegistry [id = " + id + ", device = " + device + ", endOfValidity = " + endOfValidity + ", version = " + version + "]"; + } + + //------------------------------------------------------------------------------------------------- + @Override + public int hashCode() { + return Objects.hash(id); + } + + //------------------------------------------------------------------------------------------------- + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + + if (obj == null) { + return false; + } + + if (getClass() != obj.getClass()) { + return false; + } + + final DeviceRegistry other = (DeviceRegistry) obj; + + return id == other.id; + } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/System.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/System.java index 95cf04048..9609f2743 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/System.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/System.java @@ -25,7 +25,7 @@ import eu.arrowhead.common.CoreDefaults; @Entity -@Table(name = "system_", uniqueConstraints = @UniqueConstraint(columnNames = { "systemName", "address", "port" })) +@Table(name = "system", uniqueConstraints = @UniqueConstraint(columnNames = { "systemName", "address", "port" })) @NamedEntityGraph(name = "systemWithServiceRegistryEntries", attributeNodes = { @NamedAttributeNode(value = "serviceRegistryEntries") diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/SystemRegistry.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/SystemRegistry.java new file mode 100644 index 000000000..dd70c5270 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/SystemRegistry.java @@ -0,0 +1,131 @@ +package eu.arrowhead.common.database.entity; + +import eu.arrowhead.common.CoreDefaults; +import eu.arrowhead.common.dto.shared.ServiceSecurityType; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; + +import javax.persistence.*; +import java.time.ZonedDateTime; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.Set; + +@Entity +@Table(uniqueConstraints = @UniqueConstraint(columnNames = {"systemId", "deviceId"})) +public class SystemRegistry +{ + + //================================================================================================= + // members + public static final List SORTABLE_FIELDS_BY = List.of("id", "updatedAt", "createdAt"); //NOSONAR + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private long id; + + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "systemId", referencedColumnName = "id", nullable = false) + private System system; + + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "deviceId", referencedColumnName = "id", nullable = false) + private Device device; + + @Column(nullable = true) + private ZonedDateTime endOfValidity; + + @Column(nullable = true, columnDefinition = "TEXT") + private String metadata; + + @Column(nullable = true) + private Integer version = 1; + + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") + private ZonedDateTime createdAt; + + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") + private ZonedDateTime updatedAt; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public SystemRegistry() {} + + //------------------------------------------------------------------------------------------------- + public SystemRegistry(final System system, final Device device, final ZonedDateTime endOfValidity, + final String metadata, final Integer version) { + this.system = system; + this.device = device; + this.endOfValidity = endOfValidity; + this.metadata = metadata; + this.version = version; + } + + //------------------------------------------------------------------------------------------------- + @PrePersist + public void onCreate() { + this.createdAt = ZonedDateTime.now(); + this.updatedAt = this.createdAt; + } + + //------------------------------------------------------------------------------------------------- + @PreUpdate + public void onUpdate() { + this.updatedAt = ZonedDateTime.now(); + } + + //------------------------------------------------------------------------------------------------- + public long getId() { return id; } + public System getSystem() { return system; } + public Device getDevice() { return device; } + public ZonedDateTime getEndOfValidity() { return endOfValidity; } + public String getMetadata() { return metadata; } + public Integer getVersion() { return version; } + public ZonedDateTime getCreatedAt() { return createdAt; } + public ZonedDateTime getUpdatedAt() { return updatedAt; } + + //------------------------------------------------------------------------------------------------- + public void setId(final long id) { this.id = id; } + public void setSystem(final System system) { this.system = system; } + public void setDevice(final Device device) { this.device = device; } + public void setEndOfValidity(final ZonedDateTime endOfValidity) { this.endOfValidity = endOfValidity; } + public void setMetadata(final String metadata) { this.metadata = metadata; } + public void setVersion(final Integer version) { this.version = version; } + public void setCreatedAt(final ZonedDateTime createdAt) { this.createdAt = createdAt; } + public void setUpdatedAt(final ZonedDateTime updatedAt) { this.updatedAt = updatedAt; } + + //------------------------------------------------------------------------------------------------- + @Override + public String toString() { + return "ServiceRegistry [id = " + id + ", system = " + system + ", device = " + device + ", endOfValidity = " + endOfValidity + ", version = " + version + "]"; + } + + //------------------------------------------------------------------------------------------------- + @Override + public int hashCode() { + return Objects.hash(id); + } + + //------------------------------------------------------------------------------------------------- + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + + if (obj == null) { + return false; + } + + if (getClass() != obj.getClass()) { + return false; + } + + final SystemRegistry other = (SystemRegistry) obj; + + return id == other.id; + } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRegistryRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRegistryRepository.java new file mode 100644 index 000000000..0ccff6e2a --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRegistryRepository.java @@ -0,0 +1,20 @@ +package eu.arrowhead.common.database.repository; + +import eu.arrowhead.common.database.entity.Device; +import eu.arrowhead.common.database.entity.DeviceRegistry; +import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.database.entity.SystemRegistry; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Optional; + +@Repository +public interface DeviceRegistryRepository extends RefreshableRepository { + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public Optional findByDevice(final Device device); +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRepository.java new file mode 100644 index 000000000..d8c604a67 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRepository.java @@ -0,0 +1,19 @@ +package eu.arrowhead.common.database.repository; + +import eu.arrowhead.common.database.entity.Device; +import eu.arrowhead.common.database.entity.System; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Optional; + +@Repository +public interface DeviceRepository extends RefreshableRepository { + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public Optional findByDeviceNameAndAddress(final String deviceName, final String address); + public List findByDeviceName(final String deviceName); +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java new file mode 100644 index 000000000..9dc42ca5f --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java @@ -0,0 +1,21 @@ +package eu.arrowhead.common.database.repository; + +import eu.arrowhead.common.database.entity.*; +import eu.arrowhead.common.database.entity.System; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Optional; + +@Repository +public interface SystemRegistryRepository extends RefreshableRepository { + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public Optional findBySystem(final System system); + public List findByDevice(final Device device); +} \ No newline at end of file diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryMain.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryMain.java new file mode 100644 index 000000000..6725ca7c1 --- /dev/null +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryMain.java @@ -0,0 +1,29 @@ +package eu.arrowhead.core.deviceregistry; + + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.database.repository.RefreshableRepositoryImpl; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@SpringBootApplication +@ComponentScan(CommonConstants.BASE_PACKAGE) +@EntityScan(CoreCommonConstants.DATABASE_ENTITY_PACKAGE) +@EnableJpaRepositories(basePackages = CoreCommonConstants.DATABASE_REPOSITORY_PACKAGE, repositoryBaseClass = RefreshableRepositoryImpl.class) +@EnableSwagger2 +public class DeviceRegistryMain +{ + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public static void main(final String[] args) { + SpringApplication.run(DeviceRegistryMain.class, args); + } +} diff --git a/systemregistry/src/deb/arrowhead-systemegistry.service b/systemregistry/src/deb/arrowhead-systemregistry.service similarity index 100% rename from systemregistry/src/deb/arrowhead-systemegistry.service rename to systemregistry/src/deb/arrowhead-systemregistry.service diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryMain.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryMain.java new file mode 100644 index 000000000..bf8aead53 --- /dev/null +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryMain.java @@ -0,0 +1,29 @@ +package eu.arrowhead.core.systemregistry; + + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.database.repository.RefreshableRepositoryImpl; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@SpringBootApplication +@ComponentScan(CommonConstants.BASE_PACKAGE) +@EntityScan(CoreCommonConstants.DATABASE_ENTITY_PACKAGE) +@EnableJpaRepositories(basePackages = CoreCommonConstants.DATABASE_REPOSITORY_PACKAGE, repositoryBaseClass = RefreshableRepositoryImpl.class) +@EnableSwagger2 +public class SystemRegistryMain +{ + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public static void main(final String[] args) { + SpringApplication.run(SystemRegistryMain.class, args); + } +} From 5ecd2efb3c3c7931d6489ed2687336ad4c7beb43 Mon Sep 17 00:00:00 2001 From: mzsilak Date: Fri, 10 Jan 2020 17:01:52 +0100 Subject: [PATCH 005/301] added database scripts --- .../common/database/entity/Device.java | 8 +- scripts/authorization_privileges.sql | 4 +- scripts/create_arrowhead_tables.sql | 67 +- scripts/event_handler_privileges.sql | 4 +- scripts/gatekeeper_privileges.sql | 4 +- scripts/orchestrator_privileges.sql | 4 +- scripts/service_registry_privileges.sql | 4 +- ...SystemRegistryApplicationInitListener.java | 92 ++ .../SystemRegistryController.java | 1004 +++++++++++++++++ .../service/SystemRegistryDBService.java | 30 + 10 files changed, 1196 insertions(+), 25 deletions(-) create mode 100644 systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryApplicationInitListener.java create mode 100644 systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java create mode 100644 systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java index e0bfad57f..46628fad5 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java @@ -12,10 +12,10 @@ import java.util.Set; @Entity -@Table(name = "device", uniqueConstraints = @UniqueConstraint(columnNames = { "deviceName", "address" })) +@Table(name = "device", uniqueConstraints = @UniqueConstraint(columnNames = { "deviceName", "macAddress" })) @NamedEntityGraph(name = "deviceWithSystemRegistryEntries", attributeNodes = { - @NamedAttributeNode(value = "serviceRegistryEntries") + @NamedAttributeNode(value = "systemRegistryEntries") }) public class Device { @@ -47,7 +47,7 @@ public class Device @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") private ZonedDateTime updatedAt; - @OneToMany(mappedBy = "system", fetch = FetchType.LAZY, orphanRemoval = true) + @OneToMany(mappedBy = "device", fetch = FetchType.LAZY, orphanRemoval = true) @OnDelete(action = OnDeleteAction.CASCADE) private Set systemRegistryEntries = new HashSet<>(); @@ -98,7 +98,7 @@ public void onUpdate() { public void setAuthenticationInfo(final String authenticationInfo) { this.authenticationInfo = authenticationInfo; } public void setCreatedAt(final ZonedDateTime createdAt) { this.createdAt = createdAt; } public void setUpdatedAt(final ZonedDateTime updatedAt) { this.updatedAt = updatedAt; } - public void setSystemRegistryEntries(final Set serviceRegistryEntries) { this.systemRegistryEntries = serviceRegistryEntries; } + public void setSystemRegistryEntries(final Set systemRegistryEntries) { this.systemRegistryEntries = systemRegistryEntries; } //------------------------------------------------------------------------------------------------- @Override diff --git a/scripts/authorization_privileges.sql b/scripts/authorization_privileges.sql index 0484c30a3..2b6c37156 100644 --- a/scripts/authorization_privileges.sql +++ b/scripts/authorization_privileges.sql @@ -6,7 +6,7 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'authorizatio GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'authorization'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'authorization'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'authorization'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'authorization'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'authorization'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'authorization'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'authorization'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'authorization'@'localhost'; @@ -21,7 +21,7 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'authorizatio GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'authorization'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'authorization'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'authorization'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'authorization'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'authorization'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'authorization'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'authorization'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'authorization'@'%'; diff --git a/scripts/create_arrowhead_tables.sql b/scripts/create_arrowhead_tables.sql index df58ad803..4345735bf 100644 --- a/scripts/create_arrowhead_tables.sql +++ b/scripts/create_arrowhead_tables.sql @@ -54,7 +54,7 @@ CREATE TABLE IF NOT EXISTS `cloud_gateway_relay` ( CONSTRAINT `gw_relay_constr` FOREIGN KEY (`relay_id`) REFERENCES `relay` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `system_` ( +CREATE TABLE IF NOT EXISTS `system` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `system_name` varchar(255) NOT NULL, `address` varchar(255) NOT NULL, @@ -66,6 +66,18 @@ CREATE TABLE IF NOT EXISTS `system_` ( UNIQUE KEY `triple` (`system_name`,`address`,`port`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `device` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `device_name` varchar(255) NOT NULL, + `address` varchar(255) NOT NULL, + `mac_address` varchar(255) NOT NULL, + `authentication_info` varchar(2047) DEFAULT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `double` (`device_name`,`mac_address`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE IF NOT EXISTS `service_definition` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `service_definition` varchar(255) NOT NULL, @@ -87,6 +99,39 @@ CREATE TABLE IF NOT EXISTS `service_interface` ( INSERT IGNORE INTO `service_interface` (interface_name) VALUES ('HTTP-SECURE-JSON'); INSERT IGNORE INTO `service_interface` (interface_name) VALUES ('HTTP-INSECURE-JSON'); +-- Device Registry + +CREATE TABLE IF NOT EXISTS `device_registry` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `device_id` bigint(20) NOT NULL, + `end_of_validity` timestamp NULL DEFAULT NULL, + `metadata` text, + `version` int(11) DEFAULT 1, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `device_registry_device` (`device_id`), + CONSTRAINT `device_registry_device` FOREIGN KEY (`device_id`) REFERENCES `device` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- System Registry + +CREATE TABLE IF NOT EXISTS `system_registry` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `system_id` bigint(20) NOT NULL, + `device_id` bigint(20) NOT NULL, + `end_of_validity` timestamp NULL DEFAULT NULL, + `metadata` text, + `version` int(11) DEFAULT 1, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `system_registry_pair` (`system_id`,`device_id`), + KEY `system_registry_device` (`device_id`), + CONSTRAINT `system_registry_system` FOREIGN KEY (`system_id`) REFERENCES `system` (`id`) ON DELETE CASCADE, + CONSTRAINT `system_registry_device` FOREIGN KEY (`device_id`) REFERENCES `device` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + -- Service Registry CREATE TABLE IF NOT EXISTS `service_registry` ( @@ -101,10 +146,10 @@ CREATE TABLE IF NOT EXISTS `service_registry` ( `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), - UNIQUE KEY `pair` (`service_id`,`system_id`), - KEY `system` (`system_id`), - CONSTRAINT `service` FOREIGN KEY (`service_id`) REFERENCES `service_definition` (`id`) ON DELETE CASCADE, - CONSTRAINT `system` FOREIGN KEY (`system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE + UNIQUE KEY `service_registry_pair` (`service_id`,`system_id`), + KEY `service_registry_system` (`system_id`), + CONSTRAINT `service_registry_service` FOREIGN KEY (`service_id`) REFERENCES `service_definition` (`id`) ON DELETE CASCADE, + CONSTRAINT `service_registry_system` FOREIGN KEY (`system_id`) REFERENCES `system` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `service_registry_interface_connection` ( @@ -134,8 +179,8 @@ CREATE TABLE IF NOT EXISTS `authorization_intra_cloud` ( KEY `provider` (`provider_system_id`), KEY `service_intra_auth` (`service_id`), CONSTRAINT `service_intra_auth` FOREIGN KEY (`service_id`) REFERENCES `service_definition` (`id`) ON DELETE CASCADE, - CONSTRAINT `provider` FOREIGN KEY (`provider_system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE, - CONSTRAINT `consumer` FOREIGN KEY (`consumer_system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE + CONSTRAINT `provider` FOREIGN KEY (`provider_system_id`) REFERENCES `system` (`id`) ON DELETE CASCADE, + CONSTRAINT `consumer` FOREIGN KEY (`consumer_system_id`) REFERENCES `system` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `authorization_inter_cloud` ( @@ -150,7 +195,7 @@ CREATE TABLE IF NOT EXISTS `authorization_inter_cloud` ( KEY `service_inter_auth` (`service_id`), CONSTRAINT `cloud` FOREIGN KEY (`consumer_cloud_id`) REFERENCES `cloud` (`id`) ON DELETE CASCADE, CONSTRAINT `service_inter_auth` FOREIGN KEY (`service_id`) REFERENCES `service_definition` (`id`) ON DELETE CASCADE, - CONSTRAINT `provider_inter_auth` FOREIGN KEY (`provider_system_id`) REFERENCES `system_` (id) ON DELETE CASCADE + CONSTRAINT `provider_inter_auth` FOREIGN KEY (`provider_system_id`) REFERENCES `system` (id) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `authorization_inter_cloud_interface_connection` ( @@ -195,7 +240,7 @@ CREATE TABLE IF NOT EXISTS `orchestrator_store` ( PRIMARY KEY (`id`), UNIQUE KEY `priority_rule` (`service_id`, `service_interface_id`, `consumer_system_id`,`priority`), UNIQUE KEY `duplication_rule` (`service_id`, `service_interface_id`, `consumer_system_id`,`provider_system_id`, `foreign_`), - CONSTRAINT `consumer_orch` FOREIGN KEY (`consumer_system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE, + CONSTRAINT `consumer_orch` FOREIGN KEY (`consumer_system_id`) REFERENCES `system` (`id`) ON DELETE CASCADE, CONSTRAINT `service_orch` FOREIGN KEY (`service_id`) REFERENCES `service_definition` (`id`) ON DELETE CASCADE, CONSTRAINT `service_intf_orch` FOREIGN KEY (`service_interface_id`) REFERENCES `service_interface` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -251,7 +296,7 @@ CREATE TABLE IF NOT EXISTS `subscription` ( `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `pair` (`event_type_id`,`system_id`), - CONSTRAINT `subscriber_system` FOREIGN KEY (`system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE, + CONSTRAINT `subscriber_system` FOREIGN KEY (`system_id`) REFERENCES `system` (`id`) ON DELETE CASCADE, CONSTRAINT `event_type` FOREIGN KEY (`event_type_id`) REFERENCES `event_type` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -265,7 +310,7 @@ CREATE TABLE IF NOT EXISTS `subscription_publisher_connection` ( PRIMARY KEY (`id`), UNIQUE KEY `pair` (`subscription_id`,`system_id`), CONSTRAINT `subscription_constraint` FOREIGN KEY (`subscription_id`) REFERENCES `subscription` (`id`) ON DELETE CASCADE, - CONSTRAINT `system_constraint` FOREIGN KEY (`system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE + CONSTRAINT `system_constraint` FOREIGN KEY (`system_id`) REFERENCES `system` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Choreographer diff --git a/scripts/event_handler_privileges.sql b/scripts/event_handler_privileges.sql index 59183f487..a28bfd821 100644 --- a/scripts/event_handler_privileges.sql +++ b/scripts/event_handler_privileges.sql @@ -5,7 +5,7 @@ REVOKE ALL, GRANT OPTION FROM 'event_handler'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`event_type` TO 'event_handler'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'event_handler'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'event_handler'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'event_handler'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'event_handler'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'event_handler'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'event_handler'@'%'; @@ -13,7 +13,7 @@ REVOKE ALL, GRANT OPTION FROM 'event_handler'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`event_type` TO 'event_handler'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'event_handler'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'event_handler'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'event_handler'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'event_handler'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'event_handler'@'%'; FLUSH PRIVILEGES; \ No newline at end of file diff --git a/scripts/gatekeeper_privileges.sql b/scripts/gatekeeper_privileges.sql index 944fe7cb1..212fed558 100644 --- a/scripts/gatekeeper_privileges.sql +++ b/scripts/gatekeeper_privileges.sql @@ -4,7 +4,7 @@ REVOKE ALL, GRANT OPTION FROM 'gatekeeper'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'gatekeeper'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'gatekeeper'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'gatekeeper'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'gatekeeper'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'gatekeeper'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'gatekeeper'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'gatekeeper'@'localhost'; @@ -17,7 +17,7 @@ REVOKE ALL, GRANT OPTION FROM 'gatekeeper'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'gatekeeper'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'gatekeeper'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'gatekeeper'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'gatekeeper'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'gatekeeper'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'gatekeeper'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'gatekeeper'@'%'; diff --git a/scripts/orchestrator_privileges.sql b/scripts/orchestrator_privileges.sql index 9595b3157..d6a223f31 100644 --- a/scripts/orchestrator_privileges.sql +++ b/scripts/orchestrator_privileges.sql @@ -4,7 +4,7 @@ REVOKE ALL, GRANT OPTION FROM 'orchestrator'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'orchestrator'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`foreign_system` TO 'orchestrator'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'orchestrator'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'orchestrator'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'orchestrator'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'orchestrator'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'orchestrator'@'localhost'; @@ -17,7 +17,7 @@ REVOKE ALL, GRANT OPTION FROM 'orchestrator'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'orchestrator'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`foreign_system` TO 'orchestrator'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'orchestrator'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'orchestrator'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'orchestrator'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'orchestrator'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'orchestrator'@'%'; diff --git a/scripts/service_registry_privileges.sql b/scripts/service_registry_privileges.sql index 072ae3572..85a994f86 100644 --- a/scripts/service_registry_privileges.sql +++ b/scripts/service_registry_privileges.sql @@ -2,7 +2,7 @@ USE `arrowhead`; REVOKE ALL, GRANT OPTION FROM 'service_registry'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'service_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'service_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'service_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'service_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'service_registry'@'localhost'; @@ -29,7 +29,7 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'service_registry'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'service_registry'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'service_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'service_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'service_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'service_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'service_registry'@'%'; diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryApplicationInitListener.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryApplicationInitListener.java new file mode 100644 index 000000000..d9c307f6d --- /dev/null +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryApplicationInitListener.java @@ -0,0 +1,92 @@ +package eu.arrowhead.core.systemregistry; + +import eu.arrowhead.common.ApplicationInitListener; +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreDefaults; +import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.database.service.CommonDBService; +import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.common.exception.DataNotFoundException; +import eu.arrowhead.core.systemregistry.database.service.SystemRegistryDBService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.context.event.ContextRefreshedEvent; +import org.springframework.stereotype.Component; + +import java.util.Base64; +import java.util.List; +import java.util.Map; + +@Component +public class SystemRegistryApplicationInitListener extends ApplicationInitListener { + + //================================================================================================= + // members + + @Autowired + private CommonDBService commonDBService; + + @Autowired + private SystemRegistryDBService systemRegistryDBService; + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + @Override + protected void customInit(final ContextRefreshedEvent event) { + logger.debug("customInit started..."); + if (!isOwnCloudRegistered()) { + registerOwnCloud(event.getApplicationContext()); + } + + try { + final String name = coreSystemRegistrationProperties.getCoreSystem().name().toLowerCase(); + final List oldSystems = systemRegistryDBService.getSystemByName(name); + if (!oldSystems.isEmpty()) { + for (final System system : oldSystems) { + systemRegistryDBService.removeSystemById(system.getId()); + } + } + + final String authInfo = sslProperties.isSslEnabled() ? Base64.getEncoder().encodeToString(publicKey.getEncoded()) : null; + systemRegistryDBService.createSystem(name, coreSystemRegistrationProperties.getCoreSystemDomainName(), coreSystemRegistrationProperties.getCoreSystemDomainPort(), authInfo); + } catch (final ArrowheadException ex) { + logger.error("Can't registrate {} as a system.", coreSystemRegistrationProperties.getCoreSystem().name()); + logger.debug("Stacktrace", ex); + } + } + + //------------------------------------------------------------------------------------------------- + private boolean isOwnCloudRegistered() { + logger.debug("isOwnCloudRegistered started..."); + try { + commonDBService.getOwnCloud(sslProperties.isSslEnabled()); + return true; + } catch (final DataNotFoundException ex) { + return false; + } + } + + //------------------------------------------------------------------------------------------------- + private void registerOwnCloud(final ApplicationContext appContext) { + logger.debug("registerOwnCloud started..."); + + if (!standaloneMode) { + String name = CoreDefaults.DEFAULT_OWN_CLOUD_NAME; + String operator = CoreDefaults.DEFAULT_OWN_CLOUD_OPERATOR; + + if (sslProperties.isSslEnabled()) { + @SuppressWarnings("unchecked") + final Map context = appContext.getBean(CommonConstants.ARROWHEAD_CONTEXT, Map.class); + final String serverCN = (String) context.get(CommonConstants.SERVER_COMMON_NAME); + final String[] serverFields = serverCN.split("\\."); + name = serverFields[1]; + operator = serverFields[2]; + } + + commonDBService.insertOwnCloud(operator, name, sslProperties.isSslEnabled(), null); + logger.info("{}.{} own cloud is registered in {} mode.", name, operator, getModeString()); + } + } +} \ No newline at end of file diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java new file mode 100644 index 000000000..dcde23830 --- /dev/null +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java @@ -0,0 +1,1004 @@ +package eu.arrowhead.core.systemregistry; + +import eu.arrowhead.common.*; +import eu.arrowhead.common.core.CoreSystem; +import eu.arrowhead.common.core.CoreSystemService; +import eu.arrowhead.common.dto.internal.*; +import eu.arrowhead.common.dto.shared.*; +import eu.arrowhead.common.exception.BadPayloadException; +import eu.arrowhead.common.intf.ServiceInterfaceNameVerifier; +import eu.arrowhead.core.systemregistry.database.service.SystemRegistryDBService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.apache.http.HttpStatus; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Sort.Direction; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; + +import java.time.format.DateTimeParseException; + +@Api(tags = { CoreCommonConstants.SWAGGER_TAG_ALL }) +@CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, + allowedHeaders = { HttpHeaders.ORIGIN, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT, HttpHeaders.AUTHORIZATION } +) +@RestController +@RequestMapping(CommonConstants.SERVICE_REGISTRY_URI) +public class SystemRegistryController +{ + + //================================================================================================= + // members + + private static final String GET_SYSTEM_BY_ID_HTTP_200_MESSAGE = "System by requested id returned"; + private static final String GET_SYSTEM_BY_ID_HTTP_400_MESSAGE = "No Such System by requested id"; + private static final String PATH_VARIABLE_ID = "id"; + private static final String SYSTEM_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/system/{" + PATH_VARIABLE_ID + "}"; + private static final String SYSTEMS_URI = CoreCommonConstants.MGMT_URI + "/systems"; + private static final String SYSTEMS_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/systems/{" + PATH_VARIABLE_ID + "}"; + private static final String GET_SYSTEMS_HTTP_200_MESSAGE = "Systems returned"; + private static final String GET_SYSTEMS_HTTP_400_MESSAGE = " Invalid parameters"; + private static final String POST_SYSTEM_HTTP_201_MESSAGE = "System created"; + private static final String POST_SYSTEM_HTTP_400_MESSAGE = "Could not create system"; + private static final String PUT_SYSTEM_HTTP_200_MESSAGE = "System updated"; + private static final String PUT_SYSTEM_HTTP_400_MESSAGE = "Could not update system"; + private static final String PATCH_SYSTEM_HTTP_200_MESSAGE = "System updated"; + private static final String PATCH_SYSTEM_HTTP_400_MESSAGE = "Could not update system"; + private static final String DELETE_SYSTEM_HTTP_200_MESSAGE = "System deleted"; + private static final String DELETE_SYSTEM_HTTP_400_MESSAGE = "Could not delete system"; + + private static final String SERVICES_URI = CoreCommonConstants.MGMT_URI + "/services"; + private static final String SERVICES_BY_ID_URI = SERVICES_URI + "/{" + PATH_VARIABLE_ID + "}"; + private static final String GET_SERVICES_HTTP_200_MESSAGE = "Services returned"; + private static final String GET_SERVICES_HTTP_400_MESSAGE = "Could not retrieve service definition"; + private static final String POST_SERVICES_HTTP_201_MESSAGE = "Service definition created"; + private static final String POST_SERVICES_HTTP_400_MESSAGE = "Could not create service definition"; + private static final String PUT_SERVICES_HTTP_200_MESSAGE = "Service definition updated"; + private static final String PUT_SERVICES_HTTP_400_MESSAGE = "Could not update service definition"; + private static final String PATCH_SERVICES_HTTP_200_MESSAGE = "Service definition updated"; + private static final String PATCH_SERVICES_HTTP_400_MESSAGE = "Could not update service definition"; + private static final String DELETE_SERVICES_HTTP_200_MESSAGE = "Service definition removed"; + private static final String DELETE_SERVICES_HTTP_400_MESSAGE = "Could not remove service definition"; + + private static final String SERVICE_REGISTRY_REGISTER_DESCRIPTION = "Registers a service"; + private static final String SERVICE_REGISTRY_REGISTER_201_MESSAGE = "Service registered"; + private static final String SERVICE_REGISTRY_REGISTER_400_MESSAGE = "Could not register service"; + private static final String SERVICE_REGISTRY_UNREGISTER_DESCRIPTION = "Remove a registered service"; + private static final String SERVICE_REGISTRY_UNREGISTER_200_MESSAGE = "Registered service removed"; + private static final String SERVICE_REGISTRY_UNREGISTER_400_MESSAGE = "Could not remove service"; + private static final String SERVICE_REGISTRY_QUERY_DESCRIPTION = "Return Service Registry data that fits the specification"; + private static final String SERVICE_REGISTRY_QUERY_200_MESSAGE = "Service Registry data returned"; + private static final String SERVICE_REGISTRY_QUERY_400_MESSAGE = "Could not query Service Registry"; + private static final String SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_DESCRIPTION = "Return system by requested id"; + private static final String SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_200_MESSAGE = "System data by id returned"; + private static final String SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_400_MESSAGE = "Could not query Service Registry by Consumer system id"; + private static final String SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_DESCRIPTION = "Return System by requested dto"; + private static final String SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_200_MESSAGE = "Consumer System data by requestDTO returned"; + private static final String SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_400_MESSAGE = "Could not query Service Registry by Consumer system requestDTO"; + private static final String SERVICE_REGISTRY_UPDATE_DESCRIPTION = "Update a service"; + private static final String SERVICE_REGISTRY_UPDATE_200_MESSAGE = "Service updated"; + private static final String SERVICE_REGISTRY_UPDATE_400_MESSAGE = "Could not update service"; + private static final String SERVICE_REGISTRY_MERGE_DESCRIPTION = "Merge/Patch a service"; + private static final String SERVICE_REGISTRY_MERGE_200_MESSAGE = "Service merged"; + private static final String SERVICE_REGISTRY_MERGE_400_MESSAGE = "Could not merge service"; + + private static final String NOT_VALID_PARAMETERS_ERROR_MESSAGE = "Not valid request parameters."; + private static final String ID_NOT_VALID_ERROR_MESSAGE = "Id must be greater than 0. "; + private static final String SYSTEM_NAME_NULL_ERROR_MESSAGE = " System name must have value "; + private static final String SYSTEM_ADDRESS_NULL_ERROR_MESSAGE = " System address must have value "; + private static final String SYSTEM_PORT_NULL_ERROR_MESSAGE = " System port must have value "; + + private static final String SERVICE_REGISTRY_MGMT_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/{" + PATH_VARIABLE_ID + "}"; + private static final String PATH_VARIABLE_SERVICE_DEFINITION = "serviceDefinition"; + private static final String SERVICE_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI = CoreCommonConstants.MGMT_URI + "/servicedef" + "/{" + PATH_VARIABLE_SERVICE_DEFINITION + "}"; + private static final String SERVICE_REGISTRY_MGMT_GROUPED_URI = CoreCommonConstants.MGMT_URI + "/grouped"; + private static final String GET_SERVICE_REGISTRY_HTTP_200_MESSAGE = "Service Registry entries returned"; + private static final String GET_SERVICE_REGISTRY_HTTP_400_MESSAGE = "Could not retrieve service registry entries"; + private static final String DELETE_SERVICE_REGISTRY_HTTP_200_MESSAGE = "Service Registry entry removed"; + private static final String DELETE_SERVICE_REGISTRY_HTTP_400_MESSAGE = "Could not remove service registry entry"; + + private final Logger logger = LogManager.getLogger(SystemRegistryController.class); + + @Autowired + private SystemRegistryDBService systemRegistryDBService; + + @Autowired + private ServiceInterfaceNameVerifier interfaceNameVerifier; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return an echo message with the purpose of testing the core service availability", response = String.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = CoreCommonConstants.SWAGGER_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CommonConstants.ECHO_URI) + public String echoService() { + return "Got it!"; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return system by id", response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_BY_ID_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_BY_ID_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(SYSTEMS_BY_ID_URI) + @ResponseBody public SystemResponseDTO getSystemById(@PathVariable(value = PATH_VARIABLE_ID) final long systemId) { + logger.debug("getSystemById started ..."); + + if (systemId < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEM_BY_ID_URI); + } + + return systemRegistryDBService.getSystemById(systemId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return systems by request parameters", response = SystemListResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEMS_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEMS_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(SYSTEMS_URI) + @ResponseBody public SystemListResponseDTO getSystems( + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("getSystems started ..."); + + final int validatedPage; + final int validatedSize; + if (page == null && size == null) { + validatedPage = -1; + validatedSize = -1; + } else { + if (page == null || size == null) { + throw new BadPayloadException(NOT_VALID_PARAMETERS_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_URI); + } else { + validatedPage = page; + validatedSize = size; + } + } + + final Direction validatedDirection = CoreUtilities.calculateDirection(direction, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_URI); + + return systemRegistryDBService.getSystemEntries(validatedPage, validatedSize, validatedDirection, sortField); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return created system ", response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_SYSTEM_HTTP_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = SYSTEMS_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(org.springframework.http.HttpStatus.CREATED) + @ResponseBody public SystemResponseDTO addSystem(@RequestBody final SystemRequestDTO request) { + return callCreateSystem(request); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return updated system ", response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = PUT_SYSTEM_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PutMapping(path = SYSTEMS_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public SystemResponseDTO updateSystem(@PathVariable(value = PATH_VARIABLE_ID) final long systemId, @RequestBody final SystemRequestDTO request) { + return callUpdateSystem(request, systemId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return system updated by fields", response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = PATCH_SYSTEM_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PATCH_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PatchMapping(path = SYSTEMS_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public SystemResponseDTO mergeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long systemId, @RequestBody final SystemRequestDTO request) { + return callMergeSystem(request, systemId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Remove system", tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEM_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = SYSTEMS_BY_ID_URI) + public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New System delete request received with id: {}", id); + + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_BY_ID_URI); + } + + systemRegistryDBService.removeSystemById(id); + logger.debug("System with id: '{}' successfully deleted", id); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested service definitions by the given parameters", response = ServiceDefinitionsListResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SERVICES_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SERVICES_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = SERVICES_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public ServiceDefinitionsListResponseDTO getServiceDefinitions( + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("New Service Definition get request received with page: {} and item_per page: {}", page, size); + + int validatedPage; + int validatedSize; + if (page == null && size == null) { + validatedPage = -1; + validatedSize = -1; + } else { + if (page == null || size == null) { + throw new BadPayloadException("Defined page or size could not be with undefined size or page.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_URI); + } else { + validatedPage = page; + validatedSize = size; + } + } + + final Direction validatedDirection = CoreUtilities.calculateDirection(direction, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_URI); + final ServiceDefinitionsListResponseDTO serviceDefinitionEntries = systemRegistryDBService + .getServiceDefinitionEntriesResponse(validatedPage, validatedSize, validatedDirection, sortField); + logger.debug("Service definition with page: {} and item_per page: {} successfully retrieved", page, size); + + return serviceDefinitionEntries; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested service definition", response = ServiceDefinitionResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SERVICES_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SERVICES_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = SERVICES_BY_ID_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public ServiceDefinitionResponseDTO getServiceDefinitionById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New Service Definition get request received with id: {}", id); + + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_BY_ID_URI); + } + + final ServiceDefinitionResponseDTO serviceDefinitionEntry = systemRegistryDBService.getServiceDefinitionByIdResponse(id); + logger.debug("Service definition with id: '{}' successfully retrieved", id); + + return serviceDefinitionEntry; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return created service definition", response = ServiceDefinitionResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_SERVICES_HTTP_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_SERVICES_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = SERVICES_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) + @ResponseBody public ServiceDefinitionResponseDTO addServiceDefinition(@RequestBody final ServiceDefinitionRequestDTO serviceDefinitionRequestDTO) { + final String serviceDefinition = serviceDefinitionRequestDTO.getServiceDefinition(); + logger.debug("New Service Definition registration request received with definition: {}", serviceDefinition); + + if (Utilities.isEmpty(serviceDefinition)) { + throw new BadPayloadException("Service definition is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_URI); + } + + for (final CoreSystemService coreSystemService : CoreSystemService.values()) { + if (coreSystemService.getServiceDefinition().equalsIgnoreCase(serviceDefinition.trim())) { + throw new BadPayloadException("serviceDefinition '" + serviceDefinition + "' is a reserved arrowhead core system service.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_URI); + } + } + + final ServiceDefinitionResponseDTO serviceDefinitionResponse = systemRegistryDBService.createServiceDefinitionResponse(serviceDefinition); + logger.debug("{} service definition successfully registered.", serviceDefinition); + + return serviceDefinitionResponse; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return updated service definition", response = ServiceDefinitionResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = PUT_SERVICES_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_SERVICES_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PutMapping(path = SERVICES_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public ServiceDefinitionResponseDTO putUpdateServiceDefinition(@PathVariable(value = PATH_VARIABLE_ID) final long id, + @RequestBody final ServiceDefinitionRequestDTO serviceDefinitionRequestDTO) { + final String serviceDefinition = serviceDefinitionRequestDTO.getServiceDefinition(); + logger.debug("New Service Definition update request received with id: {}, definition: {}", id, serviceDefinition); + + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_BY_ID_URI); + } + + if (Utilities.isEmpty(serviceDefinition)) { + throw new BadPayloadException("serviceDefinition is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_BY_ID_URI); + } + + for (final CoreSystemService coreSystemService : CoreSystemService.values()) { + if (coreSystemService.getServiceDefinition().equalsIgnoreCase(serviceDefinition.trim())) { + throw new BadPayloadException("serviceDefinition '" + serviceDefinition + "' is a reserved arrowhead core system service.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_URI); + } + } + + final ServiceDefinitionResponseDTO serviceDefinitionResponse = systemRegistryDBService.updateServiceDefinitionByIdResponse(id, serviceDefinition); + logger.debug("Service definition with id: '{}' successfully updated with definition '{}'.", id, serviceDefinition); + + return serviceDefinitionResponse; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return updated service definition", response = ServiceDefinitionResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = PATCH_SERVICES_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PATCH_SERVICES_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PatchMapping(path = SERVICES_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = "application/json") + @ResponseBody public ServiceDefinitionResponseDTO patchUpdateServiceDefinition(@PathVariable(value = PATH_VARIABLE_ID) final long id, + @RequestBody final ServiceDefinitionRequestDTO serviceDefinitionRequestDTO) { + // Currently ServiceDefinition has only one updatable field, therefore PUT and PATCH do the same + return putUpdateServiceDefinition(id, serviceDefinitionRequestDTO); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Remove service definition", tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SERVICES_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SERVICES_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = SERVICES_BY_ID_URI) + public void removeServiceDefinition(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New Service Definition delete request received with id: {}", id); + + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_BY_ID_URI); + } + + systemRegistryDBService.removeServiceDefinitionById(id); + logger.debug("Service definition with id: '{}' successfully deleted", id); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested service registry entries by the given parameters", response = ServiceRegistryListResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SERVICE_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SERVICE_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CoreCommonConstants.MGMT_URI) + @ResponseBody public ServiceRegistryListResponseDTO getServiceRegistryEntries( + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("New Service Registry get request received with page: {} and item_per page: {}", page, size); + + int validatedPage; + int validatedSize; + if (page == null && size == null) { + validatedPage = -1; + validatedSize = -1; + } else { + if (page == null || size == null) { + throw new BadPayloadException("Defined page or size could not be with undefined size or page.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + + CoreCommonConstants.MGMT_URI); + } else { + validatedPage = page; + validatedSize = size; + } + } + + final Direction validatedDirection = CoreUtilities.calculateDirection(direction, CommonConstants.SERVICE_REGISTRY_URI + CoreCommonConstants.MGMT_URI); + final ServiceRegistryListResponseDTO serviceRegistryEntriesResponse = systemRegistryDBService + .getServiceRegistryEntriesResponse(validatedPage, validatedSize, validatedDirection, sortField); + logger.debug("Service Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); + + return serviceRegistryEntriesResponse; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested service registry entry", response = ServiceRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SERVICE_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SERVICE_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = SERVICE_REGISTRY_MGMT_BY_ID_URI) + @ResponseBody public ServiceRegistryResponseDTO getServiceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New Service Registry get request received with id: {}", id); + + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICE_REGISTRY_MGMT_BY_ID_URI); + } + final ServiceRegistryResponseDTO serviceRegistryEntryByIdResponse = systemRegistryDBService.getServiceRegistryEntryByIdResponse(id); + logger.debug("Service Registry entry with id: {} successfully retrieved", id); + + return serviceRegistryEntryByIdResponse; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested service registry entries by service definition based on the given parameters", response = ServiceRegistryListResponseDTO.class, + tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SERVICE_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SERVICE_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = SERVICE_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI) + @ResponseBody public ServiceRegistryListResponseDTO getServiceRegistryEntriesByServiceDefinition( + @PathVariable(value = PATH_VARIABLE_SERVICE_DEFINITION) final String serviceDefinition, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("New Service Registry get by Service Definition request received with page: {} and item_per page: {}", page, size); + + if (Utilities.isEmpty(serviceDefinition)) { + throw new BadPayloadException("Service definition cannot be empty.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICE_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI); + } + + int validatedPage; + int validatedSize; + if (page == null && size == null) { + validatedPage = -1; + validatedSize = -1; + } else { + if (page == null || size == null) { + throw new BadPayloadException("Defined page or size could not be with undefined size or page.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + + SERVICE_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI); + } else { + validatedPage = page; + validatedSize = size; + } + } + + final Direction validatedDirection = CoreUtilities.calculateDirection(direction, CommonConstants.SERVICE_REGISTRY_URI + SERVICE_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI); + final ServiceRegistryListResponseDTO serviceRegistryEntries = systemRegistryDBService + .getServiceRegistryEntriesByServiceDefinitionResponse(serviceDefinition, validatedPage, validatedSize, + validatedDirection, sortField); + logger.debug("Service Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); + + return serviceRegistryEntries; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return all service registry entries grouped for frontend usage", response = ServiceRegistryGroupedResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SERVICE_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SERVICE_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = SERVICE_REGISTRY_MGMT_GROUPED_URI) + @ResponseBody public ServiceRegistryGroupedResponseDTO getServiceRegistryGroupedData() { + logger.debug("New get request for grouped service registry data"); + + final ServiceRegistryGroupedResponseDTO serviceRegistryGroupedResponseDTO = systemRegistryDBService.getServiceRegistryDataForServiceRegistryGroupedResponse(); + logger.debug("Grouped service registry data successfully retrieved"); + + return serviceRegistryGroupedResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Remove the specified service registry entry", tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SERVICE_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SERVICE_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = SERVICE_REGISTRY_MGMT_BY_ID_URI) + public void removeServiceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New Service Registry delete request received with id: {}", id); + + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICE_REGISTRY_MGMT_BY_ID_URI); + } + + systemRegistryDBService.removeServiceRegistryEntryById(id); + logger.debug("Service Registry with id: '{}' successfully deleted", id); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SERVICE_REGISTRY_REGISTER_DESCRIPTION, response = ServiceRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = SERVICE_REGISTRY_REGISTER_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SERVICE_REGISTRY_REGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) + @PostMapping(path = CommonConstants.OP_SERVICE_REGISTRY_REGISTER_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public ServiceRegistryResponseDTO registerService(@RequestBody final ServiceRegistryRequestDTO request) { + logger.debug("New service registration request received"); + checkServiceRegistryRequest(request, false); + + final ServiceRegistryResponseDTO response = systemRegistryDBService.registerServiceResponse(request); + logger.debug("{} successfully registers its service {}", request.getProviderSystem().getSystemName(), request.getServiceDefinition()); + + return response; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SERVICE_REGISTRY_REGISTER_DESCRIPTION, response = ServiceRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = SERVICE_REGISTRY_REGISTER_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SERVICE_REGISTRY_REGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) + @PostMapping(path = CoreCommonConstants.MGMT_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody ServiceRegistryResponseDTO addServiceRegistry(@RequestBody final ServiceRegistryRequestDTO request) { + logger.debug("New service registration request received"); + checkServiceRegistryRequest(request, CoreCommonConstants.MGMT_URI, true); + + final ServiceRegistryResponseDTO response = systemRegistryDBService.registerServiceResponse(request); + logger.debug("{}'s service {} is successfully registered", request.getProviderSystem().getSystemName(), request.getServiceDefinition()); + + return response; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SERVICE_REGISTRY_UPDATE_DESCRIPTION, response = ServiceRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SERVICE_REGISTRY_UPDATE_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SERVICE_REGISTRY_UPDATE_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PutMapping(path = SERVICE_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody ServiceRegistryResponseDTO updateServiceRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final ServiceRegistryRequestDTO request) { + logger.debug("New service registry update request received"); + checkServiceRegistryUpdateRequest(id, request, CoreCommonConstants.MGMT_URI); + + final ServiceRegistryResponseDTO response = systemRegistryDBService.updateServiceByIdResponse(id, request); + logger.debug("Service Registry entry {} is successfully updated with system {} and service {}", id, request.getProviderSystem().getSystemName(), request.getServiceDefinition()); + + return response; + } + + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SERVICE_REGISTRY_MERGE_DESCRIPTION, response = ServiceRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SERVICE_REGISTRY_MERGE_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SERVICE_REGISTRY_MERGE_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PatchMapping(path = SERVICE_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody ServiceRegistryResponseDTO mergeServiceRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final ServiceRegistryRequestDTO request) { + logger.debug("New service registry merge request received"); + checkServiceRegistryMergeRequest(id, request, CoreCommonConstants.MGMT_URI); + + final ServiceRegistryResponseDTO response = systemRegistryDBService.mergeServiceByIdResponse(id, request); + logger.debug("Service Registry entry {} is successfully merged witch system {} and service {}", id, response.getProvider().getSystemName(), request.getServiceDefinition()); + + return response; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SERVICE_REGISTRY_UNREGISTER_DESCRIPTION, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SERVICE_REGISTRY_UNREGISTER_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SERVICE_REGISTRY_UNREGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_URI) + public void unregisterService(@RequestParam(CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_SERVICE_DEFINITION) final String serviceDefinition, + @RequestParam(CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_SYSTEM_NAME) final String providerName, + @RequestParam(CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_ADDRESS) final String providerAddress, + @RequestParam(CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_PORT) final int providerPort) { + logger.debug("Service removal request received"); + checkUnregisterServiceParameters(serviceDefinition, providerName, providerAddress, providerPort); + + systemRegistryDBService.removeServiceRegistry(serviceDefinition, providerName, providerAddress, providerPort); + logger.debug("{} successfully removed its service {}", providerName, serviceDefinition); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SERVICE_REGISTRY_QUERY_DESCRIPTION, response = ServiceQueryResultDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SERVICE_REGISTRY_QUERY_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SERVICE_REGISTRY_QUERY_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = CommonConstants.OP_SERVICE_REGISTRY_QUERY_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public ServiceQueryResultDTO queryRegistry(@RequestBody final ServiceQueryFormDTO form) { + logger.debug("Service query request received"); + + if (Utilities.isEmpty(form.getServiceDefinitionRequirement())) { + throw new BadPayloadException("Service definition requirement is null or blank" , HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + + CommonConstants.OP_SERVICE_REGISTRY_QUERY_URI); + } + + final ServiceQueryResultDTO result = systemRegistryDBService.queryRegistry(form); + logger.debug("Return {} providers for service {}", result.getServiceQueryData().size(), form.getServiceDefinitionRequirement()); + + return result; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_DESCRIPTION, response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_PRIVATE }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CoreCommonConstants.OP_SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public SystemResponseDTO queryRegistryBySystemId(@PathVariable(value = PATH_VARIABLE_ID) final long systemId) { + logger.debug("Service query by system id request received"); + + if (systemId < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + + CoreCommonConstants.OP_SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_URI); + } + + final SystemResponseDTO result = systemRegistryDBService.getSystemById(systemId); + + logger.debug("Return system by id: {}", systemId); + return result; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_DESCRIPTION, response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_PRIVATE }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = CoreCommonConstants.OP_SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public SystemResponseDTO queryRegistryBySystemDTO(@RequestBody final SystemRequestDTO request) { + logger.debug("Service query by systemRequestDTO request received"); + + checkSystemRequest(request, CommonConstants.SERVICE_REGISTRY_URI + CoreCommonConstants.OP_SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_URI, false); + + final String systemName = request.getSystemName(); + final String address = request.getAddress(); + final int port = request.getPort(); + + final SystemResponseDTO result = systemRegistryDBService.getSystemByNameAndAddressAndPortResponse(systemName, address, port); + + logger.debug("Return system by name: {}, address: {}, port: {}", systemName, address, port); + return result; + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private SystemResponseDTO callCreateSystem(final SystemRequestDTO request) { + logger.debug("callCreateSystem started..."); + + checkSystemRequest(request, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_URI, true); + + final String systemName = request.getSystemName(); + final String address = request.getAddress(); + final int port = request.getPort(); + final String authenticationInfo = request.getAuthenticationInfo(); + + return systemRegistryDBService.createSystemResponse(systemName, address, port, authenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private SystemResponseDTO callUpdateSystem(final SystemRequestDTO request, final long systemId) { + logger.debug("callUpdateSystem started..."); + + checkSystemPutRequest(request, systemId); + + final String validatedSystemName = request.getSystemName().toLowerCase(); + final String validatedAddress = request.getAddress().toLowerCase(); + final int validatedPort = request.getPort(); + final String validatedAuthenticationInfo = request.getAuthenticationInfo(); + + return systemRegistryDBService.updateSystemResponse(systemId, validatedSystemName, validatedAddress, validatedPort, validatedAuthenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private SystemResponseDTO callMergeSystem(final SystemRequestDTO request, final long systemId) { + logger.debug("callMergeSystem started..."); + + checkSystemMergeRequest(request, systemId); + + final String validatedSystemName = request.getSystemName() != null ? request.getSystemName().toLowerCase() : ""; + final String validatedAddress = request.getAddress() != null ? request.getAddress().toLowerCase() : ""; + final Integer validatedPort = request.getPort(); + final String validatedAuthenticationInfo = request.getAuthenticationInfo(); + + return systemRegistryDBService.mergeSystemResponse(systemId, validatedSystemName, validatedAddress, validatedPort, validatedAuthenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private void checkSystemMergeRequest(final SystemRequestDTO request, final long systemId) { + logger.debug("checkSystemPatchRequest started..."); + + if (systemId <= 0) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_BY_ID_URI); + } + + boolean needChange = false; + if (!Utilities.isEmpty(request.getAddress())) { + needChange = true; + } + + + if (!Utilities.isEmpty(request.getSystemName())) { + needChange = true; + for (final CoreSystem coreSysteam : CoreSystem.values()) { + if (coreSysteam.name().equalsIgnoreCase(request.getSystemName().trim())) { + throw new BadPayloadException("System name '" + request.getSystemName() + "' is a reserved arrowhead core system name.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_BY_ID_URI); + } + } + } + + if (request.getPort() != null) { + final int validatedPort = request.getPort(); + if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX +".", HttpStatus.SC_BAD_REQUEST, + CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_BY_ID_URI); + } + + needChange = true; + } + + if (request.getAuthenticationInfo() != null) { + needChange = true; + } + + if (!needChange) { + throw new BadPayloadException("Patch request is empty." , HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_BY_ID_URI); + } + } + + //------------------------------------------------------------------------------------------------- + private void checkSystemPutRequest(final SystemRequestDTO request, final long systemId) { + logger.debug("checkSystemPutRequest started..."); + + if (systemId <= 0) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_BY_ID_URI); + } + + checkSystemRequest(request, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_BY_ID_URI, true); + } + + //------------------------------------------------------------------------------------------------- + private void checkSystemRequest(final SystemRequestDTO request, final String origin, final boolean checkReservedCoreSystemNames) { + logger.debug("checkSystemRequest started..."); + + if (request == null) { + throw new BadPayloadException("System is null.", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(request.getSystemName())) { + throw new BadPayloadException(SYSTEM_NAME_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (checkReservedCoreSystemNames) { + for (final CoreSystem coreSysteam : CoreSystem.values()) { + if (coreSysteam.name().equalsIgnoreCase(request.getSystemName().trim())) { + throw new BadPayloadException("System name '" + request.getSystemName() + "' is a reserved arrowhead core system name.", HttpStatus.SC_BAD_REQUEST, origin); + } + } + } + + if (Utilities.isEmpty(request.getAddress())) { + throw new BadPayloadException(SYSTEM_ADDRESS_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (request.getPort() == null) { + throw new BadPayloadException(SYSTEM_PORT_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + final int validatedPort = request.getPort(); + if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + private void checkServiceRegistryRequest(final ServiceRegistryRequestDTO request, final boolean checkReservedCoreSystemNames) { + logger.debug("checkServiceRegistryRequest started..."); + + final String origin = CommonConstants.SERVICE_REGISTRY_URI + CommonConstants.OP_SERVICE_REGISTRY_REGISTER_URI; + + checkServiceRegistryRequest(request, origin, checkReservedCoreSystemNames); + } + + //------------------------------------------------------------------------------------------------- + private void checkServiceRegistryRequest(final ServiceRegistryRequestDTO request, final String origin, final boolean checkReservedCoreSystemNames) { + logger.debug("checkServiceRegistryRequest started..."); + + if (Utilities.isEmpty(request.getServiceDefinition())) { + throw new BadPayloadException("Service definition is null or blank", HttpStatus.SC_BAD_REQUEST, origin); + } + + checkSystemRequest(request.getProviderSystem(), origin, checkReservedCoreSystemNames); + + if (!Utilities.isEmpty(request.getEndOfValidity())) { + try { + Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()); + } catch (final DateTimeParseException ex) { + throw new BadPayloadException("End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", + HttpStatus.SC_BAD_REQUEST, origin); + } + } + + ServiceSecurityType securityType = null; + if (request.getSecure() != null) { + for (final ServiceSecurityType type : ServiceSecurityType.values()) { + if (type.name().equalsIgnoreCase(request.getSecure())) { + securityType = type; + break; + } + } + + if (securityType == null) { + throw new BadPayloadException("Security type is not valid.", HttpStatus.SC_BAD_REQUEST, origin); + } + } else { + securityType = ServiceSecurityType.NOT_SECURE; + } + + if (securityType != ServiceSecurityType.NOT_SECURE && request.getProviderSystem().getAuthenticationInfo() == null) { + throw new BadPayloadException("Security type is in conflict with the availability of the authentication info.", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (request.getInterfaces() == null || request.getInterfaces().isEmpty()) { + throw new BadPayloadException("Interfaces list is null or empty.", HttpStatus.SC_BAD_REQUEST, origin); + } + + for (final String intf : request.getInterfaces()) { + if (!interfaceNameVerifier.isValid(intf)) { + throw new BadPayloadException("Specified interface name is not valid: " + intf, HttpStatus.SC_BAD_REQUEST, origin); + } + } + } + + //------------------------------------------------------------------------------------------------- + private void checkUnregisterServiceParameters(final String serviceDefinition, final String providerName, final String providerAddress, final int providerPort) { + // parameters can't be null, but can be empty + logger.debug("checkUnregisterServiceParameters started..."); + + final String origin = CommonConstants.SERVICE_REGISTRY_URI + CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_URI; + if (Utilities.isEmpty(serviceDefinition)) { + throw new BadPayloadException("Service definition is blank", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(providerName)) { + throw new BadPayloadException("Name of the provider system is blank", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(providerAddress)) { + throw new BadPayloadException("Address of the provider system is blank", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (providerPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || providerPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + private void checkServiceRegistryUpdateRequest(final long id, final ServiceRegistryRequestDTO request, final String origin) { + logger.debug("checkServiceRegistryUpdateRequest started..."); + + if (id <= 0) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, origin); + } + + checkServiceRegistryRequest(request, origin, true); + + } + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings("squid:S3776") + private void checkServiceRegistryMergeRequest(final long id, final ServiceRegistryRequestDTO request, final String origin) { + logger.debug("checkServiceRegistryMergeRequest started..."); + + if (id <= 0) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, origin); + } + + boolean needChange = false; + if (request.getProviderSystem() != null && !Utilities.isEmpty(request.getProviderSystem().getAddress())) { + needChange = true; + } + + if (request.getProviderSystem() != null && !Utilities.isEmpty(request.getProviderSystem().getSystemName())) { + needChange = true; + } + + if (request.getProviderSystem() != null && request.getProviderSystem().getPort() != null) { + final int validatedPort = request.getProviderSystem().getPort(); + if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX +".", HttpStatus.SC_BAD_REQUEST, + origin); + } + + needChange = true; + } + + if (request.getProviderSystem() != null && request.getProviderSystem().getAuthenticationInfo() != null) { + needChange = true; + } + + if (request.getEndOfValidity() != null) { + needChange = true; + } + + if (request.getMetadata() != null) { + needChange = true; + } + + if (request.getInterfaces() != null) { + needChange = true; + } + + if (request.getSecure() != null) { + needChange = true; + } + + if (request.getServiceDefinition() != null) { + needChange = true; + } + + if (request.getServiceUri() != null) { + needChange = true; + } + + if (request.getVersion() != null) { + needChange = true; + } + + if (!needChange) { + throw new BadPayloadException("Patch request is empty." , HttpStatus.SC_BAD_REQUEST, origin); + } + } +} \ No newline at end of file diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java new file mode 100644 index 000000000..62f7b0c69 --- /dev/null +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java @@ -0,0 +1,30 @@ +package eu.arrowhead.core.systemregistry.database.service; + +import eu.arrowhead.common.SSLProperties; +import eu.arrowhead.common.database.repository.*; +import eu.arrowhead.common.intf.ServiceInterfaceNameVerifier; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class SystemRegistryDBService +{ + + //================================================================================================= + // members + + private final Logger logger = LogManager.getLogger(SystemRegistryDBService.class); + + + @Autowired + private SystemRegistryRepository serviceRegistryRepository; + + @Autowired + private SystemRepository systemRepository; + + @Autowired + private SSLProperties sslProperties; + +} From d95ec9fb484746a741af0fd14fc6e86cfeeecb2d Mon Sep 17 00:00:00 2001 From: mzsilak Date: Wed, 15 Jan 2020 17:08:37 +0100 Subject: [PATCH 006/301] WIP on SystemRegistryController --- .../ChoreographerController.java | 2 +- .../eu/arrowhead/common/CoreUtilities.java | 13 +- .../common/dto/internal/DTOConverter.java | 84 +- .../dto/internal/DeviceListResponseDTO.java | 43 + .../common/dto/shared/DeviceResponseDTO.java | 84 ++ .../eventhandler/EventHandlerController.java | 834 +++++++++--------- .../core/gatekeeper/GatekeeperController.java | 4 +- .../OrchestratorStoreController.java | 6 +- .../SystemRegistryController.java | 102 ++- .../service/SystemRegistryDBService.java | 411 ++++++++- 10 files changed, 1057 insertions(+), 526 deletions(-) create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/internal/DeviceListResponseDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceResponseDTO.java diff --git a/choreographer/src/main/java/eu/arrowhead/core/choreographer/ChoreographerController.java b/choreographer/src/main/java/eu/arrowhead/core/choreographer/ChoreographerController.java index 0bc785e7b..6882f14e3 100644 --- a/choreographer/src/main/java/eu/arrowhead/core/choreographer/ChoreographerController.java +++ b/choreographer/src/main/java/eu/arrowhead/core/choreographer/ChoreographerController.java @@ -162,7 +162,7 @@ public void removeActionPlanById(@PathVariable(value = PATH_VARIABLE_ID) final l final ValidatedPageParams validatedPageParams = CoreUtilities.validatePageParameters(page, size, direction, sortField); final List choreographerActionPlanEntriesResponse = choreographerDBService.getChoreographerActionPlanEntriesResponse(validatedPageParams.getValidatedPage(), validatedPageParams.getValidatedSize(), - validatedPageParams.getValidatedDirecion(), + validatedPageParams.getValidatedDirection(), sortField); logger.debug("ChoreographerActionPlans with page: {} and item_per page: {} retrieved successfully", page, size); diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreUtilities.java b/core-common/src/main/java/eu/arrowhead/common/CoreUtilities.java index fd20c8d76..32b355c42 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreUtilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreUtilities.java @@ -73,24 +73,25 @@ public static class ValidatedPageParams { //================================================================================================= // members - + private static final int MAX_BATCH_SIZE = 200; + private final int validatedPage; private final int validatedSize; - private final Direction validatedDirecion; + private final Direction validatedDirection; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ValidatedPageParams(final int validatedPage, final int validatedSize, final Direction validatedDirection) { - this.validatedPage = validatedPage; - this.validatedSize = validatedSize; - this.validatedDirecion = validatedDirection; + this.validatedPage = Math.max(validatedPage, 0); + this.validatedSize = validatedSize < 1 ? MAX_BATCH_SIZE : validatedSize; + this.validatedDirection = validatedDirection; } //------------------------------------------------------------------------------------------------- public int getValidatedPage() { return validatedPage; } public int getValidatedSize() { return validatedSize; } - public Direction getValidatedDirecion() { return validatedDirecion; } + public Direction getValidatedDirection() { return validatedDirection; } } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java index d2cc2b0cf..03c595a49 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java @@ -9,58 +9,38 @@ import java.util.Map.Entry; import java.util.Set; +import eu.arrowhead.common.database.entity.*; import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.dto.shared.*; import org.springframework.data.domain.Page; import org.springframework.util.Assert; import eu.arrowhead.common.Utilities; -import eu.arrowhead.common.database.entity.AuthorizationInterCloud; -import eu.arrowhead.common.database.entity.AuthorizationInterCloudInterfaceConnection; -import eu.arrowhead.common.database.entity.AuthorizationIntraCloud; -import eu.arrowhead.common.database.entity.AuthorizationIntraCloudInterfaceConnection; -import eu.arrowhead.common.database.entity.ChoreographerAction; -import eu.arrowhead.common.database.entity.ChoreographerActionActionStepConnection; -import eu.arrowhead.common.database.entity.ChoreographerActionPlan; -import eu.arrowhead.common.database.entity.ChoreographerActionPlanActionConnection; -import eu.arrowhead.common.database.entity.ChoreographerActionStep; -import eu.arrowhead.common.database.entity.ChoreographerActionStepServiceDefinitionConnection; -import eu.arrowhead.common.database.entity.ChoreographerNextActionStep; -import eu.arrowhead.common.database.entity.Cloud; -import eu.arrowhead.common.database.entity.CloudGatekeeperRelay; -import eu.arrowhead.common.database.entity.CloudGatewayRelay; -import eu.arrowhead.common.database.entity.EventType; -import eu.arrowhead.common.database.entity.ForeignSystem; -import eu.arrowhead.common.database.entity.OrchestratorStore; -import eu.arrowhead.common.database.entity.Relay; -import eu.arrowhead.common.database.entity.ServiceDefinition; -import eu.arrowhead.common.database.entity.ServiceInterface; -import eu.arrowhead.common.database.entity.ServiceRegistry; -import eu.arrowhead.common.database.entity.ServiceRegistryInterfaceConnection; -import eu.arrowhead.common.database.entity.Subscription; -import eu.arrowhead.common.database.entity.SubscriptionPublisherConnection; -import eu.arrowhead.common.dto.shared.ChoreographerActionPlanResponseDTO; -import eu.arrowhead.common.dto.shared.ChoreographerActionResponseDTO; -import eu.arrowhead.common.dto.shared.ChoreographerActionStepResponseDTO; -import eu.arrowhead.common.dto.shared.ChoreographerNextActionStepResponseDTO; -import eu.arrowhead.common.dto.shared.CloudRequestDTO; -import eu.arrowhead.common.dto.shared.EventDTO; -import eu.arrowhead.common.dto.shared.EventPublishRequestDTO; -import eu.arrowhead.common.dto.shared.EventTypeResponseDTO; -import eu.arrowhead.common.dto.shared.PreferredProviderDataDTO; -import eu.arrowhead.common.dto.shared.ServiceDefinitionResponseDTO; -import eu.arrowhead.common.dto.shared.ServiceInterfaceResponseDTO; -import eu.arrowhead.common.dto.shared.ServiceQueryResultDTO; -import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; -import eu.arrowhead.common.dto.shared.SubscriptionListResponseDTO; -import eu.arrowhead.common.dto.shared.SubscriptionResponseDTO; -import eu.arrowhead.common.dto.shared.SystemRequestDTO; -import eu.arrowhead.common.dto.shared.SystemResponseDTO; public class DTOConverter { //================================================================================================= // methods - + + //------------------------------------------------------------------------------------------------- + public static DeviceResponseDTO convertDeviceToDeviceResponseDTO(final Device device) { + Assert.notNull(device, "Device is null"); + return new DeviceResponseDTO(device.getId(), device.getDeviceName(), device.getAddress(), device.getMacAddress(), device.getAuthenticationInfo(), + Utilities.convertZonedDateTimeToUTCString(device.getCreatedAt()), Utilities.convertZonedDateTimeToUTCString(device.getUpdatedAt())); + } + + //------------------------------------------------------------------------------------------------- + public static DeviceListResponseDTO convertDeviceEntryListToDeviceListResponseDTO(final Page deviceEntryList) { + Assert.notNull(deviceEntryList, "deviceEntryList is null"); + + final long count = deviceEntryList.getTotalElements(); + final DeviceListResponseDTO deviceListResponseDTO = new DeviceListResponseDTO(); + deviceListResponseDTO.setCount(count); + deviceListResponseDTO.setData(deviceEntryListToDeviceResponseDTOList(deviceEntryList.getContent())); + + return deviceListResponseDTO; + } + //------------------------------------------------------------------------------------------------- public static SystemResponseDTO convertSystemToSystemResponseDTO(final System system) { Assert.notNull(system, "System is null"); @@ -658,18 +638,29 @@ public static ChoreographerActionPlanResponseDTO convertChoreographerActionPlanT private DTOConverter() { throw new UnsupportedOperationException(); } - + //------------------------------------------------------------------------------------------------- private static List systemEntryListToSystemResponseDTOList(final List systemList) { final List systemResponseDTOs = new ArrayList<>(systemList.size()); - + for (final System system : systemList) { systemResponseDTOs.add(convertSystemToSystemResponseDTO(system)); } - + return systemResponseDTOs; } - + + //------------------------------------------------------------------------------------------------- + private static List deviceEntryListToDeviceResponseDTOList(final List deviceList) { + final List deviceResponseDTOs = new ArrayList<>(deviceList.size()); + + for (final Device device : deviceList) { + deviceResponseDTOs.add(convertDeviceToDeviceResponseDTO(device)); + } + + return deviceResponseDTOs; + } + //------------------------------------------------------------------------------------------------- private static List collectInterfacesFromServiceRegistry(final Set interfaceConnections) { final List result = new ArrayList<>(interfaceConnections.size()); @@ -754,4 +745,5 @@ private static Set collectAuthorizedPublishersFromSubscriptio return result; } + } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DeviceListResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DeviceListResponseDTO.java new file mode 100644 index 000000000..30891bcd3 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DeviceListResponseDTO.java @@ -0,0 +1,43 @@ +package eu.arrowhead.common.dto.internal; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import eu.arrowhead.common.dto.shared.DeviceResponseDTO; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +@JsonInclude(Include.NON_NULL) +public class DeviceListResponseDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = -1661484009332215820L; + + private List data = new ArrayList<>(); + private long count; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public DeviceListResponseDTO() {} + + //------------------------------------------------------------------------------------------------- + public DeviceListResponseDTO(final List deviceResponseDTOList, final int totalNumberOfSystems) { + super(); + this.data = deviceResponseDTOList; + this.count = totalNumberOfSystems; + } + + //------------------------------------------------------------------------------------------------- + public List getData() { return data; } + public long getCount() { return count; } + + //------------------------------------------------------------------------------------------------- + public void setData(final List data) { this.data = data; } + public void setCount(final long count) { this.count = count; } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceResponseDTO.java new file mode 100644 index 000000000..4c6f94df9 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceResponseDTO.java @@ -0,0 +1,84 @@ +package eu.arrowhead.common.dto.shared; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.Serializable; +import java.util.Objects; + +@JsonInclude(Include.NON_NULL) +public class DeviceResponseDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = 3919207845374510215L; + + private long id; + private String deviceName; + private String address; + private String macAddress; + private String authenticationInfo; + private String createdAt; + private String updatedAt; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public DeviceResponseDTO() {} + + //------------------------------------------------------------------------------------------------- + public DeviceResponseDTO(final long deviceId, final String deviceName, final String address, final String macAddress, final String authenticationInfo, final String createdAt, final String upDatedAt) { + this.id = deviceId; + this.deviceName = deviceName; + this.address = address; + this.macAddress = macAddress; + this.authenticationInfo = authenticationInfo; + this.createdAt = createdAt; + this.updatedAt = upDatedAt; + } + + //------------------------------------------------------------------------------------------------- + public long getId() { return id; } + public String getDeviceName() { return deviceName; } + public String getAddress() { return address; } + public String getMacAddress() { return macAddress; } + public String getAuthenticationInfo() { return authenticationInfo; } + public String getUpdatedAt() { return updatedAt; } + public String getCreatedAt() { return createdAt; } + + //------------------------------------------------------------------------------------------------- + public void setId(final long sytemId) { this.id = sytemId; } + public void setDeviceName(final String deviceName) { this.deviceName = deviceName; } + public void setAddress(final String address) { this.address = address; } + public void setMacAddress(final String macAddress) { this.macAddress = macAddress; } + public void setAuthenticationInfo(final String authenticationInfo) { this.authenticationInfo = authenticationInfo; } + public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } + public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } + + //------------------------------------------------------------------------------------------------- + @Override + public int hashCode() { + return Objects.hash(address, macAddress, deviceName); + } + + //------------------------------------------------------------------------------------------------- + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final DeviceResponseDTO other = (DeviceResponseDTO) obj; + + return Objects.equals(address, other.address) && + Objects.equals(macAddress, other.macAddress) && + Objects.equals(deviceName, other.deviceName); + } +} \ No newline at end of file diff --git a/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/EventHandlerController.java b/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/EventHandlerController.java index f02d43c18..1fe8084a0 100644 --- a/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/EventHandlerController.java +++ b/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/EventHandlerController.java @@ -1,418 +1,418 @@ -package eu.arrowhead.core.eventhandler; - -import java.time.ZonedDateTime; -import java.time.format.DateTimeParseException; - -import org.apache.http.HttpStatus; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.CrossOrigin; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; - -import eu.arrowhead.common.CommonConstants; -import eu.arrowhead.common.CoreCommonConstants; -import eu.arrowhead.common.CoreDefaults; -import eu.arrowhead.common.CoreUtilities; -import eu.arrowhead.common.CoreUtilities.ValidatedPageParams; -import eu.arrowhead.common.Defaults; -import eu.arrowhead.common.Utilities; -import eu.arrowhead.common.dto.shared.EventPublishRequestDTO; -import eu.arrowhead.common.dto.shared.SubscriptionListResponseDTO; -import eu.arrowhead.common.dto.shared.SubscriptionRequestDTO; -import eu.arrowhead.common.dto.shared.SubscriptionResponseDTO; -import eu.arrowhead.common.dto.shared.SystemRequestDTO; -import eu.arrowhead.common.exception.BadPayloadException; -import eu.arrowhead.core.eventhandler.database.service.EventHandlerDBService; -import eu.arrowhead.core.eventhandler.service.EventHandlerService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; - -@Api(tags = { CoreCommonConstants.SWAGGER_TAG_ALL }) -@CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, - allowedHeaders = { HttpHeaders.ORIGIN, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT, HttpHeaders.AUTHORIZATION } -) -@RestController -@RequestMapping(CommonConstants.EVENT_HANDLER_URI) -public class EventHandlerController { - - //================================================================================================= - // members - - private static final String PATH_VARIABLE_ID = "id"; - - private static final String EVENT_HANDLER_MGMT_URI = CoreCommonConstants.MGMT_URI + "/subscriptions"; - private static final String EVENTHANLER_BY_ID_MGMT_URI = EVENT_HANDLER_MGMT_URI + "/{" + PATH_VARIABLE_ID + "}"; - - private static final String GET_EVENT_HANDLER_MGMT_DESCRIPTION = "Return requested Subscription entries by the given parameters"; - private static final String GET_EVENT_HANDLER_MGMT_HTTP_200_MESSAGE = "Subscription entries returned"; - private static final String GET_EVENT_HANDLER_MGMT_HTTP_400_MESSAGE = "Could not retrieve Subscription entries"; - - private static final String GET_EVENT_HANDLER_BY_ID_MGMT_DESCRIPTION = "Return requested Subscription entry by the given id"; - private static final String GET_EVENT_HANDLER_BY_ID_MGMT_HTTP_200_MESSAGE = "Subscription entriy returned"; - private static final String GET_EVENT_HANDLER_BY_ID_MGMT_HTTP_400_MESSAGE = "Could not retrieve Subscription entry"; - - private static final String DELETE_EVENT_HANDLER_MGMT_DESCRIPTION = "Delete requested Subscription entry by the given id"; - private static final String DELETE_EVENT_HANDLER_MGMT_HTTP_200_MESSAGE = "Subscription entriy deleted"; - private static final String DELETE_EVENT_HANDLER_MGMT_HTTP_400_MESSAGE = "Could not delete Subscription entry"; - - private static final String PUT_EVENT_HANDLER_MGMT_DESCRIPTION = "Update requested Subscription entry by the given id and parameters"; - private static final String PUT_EVENT_HANDLER_MGMT_HTTP_200_MESSAGE = "Updated Subscription entry returned"; - private static final String PUT_EVENT_HANDLER_MGMT_HTTP_400_MESSAGE = "Could not update Subscription entry"; - - private static final String POST_EVENT_HANDLER_SUBSCRIPTION_DESCRIPTION = "Subscription to the events specified in requested Subscription "; - private static final String POST_EVENT_HANDLER_SUBSCRIPTION_HTTP_200_MESSAGE = "Successful subscription."; - private static final String POST_EVENT_HANDLER_SUBSCRIPTION_HTTP_400_MESSAGE = "Unsuccessful subscription."; - - private static final String DELETE_EVENT_HANDLER_SUBSCRIPTION_DESCRIPTION = "Unsubscription from the events specified in requested Subscription "; - private static final String DELETE_EVENT_HANDLER_SUBSCRIPTION_HTTP_200_MESSAGE = "Successful unsubscription."; - private static final String DELETE_EVENT_HANDLER_SUBSCRIPTION_HTTP_400_MESSAGE = "Unsuccessful unsubscription."; - - private static final String POST_EVENT_HANDLER_PUBLISH_DESCRIPTION = "Publish event"; - private static final String POST_EVENT_HANDLER_PUBLISH_HTTP_200_MESSAGE = "Publish event success"; - private static final String POST_EVENT_HANDLER_PUBLISH_HTTP_400_MESSAGE = "Publish event not success"; - - private static final String POST_EVENT_HANDLER_PUBLISH_AUTH_UPDATE_DESCRIPTION = "Publish authorization change event "; - private static final String POST_EVENT_HANDLER_PUBLISH_AUTH_UPDATE_HTTP_200_MESSAGE = "Publish authorization change event success"; - private static final String POST_EVENT_HANDLER_PUBLISH_AUTH_UPDATE_HTTP_400_MESSAGE = "Publish authorization change event not success"; - - private static final String NULL_PARAMETER_ERROR_MESSAGE = " is null."; - private static final String NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE = " is null or blank."; - private static final String ID_NOT_VALID_ERROR_MESSAGE = " Id must be greater than 0. "; - private static final String WRONG_FORMAT_ERROR_MESSAGE = " is in wrong format. "; - private static final String IS_AFTER_TOLERATED_DIFF_ERROR_MESSAGE = " is further in the future than the tolerated time difference"; - private static final String IS_BEFORE_TOLERATED_DIFF_ERROR_MESSAGE = " is further in the past than the tolerated time difference"; - - @Value(CoreCommonConstants.$TIME_STAMP_TOLERANCE_SECONDS_WD) - private long timeStampTolerance; - - private final Logger logger = LogManager.getLogger(EventHandlerController.class); - - @Autowired - EventHandlerService eventHandlerService; - - @Autowired - EventHandlerDBService eventHandlerDBService; - - //================================================================================================= - // methods - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return an echo message with the purpose of testing the core service availability", response = String.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) - @ApiResponses (value = { - @ApiResponse(code = HttpStatus.SC_OK, message = CoreCommonConstants.SWAGGER_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = CommonConstants.ECHO_URI) - public String echoService() { - return "Got it!"; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = GET_EVENT_HANDLER_MGMT_DESCRIPTION, response = SubscriptionListResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_EVENT_HANDLER_MGMT_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_EVENT_HANDLER_MGMT_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = EVENT_HANDLER_MGMT_URI, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public SubscriptionListResponseDTO getSubscriptions( - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("New getSubscriptions get request recieved with page: {} and item_per page: {}", page, size); - - final ValidatedPageParams validParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.EVENT_HANDLER_URI + EVENT_HANDLER_MGMT_URI); - final SubscriptionListResponseDTO subscriptionsResponse = eventHandlerDBService.getSubscriptionsResponse(validParameters.getValidatedPage(), validParameters.getValidatedSize(), - validParameters.getValidatedDirecion(), sortField); - - logger.debug("Subscriptions with page: {} and item_per page: {} retrieved successfully", page, size); - return subscriptionsResponse; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = GET_EVENT_HANDLER_BY_ID_MGMT_DESCRIPTION, response = SubscriptionResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_EVENT_HANDLER_BY_ID_MGMT_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_EVENT_HANDLER_BY_ID_MGMT_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = EVENTHANLER_BY_ID_MGMT_URI, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public SubscriptionResponseDTO getSubscriptionById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New getSubscriptionById get request recieved with id: {}", id); - - final String origin = CommonConstants.EVENT_HANDLER_URI + EVENTHANLER_BY_ID_MGMT_URI; - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - final SubscriptionResponseDTO subscriptionResponse = eventHandlerDBService.getSubscriptionByIdResponse(id); - - logger.debug("Subscription entry with id: {} successfully retrieved", id); - return subscriptionResponse; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = DELETE_EVENT_HANDLER_MGMT_DESCRIPTION, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_EVENT_HANDLER_MGMT_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_EVENT_HANDLER_MGMT_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @DeleteMapping(path = EVENTHANLER_BY_ID_MGMT_URI, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public void deleteSubscription(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New deleteSubscription delete request recieved with id: {}", id); - - final String origin = CommonConstants.EVENT_HANDLER_URI + EVENTHANLER_BY_ID_MGMT_URI; - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - eventHandlerDBService.deleteSubscriptionResponse(id); - - logger.debug("Subscription entry with id: {} successfully deleted", id); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = PUT_EVENT_HANDLER_MGMT_DESCRIPTION, response = SubscriptionResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = PUT_EVENT_HANDLER_MGMT_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_EVENT_HANDLER_MGMT_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PutMapping(path = EVENTHANLER_BY_ID_MGMT_URI, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public SubscriptionResponseDTO updateSubscription(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final SubscriptionRequestDTO request) { - logger.debug("New updateSubscription put request recieved with id: {}", id); - - final String origin = CommonConstants.EVENT_HANDLER_URI + EVENTHANLER_BY_ID_MGMT_URI; - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - checkSubscriptionRequestDTO(request, origin); - final SubscriptionResponseDTO response = eventHandlerService.updateSubscriptionResponse(id, request); - - logger.debug("Subscription entry with id: {} successfully updated", id); - return response; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = POST_EVENT_HANDLER_SUBSCRIPTION_DESCRIPTION, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = POST_EVENT_HANDLER_SUBSCRIPTION_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_EVENT_HANDLER_SUBSCRIPTION_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PostMapping(path = CommonConstants.OP_EVENT_HANDLER_SUBSCRIBE, consumes = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public void subscribe(@RequestBody final SubscriptionRequestDTO request) { - logger.debug("subscription started ..."); - - final String origin = CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_SUBSCRIBE; - checkSubscriptionRequestDTO(request, origin); - - eventHandlerService.subscribe(request); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = DELETE_EVENT_HANDLER_SUBSCRIPTION_DESCRIPTION, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_EVENT_HANDLER_SUBSCRIPTION_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_EVENT_HANDLER_SUBSCRIPTION_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @DeleteMapping(path = CommonConstants.OP_EVENT_HANDLER_UNSUBSCRIBE) - @ResponseBody public void unsubscribe( - @RequestParam(CommonConstants.OP_EVENT_HANDLER_UNSUBSCRIBE_REQUEST_PARAM_EVENT_TYPE) final String eventType, - @RequestParam(CommonConstants.OP_EVENT_HANDLER_UNSUBSCRIBE_REQUEST_PARAM_SUBSCRIBER_SYSTEM_NAME) final String subscriberName, - @RequestParam(CommonConstants.OP_EVENT_HANDLER_UNSUBSCRIBE_REQUEST_PARAM_SUBSCRIBER_ADDRESS) final String subscriberAddress, - @RequestParam(CommonConstants.OP_EVENT_HANDLER_UNSUBSCRIBE_REQUEST_PARAM_SUBSCRIBER_PORT) final int subscriberPort) { - logger.debug("unSubscription started ..."); - - final String origin = CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_SUBSCRIBE; - checkUnsubscribeParameters(eventType, subscriberName, subscriberAddress, subscriberPort, origin); - - eventHandlerService.unsubscribe(eventType, subscriberName, subscriberAddress, subscriberPort); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = POST_EVENT_HANDLER_PUBLISH_DESCRIPTION, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = POST_EVENT_HANDLER_PUBLISH_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_EVENT_HANDLER_PUBLISH_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PostMapping(path = CommonConstants.OP_EVENT_HANDLER_PUBLISH, consumes = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public void publish(@RequestBody final EventPublishRequestDTO request) { - logger.debug("publish started ..."); - - final String origin = CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_PUBLISH; - checkEventPublishRequestDTO(request, origin); - validateTimeStamp(request, origin); - - eventHandlerService.publishResponse(request); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = POST_EVENT_HANDLER_PUBLISH_AUTH_UPDATE_DESCRIPTION, tags = { CoreCommonConstants.SWAGGER_TAG_PRIVATE }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = POST_EVENT_HANDLER_PUBLISH_AUTH_UPDATE_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_EVENT_HANDLER_PUBLISH_AUTH_UPDATE_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PostMapping(path = CommonConstants.OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE, consumes = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public void publishSubscriberAuthorizationUpdate(@RequestBody final EventPublishRequestDTO request) { - logger.debug("publishSubscriberAuthorizationUpdate started ..."); - - final String origin = CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE; - checkEventPublishRequestDTO(request, origin); - validateTimeStamp(request, origin); - - eventHandlerService.publishSubscriberAuthorizationUpdateResponse(request); - } - - //================================================================================================= - // assistant methods - - //------------------------------------------------------------------------------------------------- - private void checkSubscriptionRequestDTO(final SubscriptionRequestDTO request, final String origin) { - logger.debug("checkSubscriptionRequestDTO started ..."); - - if (request == null) { - throw new BadPayloadException("Request" + NULL_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - checkSystemRequestDTO(request.getSubscriberSystem(), origin); - - if (Utilities.isEmpty(request.getEventType())) { - throw new BadPayloadException("Request.EventType" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - if (Utilities.isEmpty(request.getNotifyUri())) { - throw new BadPayloadException("Request.NotifyUri" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - if (request.getMatchMetaData() && (request.getFilterMetaData() == null || request.getFilterMetaData().isEmpty())) { - throw new BadPayloadException("Request.MatchMetaData is true but Request.FilterMetaData" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - if (request.getSources() != null && !request.getSources().isEmpty()) { - for (final SystemRequestDTO systemRequestDTO : request.getSources()) { - checkSystemRequestDTO(systemRequestDTO, origin); - } - } - } - - //------------------------------------------------------------------------------------------------- - private void checkSystemRequestDTO(final SystemRequestDTO system, final String origin) { - logger.debug("checkSystemRequestDTO started..."); - - if (system == null) { - throw new BadPayloadException("System" + NULL_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - if (Utilities.isEmpty(system.getSystemName())) { - throw new BadPayloadException("System name" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - if (Utilities.isEmpty(system.getAddress())) { - throw new BadPayloadException("System address" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - if (system.getPort() == null) { - throw new BadPayloadException("System port" + NULL_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - final int validatedPort = system.getPort().intValue(); - if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { - throw new BadPayloadException("System port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", - HttpStatus.SC_BAD_REQUEST, origin); - } - } - - //------------------------------------------------------------------------------------------------- - private void checkEventPublishRequestDTO(final EventPublishRequestDTO request, final String origin) { - logger.debug("checkEventPublishRequestDTO started ..."); - - if (request == null) { - throw new BadPayloadException("Request" + NULL_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - checkSystemRequestDTO(request.getSource(), origin); - - if (Utilities.isEmpty( request.getEventType())) { - throw new BadPayloadException("Request.EventType" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - if (Utilities.isEmpty( request.getPayload())) { - throw new BadPayloadException("Request.Payload" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - } - - //------------------------------------------------------------------------------------------------- - // This method may CHANGE the content of EventPublishRequestDTO - private void validateTimeStamp(final EventPublishRequestDTO request, final String origin) { - logger.debug("validateTimeStamp started ..."); - - if (Utilities.isEmpty(request.getTimeStamp())) { - request.setTimeStamp(Utilities.convertZonedDateTimeToUTCString(ZonedDateTime.now())); - } else { - final ZonedDateTime now = ZonedDateTime.now(); - final ZonedDateTime timeStamp; - - try { - timeStamp = Utilities.parseUTCStringToLocalZonedDateTime(request.getTimeStamp()); - } catch (final DateTimeParseException ex) { - throw new BadPayloadException("Request.TimeStamp" + WRONG_FORMAT_ERROR_MESSAGE + ex, HttpStatus.SC_BAD_REQUEST, origin); - } - - if (timeStamp.isAfter(now.plusSeconds(timeStampTolerance))) { - throw new BadPayloadException("Request.TimeStamp" + IS_AFTER_TOLERATED_DIFF_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - if (timeStamp.isBefore(now.minusSeconds(timeStampTolerance))) { - throw new BadPayloadException("Request.TimeStamp" + IS_BEFORE_TOLERATED_DIFF_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - } - } - - //------------------------------------------------------------------------------------------------- - private void checkUnsubscribeParameters(final String eventType, final String subscriberName, final String subscriberAddress, final int subscriberPort, final String origin) { - logger.debug("checkUnsubscribeParameters started..."); - - if (Utilities.isEmpty(eventType)) { - throw new BadPayloadException("Event Type is blank", HttpStatus.SC_BAD_REQUEST, origin); - } - - if (Utilities.isEmpty(subscriberName)) { - throw new BadPayloadException("Name of the subscriber system is blank", HttpStatus.SC_BAD_REQUEST, origin); - } - - if (Utilities.isEmpty(subscriberAddress)) { - throw new BadPayloadException("Address of the subscriber system is blank", HttpStatus.SC_BAD_REQUEST, origin); - } - } +package eu.arrowhead.core.eventhandler; + +import java.time.ZonedDateTime; +import java.time.format.DateTimeParseException; + +import org.apache.http.HttpStatus; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.CoreDefaults; +import eu.arrowhead.common.CoreUtilities; +import eu.arrowhead.common.CoreUtilities.ValidatedPageParams; +import eu.arrowhead.common.Defaults; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.dto.shared.EventPublishRequestDTO; +import eu.arrowhead.common.dto.shared.SubscriptionListResponseDTO; +import eu.arrowhead.common.dto.shared.SubscriptionRequestDTO; +import eu.arrowhead.common.dto.shared.SubscriptionResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; +import eu.arrowhead.common.exception.BadPayloadException; +import eu.arrowhead.core.eventhandler.database.service.EventHandlerDBService; +import eu.arrowhead.core.eventhandler.service.EventHandlerService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; + +@Api(tags = { CoreCommonConstants.SWAGGER_TAG_ALL }) +@CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, + allowedHeaders = { HttpHeaders.ORIGIN, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT, HttpHeaders.AUTHORIZATION } +) +@RestController +@RequestMapping(CommonConstants.EVENT_HANDLER_URI) +public class EventHandlerController { + + //================================================================================================= + // members + + private static final String PATH_VARIABLE_ID = "id"; + + private static final String EVENT_HANDLER_MGMT_URI = CoreCommonConstants.MGMT_URI + "/subscriptions"; + private static final String EVENTHANLER_BY_ID_MGMT_URI = EVENT_HANDLER_MGMT_URI + "/{" + PATH_VARIABLE_ID + "}"; + + private static final String GET_EVENT_HANDLER_MGMT_DESCRIPTION = "Return requested Subscription entries by the given parameters"; + private static final String GET_EVENT_HANDLER_MGMT_HTTP_200_MESSAGE = "Subscription entries returned"; + private static final String GET_EVENT_HANDLER_MGMT_HTTP_400_MESSAGE = "Could not retrieve Subscription entries"; + + private static final String GET_EVENT_HANDLER_BY_ID_MGMT_DESCRIPTION = "Return requested Subscription entry by the given id"; + private static final String GET_EVENT_HANDLER_BY_ID_MGMT_HTTP_200_MESSAGE = "Subscription entriy returned"; + private static final String GET_EVENT_HANDLER_BY_ID_MGMT_HTTP_400_MESSAGE = "Could not retrieve Subscription entry"; + + private static final String DELETE_EVENT_HANDLER_MGMT_DESCRIPTION = "Delete requested Subscription entry by the given id"; + private static final String DELETE_EVENT_HANDLER_MGMT_HTTP_200_MESSAGE = "Subscription entriy deleted"; + private static final String DELETE_EVENT_HANDLER_MGMT_HTTP_400_MESSAGE = "Could not delete Subscription entry"; + + private static final String PUT_EVENT_HANDLER_MGMT_DESCRIPTION = "Update requested Subscription entry by the given id and parameters"; + private static final String PUT_EVENT_HANDLER_MGMT_HTTP_200_MESSAGE = "Updated Subscription entry returned"; + private static final String PUT_EVENT_HANDLER_MGMT_HTTP_400_MESSAGE = "Could not update Subscription entry"; + + private static final String POST_EVENT_HANDLER_SUBSCRIPTION_DESCRIPTION = "Subscription to the events specified in requested Subscription "; + private static final String POST_EVENT_HANDLER_SUBSCRIPTION_HTTP_200_MESSAGE = "Successful subscription."; + private static final String POST_EVENT_HANDLER_SUBSCRIPTION_HTTP_400_MESSAGE = "Unsuccessful subscription."; + + private static final String DELETE_EVENT_HANDLER_SUBSCRIPTION_DESCRIPTION = "Unsubscription from the events specified in requested Subscription "; + private static final String DELETE_EVENT_HANDLER_SUBSCRIPTION_HTTP_200_MESSAGE = "Successful unsubscription."; + private static final String DELETE_EVENT_HANDLER_SUBSCRIPTION_HTTP_400_MESSAGE = "Unsuccessful unsubscription."; + + private static final String POST_EVENT_HANDLER_PUBLISH_DESCRIPTION = "Publish event"; + private static final String POST_EVENT_HANDLER_PUBLISH_HTTP_200_MESSAGE = "Publish event success"; + private static final String POST_EVENT_HANDLER_PUBLISH_HTTP_400_MESSAGE = "Publish event not success"; + + private static final String POST_EVENT_HANDLER_PUBLISH_AUTH_UPDATE_DESCRIPTION = "Publish authorization change event "; + private static final String POST_EVENT_HANDLER_PUBLISH_AUTH_UPDATE_HTTP_200_MESSAGE = "Publish authorization change event success"; + private static final String POST_EVENT_HANDLER_PUBLISH_AUTH_UPDATE_HTTP_400_MESSAGE = "Publish authorization change event not success"; + + private static final String NULL_PARAMETER_ERROR_MESSAGE = " is null."; + private static final String NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE = " is null or blank."; + private static final String ID_NOT_VALID_ERROR_MESSAGE = " Id must be greater than 0. "; + private static final String WRONG_FORMAT_ERROR_MESSAGE = " is in wrong format. "; + private static final String IS_AFTER_TOLERATED_DIFF_ERROR_MESSAGE = " is further in the future than the tolerated time difference"; + private static final String IS_BEFORE_TOLERATED_DIFF_ERROR_MESSAGE = " is further in the past than the tolerated time difference"; + + @Value(CoreCommonConstants.$TIME_STAMP_TOLERANCE_SECONDS_WD) + private long timeStampTolerance; + + private final Logger logger = LogManager.getLogger(EventHandlerController.class); + + @Autowired + EventHandlerService eventHandlerService; + + @Autowired + EventHandlerDBService eventHandlerDBService; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return an echo message with the purpose of testing the core service availability", response = String.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) + @ApiResponses (value = { + @ApiResponse(code = HttpStatus.SC_OK, message = CoreCommonConstants.SWAGGER_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CommonConstants.ECHO_URI) + public String echoService() { + return "Got it!"; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = GET_EVENT_HANDLER_MGMT_DESCRIPTION, response = SubscriptionListResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_EVENT_HANDLER_MGMT_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_EVENT_HANDLER_MGMT_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = EVENT_HANDLER_MGMT_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public SubscriptionListResponseDTO getSubscriptions( + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("New getSubscriptions get request recieved with page: {} and item_per page: {}", page, size); + + final ValidatedPageParams validParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.EVENT_HANDLER_URI + EVENT_HANDLER_MGMT_URI); + final SubscriptionListResponseDTO subscriptionsResponse = eventHandlerDBService.getSubscriptionsResponse(validParameters.getValidatedPage(), validParameters.getValidatedSize(), + validParameters.getValidatedDirection(), sortField); + + logger.debug("Subscriptions with page: {} and item_per page: {} retrieved successfully", page, size); + return subscriptionsResponse; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = GET_EVENT_HANDLER_BY_ID_MGMT_DESCRIPTION, response = SubscriptionResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_EVENT_HANDLER_BY_ID_MGMT_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_EVENT_HANDLER_BY_ID_MGMT_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = EVENTHANLER_BY_ID_MGMT_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public SubscriptionResponseDTO getSubscriptionById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New getSubscriptionById get request recieved with id: {}", id); + + final String origin = CommonConstants.EVENT_HANDLER_URI + EVENTHANLER_BY_ID_MGMT_URI; + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + final SubscriptionResponseDTO subscriptionResponse = eventHandlerDBService.getSubscriptionByIdResponse(id); + + logger.debug("Subscription entry with id: {} successfully retrieved", id); + return subscriptionResponse; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = DELETE_EVENT_HANDLER_MGMT_DESCRIPTION, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_EVENT_HANDLER_MGMT_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_EVENT_HANDLER_MGMT_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = EVENTHANLER_BY_ID_MGMT_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public void deleteSubscription(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New deleteSubscription delete request recieved with id: {}", id); + + final String origin = CommonConstants.EVENT_HANDLER_URI + EVENTHANLER_BY_ID_MGMT_URI; + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + eventHandlerDBService.deleteSubscriptionResponse(id); + + logger.debug("Subscription entry with id: {} successfully deleted", id); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = PUT_EVENT_HANDLER_MGMT_DESCRIPTION, response = SubscriptionResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = PUT_EVENT_HANDLER_MGMT_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_EVENT_HANDLER_MGMT_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PutMapping(path = EVENTHANLER_BY_ID_MGMT_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public SubscriptionResponseDTO updateSubscription(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final SubscriptionRequestDTO request) { + logger.debug("New updateSubscription put request recieved with id: {}", id); + + final String origin = CommonConstants.EVENT_HANDLER_URI + EVENTHANLER_BY_ID_MGMT_URI; + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + checkSubscriptionRequestDTO(request, origin); + final SubscriptionResponseDTO response = eventHandlerService.updateSubscriptionResponse(id, request); + + logger.debug("Subscription entry with id: {} successfully updated", id); + return response; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = POST_EVENT_HANDLER_SUBSCRIPTION_DESCRIPTION, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = POST_EVENT_HANDLER_SUBSCRIPTION_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_EVENT_HANDLER_SUBSCRIPTION_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = CommonConstants.OP_EVENT_HANDLER_SUBSCRIBE, consumes = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public void subscribe(@RequestBody final SubscriptionRequestDTO request) { + logger.debug("subscription started ..."); + + final String origin = CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_SUBSCRIBE; + checkSubscriptionRequestDTO(request, origin); + + eventHandlerService.subscribe(request); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = DELETE_EVENT_HANDLER_SUBSCRIPTION_DESCRIPTION, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_EVENT_HANDLER_SUBSCRIPTION_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_EVENT_HANDLER_SUBSCRIPTION_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = CommonConstants.OP_EVENT_HANDLER_UNSUBSCRIBE) + @ResponseBody public void unsubscribe( + @RequestParam(CommonConstants.OP_EVENT_HANDLER_UNSUBSCRIBE_REQUEST_PARAM_EVENT_TYPE) final String eventType, + @RequestParam(CommonConstants.OP_EVENT_HANDLER_UNSUBSCRIBE_REQUEST_PARAM_SUBSCRIBER_SYSTEM_NAME) final String subscriberName, + @RequestParam(CommonConstants.OP_EVENT_HANDLER_UNSUBSCRIBE_REQUEST_PARAM_SUBSCRIBER_ADDRESS) final String subscriberAddress, + @RequestParam(CommonConstants.OP_EVENT_HANDLER_UNSUBSCRIBE_REQUEST_PARAM_SUBSCRIBER_PORT) final int subscriberPort) { + logger.debug("unSubscription started ..."); + + final String origin = CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_SUBSCRIBE; + checkUnsubscribeParameters(eventType, subscriberName, subscriberAddress, subscriberPort, origin); + + eventHandlerService.unsubscribe(eventType, subscriberName, subscriberAddress, subscriberPort); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = POST_EVENT_HANDLER_PUBLISH_DESCRIPTION, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = POST_EVENT_HANDLER_PUBLISH_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_EVENT_HANDLER_PUBLISH_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = CommonConstants.OP_EVENT_HANDLER_PUBLISH, consumes = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public void publish(@RequestBody final EventPublishRequestDTO request) { + logger.debug("publish started ..."); + + final String origin = CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_PUBLISH; + checkEventPublishRequestDTO(request, origin); + validateTimeStamp(request, origin); + + eventHandlerService.publishResponse(request); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = POST_EVENT_HANDLER_PUBLISH_AUTH_UPDATE_DESCRIPTION, tags = { CoreCommonConstants.SWAGGER_TAG_PRIVATE }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = POST_EVENT_HANDLER_PUBLISH_AUTH_UPDATE_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_EVENT_HANDLER_PUBLISH_AUTH_UPDATE_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = CommonConstants.OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE, consumes = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public void publishSubscriberAuthorizationUpdate(@RequestBody final EventPublishRequestDTO request) { + logger.debug("publishSubscriberAuthorizationUpdate started ..."); + + final String origin = CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE; + checkEventPublishRequestDTO(request, origin); + validateTimeStamp(request, origin); + + eventHandlerService.publishSubscriberAuthorizationUpdateResponse(request); + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private void checkSubscriptionRequestDTO(final SubscriptionRequestDTO request, final String origin) { + logger.debug("checkSubscriptionRequestDTO started ..."); + + if (request == null) { + throw new BadPayloadException("Request" + NULL_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + checkSystemRequestDTO(request.getSubscriberSystem(), origin); + + if (Utilities.isEmpty(request.getEventType())) { + throw new BadPayloadException("Request.EventType" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(request.getNotifyUri())) { + throw new BadPayloadException("Request.NotifyUri" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (request.getMatchMetaData() && (request.getFilterMetaData() == null || request.getFilterMetaData().isEmpty())) { + throw new BadPayloadException("Request.MatchMetaData is true but Request.FilterMetaData" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (request.getSources() != null && !request.getSources().isEmpty()) { + for (final SystemRequestDTO systemRequestDTO : request.getSources()) { + checkSystemRequestDTO(systemRequestDTO, origin); + } + } + } + + //------------------------------------------------------------------------------------------------- + private void checkSystemRequestDTO(final SystemRequestDTO system, final String origin) { + logger.debug("checkSystemRequestDTO started..."); + + if (system == null) { + throw new BadPayloadException("System" + NULL_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(system.getSystemName())) { + throw new BadPayloadException("System name" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(system.getAddress())) { + throw new BadPayloadException("System address" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (system.getPort() == null) { + throw new BadPayloadException("System port" + NULL_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + final int validatedPort = system.getPort().intValue(); + if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + throw new BadPayloadException("System port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", + HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + private void checkEventPublishRequestDTO(final EventPublishRequestDTO request, final String origin) { + logger.debug("checkEventPublishRequestDTO started ..."); + + if (request == null) { + throw new BadPayloadException("Request" + NULL_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + checkSystemRequestDTO(request.getSource(), origin); + + if (Utilities.isEmpty( request.getEventType())) { + throw new BadPayloadException("Request.EventType" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty( request.getPayload())) { + throw new BadPayloadException("Request.Payload" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + // This method may CHANGE the content of EventPublishRequestDTO + private void validateTimeStamp(final EventPublishRequestDTO request, final String origin) { + logger.debug("validateTimeStamp started ..."); + + if (Utilities.isEmpty(request.getTimeStamp())) { + request.setTimeStamp(Utilities.convertZonedDateTimeToUTCString(ZonedDateTime.now())); + } else { + final ZonedDateTime now = ZonedDateTime.now(); + final ZonedDateTime timeStamp; + + try { + timeStamp = Utilities.parseUTCStringToLocalZonedDateTime(request.getTimeStamp()); + } catch (final DateTimeParseException ex) { + throw new BadPayloadException("Request.TimeStamp" + WRONG_FORMAT_ERROR_MESSAGE + ex, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (timeStamp.isAfter(now.plusSeconds(timeStampTolerance))) { + throw new BadPayloadException("Request.TimeStamp" + IS_AFTER_TOLERATED_DIFF_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (timeStamp.isBefore(now.minusSeconds(timeStampTolerance))) { + throw new BadPayloadException("Request.TimeStamp" + IS_BEFORE_TOLERATED_DIFF_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + } + } + + //------------------------------------------------------------------------------------------------- + private void checkUnsubscribeParameters(final String eventType, final String subscriberName, final String subscriberAddress, final int subscriberPort, final String origin) { + logger.debug("checkUnsubscribeParameters started..."); + + if (Utilities.isEmpty(eventType)) { + throw new BadPayloadException("Event Type is blank", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(subscriberName)) { + throw new BadPayloadException("Name of the subscriber system is blank", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(subscriberAddress)) { + throw new BadPayloadException("Address of the subscriber system is blank", HttpStatus.SC_BAD_REQUEST, origin); + } + } } \ No newline at end of file diff --git a/gatekeeper/src/main/java/eu/arrowhead/core/gatekeeper/GatekeeperController.java b/gatekeeper/src/main/java/eu/arrowhead/core/gatekeeper/GatekeeperController.java index bc809dd16..98f2c2f55 100644 --- a/gatekeeper/src/main/java/eu/arrowhead/core/gatekeeper/GatekeeperController.java +++ b/gatekeeper/src/main/java/eu/arrowhead/core/gatekeeper/GatekeeperController.java @@ -145,7 +145,7 @@ public String echoService() { final ValidatedPageParams validParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.GATEKEEPER_URI + CLOUDS_MGMT_URI); final CloudWithRelaysListResponseDTO cloudsResponse = gatekeeperDBService.getCloudsResponse(validParameters.getValidatedPage(), validParameters.getValidatedSize(), - validParameters.getValidatedDirecion(), sortField); + validParameters.getValidatedDirection(), sortField); logger.debug("Clouds with page: {} and item_per page: {} retrieved successfully", page, size); return cloudsResponse; @@ -311,7 +311,7 @@ public void removeCloudById(@PathVariable(value = PATH_VARIABLE_ID) final long i final ValidatedPageParams validParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.GATEKEEPER_URI + RELAYS_MGMT_URI); final RelayListResponseDTO relaysResponse = gatekeeperDBService.getRelaysResponse(validParameters.getValidatedPage(), validParameters.getValidatedSize(), - validParameters.getValidatedDirecion(), sortField); + validParameters.getValidatedDirection(), sortField); logger.debug("Relays with page: {} and item_per page: {} retrieved successfully", page, size); return relaysResponse; diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/OrchestratorStoreController.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/OrchestratorStoreController.java index 39e27b985..2f5f64356 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/OrchestratorStoreController.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/OrchestratorStoreController.java @@ -122,7 +122,7 @@ public class OrchestratorStoreController { final ValidatedPageParams vpp = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.ORCHESTRATOR_URI + CoreCommonConstants.ORCHESTRATOR_STORE_MGMT_URI); final OrchestratorStoreListResponseDTO orchestratorStoreListResponse = orchestratorStoreDBService.getOrchestratorStoreEntriesResponse(vpp.getValidatedPage(), vpp.getValidatedSize(), - vpp.getValidatedDirecion(), sortField); + vpp.getValidatedDirection(), sortField); logger.debug("OrchestratorStores with page: {} and item_per page: {} retrieved successfully", page, size); return orchestratorStoreListResponse; @@ -147,7 +147,7 @@ public class OrchestratorStoreController { final ValidatedPageParams vpp = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.ORCHESTRATOR_URI + ORCHESTRATOR_STORE_MGMT_ALL_TOP_PRIORITY); final OrchestratorStoreListResponseDTO orchestratorStoreResponse = orchestratorStoreDBService.getAllTopPriorityOrchestratorStoreEntriesResponse(vpp.getValidatedPage(), vpp.getValidatedSize(), - vpp.getValidatedDirecion(), sortField); + vpp.getValidatedDirection(), sortField); logger.debug("OrchestratorStores with page: {} and item_per page: {} retrieved successfully", page, size); return orchestratorStoreResponse; @@ -174,7 +174,7 @@ public class OrchestratorStoreController { final ValidatedPageParams vpp = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.ORCHESTRATOR_URI + ORCHESTRATOR_STORE_MGMT_ALL_BY_CONSUMER); checkOrchestratorStoreRequestDTOForConsumerIdAndServiceDefinitionName(request, CommonConstants.ORCHESTRATOR_URI + ORCHESTRATOR_STORE_MGMT_ALL_BY_CONSUMER); final OrchestratorStoreListResponseDTO orchestratorStoreResponse = orchestratorStoreDBService.getOrchestratorStoresByConsumerResponse(vpp.getValidatedPage(), vpp.getValidatedSize(), - vpp.getValidatedDirecion(), sortField, + vpp.getValidatedDirection(), sortField, request.getConsumerSystemId(), request.getServiceDefinitionName(), request.getServiceInterfaceName()); diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java index dcde23830..4da17655d 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java @@ -28,13 +28,13 @@ allowedHeaders = { HttpHeaders.ORIGIN, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT, HttpHeaders.AUTHORIZATION } ) @RestController -@RequestMapping(CommonConstants.SERVICE_REGISTRY_URI) +@RequestMapping(CommonConstants.SYSTEM_REGISTRY_URI) public class SystemRegistryController { //================================================================================================= // members - + private static final String GET_SYSTEM_BY_ID_HTTP_200_MESSAGE = "System by requested id returned"; private static final String GET_SYSTEM_BY_ID_HTTP_400_MESSAGE = "No Such System by requested id"; private static final String PATH_VARIABLE_ID = "id"; @@ -51,7 +51,23 @@ public class SystemRegistryController private static final String PATCH_SYSTEM_HTTP_400_MESSAGE = "Could not update system"; private static final String DELETE_SYSTEM_HTTP_200_MESSAGE = "System deleted"; private static final String DELETE_SYSTEM_HTTP_400_MESSAGE = "Could not delete system"; - + + private static final String GET_DEVICE_BY_ID_HTTP_200_MESSAGE = "Device by requested id returned"; + private static final String GET_DEVICE_BY_ID_HTTP_400_MESSAGE = "No Such Device by requested id"; + private static final String DEVICE_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/device/{" + PATH_VARIABLE_ID + "}"; + private static final String DEVICES_URI = CoreCommonConstants.MGMT_URI + "/devices"; + private static final String DEVICES_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/devices/{" + PATH_VARIABLE_ID + "}"; + private static final String GET_DEVICES_HTTP_200_MESSAGE = "Devices returned"; + private static final String GET_DEVICES_HTTP_400_MESSAGE = " Invalid parameters"; + private static final String POST_DEVICE_HTTP_201_MESSAGE = "Device created"; + private static final String POST_DEVICE_HTTP_400_MESSAGE = "Could not create device"; + private static final String PUT_DEVICE_HTTP_200_MESSAGE = "Device updated"; + private static final String PUT_DEVICE_HTTP_400_MESSAGE = "Could not update device"; + private static final String PATCH_DEVICE_HTTP_200_MESSAGE = "Device updated"; + private static final String PATCH_DEVICE_HTTP_400_MESSAGE = "Could not update device"; + private static final String DELETE_DEVICE_HTTP_200_MESSAGE = "Device deleted"; + private static final String DELETE_DEVICE_HTTP_400_MESSAGE = "Could not delete device"; + private static final String SERVICES_URI = CoreCommonConstants.MGMT_URI + "/services"; private static final String SERVICES_BY_ID_URI = SERVICES_URI + "/{" + PATH_VARIABLE_ID + "}"; private static final String GET_SERVICES_HTTP_200_MESSAGE = "Services returned"; @@ -159,24 +175,9 @@ public String echoService() { @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { logger.debug("getSystems started ..."); - - final int validatedPage; - final int validatedSize; - if (page == null && size == null) { - validatedPage = -1; - validatedSize = -1; - } else { - if (page == null || size == null) { - throw new BadPayloadException(NOT_VALID_PARAMETERS_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_URI); - } else { - validatedPage = page; - validatedSize = size; - } - } - - final Direction validatedDirection = CoreUtilities.calculateDirection(direction, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_URI); - - return systemRegistryDBService.getSystemEntries(validatedPage, validatedSize, validatedDirection, sortField); + + final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.SYSTEM_REGISTRY_URI + DEVICES_URI); + return systemRegistryDBService.getSystemEntries(pageParameters, sortField); } //------------------------------------------------------------------------------------------------- @@ -207,7 +208,7 @@ public String echoService() { } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return system updated by fields", response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiOperation(value = "Return system updated by fields", response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_CREATED, message = PATCH_SYSTEM_HTTP_200_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PATCH_SYSTEM_HTTP_400_MESSAGE), @@ -238,43 +239,48 @@ public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) systemRegistryDBService.removeSystemById(id); logger.debug("System with id: '{}' successfully deleted", id); } - + //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return requested service definitions by the given parameters", response = ServiceDefinitionsListResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiOperation(value = "Return device by id", response = DeviceResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SERVICES_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SERVICES_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_BY_ID_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_BY_ID_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(SYSTEMS_BY_ID_URI) + @ResponseBody public DeviceResponseDTO getDeviceById(@PathVariable(value = PATH_VARIABLE_ID) final long deviceId) { + logger.debug("getDeviceById started ..."); + + if (deviceId < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEM_BY_ID_URI); + } + + return systemRegistryDBService.getDeviceById(deviceId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested device by the given parameters", response = DeviceListResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEMS_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEMS_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @GetMapping(path = SERVICES_URI, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public ServiceDefinitionsListResponseDTO getServiceDefinitions( + @GetMapping(path = DEVICES_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public DeviceListResponseDTO getDeviceListByRequestParameters( @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("New Service Definition get request received with page: {} and item_per page: {}", page, size); - - int validatedPage; - int validatedSize; - if (page == null && size == null) { - validatedPage = -1; - validatedSize = -1; - } else { - if (page == null || size == null) { - throw new BadPayloadException("Defined page or size could not be with undefined size or page.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_URI); - } else { - validatedPage = page; - validatedSize = size; - } - } + logger.debug("New DeviceList get request received with page: {} and item_per page: {}", page, size); - final Direction validatedDirection = CoreUtilities.calculateDirection(direction, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_URI); - final ServiceDefinitionsListResponseDTO serviceDefinitionEntries = systemRegistryDBService - .getServiceDefinitionEntriesResponse(validatedPage, validatedSize, validatedDirection, sortField); - logger.debug("Service definition with page: {} and item_per page: {} successfully retrieved", page, size); + final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.SYSTEM_REGISTRY_URI + DEVICES_URI); + final DeviceListResponseDTO deviceListResponseDTO = systemRegistryDBService + .getDeviceEntries(pageParameters, sortField); + logger.debug("DeviceList with page: {} and item_per page: {} successfully retrieved", page, size); - return serviceDefinitionEntries; + return deviceListResponseDTO; } //------------------------------------------------------------------------------------------------- diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java index 62f7b0c69..45d30f6eb 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java @@ -1,12 +1,30 @@ package eu.arrowhead.core.systemregistry.database.service; -import eu.arrowhead.common.SSLProperties; -import eu.arrowhead.common.database.repository.*; -import eu.arrowhead.common.intf.ServiceInterfaceNameVerifier; +import eu.arrowhead.common.*; +import eu.arrowhead.common.database.entity.Device; +import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.database.repository.DeviceRepository; +import eu.arrowhead.common.database.repository.SystemRegistryRepository; +import eu.arrowhead.common.database.repository.SystemRepository; +import eu.arrowhead.common.dto.internal.DTOConverter; +import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; +import eu.arrowhead.common.dto.internal.SystemListResponseDTO; +import eu.arrowhead.common.dto.shared.DeviceResponseDTO; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.common.exception.InvalidParameterException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.repository.support.SimpleJpaRepository; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Objects; +import java.util.Optional; @Service public class SystemRegistryDBService @@ -15,6 +33,11 @@ public class SystemRegistryDBService //================================================================================================= // members + private static final String COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE = "Could not delete System, with given parameters"; + private static final String PORT_RANGE_ERROR_MESSAGE = "Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + "."; + + private static final int MAX_BATCH_SIZE = 200; + private final Logger logger = LogManager.getLogger(SystemRegistryDBService.class); @@ -24,7 +47,389 @@ public class SystemRegistryDBService @Autowired private SystemRepository systemRepository; + @Autowired + private DeviceRepository deviceRepository; + @Autowired private SSLProperties sslProperties; + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public SystemResponseDTO getSystemById(final long systemId) { + logger.debug("getSystemById started..."); + + try { + final Optional systemOption = systemRepository.findById(systemId); + if (systemOption.isEmpty()){ + throw new InvalidParameterException("System with id " + systemId + " not found."); + } + + return DTOConverter.convertSystemToSystemResponseDTO(systemOption.get()); + } catch (final InvalidParameterException ex) { + throw ex; + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + + //------------------------------------------------------------------------------------------------- + public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) { + logger.debug("getSystemEntries started..."); + + final int validatedPage = pageParams.getValidatedPage(); + final int validatedSize = pageParams.getValidatedSize(); + final Sort.Direction validatedDirection = pageParams.getValidatedDirection(); + final String validatedSortField = Utilities.isEmpty(sortField) ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); + + if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) { + throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); + } + + try { + return DTOConverter.convertSystemEntryListToSystemListResponseDTO(systemRepository.findAll(PageRequest.of(validatedPage, validatedSize, validatedDirection, validatedSortField))); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) { + logger.debug("createSystem started..."); + + final System system = validateNonNullSystemParameters(systemName, address, port, authenticationInfo); + + try { + return systemRepository.saveAndFlush(system); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemResponseDTO createSystemResponse(final String systemName, final String address, final int port, final String authenticationInfo) { + logger.debug("createSystemResponse started..."); + + return DTOConverter.convertSystemToSystemResponseDTO(createSystem(systemName, address, port, authenticationInfo)); + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemResponseDTO updateSystemResponse(final long systemId, final String systemName, final String address, final int port, final String authenticationInfo) { + logger.debug("updateSystemResponse started..."); + + return DTOConverter.convertSystemToSystemResponseDTO(updateSystem(systemId, systemName, address, port, authenticationInfo)); + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public System updateSystem(final long systemId, final String systemName, final String address, final int port, final String authenticationInfo) { + logger.debug("updateSystem started..."); + + final long validatedSystemId = validateSystemId(systemId); + final int validatedPort = validateSystemPort(port); + final String validatedSystemName = validateSystemParamString(systemName); + if (validatedSystemName.contains(".")) { + throw new InvalidParameterException("System name can't contain dot (.)"); + } + final String validatedAddress = validateSystemParamString(address); + final String validatedAuthenticationInfo = authenticationInfo; + + + try { + final Optional systemOptional = systemRepository.findById(validatedSystemId); + if (!systemOptional.isPresent()) { + throw new InvalidParameterException("No system with id : " + validatedSystemId); + } + + final System system = systemOptional.get(); + + if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) { + checkConstraintsOfSystemTable(validatedSystemName, validatedAddress, validatedPort); + } + + system.setSystemName(validatedSystemName); + system.setAddress(validatedAddress); + system.setPort(validatedPort); + system.setAuthenticationInfo(validatedAuthenticationInfo); + + return systemRepository.saveAndFlush(system); + } catch (final InvalidParameterException ex) { + throw ex; + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public void removeSystemById(final long id) { + logger.debug("removeSystemById started..."); + + try { + if (!systemRepository.existsById(id)) { + throw new InvalidParameterException(COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE); + } + + systemRepository.deleteById(id); + systemRepository.flush(); + } catch (final InvalidParameterException ex) { + throw ex; + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemResponseDTO mergeSystemResponse(final long systemId, final String systemName, final String address, final Integer port, final String authenticationInfo) { + logger.debug("mergeSystemResponse started..."); + + return DTOConverter.convertSystemToSystemResponseDTO(mergeSystem(systemId, systemName, address, port, authenticationInfo)); + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public System mergeSystem(final long systemId, final String systemName, final String address, final Integer port, final String authenticationInfo) { + logger.debug("mergeSystem started..."); + + final long validatedSystemId = validateSystemId(systemId); + final Integer validatedPort = validateAllowNullSystemPort(port); + final String validatedSystemName = validateAllowNullSystemParamString(systemName); + if (validatedSystemName != null && validatedSystemName.contains(".")) { + throw new InvalidParameterException("System name can't contain dot (.)"); + } + final String validatedAddress = validateAllowNullSystemParamString(address); + final String validatedAuthenticationInfo = authenticationInfo; + + try { + final Optional systemOptional = systemRepository.findById(validatedSystemId); + if (!systemOptional.isPresent()) { + throw new InvalidParameterException("No system with id : " + validatedSystemId); + } + + final System system = systemOptional.get(); + + if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) { + checkConstraintsOfSystemTable(validatedSystemName != null ? validatedSystemName : system.getSystemName(), + validatedAddress != null ? validatedAddress : system.getAddress(), + validatedPort != null ? validatedPort.intValue() : system.getPort()); + } + + if (!Utilities.isEmpty(validatedSystemName)) { + system.setSystemName(validatedSystemName); + } + + if (!Utilities.isEmpty(validatedAddress)) { + system.setAddress(validatedAddress); + } + + if (validatedPort != null) { + system.setPort(validatedPort); + } + + if (!Utilities.isEmpty(validatedAuthenticationInfo)) { + system.setAuthenticationInfo(validatedAuthenticationInfo); + } + + return systemRepository.saveAndFlush(system); + } catch (final InvalidParameterException ex) { + throw ex; + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + + //------------------------------------------------------------------------------------------------- + public DeviceResponseDTO getDeviceById(long deviceId) { + logger.debug("getDeviceById started..."); + + try { + final Optional deviceOptional = deviceRepository.findById(deviceId); + if (deviceOptional.isEmpty()){ + throw new InvalidParameterException("Device with id " + deviceId + " not found."); + } + + return DTOConverter.convertDeviceToDeviceResponseDTO(deviceOptional.get()); + } catch (final InvalidParameterException ex) { + throw ex; + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) { + logger.debug("getDeviceList started..."); + + final String validatedSortField = Utilities.isEmpty(sortField) ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); + + if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) { + throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); + } + + try { + final Page devices = deviceRepository.findAll(PageRequest.of(pageParams.getValidatedPage(), pageParams.getValidatedSize(), + pageParams.getValidatedDirection(), validatedSortField)); + return DTOConverter.convertDeviceEntryListToDeviceListResponseDTO(devices); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings("squid:S1126") + private boolean checkSystemIfUniqueValidationNeeded(final System system, final String validatedSystemName, final String validatedAddress, final Integer validatedPort) { + logger.debug("checkSystemIfUniqueValidationNeeded started..."); + + final String actualSystemName = system.getSystemName(); + final String actualAddress = system.getAddress(); + final int actualPort = system.getPort(); + + if (validatedSystemName != null && !actualSystemName.equalsIgnoreCase(validatedSystemName)) { + return true; + } + + if (validatedAddress != null && !actualAddress.equalsIgnoreCase(validatedAddress)) { + return true; + } + + if (validatedPort != null && actualPort != validatedPort.intValue()) { + return true; + } + + return false; + } + + //------------------------------------------------------------------------------------------------- + private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) { + logger.debug("checkConstraintsOfSystemTable started..."); + + try { + final Optional find = systemRepository.findBySystemNameAndAddressAndPort(validatedSystemName.toLowerCase().trim(), validatedAddress.toLowerCase().trim(), validatedPort); + if (find.isPresent()) { + throw new InvalidParameterException("System with name: " + validatedSystemName + ", address: " + validatedAddress + ", port: " + validatedPort + " already exists."); + } + } catch (final InvalidParameterException ex) { + throw ex; + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) { + logger.debug("validateNonNullSystemParameters started..."); + + if (Utilities.isEmpty(systemName)) { + throw new InvalidParameterException("System name is null or empty"); + } + + if (Utilities.isEmpty(address)) { + throw new InvalidParameterException("System address is null or empty"); + } + + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); + } + + final String validatedSystemName = systemName.trim().toLowerCase(); + if (validatedSystemName.contains(".")) { + throw new InvalidParameterException("System name can't contain dot (.)"); + } + final String validatedAddress = address.trim().toLowerCase(); + final String validatedAuthenticationInfo = authenticationInfo; + + checkConstraintsOfSystemTable(validatedSystemName, validatedAddress, port); + + return new System(validatedSystemName, validatedAddress, port, validatedAuthenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private String validateSystemParamString(final String param) { + logger.debug("validateSystemParamString started..."); + + if (Utilities.isEmpty(param)) { + throw new InvalidParameterException("parameter null or empty"); + } + + return param.trim().toLowerCase(); + } + + //------------------------------------------------------------------------------------------------- + private int validateSystemPort(final int port) { + logger.debug("validateSystemPort started..."); + + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); + } + + return port; + } + + //------------------------------------------------------------------------------------------------- + private long validateSystemId(final long systemId) { + logger.debug("validateSystemId started..."); + + if (systemId < 1) { + throw new IllegalArgumentException("System id must be greater than zero"); + } + + return systemId; + } + + //------------------------------------------------------------------------------------------------- + private Integer validateAllowNullSystemPort(final Integer port) { + logger.debug("validateAllowNullSystemPort started..."); + + if (port != null && (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX)) { + throw new IllegalArgumentException(PORT_RANGE_ERROR_MESSAGE); + } + + return port; + } + + //------------------------------------------------------------------------------------------------- + private String validateAllowNullSystemParamString(final String param) { + logger.debug("validateAllowNullSystemParamString started..."); + + if (Utilities.isEmpty(param)) { + return null; + } + + return param.trim().toLowerCase(); + } + + //------------------------------------------------------------------------------------------------- + private System findOrCreateSystem(final String systemName, final String address, final int port, final String authenticationInfo) { + final Optional optProvider = systemRepository.findBySystemNameAndAddressAndPort(systemName.toLowerCase().trim(), address.toLowerCase().trim(), port); + System provider; + if (optProvider.isPresent()) { + provider = optProvider.get(); + if (!Objects.equals(authenticationInfo, provider.getAuthenticationInfo())) { // authentication info has changed + provider.setAuthenticationInfo(authenticationInfo); + provider = systemRepository.saveAndFlush(provider); + } + } else { + provider = createSystem(systemName, address, port, authenticationInfo); + } + return provider; + } + } From 57794c11bd83a48ab9c1ec60a3d0a41bbdc164ae Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Thu, 16 Jan 2020 09:32:35 +0100 Subject: [PATCH 007/301] wip on systemregistry --- .../common/dto/shared/DeviceRequestDTO.java | 85 ++++++ .../SystemRegistryController.java | 107 +++---- .../service/SystemRegistryDBService.java | 273 ++++++++++++------ 3 files changed, 316 insertions(+), 149 deletions(-) create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRequestDTO.java diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRequestDTO.java new file mode 100644 index 000000000..5a5906e26 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRequestDTO.java @@ -0,0 +1,85 @@ +package eu.arrowhead.common.dto.shared; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.Serializable; +import java.util.Objects; + +@JsonInclude(Include.NON_NULL) +public class DeviceRequestDTO implements Serializable +{ + + //================================================================================================= + // members + + private static final long serialVersionUID = 3919207845374510215L; + + private String deviceName; + private String address; + private String macAddress; + private String authenticationInfo; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public DeviceRequestDTO() {} + + //------------------------------------------------------------------------------------------------- + public DeviceRequestDTO(final String deviceName, final String address, final String macAddress, final String authenticationInfo) + { + this.deviceName = deviceName; + this.address = address; + this.macAddress = macAddress; + this.authenticationInfo = authenticationInfo; + } + + //------------------------------------------------------------------------------------------------- + public String getDeviceName() { return deviceName; } + + //------------------------------------------------------------------------------------------------- + public void setDeviceName(final String deviceName) { this.deviceName = deviceName; } + + public String getAddress() { return address; } + + public void setAddress(final String address) { this.address = address; } + + public String getMacAddress() { return macAddress; } + + public void setMacAddress(final String macAddress) { this.macAddress = macAddress; } + + public String getAuthenticationInfo() { return authenticationInfo; } + + public void setAuthenticationInfo(final String authenticationInfo) { this.authenticationInfo = authenticationInfo; } + + //------------------------------------------------------------------------------------------------- + @Override + public int hashCode() + { + return Objects.hash(address, macAddress, deviceName); + } + + //------------------------------------------------------------------------------------------------- + @Override + public boolean equals(final Object obj) + { + if (this == obj) + { + return true; + } + if (obj == null) + { + return false; + } + if (getClass() != obj.getClass()) + { + return false; + } + final DeviceRequestDTO other = (DeviceRequestDTO) obj; + + return Objects.equals(address, other.address) && + Objects.equals(macAddress, other.macAddress) && + Objects.equals(deviceName, other.deviceName); + } +} \ No newline at end of file diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java index 4da17655d..150f23437 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java @@ -149,7 +149,7 @@ public String echoService() { @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @GetMapping(SYSTEMS_BY_ID_URI) + @GetMapping(SYSTEM_BY_ID_URI) @ResponseBody public SystemResponseDTO getSystemById(@PathVariable(value = PATH_VARIABLE_ID) final long systemId) { logger.debug("getSystemById started ..."); @@ -181,7 +181,7 @@ public String echoService() { } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return created system ", response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiOperation(value = "Return created system", response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_SYSTEM_HTTP_201_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_SYSTEM_HTTP_400_MESSAGE), @@ -195,7 +195,7 @@ public String echoService() { } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return updated system ", response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiOperation(value = "Return updated system", response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_CREATED, message = PUT_SYSTEM_HTTP_200_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_SYSTEM_HTTP_400_MESSAGE), @@ -284,91 +284,52 @@ public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return requested service definition", response = ServiceDefinitionResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiOperation(value = "Return created device", response = DeviceResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SERVICES_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SERVICES_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_DEVICE_HTTP_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_DEVICE_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @GetMapping(path = SERVICES_BY_ID_URI, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public ServiceDefinitionResponseDTO getServiceDefinitionById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New Service Definition get request received with id: {}", id); - - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_BY_ID_URI); - } - - final ServiceDefinitionResponseDTO serviceDefinitionEntry = systemRegistryDBService.getServiceDefinitionByIdResponse(id); - logger.debug("Service definition with id: '{}' successfully retrieved", id); - - return serviceDefinitionEntry; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return created service definition", response = ServiceDefinitionResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_SERVICES_HTTP_201_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_SERVICES_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PostMapping(path = SERVICES_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(path = DEVICES_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) - @ResponseBody public ServiceDefinitionResponseDTO addServiceDefinition(@RequestBody final ServiceDefinitionRequestDTO serviceDefinitionRequestDTO) { - final String serviceDefinition = serviceDefinitionRequestDTO.getServiceDefinition(); - logger.debug("New Service Definition registration request received with definition: {}", serviceDefinition); - - if (Utilities.isEmpty(serviceDefinition)) { - throw new BadPayloadException("Service definition is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_URI); - } - - for (final CoreSystemService coreSystemService : CoreSystemService.values()) { - if (coreSystemService.getServiceDefinition().equalsIgnoreCase(serviceDefinition.trim())) { - throw new BadPayloadException("serviceDefinition '" + serviceDefinition + "' is a reserved arrowhead core system service.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_URI); - } - } - - final ServiceDefinitionResponseDTO serviceDefinitionResponse = systemRegistryDBService.createServiceDefinitionResponse(serviceDefinition); - logger.debug("{} service definition successfully registered.", serviceDefinition); + @ResponseBody public DeviceResponseDTO addDevice(@RequestBody final DeviceRequestDTO deviceRequestDto) { + logger.debug("New device registration request received with name: {}", deviceRequestDto.getDeviceName()); + + validateDevice(deviceRequestDto); + + final DeviceResponseDTO responseDTO = systemRegistryDBService.createDevice(deviceRequestDto); + logger.debug("{} successfully registered.", responseDTO); - return serviceDefinitionResponse; + return responseDTO; } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return updated service definition", response = ServiceDefinitionResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiOperation(value = "Return updated device", response = DeviceResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = PUT_SERVICES_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_SERVICES_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = PUT_DEVICE_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_DEVICE_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @PutMapping(path = SERVICES_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public ServiceDefinitionResponseDTO putUpdateServiceDefinition(@PathVariable(value = PATH_VARIABLE_ID) final long id, - @RequestBody final ServiceDefinitionRequestDTO serviceDefinitionRequestDTO) { + @PutMapping(path = DEVICE_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public DeviceResponseDTO putUpdateServiceDefinition(@PathVariable(value = PATH_VARIABLE_ID) final long id, + @RequestBody final DeviceRequestDTO deviceRequestDto) { final String serviceDefinition = serviceDefinitionRequestDTO.getServiceDefinition(); logger.debug("New Service Definition update request received with id: {}, definition: {}", id, serviceDefinition); if (id < 1) { throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_BY_ID_URI); - } - - if (Utilities.isEmpty(serviceDefinition)) { - throw new BadPayloadException("serviceDefinition is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_BY_ID_URI); - } - - for (final CoreSystemService coreSystemService : CoreSystemService.values()) { - if (coreSystemService.getServiceDefinition().equalsIgnoreCase(serviceDefinition.trim())) { - throw new BadPayloadException("serviceDefinition '" + serviceDefinition + "' is a reserved arrowhead core system service.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_URI); - } } - + + validateDevice(deviceRequestDto); + final ServiceDefinitionResponseDTO serviceDefinitionResponse = systemRegistryDBService.updateServiceDefinitionByIdResponse(id, serviceDefinition); logger.debug("Service definition with id: '{}' successfully updated with definition '{}'.", id, serviceDefinition); return serviceDefinitionResponse; } - + //------------------------------------------------------------------------------------------------- @ApiOperation(value = "Return updated service definition", response = ServiceDefinitionResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) @ApiResponses(value = { @@ -942,7 +903,23 @@ private void checkServiceRegistryUpdateRequest(final long id, final ServiceRegis checkServiceRegistryRequest(request, origin, true); } - + + //------------------------------------------------------------------------------------------------- + private void validateDevice(@RequestBody final DeviceRequestDTO deviceRequestDto) + { + if (Utilities.isEmpty(deviceRequestDto.getDeviceName())) { + throw new BadPayloadException("Device name is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); + } + + if (Utilities.isEmpty(deviceRequestDto.getAddress())) { + throw new BadPayloadException("Device address is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); + } + + if (Utilities.isEmpty(deviceRequestDto.getMacAddress())) { + throw new BadPayloadException("Device MAC address is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); + } + } + //------------------------------------------------------------------------------------------------- @SuppressWarnings("squid:S3776") private void checkServiceRegistryMergeRequest(final long id, final ServiceRegistryRequestDTO request, final String origin) { diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java index 45d30f6eb..a3fa3bcb0 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java @@ -9,6 +9,7 @@ import eu.arrowhead.common.dto.internal.DTOConverter; import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; import eu.arrowhead.common.dto.internal.SystemListResponseDTO; +import eu.arrowhead.common.dto.shared.DeviceRequestDTO; import eu.arrowhead.common.dto.shared.DeviceResponseDTO; import eu.arrowhead.common.dto.shared.SystemResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; @@ -19,7 +20,6 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Sort; -import org.springframework.data.jpa.repository.support.SimpleJpaRepository; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -57,19 +57,26 @@ public class SystemRegistryDBService // methods //------------------------------------------------------------------------------------------------- - public SystemResponseDTO getSystemById(final long systemId) { + public SystemResponseDTO getSystemById(final long systemId) + { logger.debug("getSystemById started..."); - try { + try + { final Optional systemOption = systemRepository.findById(systemId); - if (systemOption.isEmpty()){ + if (systemOption.isEmpty()) + { throw new InvalidParameterException("System with id " + systemId + " not found."); } return DTOConverter.convertSystemToSystemResponseDTO(systemOption.get()); - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -77,7 +84,8 @@ public SystemResponseDTO getSystemById(final long systemId) { //------------------------------------------------------------------------------------------------- - public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) { + public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) + { logger.debug("getSystemEntries started..."); final int validatedPage = pageParams.getValidatedPage(); @@ -85,13 +93,18 @@ public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageP final Sort.Direction validatedDirection = pageParams.getValidatedDirection(); final String validatedSortField = Utilities.isEmpty(sortField) ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); - if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) { + if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) + { throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); } - try { - return DTOConverter.convertSystemEntryListToSystemListResponseDTO(systemRepository.findAll(PageRequest.of(validatedPage, validatedSize, validatedDirection, validatedSortField))); - } catch (final Exception ex) { + try + { + return DTOConverter.convertSystemEntryListToSystemListResponseDTO( + systemRepository.findAll(PageRequest.of(validatedPage, validatedSize, validatedDirection, validatedSortField))); + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -99,14 +112,18 @@ public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageP //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) { + public System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) + { logger.debug("createSystem started..."); final System system = validateNonNullSystemParameters(systemName, address, port, authenticationInfo); - try { + try + { return systemRepository.saveAndFlush(system); - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -114,7 +131,8 @@ public System createSystem(final String systemName, final String address, final //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemResponseDTO createSystemResponse(final String systemName, final String address, final int port, final String authenticationInfo) { + public SystemResponseDTO createSystemResponse(final String systemName, final String address, final int port, final String authenticationInfo) + { logger.debug("createSystemResponse started..."); return DTOConverter.convertSystemToSystemResponseDTO(createSystem(systemName, address, port, authenticationInfo)); @@ -122,7 +140,9 @@ public SystemResponseDTO createSystemResponse(final String systemName, final Str //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemResponseDTO updateSystemResponse(final long systemId, final String systemName, final String address, final int port, final String authenticationInfo) { + public SystemResponseDTO updateSystemResponse(final long systemId, final String systemName, final String address, final int port, + final String authenticationInfo) + { logger.debug("updateSystemResponse started..."); return DTOConverter.convertSystemToSystemResponseDTO(updateSystem(systemId, systemName, address, port, authenticationInfo)); @@ -130,28 +150,33 @@ public SystemResponseDTO updateSystemResponse(final long systemId, final String //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public System updateSystem(final long systemId, final String systemName, final String address, final int port, final String authenticationInfo) { + public System updateSystem(final long systemId, final String systemName, final String address, final int port, final String authenticationInfo) + { logger.debug("updateSystem started..."); final long validatedSystemId = validateSystemId(systemId); final int validatedPort = validateSystemPort(port); final String validatedSystemName = validateSystemParamString(systemName); - if (validatedSystemName.contains(".")) { + if (validatedSystemName.contains(".")) + { throw new InvalidParameterException("System name can't contain dot (.)"); } final String validatedAddress = validateSystemParamString(address); final String validatedAuthenticationInfo = authenticationInfo; - try { + try + { final Optional systemOptional = systemRepository.findById(validatedSystemId); - if (!systemOptional.isPresent()) { + if (!systemOptional.isPresent()) + { throw new InvalidParameterException("No system with id : " + validatedSystemId); } final System system = systemOptional.get(); - if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) { + if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) + { checkConstraintsOfSystemTable(validatedSystemName, validatedAddress, validatedPort); } @@ -161,9 +186,13 @@ public System updateSystem(final long systemId, final String systemName, final S system.setAuthenticationInfo(validatedAuthenticationInfo); return systemRepository.saveAndFlush(system); - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -171,19 +200,26 @@ public System updateSystem(final long systemId, final String systemName, final S //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public void removeSystemById(final long id) { + public void removeSystemById(final long id) + { logger.debug("removeSystemById started..."); - try { - if (!systemRepository.existsById(id)) { + try + { + if (!systemRepository.existsById(id)) + { throw new InvalidParameterException(COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE); } systemRepository.deleteById(id); systemRepository.flush(); - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -191,7 +227,9 @@ public void removeSystemById(final long id) { //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemResponseDTO mergeSystemResponse(final long systemId, final String systemName, final String address, final Integer port, final String authenticationInfo) { + public SystemResponseDTO mergeSystemResponse(final long systemId, final String systemName, final String address, final Integer port, + final String authenticationInfo) + { logger.debug("mergeSystemResponse started..."); return DTOConverter.convertSystemToSystemResponseDTO(mergeSystem(systemId, systemName, address, port, authenticationInfo)); @@ -199,52 +237,65 @@ public SystemResponseDTO mergeSystemResponse(final long systemId, final String s //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public System mergeSystem(final long systemId, final String systemName, final String address, final Integer port, final String authenticationInfo) { + public System mergeSystem(final long systemId, final String systemName, final String address, final Integer port, final String authenticationInfo) + { logger.debug("mergeSystem started..."); final long validatedSystemId = validateSystemId(systemId); final Integer validatedPort = validateAllowNullSystemPort(port); final String validatedSystemName = validateAllowNullSystemParamString(systemName); - if (validatedSystemName != null && validatedSystemName.contains(".")) { + if (validatedSystemName != null && validatedSystemName.contains(".")) + { throw new InvalidParameterException("System name can't contain dot (.)"); } final String validatedAddress = validateAllowNullSystemParamString(address); final String validatedAuthenticationInfo = authenticationInfo; - try { + try + { final Optional systemOptional = systemRepository.findById(validatedSystemId); - if (!systemOptional.isPresent()) { + if (!systemOptional.isPresent()) + { throw new InvalidParameterException("No system with id : " + validatedSystemId); } final System system = systemOptional.get(); - if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) { + if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) + { checkConstraintsOfSystemTable(validatedSystemName != null ? validatedSystemName : system.getSystemName(), - validatedAddress != null ? validatedAddress : system.getAddress(), - validatedPort != null ? validatedPort.intValue() : system.getPort()); + validatedAddress != null ? validatedAddress : system.getAddress(), + validatedPort != null ? validatedPort.intValue() : system.getPort()); } - if (!Utilities.isEmpty(validatedSystemName)) { + if (!Utilities.isEmpty(validatedSystemName)) + { system.setSystemName(validatedSystemName); } - if (!Utilities.isEmpty(validatedAddress)) { + if (!Utilities.isEmpty(validatedAddress)) + { system.setAddress(validatedAddress); } - if (validatedPort != null) { + if (validatedPort != null) + { system.setPort(validatedPort); } - if (!Utilities.isEmpty(validatedAuthenticationInfo)) { + if (!Utilities.isEmpty(validatedAuthenticationInfo)) + { system.setAuthenticationInfo(validatedAuthenticationInfo); } return systemRepository.saveAndFlush(system); - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -252,64 +303,89 @@ public System mergeSystem(final long systemId, final String systemName, final St //------------------------------------------------------------------------------------------------- - public DeviceResponseDTO getDeviceById(long deviceId) { + public DeviceResponseDTO getDeviceById(long deviceId) + { logger.debug("getDeviceById started..."); - try { + try + { final Optional deviceOptional = deviceRepository.findById(deviceId); - if (deviceOptional.isEmpty()){ + if (deviceOptional.isEmpty()) + { throw new InvalidParameterException("Device with id " + deviceId + " not found."); } return DTOConverter.convertDeviceToDeviceResponseDTO(deviceOptional.get()); - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) { + public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) + { logger.debug("getDeviceList started..."); final String validatedSortField = Utilities.isEmpty(sortField) ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); - if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) { + if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) + { throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); } - try { + try + { final Page devices = deviceRepository.findAll(PageRequest.of(pageParams.getValidatedPage(), pageParams.getValidatedSize(), - pageParams.getValidatedDirection(), validatedSortField)); + pageParams.getValidatedDirection(), validatedSortField)); return DTOConverter.convertDeviceEntryListToDeviceListResponseDTO(devices); - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public DeviceResponseDTO createDevice(final DeviceRequestDTO dto) + { + final Device device = new Device(dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); + return DTOConverter.convertDeviceToDeviceResponseDTO(deviceRepository.save(device)); + } //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- @SuppressWarnings("squid:S1126") - private boolean checkSystemIfUniqueValidationNeeded(final System system, final String validatedSystemName, final String validatedAddress, final Integer validatedPort) { + private boolean checkSystemIfUniqueValidationNeeded(final System system, final String validatedSystemName, final String validatedAddress, + final Integer validatedPort) + { logger.debug("checkSystemIfUniqueValidationNeeded started..."); final String actualSystemName = system.getSystemName(); final String actualAddress = system.getAddress(); final int actualPort = system.getPort(); - if (validatedSystemName != null && !actualSystemName.equalsIgnoreCase(validatedSystemName)) { + if (validatedSystemName != null && !actualSystemName.equalsIgnoreCase(validatedSystemName)) + { return true; } - if (validatedAddress != null && !actualAddress.equalsIgnoreCase(validatedAddress)) { + if (validatedAddress != null && !actualAddress.equalsIgnoreCase(validatedAddress)) + { return true; } - if (validatedPort != null && actualPort != validatedPort.intValue()) { + if (validatedPort != null && actualPort != validatedPort.intValue()) + { return true; } @@ -317,40 +393,54 @@ private boolean checkSystemIfUniqueValidationNeeded(final System system, final S } //------------------------------------------------------------------------------------------------- - private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) { + private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) + { logger.debug("checkConstraintsOfSystemTable started..."); - try { - final Optional find = systemRepository.findBySystemNameAndAddressAndPort(validatedSystemName.toLowerCase().trim(), validatedAddress.toLowerCase().trim(), validatedPort); - if (find.isPresent()) { - throw new InvalidParameterException("System with name: " + validatedSystemName + ", address: " + validatedAddress + ", port: " + validatedPort + " already exists."); + try + { + final Optional find = systemRepository + .findBySystemNameAndAddressAndPort(validatedSystemName.toLowerCase().trim(), validatedAddress.toLowerCase().trim(), validatedPort); + if (find.isPresent()) + { + throw new InvalidParameterException( + "System with name: " + validatedSystemName + ", address: " + validatedAddress + ", port: " + validatedPort + " already exists."); } - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) { + private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) + { logger.debug("validateNonNullSystemParameters started..."); - if (Utilities.isEmpty(systemName)) { + if (Utilities.isEmpty(systemName)) + { throw new InvalidParameterException("System name is null or empty"); } - if (Utilities.isEmpty(address)) { + if (Utilities.isEmpty(address)) + { throw new InvalidParameterException("System address is null or empty"); } - if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) + { throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); } final String validatedSystemName = systemName.trim().toLowerCase(); - if (validatedSystemName.contains(".")) { + if (validatedSystemName.contains(".")) + { throw new InvalidParameterException("System name can't contain dot (.)"); } final String validatedAddress = address.trim().toLowerCase(); @@ -362,10 +452,12 @@ private System validateNonNullSystemParameters(final String systemName, final St } //------------------------------------------------------------------------------------------------- - private String validateSystemParamString(final String param) { + private String validateSystemParamString(final String param) + { logger.debug("validateSystemParamString started..."); - if (Utilities.isEmpty(param)) { + if (Utilities.isEmpty(param)) + { throw new InvalidParameterException("parameter null or empty"); } @@ -373,10 +465,12 @@ private String validateSystemParamString(final String param) { } //------------------------------------------------------------------------------------------------- - private int validateSystemPort(final int port) { + private int validateSystemPort(final int port) + { logger.debug("validateSystemPort started..."); - if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) + { throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); } @@ -384,10 +478,12 @@ private int validateSystemPort(final int port) { } //------------------------------------------------------------------------------------------------- - private long validateSystemId(final long systemId) { + private long validateSystemId(final long systemId) + { logger.debug("validateSystemId started..."); - if (systemId < 1) { + if (systemId < 1) + { throw new IllegalArgumentException("System id must be greater than zero"); } @@ -395,10 +491,12 @@ private long validateSystemId(final long systemId) { } //------------------------------------------------------------------------------------------------- - private Integer validateAllowNullSystemPort(final Integer port) { + private Integer validateAllowNullSystemPort(final Integer port) + { logger.debug("validateAllowNullSystemPort started..."); - if (port != null && (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX)) { + if (port != null && (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX)) + { throw new IllegalArgumentException(PORT_RANGE_ERROR_MESSAGE); } @@ -406,10 +504,12 @@ private Integer validateAllowNullSystemPort(final Integer port) { } //------------------------------------------------------------------------------------------------- - private String validateAllowNullSystemParamString(final String param) { + private String validateAllowNullSystemParamString(final String param) + { logger.debug("validateAllowNullSystemParamString started..."); - if (Utilities.isEmpty(param)) { + if (Utilities.isEmpty(param)) + { return null; } @@ -417,19 +517,24 @@ private String validateAllowNullSystemParamString(final String param) { } //------------------------------------------------------------------------------------------------- - private System findOrCreateSystem(final String systemName, final String address, final int port, final String authenticationInfo) { - final Optional optProvider = systemRepository.findBySystemNameAndAddressAndPort(systemName.toLowerCase().trim(), address.toLowerCase().trim(), port); + private System findOrCreateSystem(final String systemName, final String address, final int port, final String authenticationInfo) + { + final Optional optProvider = systemRepository + .findBySystemNameAndAddressAndPort(systemName.toLowerCase().trim(), address.toLowerCase().trim(), port); System provider; - if (optProvider.isPresent()) { + if (optProvider.isPresent()) + { provider = optProvider.get(); - if (!Objects.equals(authenticationInfo, provider.getAuthenticationInfo())) { // authentication info has changed + if (!Objects.equals(authenticationInfo, provider.getAuthenticationInfo())) + { // authentication info has changed provider.setAuthenticationInfo(authenticationInfo); provider = systemRepository.saveAndFlush(provider); } - } else { + } + else + { provider = createSystem(systemName, address, port, authenticationInfo); } return provider; } - } From 706e2b9992329482381dc92267a55c753132b5a5 Mon Sep 17 00:00:00 2001 From: mzsilak Date: Thu, 16 Jan 2020 15:46:55 +0100 Subject: [PATCH 008/301] WIP on SystemRegistryController --- .../database/repository/DeviceRepository.java | 2 +- .../SystemRegistryListResponseDTO.java | 41 ++ .../dto/shared/SystemRegistryRequestDTO.java | 39 ++ .../dto/shared/SystemRegistryResponseDTO.java | 49 ++ .../SystemRegistryController.java | 490 ++++++++---------- .../service/SystemRegistryDBService.java | 198 ++++++- 6 files changed, 517 insertions(+), 302 deletions(-) create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/internal/SystemRegistryListResponseDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryResponseDTO.java diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRepository.java index d8c604a67..bfe573e7b 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRepository.java @@ -14,6 +14,6 @@ public interface DeviceRepository extends RefreshableRepository { // methods //------------------------------------------------------------------------------------------------- - public Optional findByDeviceNameAndAddress(final String deviceName, final String address); + public Optional findByDeviceNameAndMacAddress(final String deviceName, final String address); public List findByDeviceName(final String deviceName); } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/SystemRegistryListResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/SystemRegistryListResponseDTO.java new file mode 100644 index 000000000..0e4ae3f76 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/SystemRegistryListResponseDTO.java @@ -0,0 +1,41 @@ +package eu.arrowhead.common.dto.internal; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryResponseDTO; + +import java.io.Serializable; +import java.util.List; + +@JsonInclude(Include.NON_NULL) +public class SystemRegistryListResponseDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = 3892383727230105100L; + + private List data; + private long count; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public SystemRegistryListResponseDTO() {} + + //------------------------------------------------------------------------------------------------- + public SystemRegistryListResponseDTO(final List data, final long count) { + this.data = data; + this.count = count; + } + + //------------------------------------------------------------------------------------------------- + public List getData() {return data;} + public long getCount() {return count;} + + //------------------------------------------------------------------------------------------------- + public void setData(final List data) {this.data = data;} + public void setCount(final long count) {this.count = count;} +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java new file mode 100644 index 000000000..4e9310388 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java @@ -0,0 +1,39 @@ +package eu.arrowhead.common.dto.shared; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.Serializable; +import java.util.Map; + +@JsonInclude(Include.NON_NULL) +public class SystemRegistryRequestDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = -635438605292398404L; + + private SystemResponseDTO system; + private DeviceResponseDTO provider; + private String endOfValidity; + private Map metadata; + private int version; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public SystemResponseDTO getSystem() { return system; } + public DeviceResponseDTO getProvider() { return provider; } + public String getEndOfValidity() { return endOfValidity; } + public Map getMetadata() { return metadata; } + public int getVersion() { return version; } + + //------------------------------------------------------------------------------------------------- + public void setSystem(final SystemResponseDTO system) { this.system = system; } + public void setProvider(final DeviceResponseDTO provider) { this.provider = provider; } + public void setEndOfValidity(final String endOfValidity) { this.endOfValidity = endOfValidity; } + public void setMetadata(final Map metadata) { this.metadata = metadata; } + public void setVersion(final int version) { this.version = version; } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryResponseDTO.java new file mode 100644 index 000000000..d853d0369 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryResponseDTO.java @@ -0,0 +1,49 @@ +package eu.arrowhead.common.dto.shared; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +@JsonInclude(Include.NON_NULL) +public class SystemRegistryResponseDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = -635438605292398404L; + + private long id; + private SystemResponseDTO system; + private DeviceResponseDTO provider; + private String endOfValidity; + private Map metadata; + private int version; + private String createdAt; + private String updatedAt; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public long getId() { return id; } + public SystemResponseDTO getSystem() { return system; } + public DeviceResponseDTO getProvider() { return provider; } + public String getEndOfValidity() { return endOfValidity; } + public Map getMetadata() { return metadata; } + public int getVersion() { return version; } + public String getCreatedAt() { return createdAt; } + public String getUpdatedAt() { return updatedAt; } + + //------------------------------------------------------------------------------------------------- + public void setId(final long id) { this.id = id; } + public void setSystem(final SystemResponseDTO system) { this.system = system; } + public void setProvider(final DeviceResponseDTO provider) { this.provider = provider; } + public void setEndOfValidity(final String endOfValidity) { this.endOfValidity = endOfValidity; } + public void setMetadata(final Map metadata) { this.metadata = metadata; } + public void setVersion(final int version) { this.version = version; } + public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } + public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } +} \ No newline at end of file diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java index 150f23437..e27dee743 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java @@ -2,11 +2,9 @@ import eu.arrowhead.common.*; import eu.arrowhead.common.core.CoreSystem; -import eu.arrowhead.common.core.CoreSystemService; import eu.arrowhead.common.dto.internal.*; import eu.arrowhead.common.dto.shared.*; import eu.arrowhead.common.exception.BadPayloadException; -import eu.arrowhead.common.intf.ServiceInterfaceNameVerifier; import eu.arrowhead.core.systemregistry.database.service.SystemRegistryDBService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -68,40 +66,36 @@ public class SystemRegistryController private static final String DELETE_DEVICE_HTTP_200_MESSAGE = "Device deleted"; private static final String DELETE_DEVICE_HTTP_400_MESSAGE = "Could not delete device"; - private static final String SERVICES_URI = CoreCommonConstants.MGMT_URI + "/services"; - private static final String SERVICES_BY_ID_URI = SERVICES_URI + "/{" + PATH_VARIABLE_ID + "}"; - private static final String GET_SERVICES_HTTP_200_MESSAGE = "Services returned"; - private static final String GET_SERVICES_HTTP_400_MESSAGE = "Could not retrieve service definition"; - private static final String POST_SERVICES_HTTP_201_MESSAGE = "Service definition created"; - private static final String POST_SERVICES_HTTP_400_MESSAGE = "Could not create service definition"; - private static final String PUT_SERVICES_HTTP_200_MESSAGE = "Service definition updated"; - private static final String PUT_SERVICES_HTTP_400_MESSAGE = "Could not update service definition"; - private static final String PATCH_SERVICES_HTTP_200_MESSAGE = "Service definition updated"; - private static final String PATCH_SERVICES_HTTP_400_MESSAGE = "Could not update service definition"; - private static final String DELETE_SERVICES_HTTP_200_MESSAGE = "Service definition removed"; - private static final String DELETE_SERVICES_HTTP_400_MESSAGE = "Could not remove service definition"; - - private static final String SERVICE_REGISTRY_REGISTER_DESCRIPTION = "Registers a service"; - private static final String SERVICE_REGISTRY_REGISTER_201_MESSAGE = "Service registered"; - private static final String SERVICE_REGISTRY_REGISTER_400_MESSAGE = "Could not register service"; - private static final String SERVICE_REGISTRY_UNREGISTER_DESCRIPTION = "Remove a registered service"; - private static final String SERVICE_REGISTRY_UNREGISTER_200_MESSAGE = "Registered service removed"; - private static final String SERVICE_REGISTRY_UNREGISTER_400_MESSAGE = "Could not remove service"; - private static final String SERVICE_REGISTRY_QUERY_DESCRIPTION = "Return Service Registry data that fits the specification"; - private static final String SERVICE_REGISTRY_QUERY_200_MESSAGE = "Service Registry data returned"; - private static final String SERVICE_REGISTRY_QUERY_400_MESSAGE = "Could not query Service Registry"; - private static final String SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_DESCRIPTION = "Return system by requested id"; - private static final String SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_200_MESSAGE = "System data by id returned"; - private static final String SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_400_MESSAGE = "Could not query Service Registry by Consumer system id"; - private static final String SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_DESCRIPTION = "Return System by requested dto"; - private static final String SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_200_MESSAGE = "Consumer System data by requestDTO returned"; - private static final String SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_400_MESSAGE = "Could not query Service Registry by Consumer system requestDTO"; - private static final String SERVICE_REGISTRY_UPDATE_DESCRIPTION = "Update a service"; - private static final String SERVICE_REGISTRY_UPDATE_200_MESSAGE = "Service updated"; - private static final String SERVICE_REGISTRY_UPDATE_400_MESSAGE = "Could not update service"; - private static final String SERVICE_REGISTRY_MERGE_DESCRIPTION = "Merge/Patch a service"; - private static final String SERVICE_REGISTRY_MERGE_200_MESSAGE = "Service merged"; - private static final String SERVICE_REGISTRY_MERGE_400_MESSAGE = "Could not merge service"; + private static final String POST_SYSTEMS_HTTP_201_MESSAGE = "System definition created"; + private static final String POST_SYSTEMS_HTTP_400_MESSAGE = "Could not create system definition"; + private static final String PUT_SYSTEMS_HTTP_200_MESSAGE = "System definition updated"; + private static final String PUT_SYSTEMS_HTTP_400_MESSAGE = "Could not update system definition"; + private static final String PATCH_SYSTEMS_HTTP_200_MESSAGE = "System definition updated"; + private static final String PATCH_SYSTEMS_HTTP_400_MESSAGE = "Could not update system definition"; + private static final String DELETE_SYSTEMS_HTTP_200_MESSAGE = "System definition removed"; + private static final String DELETE_SYSTEMS_HTTP_400_MESSAGE = "Could not remove system definition"; + + private static final String SYSTEM_REGISTRY_REGISTER_DESCRIPTION = "Registers a system"; + private static final String SYSTEM_REGISTRY_REGISTER_201_MESSAGE = "System registered"; + private static final String SYSTEM_REGISTRY_REGISTER_400_MESSAGE = "Could not register system"; + private static final String SYSTEM_REGISTRY_UNREGISTER_DESCRIPTION = "Remove a registered system"; + private static final String SYSTEM_REGISTRY_UNREGISTER_200_MESSAGE = "Registered system removed"; + private static final String SYSTEM_REGISTRY_UNREGISTER_400_MESSAGE = "Could not remove system"; + private static final String SYSTEM_REGISTRY_QUERY_DESCRIPTION = "Return System Registry data that fits the specification"; + private static final String SYSTEM_REGISTRY_QUERY_200_MESSAGE = "System Registry data returned"; + private static final String SYSTEM_REGISTRY_QUERY_400_MESSAGE = "Could not query System Registry"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_DESCRIPTION = "Return system by requested id"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_200_MESSAGE = "System data by id returned"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_400_MESSAGE = "Could not query System Registry by Consumer system id"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_DESCRIPTION = "Return System by requested dto"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_200_MESSAGE = "Consumer System data by requestDTO returned"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_400_MESSAGE = "Could not query System Registry by Consumer system requestDTO"; + private static final String SYSTEM_REGISTRY_UPDATE_DESCRIPTION = "Update a system"; + private static final String SYSTEM_REGISTRY_UPDATE_200_MESSAGE = "System updated"; + private static final String SYSTEM_REGISTRY_UPDATE_400_MESSAGE = "Could not update system"; + private static final String SYSTEM_REGISTRY_MERGE_DESCRIPTION = "Merge/Patch a system"; + private static final String SYSTEM_REGISTRY_MERGE_200_MESSAGE = "System merged"; + private static final String SYSTEM_REGISTRY_MERGE_400_MESSAGE = "Could not merge system"; private static final String NOT_VALID_PARAMETERS_ERROR_MESSAGE = "Not valid request parameters."; private static final String ID_NOT_VALID_ERROR_MESSAGE = "Id must be greater than 0. "; @@ -109,35 +103,33 @@ public class SystemRegistryController private static final String SYSTEM_ADDRESS_NULL_ERROR_MESSAGE = " System address must have value "; private static final String SYSTEM_PORT_NULL_ERROR_MESSAGE = " System port must have value "; - private static final String SERVICE_REGISTRY_MGMT_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/{" + PATH_VARIABLE_ID + "}"; - private static final String PATH_VARIABLE_SERVICE_DEFINITION = "serviceDefinition"; - private static final String SERVICE_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI = CoreCommonConstants.MGMT_URI + "/servicedef" + "/{" + PATH_VARIABLE_SERVICE_DEFINITION + "}"; - private static final String SERVICE_REGISTRY_MGMT_GROUPED_URI = CoreCommonConstants.MGMT_URI + "/grouped"; - private static final String GET_SERVICE_REGISTRY_HTTP_200_MESSAGE = "Service Registry entries returned"; - private static final String GET_SERVICE_REGISTRY_HTTP_400_MESSAGE = "Could not retrieve service registry entries"; - private static final String DELETE_SERVICE_REGISTRY_HTTP_200_MESSAGE = "Service Registry entry removed"; - private static final String DELETE_SERVICE_REGISTRY_HTTP_400_MESSAGE = "Could not remove service registry entry"; + private static final String SYSTEM_REGISTRY_MGMT_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/{" + PATH_VARIABLE_ID + "}"; + private static final String PATH_VARIABLE_SERVICE_DEFINITION = "systemDefinition"; + private static final String SYSTEM_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI = CoreCommonConstants.MGMT_URI + "/systemdef" + "/{" + PATH_VARIABLE_SERVICE_DEFINITION + "}"; + private static final String SYSTEM_REGISTRY_MGMT_GROUPED_URI = CoreCommonConstants.MGMT_URI + "/grouped"; + private static final String GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE = "System Registry entries returned"; + private static final String GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE = "Could not retrieve system registry entries"; + private static final String DELETE_SYSTEM_REGISTRY_HTTP_200_MESSAGE = "System Registry entry removed"; + private static final String DELETE_SYSTEM_REGISTRY_HTTP_400_MESSAGE = "Could not remove system registry entry"; private final Logger logger = LogManager.getLogger(SystemRegistryController.class); @Autowired private SystemRegistryDBService systemRegistryDBService; - @Autowired - private ServiceInterfaceNameVerifier interfaceNameVerifier; - + //================================================================================================= // methods //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return an echo message with the purpose of testing the core service availability", response = String.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) + @ApiOperation(value = "Return an echo message with the purpose of testing the core system availability", response = String.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_OK, message = CoreCommonConstants.SWAGGER_HTTP_200_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) @GetMapping(path = CommonConstants.ECHO_URI) - public String echoService() { + public String echoSystem() { return "Got it!"; } @@ -154,7 +146,7 @@ public String echoService() { logger.debug("getSystemById started ..."); if (systemId < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEM_BY_ID_URI); + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_BY_ID_URI); } return systemRegistryDBService.getSystemById(systemId); @@ -233,7 +225,7 @@ public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) logger.debug("New System delete request received with id: {}", id); if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_BY_ID_URI); + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); } systemRegistryDBService.removeSystemById(id); @@ -253,7 +245,7 @@ public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) logger.debug("getDeviceById started ..."); if (deviceId < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEM_BY_ID_URI); + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_BY_ID_URI); } return systemRegistryDBService.getDeviceById(deviceId); @@ -276,8 +268,7 @@ public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) logger.debug("New DeviceList get request received with page: {} and item_per page: {}", page, size); final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.SYSTEM_REGISTRY_URI + DEVICES_URI); - final DeviceListResponseDTO deviceListResponseDTO = systemRegistryDBService - .getDeviceEntries(pageParameters, sortField); + final DeviceListResponseDTO deviceListResponseDTO = systemRegistryDBService.getDeviceEntries(pageParameters, sortField); logger.debug("DeviceList with page: {} and item_per page: {} successfully retrieved", page, size); return deviceListResponseDTO; @@ -293,12 +284,12 @@ public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) }) @PostMapping(path = DEVICES_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) - @ResponseBody public DeviceResponseDTO addDevice(@RequestBody final DeviceRequestDTO deviceRequestDto) { - logger.debug("New device registration request received with name: {}", deviceRequestDto.getDeviceName()); + @ResponseBody public DeviceResponseDTO addDevice(@RequestBody final DeviceRequestDTO dto) { + logger.debug("New device registration request received with name: {}", dto.getDeviceName()); - validateDevice(deviceRequestDto); + validateDevice(dto); - final DeviceResponseDTO responseDTO = systemRegistryDBService.createDevice(deviceRequestDto); + final DeviceResponseDTO responseDTO = systemRegistryDBService.createDevice(dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); logger.debug("{} successfully registered.", responseDTO); return responseDTO; @@ -313,140 +304,111 @@ public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) @PutMapping(path = DEVICE_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public DeviceResponseDTO putUpdateServiceDefinition(@PathVariable(value = PATH_VARIABLE_ID) final long id, - @RequestBody final DeviceRequestDTO deviceRequestDto) { - final String serviceDefinition = serviceDefinitionRequestDTO.getServiceDefinition(); - logger.debug("New Service Definition update request received with id: {}, definition: {}", id, serviceDefinition); + @ResponseBody public DeviceResponseDTO putUpdateDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id, + @RequestBody final DeviceRequestDTO dto) { + logger.debug("New device update request received with id: {}, definition: {}", id, dto); if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_BY_ID_URI); + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + DEVICE_BY_ID_URI); } - validateDevice(deviceRequestDto); + validateDevice(dto); - final ServiceDefinitionResponseDTO serviceDefinitionResponse = systemRegistryDBService.updateServiceDefinitionByIdResponse(id, serviceDefinition); - logger.debug("Service definition with id: '{}' successfully updated with definition '{}'.", id, serviceDefinition); + final DeviceResponseDTO deviceResponseDTO = systemRegistryDBService.updateDeviceByIdResponse(id, dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); + logger.debug("Device with id: '{}' successfully updated with definition '{}'.", id, deviceResponseDTO); - return serviceDefinitionResponse; + return deviceResponseDTO; } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return updated service definition", response = ServiceDefinitionResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = PATCH_SERVICES_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PATCH_SERVICES_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PatchMapping(path = SERVICES_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = "application/json") - @ResponseBody public ServiceDefinitionResponseDTO patchUpdateServiceDefinition(@PathVariable(value = PATH_VARIABLE_ID) final long id, - @RequestBody final ServiceDefinitionRequestDTO serviceDefinitionRequestDTO) { - // Currently ServiceDefinition has only one updatable field, therefore PUT and PATCH do the same - return putUpdateServiceDefinition(id, serviceDefinitionRequestDTO); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Remove service definition", tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiOperation(value = "Remove device", tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SERVICES_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SERVICES_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEMS_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEMS_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @DeleteMapping(path = SERVICES_BY_ID_URI) - public void removeServiceDefinition(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New Service Definition delete request received with id: {}", id); + @DeleteMapping(path = DEVICE_BY_ID_URI) + public void removeDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New System Definition delete request received with id: {}", id); if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICES_BY_ID_URI); + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + DEVICE_BY_ID_URI); } - systemRegistryDBService.removeServiceDefinitionById(id); - logger.debug("Service definition with id: '{}' successfully deleted", id); + systemRegistryDBService.removeDeviceById(id); + logger.debug("Device with id: '{}' successfully deleted", id); } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return requested service registry entries by the given parameters", response = ServiceRegistryListResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiOperation(value = "Return requested system registry entries by the given parameters", response = SystemRegistryListResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SERVICE_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SERVICE_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) @GetMapping(path = CoreCommonConstants.MGMT_URI) - @ResponseBody public ServiceRegistryListResponseDTO getServiceRegistryEntries( + @ResponseBody public SystemRegistryListResponseDTO getSystemRegistryEntries( @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("New Service Registry get request received with page: {} and item_per page: {}", page, size); - - int validatedPage; - int validatedSize; - if (page == null && size == null) { - validatedPage = -1; - validatedSize = -1; - } else { - if (page == null || size == null) { - throw new BadPayloadException("Defined page or size could not be with undefined size or page.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + - CoreCommonConstants.MGMT_URI); - } else { - validatedPage = page; - validatedSize = size; - } - } - - final Direction validatedDirection = CoreUtilities.calculateDirection(direction, CommonConstants.SERVICE_REGISTRY_URI + CoreCommonConstants.MGMT_URI); - final ServiceRegistryListResponseDTO serviceRegistryEntriesResponse = systemRegistryDBService - .getServiceRegistryEntriesResponse(validatedPage, validatedSize, validatedDirection, sortField); - logger.debug("Service Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); + logger.debug("New System Registry get request received with page: {} and item_per page: {}", page, size); + + final CoreUtilities.ValidatedPageParams params = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.SYSTEM_REGISTRY_URI + CoreCommonConstants.MGMT_URI); + final SystemRegistryListResponseDTO systemRegistryEntriesResponse = systemRegistryDBService + .getSystemRegistryEntriesResponse(params, sortField); + logger.debug("System Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); - return serviceRegistryEntriesResponse; + return systemRegistryEntriesResponse; } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return requested service registry entry", response = ServiceRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiOperation(value = "Return requested system registry entry", response = SystemRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SERVICE_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SERVICE_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @GetMapping(path = SERVICE_REGISTRY_MGMT_BY_ID_URI) - @ResponseBody public ServiceRegistryResponseDTO getServiceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New Service Registry get request received with id: {}", id); + @GetMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI) + @ResponseBody public SystemRegistryResponseDTO getSystemRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New System Registry get request received with id: {}", id); if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICE_REGISTRY_MGMT_BY_ID_URI); + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_ID_URI); } - final ServiceRegistryResponseDTO serviceRegistryEntryByIdResponse = systemRegistryDBService.getServiceRegistryEntryByIdResponse(id); - logger.debug("Service Registry entry with id: {} successfully retrieved", id); + final SystemRegistryResponseDTO systemRegistryEntryByIdResponse = systemRegistryDBService.getSystemRegistryEntryByIdResponse(id); + logger.debug("System Registry entry with id: {} successfully retrieved", id); - return serviceRegistryEntryByIdResponse; + return systemRegistryEntryByIdResponse; } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return requested service registry entries by service definition based on the given parameters", response = ServiceRegistryListResponseDTO.class, + @ApiOperation(value = "Return requested system registry entries by system definition based on the given parameters", response = SystemRegistryListResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SERVICE_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SERVICE_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @GetMapping(path = SERVICE_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI) - @ResponseBody public ServiceRegistryListResponseDTO getServiceRegistryEntriesByServiceDefinition( - @PathVariable(value = PATH_VARIABLE_SERVICE_DEFINITION) final String serviceDefinition, + @GetMapping(path = SYSTEM_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI) + @ResponseBody public SystemRegistryListResponseDTO getSystemRegistryEntriesBySystemName( + @PathVariable(value = PATH_VARIABLE_SERVICE_DEFINITION) final String systemName, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("New Service Registry get by Service Definition request received with page: {} and item_per page: {}", page, size); + logger.debug("New System Registry get by System Definition request received with page: {} and item_per page: {}", page, size); - if (Utilities.isEmpty(serviceDefinition)) { - throw new BadPayloadException("Service definition cannot be empty.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICE_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI); + if (Utilities.isEmpty(systemName)) { + throw new BadPayloadException("System name cannot be empty.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI); } - + + // TODO get system registry entries with given system name + int validatedPage; int validatedSize; if (page == null && size == null) { @@ -454,198 +416,180 @@ public void removeServiceDefinition(@PathVariable(value = PATH_VARIABLE_ID) fina validatedSize = -1; } else { if (page == null || size == null) { - throw new BadPayloadException("Defined page or size could not be with undefined size or page.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + - SERVICE_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI); + throw new BadPayloadException("Defined page or size could not be with undefined size or page.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + + SYSTEM_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI); } else { validatedPage = page; validatedSize = size; } } - final Direction validatedDirection = CoreUtilities.calculateDirection(direction, CommonConstants.SERVICE_REGISTRY_URI + SERVICE_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI); - final ServiceRegistryListResponseDTO serviceRegistryEntries = systemRegistryDBService - .getServiceRegistryEntriesByServiceDefinitionResponse(serviceDefinition, validatedPage, validatedSize, + final Direction validatedDirection = CoreUtilities.calculateDirection(direction, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI); + final SystemRegistryListResponseDTO systemRegistryEntries = systemRegistryDBService + .getSystemRegistryEntriesBySystemDefinitionResponse(systemDefinition, validatedPage, validatedSize, validatedDirection, sortField); - logger.debug("Service Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); - - return serviceRegistryEntries; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return all service registry entries grouped for frontend usage", response = ServiceRegistryGroupedResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SERVICE_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SERVICE_REGISTRY_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = SERVICE_REGISTRY_MGMT_GROUPED_URI) - @ResponseBody public ServiceRegistryGroupedResponseDTO getServiceRegistryGroupedData() { - logger.debug("New get request for grouped service registry data"); - - final ServiceRegistryGroupedResponseDTO serviceRegistryGroupedResponseDTO = systemRegistryDBService.getServiceRegistryDataForServiceRegistryGroupedResponse(); - logger.debug("Grouped service registry data successfully retrieved"); + logger.debug("System Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); - return serviceRegistryGroupedResponseDTO; + return systemRegistryEntries; } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Remove the specified service registry entry", tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiOperation(value = "Remove the specified system registry entry", tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SERVICE_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SERVICE_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEM_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEM_REGISTRY_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @DeleteMapping(path = SERVICE_REGISTRY_MGMT_BY_ID_URI) - public void removeServiceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New Service Registry delete request received with id: {}", id); + @DeleteMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI) + public void removeSystemRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New System Registry delete request received with id: {}", id); if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SERVICE_REGISTRY_MGMT_BY_ID_URI); + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_ID_URI); } - systemRegistryDBService.removeServiceRegistryEntryById(id); - logger.debug("Service Registry with id: '{}' successfully deleted", id); + systemRegistryDBService.removeSystemRegistryEntryById(id); + logger.debug("System Registry with id: '{}' successfully deleted", id); } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SERVICE_REGISTRY_REGISTER_DESCRIPTION, response = ServiceRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) + @ApiOperation(value = SYSTEM_REGISTRY_REGISTER_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = SERVICE_REGISTRY_REGISTER_201_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SERVICE_REGISTRY_REGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_CREATED, message = SYSTEM_REGISTRY_REGISTER_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_REGISTER_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) - @PostMapping(path = CommonConstants.OP_SERVICE_REGISTRY_REGISTER_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public ServiceRegistryResponseDTO registerService(@RequestBody final ServiceRegistryRequestDTO request) { - logger.debug("New service registration request received"); - checkServiceRegistryRequest(request, false); + @PostMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public SystemRegistryResponseDTO registerSystem(@RequestBody final SystemRegistryRequestDTO request) { + logger.debug("New system registration request received"); + checkSystemRegistryRequest(request, false); - final ServiceRegistryResponseDTO response = systemRegistryDBService.registerServiceResponse(request); - logger.debug("{} successfully registers its service {}", request.getProviderSystem().getSystemName(), request.getServiceDefinition()); + final SystemRegistryResponseDTO response = systemRegistryDBService.registerSystemResponse(request); + logger.debug("{} successfully registers its system {}", request.getProviderSystem().getSystemName(), request.getSystemDefinition()); return response; } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SERVICE_REGISTRY_REGISTER_DESCRIPTION, response = ServiceRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiOperation(value = SYSTEM_REGISTRY_REGISTER_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = SERVICE_REGISTRY_REGISTER_201_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SERVICE_REGISTRY_REGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_CREATED, message = SYSTEM_REGISTRY_REGISTER_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_REGISTER_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) @PostMapping(path = CoreCommonConstants.MGMT_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public @ResponseBody ServiceRegistryResponseDTO addServiceRegistry(@RequestBody final ServiceRegistryRequestDTO request) { - logger.debug("New service registration request received"); - checkServiceRegistryRequest(request, CoreCommonConstants.MGMT_URI, true); + public @ResponseBody SystemRegistryResponseDTO addSystemRegistry(@RequestBody final SystemRegistryRequestDTO request) { + logger.debug("New system registration request received"); + checkSystemRegistryRequest(request, CoreCommonConstants.MGMT_URI, true); - final ServiceRegistryResponseDTO response = systemRegistryDBService.registerServiceResponse(request); - logger.debug("{}'s service {} is successfully registered", request.getProviderSystem().getSystemName(), request.getServiceDefinition()); + final SystemRegistryResponseDTO response = systemRegistryDBService.registerSystemResponse(request); + logger.debug("{}'s system {} is successfully registered", request.getProviderSystem().getSystemName(), request.getSystemDefinition()); return response; } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SERVICE_REGISTRY_UPDATE_DESCRIPTION, response = ServiceRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiOperation(value = SYSTEM_REGISTRY_UPDATE_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SERVICE_REGISTRY_UPDATE_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SERVICE_REGISTRY_UPDATE_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_UPDATE_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_UPDATE_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @PutMapping(path = SERVICE_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public @ResponseBody ServiceRegistryResponseDTO updateServiceRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final ServiceRegistryRequestDTO request) { - logger.debug("New service registry update request received"); - checkServiceRegistryUpdateRequest(id, request, CoreCommonConstants.MGMT_URI); + @PutMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody SystemRegistryResponseDTO updateSystemRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final SystemRegistryRequestDTO request) { + logger.debug("New system registry update request received"); + checkSystemRegistryUpdateRequest(id, request, CoreCommonConstants.MGMT_URI); - final ServiceRegistryResponseDTO response = systemRegistryDBService.updateServiceByIdResponse(id, request); - logger.debug("Service Registry entry {} is successfully updated with system {} and service {}", id, request.getProviderSystem().getSystemName(), request.getServiceDefinition()); + final SystemRegistryResponseDTO response = systemRegistryDBService.updateSystemByIdResponse(id, request); + logger.debug("System Registry entry {} is successfully updated with system {} and system {}", id, request.getProviderSystem().getSystemName(), request.getSystemDefinition()); return response; } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SERVICE_REGISTRY_MERGE_DESCRIPTION, response = ServiceRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiOperation(value = SYSTEM_REGISTRY_MERGE_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SERVICE_REGISTRY_MERGE_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SERVICE_REGISTRY_MERGE_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_MERGE_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_MERGE_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @PatchMapping(path = SERVICE_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public @ResponseBody ServiceRegistryResponseDTO mergeServiceRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final ServiceRegistryRequestDTO request) { - logger.debug("New service registry merge request received"); - checkServiceRegistryMergeRequest(id, request, CoreCommonConstants.MGMT_URI); + @PatchMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody SystemRegistryResponseDTO mergeSystemRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final SystemRegistryRequestDTO request) { + logger.debug("New system registry merge request received"); + checkSystemRegistryMergeRequest(id, request, CoreCommonConstants.MGMT_URI); - final ServiceRegistryResponseDTO response = systemRegistryDBService.mergeServiceByIdResponse(id, request); - logger.debug("Service Registry entry {} is successfully merged witch system {} and service {}", id, response.getProvider().getSystemName(), request.getServiceDefinition()); + final SystemRegistryResponseDTO response = systemRegistryDBService.mergeSystemByIdResponse(id, request); + logger.debug("System Registry entry {} is successfully merged witch system {} and system {}", id, response.getProvider().getSystemName(), request.getSystemDefinition()); return response; } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SERVICE_REGISTRY_UNREGISTER_DESCRIPTION, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) + @ApiOperation(value = SYSTEM_REGISTRY_UNREGISTER_DESCRIPTION, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SERVICE_REGISTRY_UNREGISTER_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SERVICE_REGISTRY_UNREGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_UNREGISTER_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_UNREGISTER_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @DeleteMapping(path = CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_URI) - public void unregisterService(@RequestParam(CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_SERVICE_DEFINITION) final String serviceDefinition, - @RequestParam(CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_SYSTEM_NAME) final String providerName, - @RequestParam(CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_ADDRESS) final String providerAddress, - @RequestParam(CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_PORT) final int providerPort) { - logger.debug("Service removal request received"); - checkUnregisterServiceParameters(serviceDefinition, providerName, providerAddress, providerPort); + @DeleteMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_URI) + public void unregisterSystem(@RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_SERVICE_DEFINITION) final String systemName, + @RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_SYSTEM_NAME) final String providerName, + @RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_ADDRESS) final String providerAddress, + @RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_PORT) final int providerPort) { + logger.debug("System removal request received"); + checkUnregisterSystemParameters(systemName, providerName, providerAddress, providerPort); - systemRegistryDBService.removeServiceRegistry(serviceDefinition, providerName, providerAddress, providerPort); - logger.debug("{} successfully removed its service {}", providerName, serviceDefinition); + systemRegistryDBService.removeSystemRegistry(systemName, providerName, providerAddress, providerPort); + logger.debug("{} successfully removed its system {}", providerName, systemName); } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SERVICE_REGISTRY_QUERY_DESCRIPTION, response = ServiceQueryResultDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) + @ApiOperation(value = SYSTEM_REGISTRY_QUERY_DESCRIPTION, response = SystemQueryResultDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SERVICE_REGISTRY_QUERY_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SERVICE_REGISTRY_QUERY_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_QUERY_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_QUERY_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @PostMapping(path = CommonConstants.OP_SERVICE_REGISTRY_QUERY_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public ServiceQueryResultDTO queryRegistry(@RequestBody final ServiceQueryFormDTO form) { - logger.debug("Service query request received"); + @PostMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_QUERY_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public SystemQueryResultDTO queryRegistry(@RequestBody final SystemQueryFormDTO form) { + logger.debug("System query request received"); - if (Utilities.isEmpty(form.getServiceDefinitionRequirement())) { - throw new BadPayloadException("Service definition requirement is null or blank" , HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + - CommonConstants.OP_SERVICE_REGISTRY_QUERY_URI); + if (Utilities.isEmpty(form.getSystemDefinitionRequirement())) { + throw new BadPayloadException("System definition requirement is null or blank" , HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + + CommonConstants.OP_SYSTEM_REGISTRY_QUERY_URI); } - final ServiceQueryResultDTO result = systemRegistryDBService.queryRegistry(form); - logger.debug("Return {} providers for service {}", result.getServiceQueryData().size(), form.getServiceDefinitionRequirement()); + final SystemQueryResultDTO result = systemRegistryDBService.queryRegistry(form); + logger.debug("Return {} providers for system {}", result.getSystemQueryData().size(), form.getSystemDefinitionRequirement()); return result; } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_DESCRIPTION, response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_PRIVATE }) + @ApiOperation(value = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_DESCRIPTION, response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_PRIVATE }) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @GetMapping(path = CoreCommonConstants.OP_SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(path = CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public SystemResponseDTO queryRegistryBySystemId(@PathVariable(value = PATH_VARIABLE_ID) final long systemId) { - logger.debug("Service query by system id request received"); + logger.debug("System query by system id request received"); if (systemId < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + - CoreCommonConstants.OP_SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_URI); + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + + CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI); } final SystemResponseDTO result = systemRegistryDBService.getSystemById(systemId); @@ -655,18 +599,18 @@ public void unregisterService(@RequestParam(CommonConstants.OP_SERVICE_REGISTRY_ } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_DESCRIPTION, response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_PRIVATE }) + @ApiOperation(value = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_DESCRIPTION, response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_PRIVATE }) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @PostMapping(path = CoreCommonConstants.OP_SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(path = CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public SystemResponseDTO queryRegistryBySystemDTO(@RequestBody final SystemRequestDTO request) { - logger.debug("Service query by systemRequestDTO request received"); + logger.debug("System query by systemRequestDTO request received"); - checkSystemRequest(request, CommonConstants.SERVICE_REGISTRY_URI + CoreCommonConstants.OP_SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_URI, false); + checkSystemRequest(request, CommonConstants.SYSTEM_REGISTRY_URI + CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI, false); final String systemName = request.getSystemName(); final String address = request.getAddress(); @@ -685,7 +629,7 @@ public void unregisterService(@RequestParam(CommonConstants.OP_SERVICE_REGISTRY_ private SystemResponseDTO callCreateSystem(final SystemRequestDTO request) { logger.debug("callCreateSystem started..."); - checkSystemRequest(request, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_URI, true); + checkSystemRequest(request, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_URI, true); final String systemName = request.getSystemName(); final String address = request.getAddress(); @@ -728,7 +672,7 @@ private void checkSystemMergeRequest(final SystemRequestDTO request, final long logger.debug("checkSystemPatchRequest started..."); if (systemId <= 0) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_BY_ID_URI); + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); } boolean needChange = false; @@ -741,7 +685,7 @@ private void checkSystemMergeRequest(final SystemRequestDTO request, final long needChange = true; for (final CoreSystem coreSysteam : CoreSystem.values()) { if (coreSysteam.name().equalsIgnoreCase(request.getSystemName().trim())) { - throw new BadPayloadException("System name '" + request.getSystemName() + "' is a reserved arrowhead core system name.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_BY_ID_URI); + throw new BadPayloadException("System name '" + request.getSystemName() + "' is a reserved arrowhead core system name.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); } } } @@ -750,7 +694,7 @@ private void checkSystemMergeRequest(final SystemRequestDTO request, final long final int validatedPort = request.getPort(); if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX +".", HttpStatus.SC_BAD_REQUEST, - CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_BY_ID_URI); + CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); } needChange = true; @@ -761,7 +705,7 @@ private void checkSystemMergeRequest(final SystemRequestDTO request, final long } if (!needChange) { - throw new BadPayloadException("Patch request is empty." , HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_BY_ID_URI); + throw new BadPayloadException("Patch request is empty." , HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); } } @@ -770,10 +714,10 @@ private void checkSystemPutRequest(final SystemRequestDTO request, final long sy logger.debug("checkSystemPutRequest started..."); if (systemId <= 0) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_BY_ID_URI); + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); } - checkSystemRequest(request, CommonConstants.SERVICE_REGISTRY_URI + SYSTEMS_BY_ID_URI, true); + checkSystemRequest(request, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI, true); } //------------------------------------------------------------------------------------------------- @@ -811,20 +755,20 @@ private void checkSystemRequest(final SystemRequestDTO request, final String ori } //------------------------------------------------------------------------------------------------- - private void checkServiceRegistryRequest(final ServiceRegistryRequestDTO request, final boolean checkReservedCoreSystemNames) { - logger.debug("checkServiceRegistryRequest started..."); + private void checkSystemRegistryRequest(final SystemRegistryRequestDTO request, final boolean checkReservedCoreSystemNames) { + logger.debug("checkSystemRegistryRequest started..."); - final String origin = CommonConstants.SERVICE_REGISTRY_URI + CommonConstants.OP_SERVICE_REGISTRY_REGISTER_URI; + final String origin = CommonConstants.SYSTEM_REGISTRY_URI + CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI; - checkServiceRegistryRequest(request, origin, checkReservedCoreSystemNames); + checkSystemRegistryRequest(request, origin, checkReservedCoreSystemNames); } //------------------------------------------------------------------------------------------------- - private void checkServiceRegistryRequest(final ServiceRegistryRequestDTO request, final String origin, final boolean checkReservedCoreSystemNames) { - logger.debug("checkServiceRegistryRequest started..."); + private void checkSystemRegistryRequest(final SystemRegistryRequestDTO request, final String origin, final boolean checkReservedCoreSystemNames) { + logger.debug("checkSystemRegistryRequest started..."); - if (Utilities.isEmpty(request.getServiceDefinition())) { - throw new BadPayloadException("Service definition is null or blank", HttpStatus.SC_BAD_REQUEST, origin); + if (Utilities.isEmpty(request.getSystemDefinition())) { + throw new BadPayloadException("System definition is null or blank", HttpStatus.SC_BAD_REQUEST, origin); } checkSystemRequest(request.getProviderSystem(), origin, checkReservedCoreSystemNames); @@ -838,9 +782,9 @@ private void checkServiceRegistryRequest(final ServiceRegistryRequestDTO request } } - ServiceSecurityType securityType = null; + SystemSecurityType securityType = null; if (request.getSecure() != null) { - for (final ServiceSecurityType type : ServiceSecurityType.values()) { + for (final SystemSecurityType type : SystemSecurityType.values()) { if (type.name().equalsIgnoreCase(request.getSecure())) { securityType = type; break; @@ -851,10 +795,10 @@ private void checkServiceRegistryRequest(final ServiceRegistryRequestDTO request throw new BadPayloadException("Security type is not valid.", HttpStatus.SC_BAD_REQUEST, origin); } } else { - securityType = ServiceSecurityType.NOT_SECURE; + securityType = SystemSecurityType.NOT_SECURE; } - if (securityType != ServiceSecurityType.NOT_SECURE && request.getProviderSystem().getAuthenticationInfo() == null) { + if (securityType != SystemSecurityType.NOT_SECURE && request.getProviderSystem().getAuthenticationInfo() == null) { throw new BadPayloadException("Security type is in conflict with the availability of the authentication info.", HttpStatus.SC_BAD_REQUEST, origin); } @@ -870,13 +814,13 @@ private void checkServiceRegistryRequest(final ServiceRegistryRequestDTO request } //------------------------------------------------------------------------------------------------- - private void checkUnregisterServiceParameters(final String serviceDefinition, final String providerName, final String providerAddress, final int providerPort) { + private void checkUnregisterSystemParameters(final String systemDefinition, final String providerName, final String providerAddress, final int providerPort) { // parameters can't be null, but can be empty - logger.debug("checkUnregisterServiceParameters started..."); + logger.debug("checkUnregisterSystemParameters started..."); - final String origin = CommonConstants.SERVICE_REGISTRY_URI + CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_URI; - if (Utilities.isEmpty(serviceDefinition)) { - throw new BadPayloadException("Service definition is blank", HttpStatus.SC_BAD_REQUEST, origin); + final String origin = CommonConstants.SYSTEM_REGISTRY_URI + CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_URI; + if (Utilities.isEmpty(systemDefinition)) { + throw new BadPayloadException("System definition is blank", HttpStatus.SC_BAD_REQUEST, origin); } if (Utilities.isEmpty(providerName)) { @@ -893,14 +837,14 @@ private void checkUnregisterServiceParameters(final String serviceDefinition, fi } //------------------------------------------------------------------------------------------------- - private void checkServiceRegistryUpdateRequest(final long id, final ServiceRegistryRequestDTO request, final String origin) { - logger.debug("checkServiceRegistryUpdateRequest started..."); + private void checkSystemRegistryUpdateRequest(final long id, final SystemRegistryRequestDTO request, final String origin) { + logger.debug("checkSystemRegistryUpdateRequest started..."); if (id <= 0) { throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, origin); } - checkServiceRegistryRequest(request, origin, true); + checkSystemRegistryRequest(request, origin, true); } @@ -922,8 +866,8 @@ private void validateDevice(@RequestBody final DeviceRequestDTO deviceRequestDto //------------------------------------------------------------------------------------------------- @SuppressWarnings("squid:S3776") - private void checkServiceRegistryMergeRequest(final long id, final ServiceRegistryRequestDTO request, final String origin) { - logger.debug("checkServiceRegistryMergeRequest started..."); + private void checkSystemRegistryMergeRequest(final long id, final SystemRegistryRequestDTO request, final String origin) { + logger.debug("checkSystemRegistryMergeRequest started..."); if (id <= 0) { throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, origin); @@ -968,11 +912,11 @@ private void checkServiceRegistryMergeRequest(final long id, final ServiceRegist needChange = true; } - if (request.getServiceDefinition() != null) { + if (request.getSystemDefinition() != null) { needChange = true; } - if (request.getServiceUri() != null) { + if (request.getSystemUri() != null) { needChange = true; } diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java index a3fa3bcb0..dc31a49f9 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java @@ -9,8 +9,10 @@ import eu.arrowhead.common.dto.internal.DTOConverter; import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; import eu.arrowhead.common.dto.internal.SystemListResponseDTO; -import eu.arrowhead.common.dto.shared.DeviceRequestDTO; +import eu.arrowhead.common.dto.internal.SystemRegistryListResponseDTO; import eu.arrowhead.common.dto.shared.DeviceResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryRequestDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryResponseDTO; import eu.arrowhead.common.dto.shared.SystemResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.exception.InvalidParameterException; @@ -34,6 +36,7 @@ public class SystemRegistryDBService // members private static final String COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE = "Could not delete System, with given parameters"; + private static final String COULD_NOT_DELETE_DEVICE_ERROR_MESSAGE = "Could not delete Device, with given parameters"; private static final String PORT_RANGE_ERROR_MESSAGE = "Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + "."; private static final int MAX_BATCH_SIZE = 200; @@ -154,14 +157,14 @@ public System updateSystem(final long systemId, final String systemName, final S { logger.debug("updateSystem started..."); - final long validatedSystemId = validateSystemId(systemId); + final long validatedSystemId = validateId(systemId); final int validatedPort = validateSystemPort(port); - final String validatedSystemName = validateSystemParamString(systemName); + final String validatedSystemName = validateParamString(systemName); if (validatedSystemName.contains(".")) { throw new InvalidParameterException("System name can't contain dot (.)"); } - final String validatedAddress = validateSystemParamString(address); + final String validatedAddress = validateParamString(address); final String validatedAuthenticationInfo = authenticationInfo; @@ -241,14 +244,14 @@ public System mergeSystem(final long systemId, final String systemName, final St { logger.debug("mergeSystem started..."); - final long validatedSystemId = validateSystemId(systemId); + final long validatedSystemId = validateId(systemId); final Integer validatedPort = validateAllowNullSystemPort(port); - final String validatedSystemName = validateAllowNullSystemParamString(systemName); + final String validatedSystemName = validateAllowNullParamString(systemName); if (validatedSystemName != null && validatedSystemName.contains(".")) { throw new InvalidParameterException("System name can't contain dot (.)"); } - final String validatedAddress = validateAllowNullSystemParamString(address); + final String validatedAddress = validateAllowNullParamString(address); final String validatedAuthenticationInfo = authenticationInfo; try @@ -355,11 +358,70 @@ public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageP //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public DeviceResponseDTO createDevice(final DeviceRequestDTO dto) + public DeviceResponseDTO createDevice(final String name, final String address, final String macAddress, final String authenticationInfo) { - final Device device = new Device(dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); + final Device device = new Device(name, address, macAddress, authenticationInfo); return DTOConverter.convertDeviceToDeviceResponseDTO(deviceRepository.save(device)); } + + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public DeviceResponseDTO updateDeviceByIdResponse(final long id, final String name, final String address, final String macAddress, final String authenticationInfo) { + + logger.debug("updateDeviceByIdResponse started..."); + + try { + + final long validatedId = validateId(id); + final Device newDevice = validateNonNullDeviceParameters(name, address, macAddress, authenticationInfo); + + final Optional optionalDevice = deviceRepository.findById(id); + final Device device = optionalDevice.orElseThrow(() -> new InvalidParameterException("No device with id : " + id)); + + device.setDeviceName(newDevice.getDeviceName()); + device.setAddress(newDevice.getAddress()); + device.setMacAddress(newDevice.getMacAddress()); + device.setAuthenticationInfo(newDevice.getAuthenticationInfo()); + + return DTOConverter.convertDeviceToDeviceResponseDTO(deviceRepository.saveAndFlush(device)); + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public void removeDeviceById(final long id) { + logger.debug("removeDeviceById started..."); + + try + { + if (!deviceRepository.existsById(id)) + { + throw new InvalidParameterException(COULD_NOT_DELETE_DEVICE_ERROR_MESSAGE); + } + + deviceRepository.deleteById(id); + deviceRepository.flush(); + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } //================================================================================================= // assistant methods @@ -419,19 +481,36 @@ private void checkConstraintsOfSystemTable(final String validatedSystemName, fin } //------------------------------------------------------------------------------------------------- - private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) + private void checkConstraintsOfDeviceTable(final String validatedDeviceName, final String validatedMacAddress) { - logger.debug("validateNonNullSystemParameters started..."); + logger.debug("checkConstraintsOfDeviceTable started..."); - if (Utilities.isEmpty(systemName)) + try { - throw new InvalidParameterException("System name is null or empty"); + final Optional find = deviceRepository.findByDeviceNameAndMacAddress(validatedDeviceName, validatedMacAddress); + if (find.isPresent()) + { + throw new InvalidParameterException( + "Device with name: " + validatedDeviceName + ", MAC address: " + validatedMacAddress + " already exists."); + } } - - if (Utilities.isEmpty(address)) + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) { - throw new InvalidParameterException("System address is null or empty"); + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } + } + + //------------------------------------------------------------------------------------------------- + private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) + { + logger.debug("validateNonNullSystemParameters started..."); + + validateNonNullParameters(systemName, address, authenticationInfo); if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { @@ -439,10 +518,6 @@ private System validateNonNullSystemParameters(final String systemName, final St } final String validatedSystemName = systemName.trim().toLowerCase(); - if (validatedSystemName.contains(".")) - { - throw new InvalidParameterException("System name can't contain dot (.)"); - } final String validatedAddress = address.trim().toLowerCase(); final String validatedAuthenticationInfo = authenticationInfo; @@ -452,7 +527,50 @@ private System validateNonNullSystemParameters(final String systemName, final St } //------------------------------------------------------------------------------------------------- - private String validateSystemParamString(final String param) + private Device validateNonNullDeviceParameters(final String deviceName, final String address, final String macAddress, final String authenticationInfo) + { + logger.debug("validateNonNullDeviceParameters started..."); + + validateNonNullParameters(deviceName, address, authenticationInfo); + + if (Utilities.isEmpty(macAddress)) + { + throw new InvalidParameterException("MAC address is null or empty"); + } + + final String validatedDeviceName = deviceName.trim().toLowerCase(); + final String validatedAddress = address.trim().toLowerCase(); + final String validatedMacAddress = macAddress.trim().toUpperCase(); + final String validatedAuthenticationInfo = authenticationInfo; + + checkConstraintsOfDeviceTable(validatedDeviceName, validatedMacAddress); + + return new Device(validatedDeviceName, validatedAddress, validatedMacAddress, validatedAuthenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private void validateNonNullParameters(final String name, final String address, final String authenticationInfo) + { + logger.debug("validateNonNullParameters started..."); + + if (Utilities.isEmpty(name)) + { + throw new InvalidParameterException("Name is null or empty"); + } + + if (Utilities.isEmpty(address)) + { + throw new InvalidParameterException("Address is null or empty"); + } + + if (name.contains(".")) + { + throw new InvalidParameterException("Name can't contain dot (.)"); + } + } + + //------------------------------------------------------------------------------------------------- + private String validateParamString(final String param) { logger.debug("validateSystemParamString started..."); @@ -478,16 +596,16 @@ private int validateSystemPort(final int port) } //------------------------------------------------------------------------------------------------- - private long validateSystemId(final long systemId) + private long validateId(final long id) { - logger.debug("validateSystemId started..."); + logger.debug("validateId started..."); - if (systemId < 1) + if (id < 1) { - throw new IllegalArgumentException("System id must be greater than zero"); + throw new IllegalArgumentException("Id must be greater than zero"); } - return systemId; + return id; } //------------------------------------------------------------------------------------------------- @@ -504,9 +622,9 @@ private Integer validateAllowNullSystemPort(final Integer port) } //------------------------------------------------------------------------------------------------- - private String validateAllowNullSystemParamString(final String param) + private String validateAllowNullParamString(final String param) { - logger.debug("validateAllowNullSystemParamString started..."); + logger.debug("validateAllowNullParamString started..."); if (Utilities.isEmpty(param)) { @@ -537,4 +655,28 @@ private System findOrCreateSystem(final String systemName, final String address, } return provider; } + + public SystemRegistryListResponseDTO getSystemRegistryEntriesResponse(final CoreUtilities.ValidatedPageParams params, final String sortField) { + return null; + } + + public SystemRegistryResponseDTO getSystemRegistryEntryByIdResponse(final long id) { + return null; + } + + public void removeSystemRegistryEntryById(long id) { + + } + + public SystemRegistryResponseDTO registerSystemResponse(SystemRegistryRequestDTO request) { + return null; + } + + public SystemRegistryResponseDTO updateSystemByIdResponse(long id, SystemRegistryRequestDTO request) { + return null; + } + + public SystemRegistryResponseDTO mergeSystemByIdResponse(long id, SystemRegistryRequestDTO request) { + return null; + } } From a746a3aea8474bbdc54d71a3c6076630a2dc9250 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Tue, 21 Jan 2020 13:11:11 +0100 Subject: [PATCH 009/301] some added content --- documentation/development/developer_tmp.txt | 55 +++++++++++++++++++-- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/documentation/development/developer_tmp.txt b/documentation/development/developer_tmp.txt index 3d4a5b14a..7cf0d8b18 100644 --- a/documentation/development/developer_tmp.txt +++ b/documentation/development/developer_tmp.txt @@ -50,7 +50,7 @@ JMS Api and Apache ActiveMQ Client Every core system have basically the same general structure. We define three separate layers. -The first layer (web layer) is for the web service endpoints (in the controller classes) Here we define the REST endpoints, perform basic input validations and sometimes minor conversations on input parameters (i.e. create an enumeration value from a String). Basic validation means checking mandatory parameters are specified and valid, specified optional paramters are valid, the specified parameter combination is valid. We check everything in this layer that is possible without accessing the database (so no unique constraint checking here). +The first layer (web layer) is for the web service endpoints (in the controller classes) Here we define the REST endpoints, perform basic input validations and sometimes minor conversations on input parameters (i.e. create an enumeration value from a String). Basic validation means checking mandatory parameters are specified and valid, specified optional parameters are valid, the specified parameter combination is valid. We check everything in this layer that is possible without accessing the database (so no unique constraint checking here). In the web layer no business logic is implemented, endpoints call a method from the second layer after input validation and possible conversation steps and returns the value. Let's see an example for an endpoint: @RestController @@ -273,7 +273,7 @@ Let's see the contents of the module: - a predefined set of core systems can use query (/query URI) without limitations; - a predefined set of core systems can use query by system (/query/system/{id} URI); - * eu.arrowhead.core.serviceregistry.swagger.SRSwaggerConfig: it is a descendant class of DefaultSwaggerConfig. It configures and actives Swagger UI. See Swagger Documentation for details. + * eu.arrowhead.core.serviceregistry.swagger.SRSwaggerConfig: it is a descendant class of DefaultSwaggerConfig. It configures and activates Swagger UI. See Swagger Documentation for details. 9.3 Authorization Module @@ -290,18 +290,63 @@ Let's see the contents of the module: * eu.arrowhead.core.authorization.AuthorizationMain: the main class of the Authorization core system is the default implementation of the Spring Boot web server (see Spring Boot documentation). We using annotations to tell Spring this is a Spring Boot application (@SpringBootApplication) and where to search for Spring-managed classes (@ComponentScan), database entities (@EntityScan) and database repositories (@EnableJpaRepositories). And it enables Swagger UI (@EnableSwagger2 annotation) * eu.arrowhead.core.authorization.AuthorizationApplicationInitListener: it overrides the getRequiredCoreSystemServiceUris(), because if there is Event Handler in the local cloud the it needs one of the Event Handler's service URIs to be able to notify about authorization rule changes. * eu.arrowhead.core.authorization.AuthorizationController: it contains the web service endpoints of the Authorization core system, see Authorization API documentation. +* eu.arrowhead.core.authorization.database.service.AuthorizationDBService: this class implements the higher level database-related methods that handle inter-cloud and intra-cloud rule creation, deletion, reading and checking. +* eu.arrowhead.core.authorization.security.AuthSecurityConfig: it's an empty descendant of the DefaultSecurityConfig class. We use @EnableWebSecurity and @Configuration annotations to activate the security. +* eu.arrowhead.core.authorization.security.AuthAccessControlFilter: it is a descendant class of the CoreSystemAccessControlFilter and it enforces authentication requirements of the Authorization web services. Only works in secured mode (see @ConditionalOnProperty annotation). Implemented rules: + - web services are only accessible from the local cloud (inherited through the base class); + - management web services (/mgmt appears in the URI) are only accessible to the local system operator (sysop...arrowhead.eu); + - a predefined set of core systems can use authorization checking and token generation services; + +* eu.arrowhead.core.authorization.swagger.AuthSwaggerConfig: it is a descendant class of DefaultSwaggerConfig. It configures and activates Swagger UI. See Swagger Documentation for details. +* eu.arrowhead.core.authorization.token.TokenGenerationService: this class implements the token generation feature. The token is an additional security tool that Arrowhead providers can utilize to make sure that any consumer trying to use its services comes through the proper channel (using orchestration). A token is a long string identifier in which is signed (by the Authorization core system) and encrypted and contains information about the consumer (name, cloud), the service (so can't reuse token to access to a different service), the service interface (so can't reuse token to access the service in a different format/protocol) and optionally an expiration date (forcing consumers to orchestrate periodically). The consumer receives the token(s) in the orchestration results which can be passed to the provider as a query parameter (at least in case of HTTP(S) services). We are using JWT (JSON Web Tokens) standard (see jwt.io) and JOSE (JSON Object Signing and Encryption) specification suite (https://datatracker.ietf.org/wg/jose/charter/) to implement our token generation. We are using the jose4j (https://bitbucket.org/b_c/jose4j/wiki/Home) implementation (which relies solely on the Java Cryptography Architecture API for cryptography) of JOSE in this class. First, we generate the JSON object that contains the information about the consumer, service, etc.(and some other JWT-related data), then sign it using the Authorization core system's private key (the selected signing algorithm is "RS512" (RSA/SHA512). After that, we encrypt the signed JSON using the provider's public key (which is stored in the DB as authenticationInfo). The encryption algorithm is "A256CBC-HS512". We also need a key management encryption algorithm as well (hence the previous algorithm uses a generated secret key that need to include in the JSON in an encrypted format), which is "RSA-OAEP-256". It seems difficult, but the jose4j did most of the work: we just have to select the algorithms, provide the necessary keys and payload, and call some high-level methods. + +9.4 Orchestrator Module + +The Orchestration core system is responsible for storing orchestration rules and performs store (using the previously mentioned rules) and dynamic orchestration. In both cases, the orchestrator tries to find suitable providers for a consumer. These providers can be local ones or (if a gatekeeper is installed in the cloud) from an other cloud. + +The application.properties of the Orchestrator contains some custom property which are not used by (all) other core systems. + +use_strict_service_intf_name_verifier: Interface names has to follow this format --, where security can be SECURE or INSECURE and protocol and format must be a sequence of letters, numbers and underscore. A regexp checker will verify that. If this setting is set to true then the PROTOCOL and FORMAT must come from a predefined set. Currently, only HTTP and HTTPS are acceptable as PROTOCOL and JSON and XML as FORMAT. +gatekeeper_is_present: a flag that tells the Orchestrator whether a Gatekeeper core system is installed in the cloud or not. If the value is false, the Orchestrator can only search providers in the local cloud. + +Let's see the contents of the module: +* eu.arrowhead.core.orchestrator.OrchestratorMain: the main class of the Orchestrator core system is the default implementation of the Spring Boot web server (see Spring Boot documentation). We using annotations to tell Spring this is a Spring Boot application (@SpringBootApplication) and where to search for Spring-managed classes (@ComponentScan), database entities (@EntityScan) and database repositories (@EnableJpaRepositories). And it enables Swagger UI (@EnableSwagger2 annotation) +* eu.arrowhead.core.orchestrator.OrchestratorApplicationInitListener: it overrides the customInit() method to load the Service Registry query URTs to the Arrowhead context object. It also overrides getRequiredCoreSystemServiceUris() to tell the URI crawler task to load the necessary URIs from the Service Registry: intra-cloud authorization rule checking, token generation, global service discovery (only if the Gatekeeper is installed) and inter-cloud negotiation (only if Gatekeeper is installed). This class also defines +some beans which we will use in different matchmaking situations (see later). +* eu.arrowhead.core.orchestrator.OrchestratorStoreController: it contains the Orchestrator web service endpoints related to storing and accessing orchestration rules. See Orchestration API documentation for details. +* eu.arrowhead.core.orchestrator.OrchestratorController: it contains the Orchestrator web service endpoints related orchestration process. See Orchestration API documentation for details. +* eu.arrowhead.core.orchestrator.database.service.OrchestratorStoreDBService: this class implements the higher level database-related methods that handle orchestrator rule creation, modification, deletion and reading. +* eu.arrowhead.core.orchestrator.matchmaking package: matchmaking is the name of the process when the Orchestrator core system has to select one element (provider, cloud) from multiple suitable entities. Because matchmaking is possible using different strategies, we define an interface for all matchmaking situations and provide one or more implementations for each interface. CloudMatchmakingAlgorithm interface is used when the orchestrator has to choose a cloud when multiple clouds have the providers that are suitable for the consumer. The DefaultCloudMatchmaker simply returns the first preferred cloud. If no preferred cloud for the consumer, it returns the first cloud in the list. The RandomWeightedCloudMatchmaker implementation chooses randomly from the clouds but clouds with higher number of suitable providers have higher chance. This strategy also try to select from the preferred clouds first. An other matchmaking interface is IntraCloudProviderMatchmakingAlgorithm which is used when the orchestrator has to select one result from local providers. The DefaultIntraCloudProviderMatchmaker selects the first (preferred) provider, while the RandomIntraCloudProviderMatchmaker chooses randomly, if no preferred is available. The third matchmaking interface is InterCloudProviderMatchmakingAlgorithm, which selects one from foreign providers. Currently, only the DefaultInterCloudProviderMatchmaker implements this interface and returns the first (preferred) provider from the list. +* eu.arrowhead.core.orchestrator.security.OSecurityConfig: it's an empty descendant of the DefaultSecurityConfig class. We use @EnableWebSecurity and @Configuration annotations to activate the security. +* eu.arrowhead.core.orchestrator.security.OrchestratorAccessControlFilter: it is a descendant class of the CoreSystemAccessControlFilter and it enforces authentication requirements of the Orchestrator web services. Only works in secured mode (see @ConditionalOnProperty annotation). Implemented rules: + + - web services are only accessible from the local cloud (inherited through the base class); + - management web services (/mgmt appears in the URI) are only accessible to the local system operator (sysop...arrowhead.eu); + - external service request (marked with the flag externalServiceRequest=true) is only allowed to the local gatekeeper; + - in case of other type of dynamic orchestration the requester system's name (in the input JSON) has to match the first part of the requester's common name (in the certificate); + +* eu.arrowhead.core.orchestrator.service.OrchestratorDriver: it contains support methods for calling web services of other core systems: query from Service Registry, intra-cloud rule check and token generation from Authorization and global service discovery and inter-cloud negotiation from Gatekeeper. +* eu.arrowhead.core.orchestrator.service.OrchestratorService: this class implements the various orchestration features by using web services of other core systems (via the OrchestratorDriver class). + + - externalServiceRequest() handles the dynamic orchestration request comes from a different cloud (via the foreign and the local Gatekeepers). The main difference between an external service request and a local request that the first one skips the authorization checks (because that is handled by the local Gatekeeper). This could be a potential security issue so be sure that this version of orchestration is only called from the local Gatekeeper (currently the security filter ensures that). The implementation is pretty straightforward: collecting suitable providers by using Service Registry query; removing non-preferred providers if necessary; converting the result to the expected format; generating tokens if necessary using Authorization's service. + - triggerInterCloud() handles the orchestration in other clouds. It basically calls the global service discovery (GSD) and inter-cloud negotiation (ICN) services of the local Gatekeeper. Please note that the GSD can return multiple clouds and the implementation selects one using the appropriate matchmaking algorithm. The ICN only contacts the selected cloud, but can return with multiple providers (from the same cloud). If the matchMaking flag is set, then an other matchmaker will select from the returned providers. + - dynamicOrchestration() handles the local dynamic orchestration requests (comes from actual consumers). This methods first tries to find suitable providers in the local cloud, but if it can't (and the cloud configuration and ochestration flags allow it), the search will expand to other clouds (calling the triggerInterCloud() previously mentioned). The steps of the implementations are the following: collecting suitable providers by using Service Registry query; removing providers that the consumer can't use because of authorization rules (by calling the appropriate web service of the Authorization core system); removing non-preferred providers if necessary; select one provider if necessary by using a matchmaker algorithm; converting the result to the expected format; generating tokens if necessary using Authorization's service. + - topPriorityEntriesOrchestrationProcess() handles the local store orchestration when only a consumer system id is provided. In that case we have to orchestrate all necessary (local) providers using top priority (1) rules. The steps are the following: obtain the appropriate rules; remove foreign provider-related rules, because this method only works with local providers; query the Service Registry for the actual provider data (and to remove the unavailable providers); query Authorization core system to check permissions; converting the result to the expected format; generating tokens if necessary using Authorization's service. + - orchestrationFromStore() handles the store orchestration when a service requirement is specified. It's using all rules related to the service, and returns the one that has the highest priority, is currently working and accessible. Please note that this method works with foreign providers too (if gatekeeper is available in the cloud). + +* eu.arrowhead.core.orchestrator.swagger.OSwaggerConfig: it is a descendant class of DefaultSwaggerConfig. It configures and activates Swagger UI. See Swagger Documentation for details. + +9.5 Gatekeeper module -Orch -GK GW EH -Chor + From dcc56646327eba62558ddb998663bdbcd9706fc6 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Tue, 21 Jan 2020 16:40:25 +0100 Subject: [PATCH 010/301] QoS Monitor skeleton (key file is still missing) --- .gitignore | 2 + .../eu/arrowhead/common/core/CoreSystem.java | 1 + pom.xml | 27 +++++++++ qos-monitor/.classpath | 49 +++++++++++++++++ qos-monitor/.project | 40 ++++++++++++++ qos-monitor/pom.xml | 52 ++++++++++++++++++ .../eu/arrowhead/core/qos/QoSMonitorMain.java | 26 +++++++++ ...itional-spring-configuration-metadata.json | 22 ++++++++ .../src/main/resources/application.properties | 52 ++++++++++++++++++ .../resources/certificates/truststore.p12 | Bin 0 -> 1162 bytes qos-monitor/src/main/resources/log4j2.xml | 46 ++++++++++++++++ qos-monitor/src/test/java/.placeholder | 0 qos-monitor/src/test/resources/.placeholder | 0 13 files changed, 317 insertions(+) create mode 100644 qos-monitor/.classpath create mode 100644 qos-monitor/.project create mode 100644 qos-monitor/pom.xml create mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorMain.java create mode 100644 qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json create mode 100644 qos-monitor/src/main/resources/application.properties create mode 100644 qos-monitor/src/main/resources/certificates/truststore.p12 create mode 100644 qos-monitor/src/main/resources/log4j2.xml create mode 100644 qos-monitor/src/test/java/.placeholder create mode 100644 qos-monitor/src/test/resources/.placeholder diff --git a/.gitignore b/.gitignore index 46cdc0f81..eb1e1b535 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,5 @@ authorization.log /deb-installer/.classpath /deb-installer/.project /deb-installer/.settings +/qos-monitor/.settings +/qos-monitor/target diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java index 4e39afa2a..194f0c337 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java @@ -23,6 +23,7 @@ public enum CoreSystem { , CoreSystemService.EVENT_UNSUBSCRIBE_SERVICE, CoreSystemService.EVENT_PUBLISH_AUTH_UPDATE_SERVICE)), GATEWAY(Defaults.DEFAULT_GATEWAY_PORT, List.of(CoreSystemService.GATEWAY_PUBLIC_KEY_SERVICE, CoreSystemService.GATEWAY_PROVIDER_SERVICE,CoreSystemService.GATEWAY_CONSUMER_SERVICE)), CHOREOGRAPHER(Defaults.DEFAULT_CHOREOGRAPHER_PORT, List.of()), // TODO: add services + QOS_MONITOR(1, List.of()), CERTIFICATE_AUTHORITY(Defaults.DEFAULT_CERTIFICATE_AUTHORITY_PORT, List.of()); // TODO: add services //================================================================================================= diff --git a/pom.xml b/pom.xml index 785a20381..525483562 100644 --- a/pom.xml +++ b/pom.xml @@ -31,6 +31,7 @@ gatekeeper gateway choreographer + qos-monitor deb-installer @@ -53,8 +54,18 @@ 3.9 2.0.1 5.15.9 + 1.2 + 5.5.0 UTF-8
+ + + + spring-repo + Spring Repository + https://repo.spring.io/plugins-release/ + + @@ -148,6 +159,22 @@ runtime + + sheltekio.javalibs + icmp4j + ${icmp4j.version} + + + net.java.dev.jna + jna + ${jna.version} + + + net.java.dev.jna + jna-platform + ${jna.version} + + + validate + + copy-resources + + + ${basedir}/target + + + src/main/resources + + application.properties + log4j2.xml + + + + + + + + + + \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorMain.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorMain.java new file mode 100644 index 000000000..0cb202d12 --- /dev/null +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorMain.java @@ -0,0 +1,26 @@ +package eu.arrowhead.core.qos; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.database.repository.RefreshableRepositoryImpl; + +@SpringBootApplication +@ComponentScan (CommonConstants.BASE_PACKAGE) +@EntityScan (CoreCommonConstants.DATABASE_ENTITY_PACKAGE) +@EnableJpaRepositories (basePackages = CoreCommonConstants.DATABASE_REPOSITORY_PACKAGE, repositoryBaseClass = RefreshableRepositoryImpl.class) +public class QoSMonitorMain { + + //================================================================================================= + // members + + //------------------------------------------------------------------------------------------------- + public static void main(final String[] args) { + SpringApplication.run(QoSMonitorMain.class, args); + } +} \ No newline at end of file diff --git a/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 000000000..bf18f4826 --- /dev/null +++ b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,22 @@ +{"properties": [ + { + "name": "core_system_name", + "type": "java.lang.String", + "description": "A description for 'core_system_name'" + }, + { + "name": "sr_address", + "type": "java.lang.String", + "description": "A description for 'sr_address'" + }, + { + "name": "sr_port", + "type": "java.lang.Integer", + "description": "A description for 'sr_port'" + }, + { + "name": "disable.hostname.verifier", + "type": "java.lang.Boolean", + "description": "A description for 'disable.hostname.verifier'" + } +]} \ No newline at end of file diff --git a/qos-monitor/src/main/resources/application.properties b/qos-monitor/src/main/resources/application.properties new file mode 100644 index 000000000..46681d416 --- /dev/null +++ b/qos-monitor/src/main/resources/application.properties @@ -0,0 +1,52 @@ +############################################ +### APPLICATION PARAMETERS ### +############################################ + +spring.main.web-application-type=NONE + +# Database connection (mandatory) +# Change the server timezone if neccessary +spring.datasource.url=jdbc:mysql://127.0.0.1:3306/arrowhead?serverTimezone=Europe/Budapest +spring.datasource.username=choreographer +spring.datasource.password=Qa5yx4oBp4Y9RLX +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +# use true only for debugging +spring.jpa.show-sql=false +spring.jpa.properties.hibernate.format_sql=true +spring.jpa.hibernate.ddl-auto=none + +############################################ +### CUSTOM PARAMETERS ### +############################################ + +# Name of the core system +core_system_name=QOS_MONITOR + +# Service Registry web-server parameters (to register the Choreographer services) +sr_address=127.0.0.1 +sr_port=8443 + +############################################ +### SECURE MODE ### +############################################ + +# configure secure mode + +# Set this to false to disable https mode +server.ssl.enabled=true + +server.ssl.key-store-type=PKCS12 +server.ssl.key-store=classpath:certificates/choreographer.p12 +server.ssl.key-store-password=123456 +server.ssl.key-alias=choreographer +server.ssl.key-password=123456 +server.ssl.client-auth=need +server.ssl.trust-store-type=PKCS12 +server.ssl.trust-store=classpath:certificates/truststore.p12 +server.ssl.trust-store-password=123456 + +#If true, http client does not check whether the hostname is match one of the server's SAN in its certificate +#Just for testing, DO NOT USE this feature in production environment +disable.hostname.verifier=false diff --git a/qos-monitor/src/main/resources/certificates/truststore.p12 b/qos-monitor/src/main/resources/certificates/truststore.p12 new file mode 100644 index 0000000000000000000000000000000000000000..57c1c5f43254b23364a333cb17dab29d31af634e GIT binary patch literal 1162 zcmV;51aZ%2`Yw2hW8Bt2LUiC1_~;MNQU^~>U>f~LJ51Rd``6D?MdK7cL!2Z#p z&86R?Zn&z;gT({uZ?!pu3vczV(QzMrGVj;19 z5A-VUiF+tjA!JR`{RS&;@dYx_BRtTsh)jI_2%G1EVJvXOZpQOh4RI`L%TqMeT3gk+p}AIxL?@pWsVtOuKM!Wra!LreLubKEJrjmOfmcz=XHp z-uicox^ThaX--E>>L6t0cKGAJZZSJpUEl}&dZL@AOlb}oRglPDx1|D6AEV!y%^mIq z^bSQ7dL;&77p>oxfe+yiD>UmVc25pxIGu}v!cX!~oX(xh)s{kG9+7Z8AuIN|DV7c1 zEO(KKH3wIhKYUFeOIo+yqCgOU{he z!i{eE;VQ1WC(sfw2&0D47*l6qW{rzvv2Y_F+X(PA`HraCxC)_yI&=ktH0wMejyDE< z*R6G~IimpvZFC9&ACtj~U)Db!(hN3i#5R3BSqPxpIKGImON9n8LLvq_m>xpPqP{ZL zl`m>7gZWL)(B>z^@8Vp_YaFlDji)MkeSX};OY?ZZ#`21!0YAU{H?rB8K<&zyg%Rh- zHAnOMest9^iQkf`0==CWZNj2QM*TqO9DT+BUUPktVDt(8aD!f+Fi0Z@UdIv)mw-I- z5G(>==99;{Rltld$19fhEJX(NlaT5$ndU{sRk<+%LjkTVHdXKy67Rbbh;WC#YLt0E z1S}^|2@Qa|08yw+bT|X1$|Rm^X0oo4ad{VMF%U!9f9VO+41sbaj2^JOy<~8?Z>b0_ zeZ4>x1XE8O%BBG_5Pe)*Zu||{3c@j@J!E)Q+Jqqb2g0AB4vE;%k!nO#EWBVBvDL6K z%$ajYQmPg3AANl$aWFnGAutIB1uG5%0vZJX1Qe21ALl_dxi!Xc`r5F&M^_UR(|QCH c!IzHi@;Q3$Pa#3~8XCLIk6cGw0s{etp!w7j3jhEB literal 0 HcmV?d00001 diff --git a/qos-monitor/src/main/resources/log4j2.xml b/qos-monitor/src/main/resources/log4j2.xml new file mode 100644 index 000000000..8025b4d46 --- /dev/null +++ b/qos-monitor/src/main/resources/log4j2.xml @@ -0,0 +1,46 @@ + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex + + INFO + INFO + . + + + + + + + + ${LOG_PATTERN} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/qos-monitor/src/test/java/.placeholder b/qos-monitor/src/test/java/.placeholder new file mode 100644 index 000000000..e69de29bb diff --git a/qos-monitor/src/test/resources/.placeholder b/qos-monitor/src/test/resources/.placeholder new file mode 100644 index 000000000..e69de29bb From e36407fb79ea2c3e2e8c1877d499c21e3fbe572e Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 21 Jan 2020 16:59:34 +0100 Subject: [PATCH 011/301] added qos_monitor certificate --- certificates/testcloud2/qos_monitor.p12 | Bin 0 -> 6177 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 certificates/testcloud2/qos_monitor.p12 diff --git a/certificates/testcloud2/qos_monitor.p12 b/certificates/testcloud2/qos_monitor.p12 new file mode 100644 index 0000000000000000000000000000000000000000..86c68f35b0a4864a2138e67019fc663757c522df GIT binary patch literal 6177 zcmY+ERa6uJl!k}y?uMaz0Ed$9mhO};X^?K|?od*Ylt#K!I){#-q)VD%-8~y;AMW|j z`Tl$F;|B^OrGke;0ELk(A)~QohGhN^ z8~+=9WQ_m5!bFFIFAP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 zSUz)u-!FJ$>sBms**e=K-6RLyi5HTX!QO%E54;hu0EskGRJ?%3JM1W})I=tqBtEP*mFdlx_{7^;i?hvg*I>RM!xmP8 zU)fD|p2`A-=l>SueCzKl3LEA>oPhRE@(hyrzsfaXfhTI13ePWu!5EKQ?fBPH&OLZD>>wkb{}iR zyi8)km%?6?Sb6Ot-p8|vUXn2?kXUEqHSlpymRqK^v}WB)Yl>h_D(A5SA$1l^U~ zB+ckxKQt(}-0J90O}AP(R(Rnl-UbP>nCyYwY#5rR ztCce_YwAQwYzO{johHwA!g$Hpyv8X8iFdPu#{LE&_sG^U1tsEmY%%n-e;gF13>fVb z&3kvAsaPBZ{v0vV%8gArma*s`b;KCm`^}~IW`-H9Z%}#@x8}wn2S`= z=FQ#kx)}=I$$k1{^E2`cJD1kz*(5L ep%cg46Zqu8^I>(B>PeKXMw*!k9s%x4;eP<*`M$;g literal 0 HcmV?d00001 From 2b6b800aa7ab25982bcf8dbb5bfba2fdc5c45605 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 21 Jan 2020 17:10:32 +0100 Subject: [PATCH 012/301] db init --- qos-monitor/src/main/resources/application.properties | 6 +++--- scripts/create_empty_arrowhead_db.sql | 7 ++++++- scripts/qos_monitor_privileges.sql | 11 +++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 scripts/qos_monitor_privileges.sql diff --git a/qos-monitor/src/main/resources/application.properties b/qos-monitor/src/main/resources/application.properties index 46681d416..b6af9ccb9 100644 --- a/qos-monitor/src/main/resources/application.properties +++ b/qos-monitor/src/main/resources/application.properties @@ -7,7 +7,7 @@ spring.main.web-application-type=NONE # Database connection (mandatory) # Change the server timezone if neccessary spring.datasource.url=jdbc:mysql://127.0.0.1:3306/arrowhead?serverTimezone=Europe/Budapest -spring.datasource.username=choreographer +spring.datasource.username=qos_monitor spring.datasource.password=Qa5yx4oBp4Y9RLX spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver @@ -38,9 +38,9 @@ sr_port=8443 server.ssl.enabled=true server.ssl.key-store-type=PKCS12 -server.ssl.key-store=classpath:certificates/choreographer.p12 +server.ssl.key-store=classpath:certificates/qos_monitor.p12 server.ssl.key-store-password=123456 -server.ssl.key-alias=choreographer +server.ssl.key-alias=qos_monitor server.ssl.key-password=123456 server.ssl.client-auth=need server.ssl.trust-store-type=PKCS12 diff --git a/scripts/create_empty_arrowhead_db.sql b/scripts/create_empty_arrowhead_db.sql index 27a130088..bf5ca3c29 100644 --- a/scripts/create_empty_arrowhead_db.sql +++ b/scripts/create_empty_arrowhead_db.sql @@ -40,4 +40,9 @@ source gatekeeper_privileges.sql -- Gateway CREATE USER IF NOT EXISTS 'gateway'@'localhost' IDENTIFIED BY 'LfiSM9DpGfDEP5g'; CREATE USER IF NOT EXISTS 'gateway'@'%' IDENTIFIED BY 'LfiSM9DpGfDEP5g'; -source gateway_privileges.sql \ No newline at end of file +source gateway_privileges.sql + +-- QoS Monitor +CREATE USER IF NOT EXISTS 'qos_monitor'@'localhost' IDENTIFIED BY 'LfiSM9DpGfDEP5g'; +CREATE USER IF NOT EXISTS 'qos_monitor'@'%' IDENTIFIED BY 'LfiSM9DpGfDEP5g'; +source qos_monitor_privileges.sql \ No newline at end of file diff --git a/scripts/qos_monitor_privileges.sql b/scripts/qos_monitor_privileges.sql new file mode 100644 index 000000000..1e3eed89b --- /dev/null +++ b/scripts/qos_monitor_privileges.sql @@ -0,0 +1,11 @@ +USE `arrowhead`; + +REVOKE ALL, GRANT OPTION FROM 'qos_monitor'@'localhost'; + +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'qos_monitor'@'localhost'; + +REVOKE ALL, GRANT OPTION FROM 'qos_monitor'@'%'; + +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'qos_monitor'@'%'; + +FLUSH PRIVILEGES; \ No newline at end of file From e5aff0e6e38bc67cadac4c25d39682ef293454a4 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 21 Jan 2020 17:29:13 +0100 Subject: [PATCH 013/301] db init --- qos-monitor/src/main/resources/application.properties | 2 +- scripts/create_empty_arrowhead_db.sql | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qos-monitor/src/main/resources/application.properties b/qos-monitor/src/main/resources/application.properties index b6af9ccb9..4842faba7 100644 --- a/qos-monitor/src/main/resources/application.properties +++ b/qos-monitor/src/main/resources/application.properties @@ -8,7 +8,7 @@ spring.main.web-application-type=NONE # Change the server timezone if neccessary spring.datasource.url=jdbc:mysql://127.0.0.1:3306/arrowhead?serverTimezone=Europe/Budapest spring.datasource.username=qos_monitor -spring.datasource.password=Qa5yx4oBp4Y9RLX +spring.datasource.password=RLY3UEx6nx4kSXy spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect diff --git a/scripts/create_empty_arrowhead_db.sql b/scripts/create_empty_arrowhead_db.sql index bf5ca3c29..f97fc6df8 100644 --- a/scripts/create_empty_arrowhead_db.sql +++ b/scripts/create_empty_arrowhead_db.sql @@ -43,6 +43,6 @@ CREATE USER IF NOT EXISTS 'gateway'@'%' IDENTIFIED BY 'LfiSM9DpGfDEP5g'; source gateway_privileges.sql -- QoS Monitor -CREATE USER IF NOT EXISTS 'qos_monitor'@'localhost' IDENTIFIED BY 'LfiSM9DpGfDEP5g'; -CREATE USER IF NOT EXISTS 'qos_monitor'@'%' IDENTIFIED BY 'LfiSM9DpGfDEP5g'; +CREATE USER IF NOT EXISTS 'qos_monitor'@'localhost' IDENTIFIED BY 'RLY3UEx6nx4kSXy'; +CREATE USER IF NOT EXISTS 'qos_monitor'@'%' IDENTIFIED BY 'RLY3UEx6nx4kSXy'; source qos_monitor_privileges.sql \ No newline at end of file From fff9d2b1e843b4b088cd674d46ccd05309ccff49 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Wed, 22 Jan 2020 11:04:34 +0100 Subject: [PATCH 014/301] qos monitor skeleton (with working echo) --- .../eu/arrowhead/common/CommonConstants.java | 5 +- .../java/eu/arrowhead/common/Defaults.java | 1 + .../eu/arrowhead/common/core/CoreSystem.java | 2 +- .../QoSMonitorApplicationInitListener.java | 10 +++ .../core/qos/QoSMonitorController.java | 47 +++++++++++ .../eu/arrowhead/core/qos/QoSMonitorMain.java | 2 + .../security/QoSMonitorSecurityConfig.java | 12 +++ .../QosMonitorAccessControlFilter.java | 28 +++++++ .../qos/swagger/QoSMonitorSwaggerConfig.java | 28 +++++++ ...itional-spring-configuration-metadata.json | 20 +++++ .../src/main/resources/application.properties | 16 +++- .../resources/certificates/qos_monitor.p12 | Bin 0 -> 6177 bytes .../main/resources/swagger/swagger-ui.html | 75 ++++++++++++++++++ 13 files changed, 241 insertions(+), 5 deletions(-) create mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorApplicationInitListener.java create mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java create mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QoSMonitorSecurityConfig.java create mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilter.java create mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/swagger/QoSMonitorSwaggerConfig.java create mode 100644 qos-monitor/src/main/resources/certificates/qos_monitor.p12 create mode 100644 qos-monitor/src/main/resources/swagger/swagger-ui.html diff --git a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java index 7ef651842..184a935cf 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java @@ -22,6 +22,7 @@ public class CommonConstants { public static final String CORE_SYSTEM_GATEWAY = "Gateway"; public static final String CORE_SYSTEM_ORCHESTRATOR = "Orchestrator"; public static final String CORE_SYSTEM_SERVICE_REGISTRY = "Service Registry"; + public static final String CORE_SYSTEM_QOS_MONITOR = "Quality of Service Monitor"; public static final String CORE_SERVICE_AUTH_TOKEN_GENERATION = "token-generation"; public static final String CORE_SERVICE_AUTH_PUBLIC_KEY = "auth-public-key"; @@ -95,7 +96,7 @@ public class CommonConstants { public static final String OP_GATEKEEPER_ICN_SERVICE = "/init_icn"; public static final String CHOREOGRAPHER_URI = "/choreographer"; - + public static final String GATEWAY_URI = "/gateway"; public static final String OP_GATEWAY_KEY_URI = "/publickey"; public static final String OP_GATEWAY_CONNECT_PROVIDER_URI = "/connect_provider"; @@ -107,6 +108,8 @@ public class CommonConstants { public static final String OP_EVENT_HANDLER_UNSUBSCRIBE = "/unsubscribe"; public static final String OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE = "/publish/authupdate"; + + public static final String QOS_MONITOR_URI = "/qosmonitor"; public static final String SWAGGER_COMMON_PACKAGE = "eu.arrowhead.common.swagger"; public static final String SWAGGER_UI_URI = "/swagger-ui.html"; diff --git a/core-common/src/main/java/eu/arrowhead/common/Defaults.java b/core-common/src/main/java/eu/arrowhead/common/Defaults.java index e5db9ed31..9099e58d1 100644 --- a/core-common/src/main/java/eu/arrowhead/common/Defaults.java +++ b/core-common/src/main/java/eu/arrowhead/common/Defaults.java @@ -20,6 +20,7 @@ public class Defaults { public static final int DEFAULT_EVENT_HANDLER_PORT = 8455; public static final int DEFAULT_CHOREOGRAPHER_PORT = 8457; public static final int DEFAULT_CERTIFICATE_AUTHORITY_PORT = 8459; + public static final int DEFAULT_QOS_MONITOR_PORT = 8451; // HTTP client defaults public static final int DEFAULT_CONNECTION_TIMEOUT = 30000; diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java index 194f0c337..04e447acd 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java @@ -23,7 +23,7 @@ public enum CoreSystem { , CoreSystemService.EVENT_UNSUBSCRIBE_SERVICE, CoreSystemService.EVENT_PUBLISH_AUTH_UPDATE_SERVICE)), GATEWAY(Defaults.DEFAULT_GATEWAY_PORT, List.of(CoreSystemService.GATEWAY_PUBLIC_KEY_SERVICE, CoreSystemService.GATEWAY_PROVIDER_SERVICE,CoreSystemService.GATEWAY_CONSUMER_SERVICE)), CHOREOGRAPHER(Defaults.DEFAULT_CHOREOGRAPHER_PORT, List.of()), // TODO: add services - QOS_MONITOR(1, List.of()), + QOS_MONITOR(Defaults.DEFAULT_QOS_MONITOR_PORT, List.of()), CERTIFICATE_AUTHORITY(Defaults.DEFAULT_CERTIFICATE_AUTHORITY_PORT, List.of()); // TODO: add services //================================================================================================= diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorApplicationInitListener.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorApplicationInitListener.java new file mode 100644 index 000000000..a314e2303 --- /dev/null +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorApplicationInitListener.java @@ -0,0 +1,10 @@ +package eu.arrowhead.core.qos; + +import org.springframework.stereotype.Component; + +import eu.arrowhead.common.ApplicationInitListener; + +@Component +public class QoSMonitorApplicationInitListener extends ApplicationInitListener { + +} \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java new file mode 100644 index 000000000..b4c584c38 --- /dev/null +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java @@ -0,0 +1,47 @@ +package eu.arrowhead.core.qos; + +import org.apache.http.HttpStatus; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.http.HttpHeaders; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.Defaults; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; + +@Api(tags = { CoreCommonConstants.SWAGGER_TAG_ALL }) +@CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, + allowedHeaders = { HttpHeaders.ORIGIN, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT, HttpHeaders.AUTHORIZATION } +) +@RestController +@RequestMapping(CommonConstants.QOS_MONITOR_URI) +public class QoSMonitorController { + + //================================================================================================= + // members + + private final Logger logger = LogManager.getLogger(QoSMonitorController.class); + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return an echo message with the purpose of testing the core service availability", response = String.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = CoreCommonConstants.SWAGGER_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CommonConstants.ECHO_URI) + public String echoService() { + return "Got it!"; + } +} \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorMain.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorMain.java index 0cb202d12..b629e6057 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorMain.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorMain.java @@ -9,11 +9,13 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.database.repository.RefreshableRepositoryImpl; +import springfox.documentation.swagger2.annotations.EnableSwagger2; @SpringBootApplication @ComponentScan (CommonConstants.BASE_PACKAGE) @EntityScan (CoreCommonConstants.DATABASE_ENTITY_PACKAGE) @EnableJpaRepositories (basePackages = CoreCommonConstants.DATABASE_REPOSITORY_PACKAGE, repositoryBaseClass = RefreshableRepositoryImpl.class) +@EnableSwagger2 public class QoSMonitorMain { //================================================================================================= diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QoSMonitorSecurityConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QoSMonitorSecurityConfig.java new file mode 100644 index 000000000..783b13167 --- /dev/null +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QoSMonitorSecurityConfig.java @@ -0,0 +1,12 @@ +package eu.arrowhead.core.qos.security; + +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; + +import eu.arrowhead.common.security.DefaultSecurityConfig; + +@Configuration +@EnableWebSecurity +public class QoSMonitorSecurityConfig extends DefaultSecurityConfig { + +} \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilter.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilter.java new file mode 100644 index 000000000..f1ac7aa19 --- /dev/null +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilter.java @@ -0,0 +1,28 @@ +package eu.arrowhead.core.qos.security; + +import java.util.Map; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.stereotype.Component; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.security.CoreSystemAccessControlFilter; + +@Component +@ConditionalOnProperty(name = CommonConstants.SERVER_SSL_ENABLED, matchIfMissing = true) +public class QosMonitorAccessControlFilter extends CoreSystemAccessControlFilter { + + //================================================================================================= + // members + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + @Override + protected void checkClientAuthorized(final String clientCN, final String method, final String requestTarget, final String requestJSON, final Map queryParams) { + super.checkClientAuthorized(clientCN, method, requestTarget, requestJSON, queryParams); + + //TODO: add custom rules here + } +} \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/swagger/QoSMonitorSwaggerConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/swagger/QoSMonitorSwaggerConfig.java new file mode 100644 index 000000000..fff5fc603 --- /dev/null +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/swagger/QoSMonitorSwaggerConfig.java @@ -0,0 +1,28 @@ +package eu.arrowhead.core.qos.swagger; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.swagger.DefaultSwaggerConfig; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@EnableSwagger2 +@Configuration +public class QoSMonitorSwaggerConfig extends DefaultSwaggerConfig { + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public QoSMonitorSwaggerConfig() { + super(CommonConstants.CORE_SYSTEM_QOS_MONITOR); + } + + //------------------------------------------------------------------------------------------------- + @Bean + public Docket customizeSwagger() { + return configureSwaggerForCoreSystem(this.getClass().getPackageName()); + } +} \ No newline at end of file diff --git a/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json index bf18f4826..2143ab2f5 100644 --- a/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -18,5 +18,25 @@ "name": "disable.hostname.verifier", "type": "java.lang.Boolean", "description": "A description for 'disable.hostname.verifier'" + }, + { + "name": "domain.name", + "type": "java.lang.String", + "description": "A description for 'domain.name'" + }, + { + "name": "domain.port", + "type": "java.lang.Integer", + "description": "A description for 'domain.port'" + }, + { + "name": "log_all_request_and_response", + "type": "java.lang.Boolean", + "description": "A description for 'log_all_request_and_response'" + }, + { + "name": "gatekeeper_is_present", + "type": "java.lang.Boolean", + "description": "A description for 'gatekeeper_is_present'" } ]} \ No newline at end of file diff --git a/qos-monitor/src/main/resources/application.properties b/qos-monitor/src/main/resources/application.properties index 4842faba7..f28686f5f 100644 --- a/qos-monitor/src/main/resources/application.properties +++ b/qos-monitor/src/main/resources/application.properties @@ -2,8 +2,6 @@ ### APPLICATION PARAMETERS ### ############################################ -spring.main.web-application-type=NONE - # Database connection (mandatory) # Change the server timezone if neccessary spring.datasource.url=jdbc:mysql://127.0.0.1:3306/arrowhead?serverTimezone=Europe/Budapest @@ -17,17 +15,29 @@ spring.jpa.show-sql=false spring.jpa.properties.hibernate.format_sql=true spring.jpa.hibernate.ddl-auto=none +# QoS Monitor web-server parameters +server.address=0.0.0.0 +server.port=8451 +domain.name=127.0.0.1 +domain.port=8451 + ############################################ ### CUSTOM PARAMETERS ### ############################################ # Name of the core system -core_system_name=QOS_MONITOR +core_system_name=QOS_MONITOR + +# Show all request/response in debug log +log_all_request_and_response=false # Service Registry web-server parameters (to register the Choreographer services) sr_address=127.0.0.1 sr_port=8443 +# Gatekeeper core system is present +gatekeeper_is_present=true + ############################################ ### SECURE MODE ### ############################################ diff --git a/qos-monitor/src/main/resources/certificates/qos_monitor.p12 b/qos-monitor/src/main/resources/certificates/qos_monitor.p12 new file mode 100644 index 0000000000000000000000000000000000000000..86c68f35b0a4864a2138e67019fc663757c522df GIT binary patch literal 6177 zcmY+ERa6uJl!k}y?uMaz0Ed$9mhO};X^?K|?od*Ylt#K!I){#-q)VD%-8~y;AMW|j z`Tl$F;|B^OrGke;0ELk(A)~QohGhN^ z8~+=9WQ_m5!bFFIFAPI`28AKsgIJN#{|EnjPJu}1+H)3qA#-#|^=CAzH>=^ax*Dwy z9sw|*ju?hGYVk1X{S((_*@(GSAcC@GnNB%ROVQvjMVa=%F2F8B}3+b_Gd z3oL=ztUo9l4bY!(&}WGDo3@M3T`@BY3b1ARFQk=48r}e2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&OLZD>>wkb{}iR zyi8)km%?6?Sb6Ot-p8|vUXn2?kXUEqHSlpymRqK^v}WB)Yl>h_D(A5SA$1l^U~ zB+ckxKQt(}-0J90O}AP(R(Rnl-UbP>nCyYwY#5rR ztCce_YwAQwYzO{johHwA!g$Hpyv8X8iFdPu#{LE&_sG^U1tsEmY%%n-e;gF13>fVb z&3kvAsaPBZ{v0vV%8gArma*s`b;KCm`^}~IW`-H9Z%}#@x8}wn2S`= z=FQ#kx)}=I$$k1{^E2`cJD1kz*(5L ep%cg46Zqu8^I>(B>PeKXMw*!k9s%x4;eP<*`M$;g literal 0 HcmV?d00001 diff --git a/qos-monitor/src/main/resources/swagger/swagger-ui.html b/qos-monitor/src/main/resources/swagger/swagger-ui.html new file mode 100644 index 000000000..b338d2f47 --- /dev/null +++ b/qos-monitor/src/main/resources/swagger/swagger-ui.html @@ -0,0 +1,75 @@ + + + + + + Service Registry + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + + + + From 75c37f919567319268c075f6d421f5eaa2521120 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Wed, 22 Jan 2020 13:23:34 +0100 Subject: [PATCH 015/301] new db tables related to intra qos --- .../src/main/resources/application.properties | 2 +- scripts/create_arrowhead_tables.sql | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/qos-monitor/src/main/resources/application.properties b/qos-monitor/src/main/resources/application.properties index f28686f5f..92fbe63fe 100644 --- a/qos-monitor/src/main/resources/application.properties +++ b/qos-monitor/src/main/resources/application.properties @@ -31,7 +31,7 @@ core_system_name=QOS_MONITOR # Show all request/response in debug log log_all_request_and_response=false -# Service Registry web-server parameters (to register the Choreographer services) +# Service Registry web-server parameters (to register the QoS Monitor services) sr_address=127.0.0.1 sr_port=8443 diff --git a/scripts/create_arrowhead_tables.sql b/scripts/create_arrowhead_tables.sql index df58ad803..c50add70b 100644 --- a/scripts/create_arrowhead_tables.sql +++ b/scripts/create_arrowhead_tables.sql @@ -333,4 +333,32 @@ CREATE TABLE IF NOT EXISTS `choreographer_next_action_step` ( CONSTRAINT `next_action_step` FOREIGN KEY (`action_step_id`) REFERENCES `choreographer_action_step` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- QoS Monitor + +CREATE TABLE IF NOT EXISTS `qos_intra_measurement` ( + `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, + `system_id` bigint(20) NOT NULL, + `measurement_type` varchar(255) NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + CONSTRAINT `fk_system` FOREIGN KEY (`system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement` ( + `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, + `measurement_id` bigint(20) NOT NULL, + `accessible` int(1) NOT NULL DEFAULT 0, + `last_access_at` timestamp, + `min_response_time` int(11), + `max_response_time` int(11), + `mean_response_time` int(11), + `sent` bigint(20) NOT NULL DEFAULT 0, + `received` bigint(20) NOT NULL DEFAULT 0, + `count_started_at` timestamp, + `sent_all` bigint(20) NOT NULL DEFAULT 0, + `received_all` bigint(20) NOT NULL DEFAULT 0, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + CONSTRAINT `fk_measurement` FOREIGN KEY (`measurement_id`) REFERENCES `qos_intra_measurement` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; From 1da4d394003aa423d091db056a37d22fd2ba5bdc Mon Sep 17 00:00:00 2001 From: rbocsi Date: Wed, 22 Jan 2020 14:54:33 +0100 Subject: [PATCH 016/301] refined qos intra tables qos intra entities and repositorites --- .../database/entity/QoSIntraMeasurement.java | 91 ++++++++++++++ .../entity/QoSIntraPingMeasurement.java | 119 ++++++++++++++++++ .../QosIntraMeasurementPingRepository.java | 12 ++ .../QosIntraMeasurementRepository.java | 12 ++ .../common/dto/shared/QoSMeasurementType.java | 5 + scripts/create_arrowhead_tables.sql | 5 +- 6 files changed, 243 insertions(+), 1 deletion(-) create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraMeasurement.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementPingRepository.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementRepository.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/QoSMeasurementType.java diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraMeasurement.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraMeasurement.java new file mode 100644 index 000000000..9a0c0a6c0 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraMeasurement.java @@ -0,0 +1,91 @@ +package eu.arrowhead.common.database.entity; + +import java.time.ZonedDateTime; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; +import javax.persistence.Table; + +import eu.arrowhead.common.CoreDefaults; +import eu.arrowhead.common.dto.shared.QoSMeasurementType; + +@Entity +@Table(name = "qos_intra_measurement") +public class QoSIntraMeasurement { + + //================================================================================================= + // members + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private long id; + + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "systemId", referencedColumnName = "id", nullable = false) + private System system; + + @Column(nullable = false, columnDefinition = "varchar(" + CoreDefaults.VARCHAR_BASIC + ")") + @Enumerated(EnumType.STRING) + private QoSMeasurementType measurementType; + + @Column(nullable = false) + private ZonedDateTime lastMeasurementAt; + + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") + private ZonedDateTime createdAt; + + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") + private ZonedDateTime updatedAt; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public QoSIntraMeasurement() {} + + //------------------------------------------------------------------------------------------------- + public QoSIntraMeasurement(final System system, final QoSMeasurementType measurementType, final ZonedDateTime lastMeasurementAt) { + this.system = system; + this.measurementType = measurementType; + this.lastMeasurementAt = lastMeasurementAt; + } + + //------------------------------------------------------------------------------------------------- + @PrePersist + public void onCreate() { + this.createdAt = ZonedDateTime.now(); + this.updatedAt = this.createdAt; + } + + //------------------------------------------------------------------------------------------------- + @PreUpdate + public void onUpdate() { + this.updatedAt = ZonedDateTime.now(); + } + + //------------------------------------------------------------------------------------------------- + public long getId() { return id; } + public System getSystem() { return system; } + public QoSMeasurementType getMeasurementType() { return measurementType; } + public ZonedDateTime getLastMeasurementAt() { return lastMeasurementAt; } + public ZonedDateTime getCreatedAt() { return createdAt; } + public ZonedDateTime getUpdatedAt() { return updatedAt; } + + //------------------------------------------------------------------------------------------------- + public void setId(final long id) { this.id = id; } + public void setSystem(final System system) { this.system = system; } + public void setMeasurementType(final QoSMeasurementType measurementType) { this.measurementType = measurementType; } + public void setLastMeasurementAt(final ZonedDateTime lastMeasurementAt) { this.lastMeasurementAt = lastMeasurementAt; } + public void setCreatedAt(final ZonedDateTime createdAt) { this.createdAt = createdAt; } + public void setUpdatedAt(final ZonedDateTime updatedAt) { this.updatedAt = updatedAt; } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java new file mode 100644 index 000000000..e4cf71ccc --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java @@ -0,0 +1,119 @@ +package eu.arrowhead.common.database.entity; + +import java.time.ZonedDateTime; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; +import javax.persistence.Table; + +@Entity +@Table(name = "qos_intra_ping_measurement") +public class QoSIntraPingMeasurement { + + //================================================================================================= + // members + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private long id; + + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "measurementId", referencedColumnName = "id", nullable = false) + @Column(unique = true) + private QoSIntraMeasurement measurement; + + @Column(nullable = false) + private boolean accessible = false; + + @Column(nullable = true) + private ZonedDateTime lastAccessAt; + + @Column(nullable = true) + private int minResponseTime; + + @Column(nullable = true) + private int maxResponseTime; + + @Column(nullable = true) + private int meanResponseTime; + + @Column(nullable = false) + private long sent; + + @Column(nullable = false) + private long received; + + @Column(nullable = true) + private ZonedDateTime countStartedAt; + + @Column(nullable = false) + private long sentAll; + + @Column(nullable = false) + private long receivedAll; + + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") + private ZonedDateTime createdAt; + + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") + private ZonedDateTime updatedAt; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public QoSIntraPingMeasurement() {} + + //------------------------------------------------------------------------------------------------- + @PrePersist + public void onCreate() { + this.createdAt = ZonedDateTime.now(); + this.updatedAt = this.createdAt; + } + + //------------------------------------------------------------------------------------------------- + @PreUpdate + public void onUpdate() { + this.updatedAt = ZonedDateTime.now(); + } + + //------------------------------------------------------------------------------------------------- + public long getId() { return id; } + public QoSIntraMeasurement getMeasurement() { return measurement; } + public boolean isAccessible() { return accessible; } + public ZonedDateTime getLastAccessAt() { return lastAccessAt; } + public int getMinResponseTime() { return minResponseTime; } + public int getMaxResponseTime() { return maxResponseTime; } + public int getMeanResponseTime() { return meanResponseTime; } + public long getSent() { return sent; } + public long getReceived() { return received; } + public ZonedDateTime getCountStartedAt() { return countStartedAt; } + public long getSentAll() { return sentAll; } + public long getReceivedAll() { return receivedAll; } + public ZonedDateTime getCreatedAt() { return createdAt; } + public ZonedDateTime getUpdatedAt() { return updatedAt; } + + //------------------------------------------------------------------------------------------------- + public void setId(final long id) { this.id = id; } + public void setMeasurement(final QoSIntraMeasurement measurement) { this.measurement = measurement; } + public void setAccessible(final boolean accessible) { this.accessible = accessible; } + public void setLastAccessAt(final ZonedDateTime lastAccessAt) { this.lastAccessAt = lastAccessAt; } + public void setMinResponseTime(final int minResponseTime) { this.minResponseTime = minResponseTime; } + public void setMaxResponseTime(final int maxResponseTime) { this.maxResponseTime = maxResponseTime; } + public void setMeanResponseTime(final int meanResponseTime) { this.meanResponseTime = meanResponseTime; } + public void setSent(final long sent) { this.sent = sent; } + public void setReceived(final long received) { this.received = received; } + public void setCountStartedAt(final ZonedDateTime countStartedAt) { this.countStartedAt = countStartedAt; } + public void setSentAll(final long sentAll) { this.sentAll = sentAll; } + public void setReceivedAll(final long receivedAll) { this.receivedAll = receivedAll; } + public void setCreatedAt(final ZonedDateTime createdAt) { this.createdAt = createdAt; } + public void setUpdatedAt(final ZonedDateTime updatedAt) { this.updatedAt = updatedAt; } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementPingRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementPingRepository.java new file mode 100644 index 000000000..3017618d3 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementPingRepository.java @@ -0,0 +1,12 @@ +package eu.arrowhead.common.database.repository; + +import org.springframework.stereotype.Repository; + +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; + +@Repository +public interface QosIntraMeasurementPingRepository extends RefreshableRepository { + + //================================================================================================= + // methods +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementRepository.java new file mode 100644 index 000000000..dc78b1464 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementRepository.java @@ -0,0 +1,12 @@ +package eu.arrowhead.common.database.repository; + +import org.springframework.stereotype.Repository; + +import eu.arrowhead.common.database.entity.QoSIntraMeasurement; + +@Repository +public interface QosIntraMeasurementRepository extends RefreshableRepository { + + //================================================================================================= + // methods +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/QoSMeasurementType.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/QoSMeasurementType.java new file mode 100644 index 000000000..ad56b33c0 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/QoSMeasurementType.java @@ -0,0 +1,5 @@ +package eu.arrowhead.common.dto.shared; + +public enum QoSMeasurementType { + PING +} \ No newline at end of file diff --git a/scripts/create_arrowhead_tables.sql b/scripts/create_arrowhead_tables.sql index c50add70b..3280499b3 100644 --- a/scripts/create_arrowhead_tables.sql +++ b/scripts/create_arrowhead_tables.sql @@ -339,6 +339,7 @@ CREATE TABLE IF NOT EXISTS `qos_intra_measurement` ( `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, `system_id` bigint(20) NOT NULL, `measurement_type` varchar(255) NOT NULL, + `last_measurement_at` timestamp NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, CONSTRAINT `fk_system` FOREIGN KEY (`system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE @@ -359,6 +360,8 @@ CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement` ( `received_all` bigint(20) NOT NULL DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - CONSTRAINT `fk_measurement` FOREIGN KEY (`measurement_id`) REFERENCES `qos_intra_measurement` (`id`) ON DELETE CASCADE + CONSTRAINT `fk_measurement` FOREIGN KEY (`measurement_id`) REFERENCES `qos_intra_measurement` (`id`) ON DELETE CASCADE, + UNIQUE KEY `unique_measurement` (`measurement_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; From 6176751bb0088fabce8432298042a76ab40d8145 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Wed, 22 Jan 2020 16:07:52 +0100 Subject: [PATCH 017/301] empty db service class renaming repositories --- .../QosIntraMeasurementPingRepository.java | 2 +- .../QosIntraMeasurementRepository.java | 2 +- .../database/service/QoSDatabaseService.java | 20 +++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementPingRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementPingRepository.java index 3017618d3..5284d11d3 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementPingRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementPingRepository.java @@ -5,7 +5,7 @@ import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; @Repository -public interface QosIntraMeasurementPingRepository extends RefreshableRepository { +public interface QoSIntraMeasurementPingRepository extends RefreshableRepository { //================================================================================================= // methods diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementRepository.java index dc78b1464..4cd8c02a3 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementRepository.java @@ -5,7 +5,7 @@ import eu.arrowhead.common.database.entity.QoSIntraMeasurement; @Repository -public interface QosIntraMeasurementRepository extends RefreshableRepository { +public interface QoSIntraMeasurementRepository extends RefreshableRepository { //================================================================================================= // methods diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java new file mode 100644 index 000000000..7468532f5 --- /dev/null +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java @@ -0,0 +1,20 @@ +package eu.arrowhead.core.qos.database.service; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import eu.arrowhead.common.database.repository.QoSIntraMeasurementPingRepository; +import eu.arrowhead.common.database.repository.QoSIntraMeasurementRepository; + +@Service +public class QoSDatabaseService { + + //================================================================================================= + // members + + @Autowired + private QoSIntraMeasurementRepository qosIntraMeasurementRepository; + + @Autowired + private QoSIntraMeasurementPingRepository qosIntraMeasurementPingRepository; +} \ No newline at end of file From e094b718b3e11edbc964d17a4e42bfadd10ad1a6 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 22 Jan 2020 17:01:13 +0100 Subject: [PATCH 018/301] implemented ping tasks skeletons --- .../arrowhead/common/CoreCommonConstants.java | 10 +++ .../eu/arrowhead/common/CoreDefaults.java | 6 ++ .../core/qos/quartz/task/CloudPingTask.java | 36 ++++++++ .../qos/quartz/task/CloudPingTaskConfig.java | 86 +++++++++++++++++++ .../core/qos/quartz/task/PingTask.java | 36 ++++++++ .../core/qos/quartz/task/PingTaskConfig.java | 86 +++++++++++++++++++ .../src/main/resources/application.properties | 7 ++ 7 files changed, 267 insertions(+) create mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTask.java create mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTaskConfig.java create mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java create mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java index 02bd3b73d..3b8c884e0 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java @@ -145,6 +145,16 @@ public class CoreCommonConstants { public static final String $EVENT_HANDLER_MAX_EXPRESS_SUBSCRIBERS_WD = "${" + EVENT_HANDLER_MAX_EXPRESS_SUBSCRIBERS + ":" + CoreDefaults.DEFAULT_EVENT_HANDLER_MAX_EXPRESS_SUBSCRIBERS + "}"; public static final String EVENT_PUBLISHING_EXPRESS_EXECUTOR = "eventPublishingExpressExecutor"; + public static final String PING_TTL_SCHEDULED = "ping_ttl_scheduled"; + public static final String $PING_TTL_SCHEDULED_WD = "${" + PING_TTL_SCHEDULED + ":" + CoreDefaults.DEFAULT_PING_TTL_SCHEDULED + "}"; + public static final String PING_TTL_INTERVAL = "ping_ttl_interval"; + public static final String $PING_TTL_INTERVAL_WD = "${" + PING_TTL_INTERVAL + ":" + CoreDefaults.DEFAULT_PING_TTL_INTERVAL_MINUTES + "}"; + + public static final String CLOUD_PING_TTL_SCHEDULED = "cloud_ping_ttl_scheduled"; + public static final String $CLOUD_PING_TTL_SCHEDULED_WD = "${" + CLOUD_PING_TTL_SCHEDULED + ":" + CoreDefaults.DEFAULT_CLOUD_PING_TTL_SCHEDULED + "}"; + public static final String CLOUD_PING_TTL_INTERVAL = "cloud_ping_ttl_interval"; + public static final String $CLOUD_PING_TTL_INTERVAL_WD = "${" + CLOUD_PING_TTL_INTERVAL + ":" + CoreDefaults.DEFAULT_CLOUD_PING_TTL_INTERVAL_MINUTES + "}"; + //================================================================================================= // assistant methods diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java b/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java index 8ffc12b5c..994cae06f 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java @@ -45,6 +45,12 @@ public class CoreDefaults { public static final long DEFAULT_TIME_STAMP_TOLERANCE_SECONDS = 120; public static final int DEFAULT_EVENT_HANDLER_MAX_EXPRESS_SUBSCRIBERS = 10; + public static final boolean DEFAULT_PING_TTL_SCHEDULED = false; + public static final int DEFAULT_PING_TTL_INTERVAL_MINUTES = 10; + + public static final boolean DEFAULT_CLOUD_PING_TTL_SCHEDULED = false; + public static final int DEFAULT_CLOUD_PING_TTL_INTERVAL_MINUTES = 10; + //================================================================================================= // assistant methods diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTask.java new file mode 100644 index 000000000..b460a0f28 --- /dev/null +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTask.java @@ -0,0 +1,36 @@ +package eu.arrowhead.core.qos.quartz.task; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.quartz.DisallowConcurrentExecution; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.stereotype.Component; + +@Component +@DisallowConcurrentExecution +public class CloudPingTask implements Job { + + //================================================================================================= + // members + + protected Logger logger = LogManager.getLogger(CloudPingTask.class); + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Override + public void execute(final JobExecutionContext context) throws JobExecutionException { + logger.debug("STARTED: Intra cloud ping task"); + + logger.debug("Finished: Intra cloud ping task"); + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + +} \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTaskConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTaskConfig.java new file mode 100644 index 000000000..519a7df5f --- /dev/null +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTaskConfig.java @@ -0,0 +1,86 @@ +package eu.arrowhead.core.qos.quartz.task; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.quartz.SimpleTrigger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.quartz.JobDetailFactoryBean; +import org.springframework.scheduling.quartz.SchedulerFactoryBean; +import org.springframework.scheduling.quartz.SimpleTriggerFactoryBean; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.quartz.AutoWiringSpringBeanQuartzTaskFactory; + +@Configuration +public class CloudPingTaskConfig { + + //================================================================================================= + // members + + protected Logger logger = LogManager.getLogger(CloudPingTaskConfig.class); + + @Autowired + private ApplicationContext applicationContext; //NOSONAR + + @Value(CoreCommonConstants.$CLOUD_PING_TTL_SCHEDULED_WD) + private boolean ttlScheduled; + + @Value(CoreCommonConstants.$CLOUD_PING_TTL_INTERVAL_WD) + private int ttlInterval; + + private static final int SCHEDULER_DELAY = 5; + + private static final String NAME_OF_TRIGGER = "Cloud_Ping_Task_Trigger"; + private static final String NAME_OF_TASK = "Cloud_Ping_Task_Detail"; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Bean + public SchedulerFactoryBean cloudPingSheduler() { + final AutoWiringSpringBeanQuartzTaskFactory jobFactory = new AutoWiringSpringBeanQuartzTaskFactory(); + jobFactory.setApplicationContext(applicationContext); + + final SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean(); + if (ttlScheduled) { + schedulerFactory.setJobFactory(jobFactory); + schedulerFactory.setJobDetails(cloudPingTaskDetails().getObject()); + schedulerFactory.setTriggers(cloudPingTaskTrigger().getObject()); + schedulerFactory.setStartupDelay(SCHEDULER_DELAY); + logger.info("Cloud ping task adjusted with ttl interval: {} minutes", ttlInterval); + } else { + logger.info("Cloud ping task is not adjusted"); + } + + return schedulerFactory; + } + + //------------------------------------------------------------------------------------------------- + @Bean + public SimpleTriggerFactoryBean cloudPingTaskTrigger() { + final SimpleTriggerFactoryBean trigger = new SimpleTriggerFactoryBean(); + trigger.setJobDetail(cloudPingTaskDetails().getObject()); + trigger.setRepeatInterval(ttlInterval * CommonConstants.CONVERSION_MILLISECOND_TO_MINUTE); + trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY); + trigger.setName(NAME_OF_TRIGGER); + + return trigger; + } + + //------------------------------------------------------------------------------------------------- + @Bean + public JobDetailFactoryBean cloudPingTaskDetails() { + final JobDetailFactoryBean jobDetailFactory = new JobDetailFactoryBean(); + jobDetailFactory.setJobClass(PingTask.class); + jobDetailFactory.setName(NAME_OF_TASK); + jobDetailFactory.setDurability(true); + + return jobDetailFactory; + } +} \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java new file mode 100644 index 000000000..c5005dfd5 --- /dev/null +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -0,0 +1,36 @@ +package eu.arrowhead.core.qos.quartz.task; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.quartz.DisallowConcurrentExecution; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.stereotype.Component; + +@Component +@DisallowConcurrentExecution +public class PingTask implements Job { + + //================================================================================================= + // members + + protected Logger logger = LogManager.getLogger(PingTask.class); + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Override + public void execute(final JobExecutionContext context) throws JobExecutionException { + logger.debug("STARTED: ping task"); + + logger.debug("Finished: ping task"); + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + +} \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java new file mode 100644 index 000000000..18e69e03f --- /dev/null +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java @@ -0,0 +1,86 @@ +package eu.arrowhead.core.qos.quartz.task; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.quartz.SimpleTrigger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.quartz.JobDetailFactoryBean; +import org.springframework.scheduling.quartz.SchedulerFactoryBean; +import org.springframework.scheduling.quartz.SimpleTriggerFactoryBean; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.quartz.AutoWiringSpringBeanQuartzTaskFactory; + +@Configuration +public class PingTaskConfig { + + //================================================================================================= + // members + + protected Logger logger = LogManager.getLogger(PingTaskConfig.class); + + @Autowired + private ApplicationContext applicationContext; //NOSONAR + + @Value(CoreCommonConstants.$PING_TTL_SCHEDULED_WD) + private boolean ttlScheduled; + + @Value(CoreCommonConstants.$PING_TTL_INTERVAL_WD) + private int ttlInterval; + + private static final int SCHEDULER_DELAY = 7; + + private static final String NAME_OF_TRIGGER = "Intra_Cloud_Ping_Task_Trigger"; + private static final String NAME_OF_TASK = "Intra_Cloud_Ping_Task_Detail"; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Bean + public SchedulerFactoryBean pingSheduler() { + final AutoWiringSpringBeanQuartzTaskFactory jobFactory = new AutoWiringSpringBeanQuartzTaskFactory(); + jobFactory.setApplicationContext(applicationContext); + + final SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean(); + if (ttlScheduled) { + schedulerFactory.setJobFactory(jobFactory); + schedulerFactory.setJobDetails(intraCloudPingTaskDetails().getObject()); + schedulerFactory.setTriggers(intraCloudPingTaskTrigger().getObject()); + schedulerFactory.setStartupDelay(SCHEDULER_DELAY); + logger.info("Pin task adjusted with ttl interval: {} minutes", ttlInterval); + } else { + logger.info("Ping task is not adjusted"); + } + + return schedulerFactory; + } + + //------------------------------------------------------------------------------------------------- + @Bean + public SimpleTriggerFactoryBean intraCloudPingTaskTrigger() { + final SimpleTriggerFactoryBean trigger = new SimpleTriggerFactoryBean(); + trigger.setJobDetail(intraCloudPingTaskDetails().getObject()); + trigger.setRepeatInterval(ttlInterval * CommonConstants.CONVERSION_MILLISECOND_TO_MINUTE); + trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY); + trigger.setName(NAME_OF_TRIGGER); + + return trigger; + } + + //------------------------------------------------------------------------------------------------- + @Bean + public JobDetailFactoryBean intraCloudPingTaskDetails() { + final JobDetailFactoryBean jobDetailFactory = new JobDetailFactoryBean(); + jobDetailFactory.setJobClass(PingTask.class); + jobDetailFactory.setName(NAME_OF_TASK); + jobDetailFactory.setDurability(true); + + return jobDetailFactory; + } +} \ No newline at end of file diff --git a/qos-monitor/src/main/resources/application.properties b/qos-monitor/src/main/resources/application.properties index f28686f5f..af56fb406 100644 --- a/qos-monitor/src/main/resources/application.properties +++ b/qos-monitor/src/main/resources/application.properties @@ -38,6 +38,13 @@ sr_port=8443 # Gatekeeper core system is present gatekeeper_is_present=true +# Monitor timings +cloud_ping_ttl_scheduled=true +cloud_ping_ttl_interval=2 + +ping_ttl_scheduled=true +ping_ttl_interval=2 + ############################################ ### SECURE MODE ### ############################################ From 4f8abe7168a083ea8c1df7398a79b634d9661a95 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Wed, 22 Jan 2020 17:16:36 +0100 Subject: [PATCH 019/301] git case sensitivity issue --- .../QosIntraMeasurementPingRepository.java | 12 ------------ .../repository/QosIntraMeasurementRepository.java | 12 ------------ 2 files changed, 24 deletions(-) delete mode 100644 core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementPingRepository.java delete mode 100644 core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementRepository.java diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementPingRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementPingRepository.java deleted file mode 100644 index 5284d11d3..000000000 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementPingRepository.java +++ /dev/null @@ -1,12 +0,0 @@ -package eu.arrowhead.common.database.repository; - -import org.springframework.stereotype.Repository; - -import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; - -@Repository -public interface QoSIntraMeasurementPingRepository extends RefreshableRepository { - - //================================================================================================= - // methods -} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementRepository.java deleted file mode 100644 index 4cd8c02a3..000000000 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/QosIntraMeasurementRepository.java +++ /dev/null @@ -1,12 +0,0 @@ -package eu.arrowhead.common.database.repository; - -import org.springframework.stereotype.Repository; - -import eu.arrowhead.common.database.entity.QoSIntraMeasurement; - -@Repository -public interface QoSIntraMeasurementRepository extends RefreshableRepository { - - //================================================================================================= - // methods -} \ No newline at end of file From 43bfce98f3bc2cfe7fa6c9f8cf84784a4fcdf62e Mon Sep 17 00:00:00 2001 From: rbocsi Date: Wed, 22 Jan 2020 17:17:34 +0100 Subject: [PATCH 020/301] fixed repository names --- .../QoSIntraMeasurementPingRepository.java | 12 ++++++++++++ .../repository/QoSIntraMeasurementRepository.java | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementPingRepository.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementRepository.java diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementPingRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementPingRepository.java new file mode 100644 index 000000000..5284d11d3 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementPingRepository.java @@ -0,0 +1,12 @@ +package eu.arrowhead.common.database.repository; + +import org.springframework.stereotype.Repository; + +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; + +@Repository +public interface QoSIntraMeasurementPingRepository extends RefreshableRepository { + + //================================================================================================= + // methods +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementRepository.java new file mode 100644 index 000000000..4cd8c02a3 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementRepository.java @@ -0,0 +1,12 @@ +package eu.arrowhead.common.database.repository; + +import org.springframework.stereotype.Repository; + +import eu.arrowhead.common.database.entity.QoSIntraMeasurement; + +@Repository +public interface QoSIntraMeasurementRepository extends RefreshableRepository { + + //================================================================================================= + // methods +} \ No newline at end of file From 379215c2e35cfd88b28ce54c89363c1b8ecd0520 Mon Sep 17 00:00:00 2001 From: mzsilak Date: Wed, 22 Jan 2020 18:40:04 +0100 Subject: [PATCH 021/301] WIP on SystemRegistryDBService --- .../eu/arrowhead/common/CommonConstants.java | 7 + .../arrowhead/common/CoreCommonConstants.java | 5 +- .../common/dto/internal/DTOConverter.java | 41 +- .../SystemRegistryListResponseDTO.java | 7 +- .../common/dto/shared/SystemQueryFormDTO.java | 130 ++ .../dto/shared/SystemQueryResultDTO.java | 31 + .../dto/shared/SystemRegistryRequestDTO.java | 12 +- .../service/ServiceRegistryDBService.java | 2 +- .../SystemRegistryController.java | 1769 ++++++++--------- .../service/SystemRegistryDBService.java | 452 ++--- 10 files changed, 1298 insertions(+), 1158 deletions(-) create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryFormDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryResultDTO.java diff --git a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java index ac03cb552..c16b1ebda 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java @@ -88,10 +88,17 @@ public class CommonConstants { public static final String SYSTEM_REGISTRY_URI = "/systemregistry"; public static final String OP_SYSTEM_REGISTRY_REGISTER_URI = "/register"; public static final String OP_SYSTEM_REGISTRY_UNREGISTER_URI = "/unregister"; + public static final String OP_SYSTEM_REGISTRY_QUERY_URI = "/query"; + + public static final String OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_SYSTEM_NAME = "system_name"; + public static final String OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_ADDRESS = "address"; + public static final String OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_PORT = "port"; public static final String DEVICE_REGISTRY_URI = "/deviceregistry"; public static final String OP_DEVICE_REGISTRY_REGISTER_URI = "/register"; public static final String OP_DEVICE_REGISTRY_UNREGISTER_URI = "/unregister"; + public static final String OP_DEVICE_REGISTRY_QUERY_URI = "/query"; + public static final String ONBOARDING_URI = "/onboarding"; public static final String OP_ONBOARDING_PLAIN = "/plain"; diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java index 02bd3b73d..ca394fef5 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java @@ -33,7 +33,10 @@ public class CoreCommonConstants { public static final String SERVER_ERROR_URI = "/error"; public static final String MGMT_URI = "/mgmt"; - + + public static final String OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI = "/query/system/{" + COMMON_FIELD_NAME_ID + "}"; + public static final String OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_URI = "/query/system"; + public static final String OP_SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_URI = "/query/system/{" + COMMON_FIELD_NAME_ID + "}"; public static final String OP_SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_URI = "/query/system"; diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java index 03c595a49..810a4bf85 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java @@ -13,6 +13,8 @@ import eu.arrowhead.common.database.entity.System; import eu.arrowhead.common.dto.shared.*; import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; import org.springframework.util.Assert; import eu.arrowhead.common.Utilities; @@ -630,7 +632,43 @@ public static ChoreographerActionPlanResponseDTO convertChoreographerActionPlanT Utilities.convertZonedDateTimeToUTCString(actionPlanEntry.getCreatedAt()), Utilities.convertZonedDateTimeToUTCString(actionPlanEntry.getUpdatedAt())); } - + + + //------------------------------------------------------------------------------------------------- + public static SystemRegistryResponseDTO convertSystemRegistryToSystemRegistryResponseDTO(final SystemRegistry entry) { + + Assert.notNull(entry, "SR entry is null."); + Assert.notNull(entry.getDevice(), "Related device is null."); + Assert.notNull(entry.getSystem(), "Related system is null."); + + final SystemResponseDTO systemResponseDTO = convertSystemToSystemResponseDTO(entry.getSystem()); + final DeviceResponseDTO deviceResponseDTO = convertDeviceToDeviceResponseDTO(entry.getDevice()); + + final SystemRegistryResponseDTO dto = new SystemRegistryResponseDTO(); + dto.setId(entry.getId()); + dto.setProvider(deviceResponseDTO); + dto.setSystem(systemResponseDTO); + dto.setEndOfValidity(Utilities.convertZonedDateTimeToUTCString(entry.getEndOfValidity())); + dto.setMetadata(Utilities.text2Map(entry.getMetadata())); + dto.setVersion(entry.getVersion()); + dto.setCreatedAt(Utilities.convertZonedDateTimeToUTCString(entry.getCreatedAt())); + dto.setUpdatedAt(Utilities.convertZonedDateTimeToUTCString(entry.getUpdatedAt())); + + return dto; + } + + //------------------------------------------------------------------------------------------------- + + public static SystemRegistryListResponseDTO convertSystemRegistryPageToSystemRegistryListResponseDTO(final Page page) { + + final List list = new ArrayList<>(page.getSize()); + for(final SystemRegistry entry : page) + { + list.add(convertSystemRegistryToSystemRegistryResponseDTO(entry)); + } + return new SystemRegistryListResponseDTO(list, list.size()); + } + //================================================================================================= // assistant methods @@ -746,4 +784,5 @@ private static Set collectAuthorizedPublishersFromSubscriptio return result; } + } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/SystemRegistryListResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/SystemRegistryListResponseDTO.java index 0e4ae3f76..37200d99e 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/SystemRegistryListResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/SystemRegistryListResponseDTO.java @@ -25,12 +25,17 @@ public class SystemRegistryListResponseDTO implements Serializable { //------------------------------------------------------------------------------------------------- public SystemRegistryListResponseDTO() {} + //------------------------------------------------------------------------------------------------- + public SystemRegistryListResponseDTO(final List data) { + this(data, data.size()); + } + //------------------------------------------------------------------------------------------------- public SystemRegistryListResponseDTO(final List data, final long count) { this.data = data; this.count = count; } - + //------------------------------------------------------------------------------------------------- public List getData() {return data;} public long getCount() {return count;} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryFormDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryFormDTO.java new file mode 100644 index 000000000..d8c420310 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryFormDTO.java @@ -0,0 +1,130 @@ +package eu.arrowhead.common.dto.shared; + +import org.springframework.util.Assert; + +import java.io.Serializable; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SystemQueryFormDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = -2699823381165019336L; + + private String systemNameRequirements; + private Map metadataRequirements; // if specified the whole content of the map must match + private Integer versionRequirement; // if specified version must match + private Integer minVersionRequirement; // if specified version must be equals or higher; ignored if versionRequirement is specified + private Integer maxVersionRequirement; // if specified version must be equals or lower; ignored if versionRequirement is specified + + private boolean pingProviders = false; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public SystemQueryFormDTO() {} + + //------------------------------------------------------------------------------------------------- + public String getSystemNameRequirements() { return systemNameRequirements; } + public Map getMetadataRequirements() { return metadataRequirements; } + public Integer getVersionRequirement() { return versionRequirement; } + public Integer getMinVersionRequirement() { return minVersionRequirement; } + public Integer getMaxVersionRequirement() { return maxVersionRequirement; } + public boolean getPingProviders() { return pingProviders; } + + //------------------------------------------------------------------------------------------------- + public void setSystemNameRequirements(final String systemNameRequirements) { this.systemNameRequirements = systemNameRequirements; } + public void setMetadataRequirements(final Map metadataRequirements) { this.metadataRequirements = metadataRequirements; } + public void setVersionRequirement(final Integer versionRequirement) { this.versionRequirement = versionRequirement; } + public void setMinVersionRequirement(final Integer minVersionRequirement) { this.minVersionRequirement = minVersionRequirement; } + public void setMaxVersionRequirement(final Integer maxVersionRequirement) { this.maxVersionRequirement = maxVersionRequirement; } + public void setPingProviders(final boolean pingProviders) { this.pingProviders = pingProviders; } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private SystemQueryFormDTO(final Builder builder) { + this.systemNameRequirements = builder.systemNameRequirements; + this.metadataRequirements = builder.metadataRequirements; + this.versionRequirement = builder.versionRequirement; + this.minVersionRequirement = builder.minVersionRequirement; + this.maxVersionRequirement = builder.maxVersionRequirement; + this.pingProviders = builder.pingProviders; + } + + //================================================================================================= + // nested classes + + //------------------------------------------------------------------------------------------------- + public static class Builder { + + //================================================================================================= + // members + + private final String systemNameRequirements; + private Map metadataRequirements; + private Integer versionRequirement; + private Integer minVersionRequirement; + private Integer maxVersionRequirement; + + private boolean pingProviders = false; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public Builder(final String systemNameRequirements) { + Assert.isTrue(systemNameRequirements != null && !systemNameRequirements.isBlank(), "systemNameRequirements is null or blank."); + this.systemNameRequirements = systemNameRequirements; + } + + + //------------------------------------------------------------------------------------------------- + public Builder metadata(final Map metadataRequirements) { + this.metadataRequirements = metadataRequirements; + return this; + } + + //------------------------------------------------------------------------------------------------- + public Builder metadata(final String key, final String value) { + Assert.isTrue(key != null && !key.isBlank(), "Key is null or blank"); + + if (this.metadataRequirements == null) { + this.metadataRequirements = new HashMap<>(); + } + this.metadataRequirements.put(key, value); + + return this; + } + + //------------------------------------------------------------------------------------------------- + public Builder version(final Integer versionRequirement) { + this.versionRequirement = versionRequirement; + return this; + } + + //------------------------------------------------------------------------------------------------- + public Builder version(final Integer minVersionRequirement, final Integer maxVersionRequirement) { + this.minVersionRequirement = minVersionRequirement; + this.maxVersionRequirement = maxVersionRequirement; + return this; + } + + //------------------------------------------------------------------------------------------------- + public Builder pingProviders(final boolean pingProviders) { + this.pingProviders = pingProviders; + return this; + } + + //------------------------------------------------------------------------------------------------- + public SystemQueryFormDTO build() { + return new SystemQueryFormDTO(this); + } + } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryResultDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryResultDTO.java new file mode 100644 index 000000000..bf8d3c655 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryResultDTO.java @@ -0,0 +1,31 @@ +package eu.arrowhead.common.dto.shared; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +@JsonInclude(Include.NON_NULL) +public class SystemQueryResultDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = -1822444510232108526L; + + private List systemQueryData = new ArrayList<>(); + private int unfilteredHits = 0; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public List getSystemQueryData() { return systemQueryData; } + public int getUnfilteredHits() { return unfilteredHits; } + + //------------------------------------------------------------------------------------------------- + public void setSystemQueryData(final List systemQueryData) { this.systemQueryData = systemQueryData; } + public void setUnfilteredHits(final int unfilteredHits) { this.unfilteredHits = unfilteredHits; } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java index 4e9310388..7ccbedb67 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java @@ -14,8 +14,8 @@ public class SystemRegistryRequestDTO implements Serializable { private static final long serialVersionUID = -635438605292398404L; - private SystemResponseDTO system; - private DeviceResponseDTO provider; + private SystemRequestDTO system; + private DeviceRequestDTO provider; private String endOfValidity; private Map metadata; private int version; @@ -24,15 +24,15 @@ public class SystemRegistryRequestDTO implements Serializable { // methods //------------------------------------------------------------------------------------------------- - public SystemResponseDTO getSystem() { return system; } - public DeviceResponseDTO getProvider() { return provider; } + public SystemRequestDTO getSystem() { return system; } + public DeviceRequestDTO getProvider() { return provider; } public String getEndOfValidity() { return endOfValidity; } public Map getMetadata() { return metadata; } public int getVersion() { return version; } //------------------------------------------------------------------------------------------------- - public void setSystem(final SystemResponseDTO system) { this.system = system; } - public void setProvider(final DeviceResponseDTO provider) { this.provider = provider; } + public void setSystem(final SystemRequestDTO system) { this.system = system; } + public void setProvider(final DeviceRequestDTO provider) { this.provider = provider; } public void setEndOfValidity(final String endOfValidity) { this.endOfValidity = endOfValidity; } public void setMetadata(final Map metadata) { this.metadata = metadata; } public void setVersion(final int version) { this.version = version; } diff --git a/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/database/service/ServiceRegistryDBService.java b/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/database/service/ServiceRegistryDBService.java index df4c544c1..4788ef99f 100644 --- a/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/database/service/ServiceRegistryDBService.java +++ b/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/database/service/ServiceRegistryDBService.java @@ -858,7 +858,7 @@ public void removeServiceRegistryEntryById(final long id) { try { if (!serviceRegistryRepository.existsById(id)) { - throw new InvalidParameterException("Service Registry entry with id '" + id + "' not exists"); + throw new InvalidParameterException("Service Registry entry with id '" + id + "' does not exists"); } serviceRegistryRepository.deleteById(id); diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java index e27dee743..4c8f49725 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java @@ -14,918 +14,877 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Sort.Direction; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; import java.time.format.DateTimeParseException; +import java.util.Objects; -@Api(tags = { CoreCommonConstants.SWAGGER_TAG_ALL }) -@CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, - allowedHeaders = { HttpHeaders.ORIGIN, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT, HttpHeaders.AUTHORIZATION } +@Api(tags = {CoreCommonConstants.SWAGGER_TAG_ALL}) +@CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, + allowedHeaders = {HttpHeaders.ORIGIN, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT, HttpHeaders.AUTHORIZATION} ) @RestController @RequestMapping(CommonConstants.SYSTEM_REGISTRY_URI) -public class SystemRegistryController -{ - - //================================================================================================= - // members - - private static final String GET_SYSTEM_BY_ID_HTTP_200_MESSAGE = "System by requested id returned"; - private static final String GET_SYSTEM_BY_ID_HTTP_400_MESSAGE = "No Such System by requested id"; - private static final String PATH_VARIABLE_ID = "id"; - private static final String SYSTEM_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/system/{" + PATH_VARIABLE_ID + "}"; - private static final String SYSTEMS_URI = CoreCommonConstants.MGMT_URI + "/systems"; - private static final String SYSTEMS_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/systems/{" + PATH_VARIABLE_ID + "}"; - private static final String GET_SYSTEMS_HTTP_200_MESSAGE = "Systems returned"; - private static final String GET_SYSTEMS_HTTP_400_MESSAGE = " Invalid parameters"; - private static final String POST_SYSTEM_HTTP_201_MESSAGE = "System created"; - private static final String POST_SYSTEM_HTTP_400_MESSAGE = "Could not create system"; - private static final String PUT_SYSTEM_HTTP_200_MESSAGE = "System updated"; - private static final String PUT_SYSTEM_HTTP_400_MESSAGE = "Could not update system"; - private static final String PATCH_SYSTEM_HTTP_200_MESSAGE = "System updated"; - private static final String PATCH_SYSTEM_HTTP_400_MESSAGE = "Could not update system"; - private static final String DELETE_SYSTEM_HTTP_200_MESSAGE = "System deleted"; - private static final String DELETE_SYSTEM_HTTP_400_MESSAGE = "Could not delete system"; - - private static final String GET_DEVICE_BY_ID_HTTP_200_MESSAGE = "Device by requested id returned"; - private static final String GET_DEVICE_BY_ID_HTTP_400_MESSAGE = "No Such Device by requested id"; - private static final String DEVICE_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/device/{" + PATH_VARIABLE_ID + "}"; - private static final String DEVICES_URI = CoreCommonConstants.MGMT_URI + "/devices"; - private static final String DEVICES_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/devices/{" + PATH_VARIABLE_ID + "}"; - private static final String GET_DEVICES_HTTP_200_MESSAGE = "Devices returned"; - private static final String GET_DEVICES_HTTP_400_MESSAGE = " Invalid parameters"; - private static final String POST_DEVICE_HTTP_201_MESSAGE = "Device created"; - private static final String POST_DEVICE_HTTP_400_MESSAGE = "Could not create device"; - private static final String PUT_DEVICE_HTTP_200_MESSAGE = "Device updated"; - private static final String PUT_DEVICE_HTTP_400_MESSAGE = "Could not update device"; - private static final String PATCH_DEVICE_HTTP_200_MESSAGE = "Device updated"; - private static final String PATCH_DEVICE_HTTP_400_MESSAGE = "Could not update device"; - private static final String DELETE_DEVICE_HTTP_200_MESSAGE = "Device deleted"; - private static final String DELETE_DEVICE_HTTP_400_MESSAGE = "Could not delete device"; - - private static final String POST_SYSTEMS_HTTP_201_MESSAGE = "System definition created"; - private static final String POST_SYSTEMS_HTTP_400_MESSAGE = "Could not create system definition"; - private static final String PUT_SYSTEMS_HTTP_200_MESSAGE = "System definition updated"; - private static final String PUT_SYSTEMS_HTTP_400_MESSAGE = "Could not update system definition"; - private static final String PATCH_SYSTEMS_HTTP_200_MESSAGE = "System definition updated"; - private static final String PATCH_SYSTEMS_HTTP_400_MESSAGE = "Could not update system definition"; - private static final String DELETE_SYSTEMS_HTTP_200_MESSAGE = "System definition removed"; - private static final String DELETE_SYSTEMS_HTTP_400_MESSAGE = "Could not remove system definition"; - - private static final String SYSTEM_REGISTRY_REGISTER_DESCRIPTION = "Registers a system"; - private static final String SYSTEM_REGISTRY_REGISTER_201_MESSAGE = "System registered"; - private static final String SYSTEM_REGISTRY_REGISTER_400_MESSAGE = "Could not register system"; - private static final String SYSTEM_REGISTRY_UNREGISTER_DESCRIPTION = "Remove a registered system"; - private static final String SYSTEM_REGISTRY_UNREGISTER_200_MESSAGE = "Registered system removed"; - private static final String SYSTEM_REGISTRY_UNREGISTER_400_MESSAGE = "Could not remove system"; - private static final String SYSTEM_REGISTRY_QUERY_DESCRIPTION = "Return System Registry data that fits the specification"; - private static final String SYSTEM_REGISTRY_QUERY_200_MESSAGE = "System Registry data returned"; - private static final String SYSTEM_REGISTRY_QUERY_400_MESSAGE = "Could not query System Registry"; - private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_DESCRIPTION = "Return system by requested id"; - private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_200_MESSAGE = "System data by id returned"; - private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_400_MESSAGE = "Could not query System Registry by Consumer system id"; - private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_DESCRIPTION = "Return System by requested dto"; - private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_200_MESSAGE = "Consumer System data by requestDTO returned"; - private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_400_MESSAGE = "Could not query System Registry by Consumer system requestDTO"; - private static final String SYSTEM_REGISTRY_UPDATE_DESCRIPTION = "Update a system"; - private static final String SYSTEM_REGISTRY_UPDATE_200_MESSAGE = "System updated"; - private static final String SYSTEM_REGISTRY_UPDATE_400_MESSAGE = "Could not update system"; - private static final String SYSTEM_REGISTRY_MERGE_DESCRIPTION = "Merge/Patch a system"; - private static final String SYSTEM_REGISTRY_MERGE_200_MESSAGE = "System merged"; - private static final String SYSTEM_REGISTRY_MERGE_400_MESSAGE = "Could not merge system"; - - private static final String NOT_VALID_PARAMETERS_ERROR_MESSAGE = "Not valid request parameters."; - private static final String ID_NOT_VALID_ERROR_MESSAGE = "Id must be greater than 0. "; - private static final String SYSTEM_NAME_NULL_ERROR_MESSAGE = " System name must have value "; - private static final String SYSTEM_ADDRESS_NULL_ERROR_MESSAGE = " System address must have value "; - private static final String SYSTEM_PORT_NULL_ERROR_MESSAGE = " System port must have value "; - - private static final String SYSTEM_REGISTRY_MGMT_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/{" + PATH_VARIABLE_ID + "}"; - private static final String PATH_VARIABLE_SERVICE_DEFINITION = "systemDefinition"; - private static final String SYSTEM_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI = CoreCommonConstants.MGMT_URI + "/systemdef" + "/{" + PATH_VARIABLE_SERVICE_DEFINITION + "}"; - private static final String SYSTEM_REGISTRY_MGMT_GROUPED_URI = CoreCommonConstants.MGMT_URI + "/grouped"; - private static final String GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE = "System Registry entries returned"; - private static final String GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE = "Could not retrieve system registry entries"; - private static final String DELETE_SYSTEM_REGISTRY_HTTP_200_MESSAGE = "System Registry entry removed"; - private static final String DELETE_SYSTEM_REGISTRY_HTTP_400_MESSAGE = "Could not remove system registry entry"; - - private final Logger logger = LogManager.getLogger(SystemRegistryController.class); - - @Autowired - private SystemRegistryDBService systemRegistryDBService; - - - //================================================================================================= - // methods - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return an echo message with the purpose of testing the core system availability", response = String.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = CoreCommonConstants.SWAGGER_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = CommonConstants.ECHO_URI) - public String echoSystem() { - return "Got it!"; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return system by id", response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_BY_ID_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_BY_ID_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(SYSTEM_BY_ID_URI) - @ResponseBody public SystemResponseDTO getSystemById(@PathVariable(value = PATH_VARIABLE_ID) final long systemId) { - logger.debug("getSystemById started ..."); - - if (systemId < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_BY_ID_URI); - } - - return systemRegistryDBService.getSystemById(systemId); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return systems by request parameters", response = SystemListResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEMS_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEMS_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(SYSTEMS_URI) - @ResponseBody public SystemListResponseDTO getSystems( - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("getSystems started ..."); - - final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.SYSTEM_REGISTRY_URI + DEVICES_URI); - return systemRegistryDBService.getSystemEntries(pageParameters, sortField); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return created system", response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_SYSTEM_HTTP_201_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_SYSTEM_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PostMapping(path = SYSTEMS_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseStatus(org.springframework.http.HttpStatus.CREATED) - @ResponseBody public SystemResponseDTO addSystem(@RequestBody final SystemRequestDTO request) { - return callCreateSystem(request); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return updated system", response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = PUT_SYSTEM_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_SYSTEM_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PutMapping(path = SYSTEMS_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public SystemResponseDTO updateSystem(@PathVariable(value = PATH_VARIABLE_ID) final long systemId, @RequestBody final SystemRequestDTO request) { - return callUpdateSystem(request, systemId); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return system updated by fields", response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = PATCH_SYSTEM_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PATCH_SYSTEM_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PatchMapping(path = SYSTEMS_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public SystemResponseDTO mergeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long systemId, @RequestBody final SystemRequestDTO request) { - return callMergeSystem(request, systemId); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Remove system", tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEM_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEM_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @DeleteMapping(path = SYSTEMS_BY_ID_URI) - public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New System delete request received with id: {}", id); - - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); - } - - systemRegistryDBService.removeSystemById(id); - logger.debug("System with id: '{}' successfully deleted", id); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return device by id", response = DeviceResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_BY_ID_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_BY_ID_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(SYSTEMS_BY_ID_URI) - @ResponseBody public DeviceResponseDTO getDeviceById(@PathVariable(value = PATH_VARIABLE_ID) final long deviceId) { - logger.debug("getDeviceById started ..."); - - if (deviceId < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_BY_ID_URI); - } - - return systemRegistryDBService.getDeviceById(deviceId); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return requested device by the given parameters", response = DeviceListResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEMS_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEMS_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = DEVICES_URI, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public DeviceListResponseDTO getDeviceListByRequestParameters( - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("New DeviceList get request received with page: {} and item_per page: {}", page, size); - - final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.SYSTEM_REGISTRY_URI + DEVICES_URI); - final DeviceListResponseDTO deviceListResponseDTO = systemRegistryDBService.getDeviceEntries(pageParameters, sortField); - logger.debug("DeviceList with page: {} and item_per page: {} successfully retrieved", page, size); - - return deviceListResponseDTO; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return created device", response = DeviceResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_DEVICE_HTTP_201_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_DEVICE_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PostMapping(path = DEVICES_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) - @ResponseBody public DeviceResponseDTO addDevice(@RequestBody final DeviceRequestDTO dto) { - logger.debug("New device registration request received with name: {}", dto.getDeviceName()); - - validateDevice(dto); - - final DeviceResponseDTO responseDTO = systemRegistryDBService.createDevice(dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); - logger.debug("{} successfully registered.", responseDTO); - - return responseDTO; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return updated device", response = DeviceResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = PUT_DEVICE_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_DEVICE_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PutMapping(path = DEVICE_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public DeviceResponseDTO putUpdateDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id, - @RequestBody final DeviceRequestDTO dto) { - logger.debug("New device update request received with id: {}, definition: {}", id, dto); - - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + DEVICE_BY_ID_URI); - } - - validateDevice(dto); - - final DeviceResponseDTO deviceResponseDTO = systemRegistryDBService.updateDeviceByIdResponse(id, dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); - logger.debug("Device with id: '{}' successfully updated with definition '{}'.", id, deviceResponseDTO); - - return deviceResponseDTO; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Remove device", tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEMS_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEMS_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @DeleteMapping(path = DEVICE_BY_ID_URI) - public void removeDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New System Definition delete request received with id: {}", id); - - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + DEVICE_BY_ID_URI); - } - - systemRegistryDBService.removeDeviceById(id); - logger.debug("Device with id: '{}' successfully deleted", id); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return requested system registry entries by the given parameters", response = SystemRegistryListResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = CoreCommonConstants.MGMT_URI) - @ResponseBody public SystemRegistryListResponseDTO getSystemRegistryEntries( - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("New System Registry get request received with page: {} and item_per page: {}", page, size); - - final CoreUtilities.ValidatedPageParams params = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.SYSTEM_REGISTRY_URI + CoreCommonConstants.MGMT_URI); - final SystemRegistryListResponseDTO systemRegistryEntriesResponse = systemRegistryDBService - .getSystemRegistryEntriesResponse(params, sortField); - logger.debug("System Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); - - return systemRegistryEntriesResponse; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return requested system registry entry", response = SystemRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI) - @ResponseBody public SystemRegistryResponseDTO getSystemRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New System Registry get request received with id: {}", id); - - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_ID_URI); - } - final SystemRegistryResponseDTO systemRegistryEntryByIdResponse = systemRegistryDBService.getSystemRegistryEntryByIdResponse(id); - logger.debug("System Registry entry with id: {} successfully retrieved", id); - - return systemRegistryEntryByIdResponse; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return requested system registry entries by system definition based on the given parameters", response = SystemRegistryListResponseDTO.class, - tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = SYSTEM_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI) - @ResponseBody public SystemRegistryListResponseDTO getSystemRegistryEntriesBySystemName( - @PathVariable(value = PATH_VARIABLE_SERVICE_DEFINITION) final String systemName, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("New System Registry get by System Definition request received with page: {} and item_per page: {}", page, size); - - if (Utilities.isEmpty(systemName)) { - throw new BadPayloadException("System name cannot be empty.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI); - } - - // TODO get system registry entries with given system name - - int validatedPage; - int validatedSize; - if (page == null && size == null) { - validatedPage = -1; - validatedSize = -1; - } else { - if (page == null || size == null) { - throw new BadPayloadException("Defined page or size could not be with undefined size or page.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + - SYSTEM_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI); - } else { - validatedPage = page; - validatedSize = size; - } - } - - final Direction validatedDirection = CoreUtilities.calculateDirection(direction, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_SERVICE_DEFINITION_URI); - final SystemRegistryListResponseDTO systemRegistryEntries = systemRegistryDBService - .getSystemRegistryEntriesBySystemDefinitionResponse(systemDefinition, validatedPage, validatedSize, - validatedDirection, sortField); - logger.debug("System Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); - - return systemRegistryEntries; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Remove the specified system registry entry", tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEM_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEM_REGISTRY_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @DeleteMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI) - public void removeSystemRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New System Registry delete request received with id: {}", id); - - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_ID_URI); - } - - systemRegistryDBService.removeSystemRegistryEntryById(id); - logger.debug("System Registry with id: '{}' successfully deleted", id); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_REGISTER_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = SYSTEM_REGISTRY_REGISTER_201_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_REGISTER_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) - @PostMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public SystemRegistryResponseDTO registerSystem(@RequestBody final SystemRegistryRequestDTO request) { - logger.debug("New system registration request received"); - checkSystemRegistryRequest(request, false); - - final SystemRegistryResponseDTO response = systemRegistryDBService.registerSystemResponse(request); - logger.debug("{} successfully registers its system {}", request.getProviderSystem().getSystemName(), request.getSystemDefinition()); - - return response; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_REGISTER_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = SYSTEM_REGISTRY_REGISTER_201_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_REGISTER_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) - @PostMapping(path = CoreCommonConstants.MGMT_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public @ResponseBody SystemRegistryResponseDTO addSystemRegistry(@RequestBody final SystemRegistryRequestDTO request) { - logger.debug("New system registration request received"); - checkSystemRegistryRequest(request, CoreCommonConstants.MGMT_URI, true); - - final SystemRegistryResponseDTO response = systemRegistryDBService.registerSystemResponse(request); - logger.debug("{}'s system {} is successfully registered", request.getProviderSystem().getSystemName(), request.getSystemDefinition()); - - return response; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_UPDATE_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_UPDATE_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_UPDATE_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PutMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public @ResponseBody SystemRegistryResponseDTO updateSystemRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final SystemRegistryRequestDTO request) { - logger.debug("New system registry update request received"); - checkSystemRegistryUpdateRequest(id, request, CoreCommonConstants.MGMT_URI); - - final SystemRegistryResponseDTO response = systemRegistryDBService.updateSystemByIdResponse(id, request); - logger.debug("System Registry entry {} is successfully updated with system {} and system {}", id, request.getProviderSystem().getSystemName(), request.getSystemDefinition()); - - return response; - } - - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_MERGE_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_MERGE_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_MERGE_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PatchMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public @ResponseBody SystemRegistryResponseDTO mergeSystemRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final SystemRegistryRequestDTO request) { - logger.debug("New system registry merge request received"); - checkSystemRegistryMergeRequest(id, request, CoreCommonConstants.MGMT_URI); - - final SystemRegistryResponseDTO response = systemRegistryDBService.mergeSystemByIdResponse(id, request); - logger.debug("System Registry entry {} is successfully merged witch system {} and system {}", id, response.getProvider().getSystemName(), request.getSystemDefinition()); - - return response; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_UNREGISTER_DESCRIPTION, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_UNREGISTER_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_UNREGISTER_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @DeleteMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_URI) - public void unregisterSystem(@RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_SERVICE_DEFINITION) final String systemName, - @RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_SYSTEM_NAME) final String providerName, - @RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_ADDRESS) final String providerAddress, - @RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_PORT) final int providerPort) { - logger.debug("System removal request received"); - checkUnregisterSystemParameters(systemName, providerName, providerAddress, providerPort); - - systemRegistryDBService.removeSystemRegistry(systemName, providerName, providerAddress, providerPort); - logger.debug("{} successfully removed its system {}", providerName, systemName); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_QUERY_DESCRIPTION, response = SystemQueryResultDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_QUERY_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_QUERY_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PostMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_QUERY_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public SystemQueryResultDTO queryRegistry(@RequestBody final SystemQueryFormDTO form) { - logger.debug("System query request received"); - - if (Utilities.isEmpty(form.getSystemDefinitionRequirement())) { - throw new BadPayloadException("System definition requirement is null or blank" , HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + - CommonConstants.OP_SYSTEM_REGISTRY_QUERY_URI); - } - - final SystemQueryResultDTO result = systemRegistryDBService.queryRegistry(form); - logger.debug("Return {} providers for system {}", result.getSystemQueryData().size(), form.getSystemDefinitionRequirement()); - - return result; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_DESCRIPTION, response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_PRIVATE }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public SystemResponseDTO queryRegistryBySystemId(@PathVariable(value = PATH_VARIABLE_ID) final long systemId) { - logger.debug("System query by system id request received"); - - if (systemId < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + - CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI); - } - - final SystemResponseDTO result = systemRegistryDBService.getSystemById(systemId); - - logger.debug("Return system by id: {}", systemId); - return result; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_DESCRIPTION, response = SystemResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_PRIVATE }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PostMapping(path = CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public SystemResponseDTO queryRegistryBySystemDTO(@RequestBody final SystemRequestDTO request) { - logger.debug("System query by systemRequestDTO request received"); - - checkSystemRequest(request, CommonConstants.SYSTEM_REGISTRY_URI + CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI, false); - - final String systemName = request.getSystemName(); - final String address = request.getAddress(); - final int port = request.getPort(); - - final SystemResponseDTO result = systemRegistryDBService.getSystemByNameAndAddressAndPortResponse(systemName, address, port); - - logger.debug("Return system by name: {}, address: {}, port: {}", systemName, address, port); - return result; - } - - //================================================================================================= - // assistant methods - - //------------------------------------------------------------------------------------------------- - private SystemResponseDTO callCreateSystem(final SystemRequestDTO request) { - logger.debug("callCreateSystem started..."); - - checkSystemRequest(request, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_URI, true); - - final String systemName = request.getSystemName(); - final String address = request.getAddress(); - final int port = request.getPort(); - final String authenticationInfo = request.getAuthenticationInfo(); - - return systemRegistryDBService.createSystemResponse(systemName, address, port, authenticationInfo); - } - - //------------------------------------------------------------------------------------------------- - private SystemResponseDTO callUpdateSystem(final SystemRequestDTO request, final long systemId) { - logger.debug("callUpdateSystem started..."); - - checkSystemPutRequest(request, systemId); - - final String validatedSystemName = request.getSystemName().toLowerCase(); - final String validatedAddress = request.getAddress().toLowerCase(); - final int validatedPort = request.getPort(); - final String validatedAuthenticationInfo = request.getAuthenticationInfo(); - - return systemRegistryDBService.updateSystemResponse(systemId, validatedSystemName, validatedAddress, validatedPort, validatedAuthenticationInfo); - } - - //------------------------------------------------------------------------------------------------- - private SystemResponseDTO callMergeSystem(final SystemRequestDTO request, final long systemId) { - logger.debug("callMergeSystem started..."); - - checkSystemMergeRequest(request, systemId); - - final String validatedSystemName = request.getSystemName() != null ? request.getSystemName().toLowerCase() : ""; - final String validatedAddress = request.getAddress() != null ? request.getAddress().toLowerCase() : ""; - final Integer validatedPort = request.getPort(); - final String validatedAuthenticationInfo = request.getAuthenticationInfo(); - - return systemRegistryDBService.mergeSystemResponse(systemId, validatedSystemName, validatedAddress, validatedPort, validatedAuthenticationInfo); - } - - //------------------------------------------------------------------------------------------------- - private void checkSystemMergeRequest(final SystemRequestDTO request, final long systemId) { - logger.debug("checkSystemPatchRequest started..."); - - if (systemId <= 0) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); - } - - boolean needChange = false; - if (!Utilities.isEmpty(request.getAddress())) { - needChange = true; - } - - - if (!Utilities.isEmpty(request.getSystemName())) { - needChange = true; - for (final CoreSystem coreSysteam : CoreSystem.values()) { - if (coreSysteam.name().equalsIgnoreCase(request.getSystemName().trim())) { - throw new BadPayloadException("System name '" + request.getSystemName() + "' is a reserved arrowhead core system name.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); - } - } - } - - if (request.getPort() != null) { - final int validatedPort = request.getPort(); - if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { - throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX +".", HttpStatus.SC_BAD_REQUEST, - CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); - } - - needChange = true; - } - - if (request.getAuthenticationInfo() != null) { - needChange = true; - } - - if (!needChange) { - throw new BadPayloadException("Patch request is empty." , HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); - } - } - - //------------------------------------------------------------------------------------------------- - private void checkSystemPutRequest(final SystemRequestDTO request, final long systemId) { - logger.debug("checkSystemPutRequest started..."); - - if (systemId <= 0) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); - } - - checkSystemRequest(request, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI, true); - } - - //------------------------------------------------------------------------------------------------- - private void checkSystemRequest(final SystemRequestDTO request, final String origin, final boolean checkReservedCoreSystemNames) { - logger.debug("checkSystemRequest started..."); - - if (request == null) { - throw new BadPayloadException("System is null.", HttpStatus.SC_BAD_REQUEST, origin); - } - - if (Utilities.isEmpty(request.getSystemName())) { - throw new BadPayloadException(SYSTEM_NAME_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - if (checkReservedCoreSystemNames) { - for (final CoreSystem coreSysteam : CoreSystem.values()) { - if (coreSysteam.name().equalsIgnoreCase(request.getSystemName().trim())) { - throw new BadPayloadException("System name '" + request.getSystemName() + "' is a reserved arrowhead core system name.", HttpStatus.SC_BAD_REQUEST, origin); - } - } - } - - if (Utilities.isEmpty(request.getAddress())) { - throw new BadPayloadException(SYSTEM_ADDRESS_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - if (request.getPort() == null) { - throw new BadPayloadException(SYSTEM_PORT_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - final int validatedPort = request.getPort(); - if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { - throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, origin); - } - } - - //------------------------------------------------------------------------------------------------- - private void checkSystemRegistryRequest(final SystemRegistryRequestDTO request, final boolean checkReservedCoreSystemNames) { - logger.debug("checkSystemRegistryRequest started..."); - - final String origin = CommonConstants.SYSTEM_REGISTRY_URI + CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI; - - checkSystemRegistryRequest(request, origin, checkReservedCoreSystemNames); - } - - //------------------------------------------------------------------------------------------------- - private void checkSystemRegistryRequest(final SystemRegistryRequestDTO request, final String origin, final boolean checkReservedCoreSystemNames) { - logger.debug("checkSystemRegistryRequest started..."); - - if (Utilities.isEmpty(request.getSystemDefinition())) { - throw new BadPayloadException("System definition is null or blank", HttpStatus.SC_BAD_REQUEST, origin); - } - - checkSystemRequest(request.getProviderSystem(), origin, checkReservedCoreSystemNames); - - if (!Utilities.isEmpty(request.getEndOfValidity())) { - try { - Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()); - } catch (final DateTimeParseException ex) { - throw new BadPayloadException("End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", - HttpStatus.SC_BAD_REQUEST, origin); - } - } - - SystemSecurityType securityType = null; - if (request.getSecure() != null) { - for (final SystemSecurityType type : SystemSecurityType.values()) { - if (type.name().equalsIgnoreCase(request.getSecure())) { - securityType = type; - break; - } - } - - if (securityType == null) { - throw new BadPayloadException("Security type is not valid.", HttpStatus.SC_BAD_REQUEST, origin); - } - } else { - securityType = SystemSecurityType.NOT_SECURE; - } - - if (securityType != SystemSecurityType.NOT_SECURE && request.getProviderSystem().getAuthenticationInfo() == null) { - throw new BadPayloadException("Security type is in conflict with the availability of the authentication info.", HttpStatus.SC_BAD_REQUEST, origin); - } - - if (request.getInterfaces() == null || request.getInterfaces().isEmpty()) { - throw new BadPayloadException("Interfaces list is null or empty.", HttpStatus.SC_BAD_REQUEST, origin); - } - - for (final String intf : request.getInterfaces()) { - if (!interfaceNameVerifier.isValid(intf)) { - throw new BadPayloadException("Specified interface name is not valid: " + intf, HttpStatus.SC_BAD_REQUEST, origin); - } - } - } - - //------------------------------------------------------------------------------------------------- - private void checkUnregisterSystemParameters(final String systemDefinition, final String providerName, final String providerAddress, final int providerPort) { - // parameters can't be null, but can be empty - logger.debug("checkUnregisterSystemParameters started..."); - - final String origin = CommonConstants.SYSTEM_REGISTRY_URI + CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_URI; - if (Utilities.isEmpty(systemDefinition)) { - throw new BadPayloadException("System definition is blank", HttpStatus.SC_BAD_REQUEST, origin); - } - - if (Utilities.isEmpty(providerName)) { - throw new BadPayloadException("Name of the provider system is blank", HttpStatus.SC_BAD_REQUEST, origin); - } - - if (Utilities.isEmpty(providerAddress)) { - throw new BadPayloadException("Address of the provider system is blank", HttpStatus.SC_BAD_REQUEST, origin); - } - - if (providerPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || providerPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { - throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, origin); - } - } - - //------------------------------------------------------------------------------------------------- - private void checkSystemRegistryUpdateRequest(final long id, final SystemRegistryRequestDTO request, final String origin) { - logger.debug("checkSystemRegistryUpdateRequest started..."); - - if (id <= 0) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, origin); - } - - checkSystemRegistryRequest(request, origin, true); - - } - - //------------------------------------------------------------------------------------------------- - private void validateDevice(@RequestBody final DeviceRequestDTO deviceRequestDto) - { - if (Utilities.isEmpty(deviceRequestDto.getDeviceName())) { - throw new BadPayloadException("Device name is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); - } - - if (Utilities.isEmpty(deviceRequestDto.getAddress())) { - throw new BadPayloadException("Device address is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); - } - - if (Utilities.isEmpty(deviceRequestDto.getMacAddress())) { - throw new BadPayloadException("Device MAC address is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); - } - } - - //------------------------------------------------------------------------------------------------- - @SuppressWarnings("squid:S3776") - private void checkSystemRegistryMergeRequest(final long id, final SystemRegistryRequestDTO request, final String origin) { - logger.debug("checkSystemRegistryMergeRequest started..."); - - if (id <= 0) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE , HttpStatus.SC_BAD_REQUEST, origin); - } - - boolean needChange = false; - if (request.getProviderSystem() != null && !Utilities.isEmpty(request.getProviderSystem().getAddress())) { - needChange = true; - } - - if (request.getProviderSystem() != null && !Utilities.isEmpty(request.getProviderSystem().getSystemName())) { - needChange = true; - } - - if (request.getProviderSystem() != null && request.getProviderSystem().getPort() != null) { - final int validatedPort = request.getProviderSystem().getPort(); - if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { - throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX +".", HttpStatus.SC_BAD_REQUEST, - origin); - } - - needChange = true; - } - - if (request.getProviderSystem() != null && request.getProviderSystem().getAuthenticationInfo() != null) { - needChange = true; - } - - if (request.getEndOfValidity() != null) { - needChange = true; - } - - if (request.getMetadata() != null) { - needChange = true; - } - - if (request.getInterfaces() != null) { - needChange = true; - } - - if (request.getSecure() != null) { - needChange = true; - } - - if (request.getSystemDefinition() != null) { - needChange = true; - } - - if (request.getSystemUri() != null) { - needChange = true; - } - - if (request.getVersion() != null) { - needChange = true; - } - - if (!needChange) { - throw new BadPayloadException("Patch request is empty." , HttpStatus.SC_BAD_REQUEST, origin); - } - } +public class SystemRegistryController { + + //================================================================================================= + // members + + private static final String GET_SYSTEM_BY_ID_HTTP_200_MESSAGE = "System by requested id returned"; + private static final String GET_SYSTEM_BY_ID_HTTP_400_MESSAGE = "No Such System by requested id"; + private static final String PATH_VARIABLE_ID = "id"; + private static final String SYSTEM_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/system/{" + PATH_VARIABLE_ID + "}"; + private static final String SYSTEMS_URI = CoreCommonConstants.MGMT_URI + "/systems"; + private static final String SYSTEMS_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/systems/{" + PATH_VARIABLE_ID + "}"; + private static final String GET_SYSTEMS_HTTP_200_MESSAGE = "Systems returned"; + private static final String GET_SYSTEMS_HTTP_400_MESSAGE = " Invalid parameters"; + private static final String POST_SYSTEM_HTTP_201_MESSAGE = "System created"; + private static final String POST_SYSTEM_HTTP_400_MESSAGE = "Could not create system"; + private static final String PUT_SYSTEM_HTTP_200_MESSAGE = "System updated"; + private static final String PUT_SYSTEM_HTTP_400_MESSAGE = "Could not update system"; + private static final String PATCH_SYSTEM_HTTP_200_MESSAGE = "System updated"; + private static final String PATCH_SYSTEM_HTTP_400_MESSAGE = "Could not update system"; + private static final String DELETE_SYSTEM_HTTP_200_MESSAGE = "System deleted"; + private static final String DELETE_SYSTEM_HTTP_400_MESSAGE = "Could not delete system"; + + private static final String GET_DEVICE_BY_ID_HTTP_200_MESSAGE = "Device by requested id returned"; + private static final String GET_DEVICE_BY_ID_HTTP_400_MESSAGE = "No Such Device by requested id"; + private static final String DEVICE_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/device/{" + PATH_VARIABLE_ID + "}"; + private static final String DEVICES_URI = CoreCommonConstants.MGMT_URI + "/devices"; + private static final String POST_DEVICE_HTTP_201_MESSAGE = "Device created"; + private static final String POST_DEVICE_HTTP_400_MESSAGE = "Could not create device"; + private static final String PUT_DEVICE_HTTP_200_MESSAGE = "Device updated"; + private static final String PUT_DEVICE_HTTP_400_MESSAGE = "Could not update device"; + + private static final String DELETE_SYSTEMS_HTTP_200_MESSAGE = "System definition removed"; + private static final String DELETE_SYSTEMS_HTTP_400_MESSAGE = "Could not remove system definition"; + + private static final String SYSTEM_REGISTRY_REGISTER_DESCRIPTION = "Registers a system"; + private static final String SYSTEM_REGISTRY_REGISTER_201_MESSAGE = "System registered"; + private static final String SYSTEM_REGISTRY_REGISTER_400_MESSAGE = "Could not register system"; + private static final String SYSTEM_REGISTRY_UNREGISTER_DESCRIPTION = "Remove a registered system"; + private static final String SYSTEM_REGISTRY_UNREGISTER_200_MESSAGE = "Registered system removed"; + private static final String SYSTEM_REGISTRY_UNREGISTER_400_MESSAGE = "Could not remove system"; + private static final String SYSTEM_REGISTRY_QUERY_DESCRIPTION = "Return System Registry data that fits the specification"; + private static final String SYSTEM_REGISTRY_QUERY_200_MESSAGE = "System Registry data returned"; + private static final String SYSTEM_REGISTRY_QUERY_400_MESSAGE = "Could not query System Registry"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_DESCRIPTION = "Return system by requested id"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_200_MESSAGE = "System data by id returned"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_400_MESSAGE = "Could not query System Registry by Consumer system id"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_DESCRIPTION = "Return System by requested dto"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_200_MESSAGE = "Consumer System data by requestDTO returned"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_400_MESSAGE = "Could not query System Registry by Consumer system requestDTO"; + private static final String SYSTEM_REGISTRY_UPDATE_DESCRIPTION = "Update a system"; + private static final String SYSTEM_REGISTRY_UPDATE_200_MESSAGE = "System updated"; + private static final String SYSTEM_REGISTRY_UPDATE_400_MESSAGE = "Could not update system"; + private static final String SYSTEM_REGISTRY_MERGE_DESCRIPTION = "Merge/Patch a system"; + private static final String SYSTEM_REGISTRY_MERGE_200_MESSAGE = "System merged"; + private static final String SYSTEM_REGISTRY_MERGE_400_MESSAGE = "Could not merge system"; + + private static final String ID_NOT_VALID_ERROR_MESSAGE = "Id must be greater than 0. "; + private static final String SYSTEM_NAME_NULL_ERROR_MESSAGE = " System name must have value "; + private static final String SYSTEM_ADDRESS_NULL_ERROR_MESSAGE = " System address must have value "; + private static final String SYSTEM_PORT_NULL_ERROR_MESSAGE = " System port must have value "; + + private static final String DEVICE_NAME_NULL_ERROR_MESSAGE = " Device name must have value "; + private static final String DEVICE_ADDRESS_NULL_ERROR_MESSAGE = " Device address must have value "; + private static final String DEVICE_MAC_ADDRESS_NULL_ERROR_MESSAGE = " Device MAC address must have value "; + + private static final String SYSTEM_REGISTRY_MGMT_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/{" + PATH_VARIABLE_ID + "}"; + private static final String PATH_VARIABLE_SYSTEM_NAME = "systenName"; + private static final String SYSTEM_REGISTRY_MGMT_BY_SYSTEM_NAME_URI = CoreCommonConstants.MGMT_URI + "/systemname" + "/{" + PATH_VARIABLE_SYSTEM_NAME + "}"; + private static final String GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE = "System Registry entries returned"; + private static final String GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE = "Could not retrieve system registry entries"; + private static final String DELETE_SYSTEM_REGISTRY_HTTP_200_MESSAGE = "System Registry entry removed"; + private static final String DELETE_SYSTEM_REGISTRY_HTTP_400_MESSAGE = "Could not remove system registry entry"; + + private final Logger logger = LogManager.getLogger(SystemRegistryController.class); + + private final SystemRegistryDBService systemRegistryDBService; + + @Autowired + public SystemRegistryController(final SystemRegistryDBService systemRegistryDBService) { + this.systemRegistryDBService = systemRegistryDBService; + } + + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return an echo message with the purpose of testing the core system availability", response = String.class, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = CoreCommonConstants.SWAGGER_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CommonConstants.ECHO_URI) + public String echoSystem() { + return "Got it!"; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return system by id", response = SystemResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_BY_ID_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_BY_ID_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(SYSTEM_BY_ID_URI) + @ResponseBody + public SystemResponseDTO getSystemById(@PathVariable(value = PATH_VARIABLE_ID) final long systemId) { + logger.debug("getSystemById started ..."); + + if (systemId < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_BY_ID_URI); + } + + return systemRegistryDBService.getSystemById(systemId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return systems by request parameters", response = SystemListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEMS_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEMS_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(SYSTEMS_URI) + @ResponseBody + public SystemListResponseDTO getSystems( + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("getSystems started ..."); + + final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.SYSTEM_REGISTRY_URI + DEVICES_URI); + return systemRegistryDBService.getSystemEntries(pageParameters, sortField); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return created system", response = SystemResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_SYSTEM_HTTP_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = SYSTEMS_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(org.springframework.http.HttpStatus.CREATED) + @ResponseBody + public SystemResponseDTO addSystem(@RequestBody final SystemRequestDTO request) { + return callCreateSystem(request); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return updated system", response = SystemResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = PUT_SYSTEM_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PutMapping(path = SYSTEMS_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public SystemResponseDTO updateSystem(@PathVariable(value = PATH_VARIABLE_ID) final long systemId, @RequestBody final SystemRequestDTO request) { + return callUpdateSystem(request, systemId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return system updated by fields", response = SystemResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = PATCH_SYSTEM_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PATCH_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PatchMapping(path = SYSTEMS_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public SystemResponseDTO mergeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long systemId, @RequestBody final SystemRequestDTO request) { + return callMergeSystem(request, systemId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Remove system", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEM_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = SYSTEMS_BY_ID_URI) + public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New System delete request received with id: {}", id); + + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); + } + + systemRegistryDBService.removeSystemById(id); + logger.debug("System with id: '{}' successfully deleted", id); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return device by id", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_BY_ID_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_BY_ID_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(SYSTEMS_BY_ID_URI) + @ResponseBody + public DeviceResponseDTO getDeviceById(@PathVariable(value = PATH_VARIABLE_ID) final long deviceId) { + logger.debug("getDeviceById started ..."); + + if (deviceId < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_BY_ID_URI); + } + + return systemRegistryDBService.getDeviceById(deviceId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested device by the given parameters", response = DeviceListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEMS_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEMS_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = DEVICES_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public DeviceListResponseDTO getDeviceListByRequestParameters( + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("New DeviceList get request received with page: {} and item_per page: {}", page, size); + + final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.SYSTEM_REGISTRY_URI + DEVICES_URI); + final DeviceListResponseDTO deviceListResponseDTO = systemRegistryDBService.getDeviceEntries(pageParameters, sortField); + logger.debug("DeviceList with page: {} and item_per page: {} successfully retrieved", page, size); + + return deviceListResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return created device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_DEVICE_HTTP_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_DEVICE_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = DEVICES_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) + @ResponseBody + public DeviceResponseDTO addDevice(@RequestBody final DeviceRequestDTO dto) { + logger.debug("New device registration request received with name: {}", dto.getDeviceName()); + + validateDevice(dto); + + final DeviceResponseDTO responseDTO = systemRegistryDBService.createDevice(dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); + logger.debug("{} successfully registered.", responseDTO); + + return responseDTO; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return updated device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = PUT_DEVICE_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_DEVICE_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PutMapping(path = DEVICE_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public DeviceResponseDTO putUpdateDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id, + @RequestBody final DeviceRequestDTO dto) { + logger.debug("New device update request received with id: {}, definition: {}", id, dto); + + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + DEVICE_BY_ID_URI); + } + + validateDevice(dto); + + final DeviceResponseDTO deviceResponseDTO = systemRegistryDBService.updateDeviceByIdResponse(id, dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); + logger.debug("Device with id: '{}' successfully updated with definition '{}'.", id, deviceResponseDTO); + + return deviceResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Remove device", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEMS_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEMS_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = DEVICE_BY_ID_URI) + public void removeDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New System Definition delete request received with id: {}", id); + + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + DEVICE_BY_ID_URI); + } + + systemRegistryDBService.removeDeviceById(id); + logger.debug("Device with id: '{}' successfully deleted", id); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested system registry entries by the given parameters", response = SystemRegistryListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CoreCommonConstants.MGMT_URI) + @ResponseBody + public SystemRegistryListResponseDTO getSystemRegistryEntries( + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("New System Registry get request received with page: {} and item_per page: {}", page, size); + + final CoreUtilities.ValidatedPageParams params = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.SYSTEM_REGISTRY_URI + CoreCommonConstants.MGMT_URI); + final SystemRegistryListResponseDTO systemRegistryEntriesResponse = systemRegistryDBService + .getSystemRegistryEntries(params, sortField); + logger.debug("System Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); + + return systemRegistryEntriesResponse; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested system registry entry", response = SystemRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI) + @ResponseBody + public SystemRegistryResponseDTO getSystemRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New System Registry get request received with id: {}", id); + + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_ID_URI); + } + final SystemRegistryResponseDTO systemRegistryEntryByIdResponse = systemRegistryDBService.getSystemRegistryById(id); + logger.debug("System Registry entry with id: {} successfully retrieved", id); + + return systemRegistryEntryByIdResponse; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested system registry entries by system definition based on the given parameters", response = SystemRegistryListResponseDTO.class, + tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = SYSTEM_REGISTRY_MGMT_BY_SYSTEM_NAME_URI) + @ResponseBody + public SystemRegistryListResponseDTO getSystemRegistryEntriesBySystemName( + @PathVariable(value = PATH_VARIABLE_SYSTEM_NAME) final String systemName, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("New System Registry get by System Definition request received with page: {} and item_per page: {}", page, size); + + final String origin = CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_SYSTEM_NAME_URI; + if (Utilities.isEmpty(systemName)) { + throw new BadPayloadException("System name cannot be empty.", HttpStatus.SC_BAD_REQUEST, origin); + } + + final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, origin); + final SystemRegistryListResponseDTO systemRegistryEntries = systemRegistryDBService.getSystemRegistryEntriesBySystemName(systemName, pageParameters, sortField); + logger.debug("System Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); + + return systemRegistryEntries; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Remove the specified system registry entry", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEM_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEM_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI) + public void removeSystemRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New System Registry delete request received with id: {}", id); + + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_ID_URI); + } + + systemRegistryDBService.removeSystemRegistryEntryById(id); + logger.debug("System Registry with id: '{}' successfully deleted", id); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_REGISTER_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = SYSTEM_REGISTRY_REGISTER_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_REGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) + @PostMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public SystemRegistryResponseDTO registerSystem(@RequestBody final SystemRegistryRequestDTO request) { + logger.debug("New system registration request received"); + checkSystemRegistryRequest(request, false); + + final SystemRegistryResponseDTO response = systemRegistryDBService.registerSystemRegistry(request); + logger.debug("{} successfully registers its system {}", request.getSystem().getSystemName(), request.getSystem()); + + return response; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_REGISTER_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = SYSTEM_REGISTRY_REGISTER_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_REGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) + @PostMapping(path = CoreCommonConstants.MGMT_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody + SystemRegistryResponseDTO addSystemRegistry(@RequestBody final SystemRegistryRequestDTO request) { + logger.debug("New system registration request received"); + checkSystemRegistryRequest(request, CoreCommonConstants.MGMT_URI, true); + + final SystemRegistryResponseDTO response = systemRegistryDBService.registerSystemRegistry(request); + logger.debug("{}'s system {} is successfully registered", request.getSystem().getSystemName(), request.getSystem()); + + return response; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_UPDATE_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_UPDATE_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_UPDATE_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PutMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody + SystemRegistryResponseDTO updateSystemRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final SystemRegistryRequestDTO request) { + logger.debug("New system registry update request received"); + checkSystemRegistryUpdateRequest(id, request, CoreCommonConstants.MGMT_URI); + + final SystemRegistryResponseDTO response = systemRegistryDBService.updateSystemRegistryById(id, request); + logger.debug("System Registry entry {} is successfully updated with system {} and system {}", id, request.getSystem().getSystemName(), request.getSystem()); + + return response; + } + + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_MERGE_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_MERGE_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_MERGE_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PatchMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody + SystemRegistryResponseDTO mergeSystemRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final SystemRegistryRequestDTO request) { + logger.debug("New system registry merge request received"); + checkSystemRegistryMergeRequest(id, request, CoreCommonConstants.MGMT_URI); + + final SystemRegistryResponseDTO response = systemRegistryDBService.mergeSystemRegistryById(id, request); + logger.debug("System Registry entry {} is successfully merged witch system {} and system {}", id, response.getSystem(), request.getSystem()); + + return response; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_UNREGISTER_DESCRIPTION, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_UNREGISTER_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_UNREGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_URI) + public void unregisterSystem(@RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_SYSTEM_NAME) final String systemName, + @RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_ADDRESS) final String address, + @RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_PORT) final int port) { + logger.debug("System removal request received"); + checkUnregisterSystemParameters(systemName, address, port); + + systemRegistryDBService.removeSystemRegistryByNameAndAddressAndPort(systemName, address, port); + logger.debug("{} successfully removed", systemName); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_QUERY_DESCRIPTION, response = SystemQueryResultDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_QUERY_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_QUERY_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_QUERY_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public SystemQueryResultDTO queryRegistry(@RequestBody final SystemQueryFormDTO form) { + logger.debug("System query request received"); + + if (Utilities.isEmpty(form.getSystemNameRequirements())) { + throw new BadPayloadException("System definition requirement is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + + CommonConstants.OP_SYSTEM_REGISTRY_QUERY_URI); + } + + final SystemQueryResultDTO result = systemRegistryDBService.queryRegistry(form); + logger.debug("Return {} providers for system {}", result.getSystemQueryData().size(), form.getSystemNameRequirements()); + + return result; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_DESCRIPTION, response = SystemResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_PRIVATE}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public SystemResponseDTO queryRegistryBySystemId(@PathVariable(value = PATH_VARIABLE_ID) final long systemId) { + logger.debug("System query by system id request received"); + + if (systemId < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + + CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI); + } + + final SystemResponseDTO result = systemRegistryDBService.getSystemById(systemId); + + logger.debug("Return system by id: {}", systemId); + return result; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_DESCRIPTION, response = SystemResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_PRIVATE}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public SystemResponseDTO queryRegistryBySystemDTO(@RequestBody final SystemRequestDTO request) { + logger.debug("System query by systemRequestDTO request received"); + + checkSystemRequest(request, CommonConstants.SYSTEM_REGISTRY_URI + CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI, false); + + final String systemName = request.getSystemName(); + final String address = request.getAddress(); + final int port = request.getPort(); + + final SystemResponseDTO result = systemRegistryDBService.getSystemByNameAndAddressAndPort(systemName, address, port); + + logger.debug("Return system by name: {}, address: {}, port: {}", systemName, address, port); + return result; + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private SystemResponseDTO callCreateSystem(final SystemRequestDTO request) { + logger.debug("callCreateSystem started..."); + + checkSystemRequest(request, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_URI, true); + + final String systemName = request.getSystemName(); + final String address = request.getAddress(); + final int port = request.getPort(); + final String authenticationInfo = request.getAuthenticationInfo(); + + return systemRegistryDBService.createSystemResponse(systemName, address, port, authenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private SystemResponseDTO callUpdateSystem(final SystemRequestDTO request, final long systemId) { + logger.debug("callUpdateSystem started..."); + + checkSystemPutRequest(request, systemId); + + final String validatedSystemName = request.getSystemName().toLowerCase(); + final String validatedAddress = request.getAddress().toLowerCase(); + final int validatedPort = request.getPort(); + final String validatedAuthenticationInfo = request.getAuthenticationInfo(); + + return systemRegistryDBService.updateSystemResponse(systemId, validatedSystemName, validatedAddress, validatedPort, validatedAuthenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private SystemResponseDTO callMergeSystem(final SystemRequestDTO request, final long systemId) { + logger.debug("callMergeSystem started..."); + + checkSystemMergeRequest(request, systemId); + + final String validatedSystemName = request.getSystemName() != null ? request.getSystemName().toLowerCase() : ""; + final String validatedAddress = request.getAddress() != null ? request.getAddress().toLowerCase() : ""; + final Integer validatedPort = request.getPort(); + final String validatedAuthenticationInfo = request.getAuthenticationInfo(); + + return systemRegistryDBService.mergeSystemResponse(systemId, validatedSystemName, validatedAddress, validatedPort, validatedAuthenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private void checkSystemMergeRequest(final SystemRequestDTO request, final long systemId) { + logger.debug("checkSystemPatchRequest started..."); + + if (systemId <= 0) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); + } + + boolean needChange = false; + if (!Utilities.isEmpty(request.getAddress())) { + needChange = true; + } + + + if (!Utilities.isEmpty(request.getSystemName())) { + needChange = true; + for (final CoreSystem coreSysteam : CoreSystem.values()) { + if (coreSysteam.name().equalsIgnoreCase(request.getSystemName().trim())) { + throw new BadPayloadException("System name '" + request.getSystemName() + "' is a reserved arrowhead core system name.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); + } + } + } + + if (request.getPort() != null) { + final int validatedPort = request.getPort(); + if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, + CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); + } + + needChange = true; + } + + if (request.getAuthenticationInfo() != null) { + needChange = true; + } + + if (!needChange) { + throw new BadPayloadException("Patch request is empty.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); + } + } + + //------------------------------------------------------------------------------------------------- + private void checkSystemPutRequest(final SystemRequestDTO request, final long systemId) { + logger.debug("checkSystemPutRequest started..."); + + if (systemId <= 0) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); + } + + checkSystemRequest(request, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI, true); + } + + //------------------------------------------------------------------------------------------------- + private void checkSystemRequest(final SystemRequestDTO request, final String origin, final boolean checkReservedCoreSystemNames) { + logger.debug("checkSystemRequest started..."); + + if (request == null) { + throw new BadPayloadException("System is null.", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(request.getSystemName())) { + throw new BadPayloadException(SYSTEM_NAME_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (checkReservedCoreSystemNames) { + for (final CoreSystem coreSysteam : CoreSystem.values()) { + if (coreSysteam.name().equalsIgnoreCase(request.getSystemName().trim())) { + throw new BadPayloadException("System name '" + request.getSystemName() + "' is a reserved arrowhead core system name.", HttpStatus.SC_BAD_REQUEST, origin); + } + } + } + + if (Utilities.isEmpty(request.getAddress())) { + throw new BadPayloadException(SYSTEM_ADDRESS_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (request.getPort() == null) { + throw new BadPayloadException(SYSTEM_PORT_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + final int validatedPort = request.getPort(); + if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + private void checkDeviceRequest(final DeviceRequestDTO request, final String origin) { + logger.debug("checkDeviceRequest started..."); + + if (request == null) { + throw new BadPayloadException("Device is null.", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(request.getDeviceName())) { + throw new BadPayloadException(DEVICE_NAME_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(request.getAddress())) { + throw new BadPayloadException(DEVICE_ADDRESS_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + if (Utilities.isEmpty(request.getMacAddress())) { + throw new BadPayloadException(DEVICE_MAC_ADDRESS_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + private void checkSystemRegistryRequest(final SystemRegistryRequestDTO request, final boolean checkReservedCoreSystemNames) { + logger.debug("checkSystemRegistryRequest started..."); + + final String origin = CommonConstants.SYSTEM_REGISTRY_URI + CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI; + + checkSystemRegistryRequest(request, origin, checkReservedCoreSystemNames); + } + + //------------------------------------------------------------------------------------------------- + private void checkSystemRegistryRequest(final SystemRegistryRequestDTO request, final String origin, final boolean checkReservedCoreSystemNames) { + logger.debug("checkSystemRegistryRequest started..."); + + checkSystemRequest(request.getSystem(), origin, checkReservedCoreSystemNames); + checkDeviceRequest(request.getProvider(), origin); + + if (!Utilities.isEmpty(request.getEndOfValidity())) { + try { + Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()); + } catch (final DateTimeParseException ex) { + throw new BadPayloadException("End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", + HttpStatus.SC_BAD_REQUEST, origin); + } + } + } + + //------------------------------------------------------------------------------------------------- + private void checkUnregisterSystemParameters(final String systemName, final String address, final int port) { + // parameters can't be null, but can be empty + logger.debug("checkUnregisterSystemParameters started..."); + + final String origin = CommonConstants.SYSTEM_REGISTRY_URI + CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_URI; + + if (Utilities.isEmpty(systemName)) { + throw new BadPayloadException("Name of the system is blank", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(address)) { + throw new BadPayloadException("Address of the system is blank", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + private void checkSystemRegistryUpdateRequest(final long id, final SystemRegistryRequestDTO request, final String origin) { + logger.debug("checkSystemRegistryUpdateRequest started..."); + + if (id <= 0) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + checkSystemRegistryRequest(request, origin, true); + + } + + //------------------------------------------------------------------------------------------------- + private void validateDevice(@RequestBody final DeviceRequestDTO deviceRequestDto) { + if (Utilities.isEmpty(deviceRequestDto.getDeviceName())) { + throw new BadPayloadException("Device name is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); + } + + if (Utilities.isEmpty(deviceRequestDto.getAddress())) { + throw new BadPayloadException("Device address is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); + } + + if (Utilities.isEmpty(deviceRequestDto.getMacAddress())) { + throw new BadPayloadException("Device MAC address is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); + } + } + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings("squid:S3776") + private void checkSystemRegistryMergeRequest(final long id, final SystemRegistryRequestDTO request, final String origin) { + logger.debug("checkSystemRegistryMergeRequest started..."); + + if (id <= 0) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + boolean needChange = false; + + if (Objects.nonNull(request.getSystem())) { + final SystemRequestDTO system = request.getSystem(); + + if (!Utilities.isEmpty(system.getSystemName())) { + needChange = true; + } else if (!Utilities.isEmpty(system.getAddress())) { + needChange = true; + } else if (Objects.nonNull(system.getPort())) { + final int validatedPort = system.getPort(); + if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, + origin); + } + + needChange = true; + } else if (Objects.nonNull(system.getAuthenticationInfo())) { + needChange = true; + } + } + + + if (request.getEndOfValidity() != null) { + needChange = true; + } + + if (request.getMetadata() != null) { + needChange = true; + } + + if (request.getVersion() <= 0) { + needChange = true; + } + + if (!needChange) { + throw new BadPayloadException("Patch request is empty.", HttpStatus.SC_BAD_REQUEST, origin); + } + } } \ No newline at end of file diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java index dc31a49f9..9393d94b6 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java @@ -2,7 +2,9 @@ import eu.arrowhead.common.*; import eu.arrowhead.common.database.entity.Device; +import eu.arrowhead.common.database.entity.ServiceRegistry; import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.database.entity.SystemRegistry; import eu.arrowhead.common.database.repository.DeviceRepository; import eu.arrowhead.common.database.repository.SystemRegistryRepository; import eu.arrowhead.common.database.repository.SystemRepository; @@ -10,10 +12,7 @@ import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; import eu.arrowhead.common.dto.internal.SystemListResponseDTO; import eu.arrowhead.common.dto.internal.SystemRegistryListResponseDTO; -import eu.arrowhead.common.dto.shared.DeviceResponseDTO; -import eu.arrowhead.common.dto.shared.SystemRegistryRequestDTO; -import eu.arrowhead.common.dto.shared.SystemRegistryResponseDTO; -import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import eu.arrowhead.common.dto.shared.*; import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.exception.InvalidParameterException; import org.apache.logging.log4j.LogManager; @@ -29,8 +28,7 @@ import java.util.Optional; @Service -public class SystemRegistryDBService -{ +public class SystemRegistryDBService { //================================================================================================= // members @@ -45,7 +43,7 @@ public class SystemRegistryDBService @Autowired - private SystemRegistryRepository serviceRegistryRepository; + private SystemRegistryRepository systemRegistryRepository; @Autowired private SystemRepository systemRepository; @@ -60,26 +58,19 @@ public class SystemRegistryDBService // methods //------------------------------------------------------------------------------------------------- - public SystemResponseDTO getSystemById(final long systemId) - { + public SystemResponseDTO getSystemById(final long systemId) { logger.debug("getSystemById started..."); - try - { + try { final Optional systemOption = systemRepository.findById(systemId); - if (systemOption.isEmpty()) - { + if (systemOption.isEmpty()) { throw new InvalidParameterException("System with id " + systemId + " not found."); } return DTOConverter.convertSystemToSystemResponseDTO(systemOption.get()); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -87,8 +78,7 @@ public SystemResponseDTO getSystemById(final long systemId) //------------------------------------------------------------------------------------------------- - public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) - { + public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) { logger.debug("getSystemEntries started..."); final int validatedPage = pageParams.getValidatedPage(); @@ -96,18 +86,14 @@ public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageP final Sort.Direction validatedDirection = pageParams.getValidatedDirection(); final String validatedSortField = Utilities.isEmpty(sortField) ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); - if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) - { + if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) { throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); } - try - { + try { return DTOConverter.convertSystemEntryListToSystemListResponseDTO( systemRepository.findAll(PageRequest.of(validatedPage, validatedSize, validatedDirection, validatedSortField))); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -115,18 +101,14 @@ public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageP //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) - { + public System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) { logger.debug("createSystem started..."); final System system = validateNonNullSystemParameters(systemName, address, port, authenticationInfo); - try - { + try { return systemRepository.saveAndFlush(system); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -134,8 +116,7 @@ public System createSystem(final String systemName, final String address, final //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemResponseDTO createSystemResponse(final String systemName, final String address, final int port, final String authenticationInfo) - { + public SystemResponseDTO createSystemResponse(final String systemName, final String address, final int port, final String authenticationInfo) { logger.debug("createSystemResponse started..."); return DTOConverter.convertSystemToSystemResponseDTO(createSystem(systemName, address, port, authenticationInfo)); @@ -144,8 +125,7 @@ public SystemResponseDTO createSystemResponse(final String systemName, final Str //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public SystemResponseDTO updateSystemResponse(final long systemId, final String systemName, final String address, final int port, - final String authenticationInfo) - { + final String authenticationInfo) { logger.debug("updateSystemResponse started..."); return DTOConverter.convertSystemToSystemResponseDTO(updateSystem(systemId, systemName, address, port, authenticationInfo)); @@ -153,33 +133,28 @@ public SystemResponseDTO updateSystemResponse(final long systemId, final String //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public System updateSystem(final long systemId, final String systemName, final String address, final int port, final String authenticationInfo) - { + public System updateSystem(final long systemId, final String systemName, final String address, final int port, final String authenticationInfo) { logger.debug("updateSystem started..."); final long validatedSystemId = validateId(systemId); final int validatedPort = validateSystemPort(port); final String validatedSystemName = validateParamString(systemName); - if (validatedSystemName.contains(".")) - { + if (validatedSystemName.contains(".")) { throw new InvalidParameterException("System name can't contain dot (.)"); } final String validatedAddress = validateParamString(address); final String validatedAuthenticationInfo = authenticationInfo; - try - { + try { final Optional systemOptional = systemRepository.findById(validatedSystemId); - if (!systemOptional.isPresent()) - { + if (!systemOptional.isPresent()) { throw new InvalidParameterException("No system with id : " + validatedSystemId); } final System system = systemOptional.get(); - if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) - { + if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) { checkConstraintsOfSystemTable(validatedSystemName, validatedAddress, validatedPort); } @@ -189,13 +164,9 @@ public System updateSystem(final long systemId, final String systemName, final S system.setAuthenticationInfo(validatedAuthenticationInfo); return systemRepository.saveAndFlush(system); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -203,26 +174,19 @@ public System updateSystem(final long systemId, final String systemName, final S //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public void removeSystemById(final long id) - { + public void removeSystemById(final long id) { logger.debug("removeSystemById started..."); - try - { - if (!systemRepository.existsById(id)) - { + try { + if (!systemRepository.existsById(id)) { throw new InvalidParameterException(COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE); } systemRepository.deleteById(id); systemRepository.flush(); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -231,8 +195,7 @@ public void removeSystemById(final long id) //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public SystemResponseDTO mergeSystemResponse(final long systemId, final String systemName, final String address, final Integer port, - final String authenticationInfo) - { + final String authenticationInfo) { logger.debug("mergeSystemResponse started..."); return DTOConverter.convertSystemToSystemResponseDTO(mergeSystem(systemId, systemName, address, port, authenticationInfo)); @@ -240,65 +203,52 @@ public SystemResponseDTO mergeSystemResponse(final long systemId, final String s //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public System mergeSystem(final long systemId, final String systemName, final String address, final Integer port, final String authenticationInfo) - { + public System mergeSystem(final long systemId, final String systemName, final String address, final Integer port, final String authenticationInfo) { logger.debug("mergeSystem started..."); final long validatedSystemId = validateId(systemId); final Integer validatedPort = validateAllowNullSystemPort(port); final String validatedSystemName = validateAllowNullParamString(systemName); - if (validatedSystemName != null && validatedSystemName.contains(".")) - { + if (validatedSystemName != null && validatedSystemName.contains(".")) { throw new InvalidParameterException("System name can't contain dot (.)"); } final String validatedAddress = validateAllowNullParamString(address); final String validatedAuthenticationInfo = authenticationInfo; - try - { + try { final Optional systemOptional = systemRepository.findById(validatedSystemId); - if (!systemOptional.isPresent()) - { + if (!systemOptional.isPresent()) { throw new InvalidParameterException("No system with id : " + validatedSystemId); } final System system = systemOptional.get(); - if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) - { + if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) { checkConstraintsOfSystemTable(validatedSystemName != null ? validatedSystemName : system.getSystemName(), - validatedAddress != null ? validatedAddress : system.getAddress(), - validatedPort != null ? validatedPort.intValue() : system.getPort()); + validatedAddress != null ? validatedAddress : system.getAddress(), + validatedPort != null ? validatedPort.intValue() : system.getPort()); } - if (!Utilities.isEmpty(validatedSystemName)) - { + if (!Utilities.isEmpty(validatedSystemName)) { system.setSystemName(validatedSystemName); } - if (!Utilities.isEmpty(validatedAddress)) - { + if (!Utilities.isEmpty(validatedAddress)) { system.setAddress(validatedAddress); } - if (validatedPort != null) - { + if (validatedPort != null) { system.setPort(validatedPort); } - if (!Utilities.isEmpty(validatedAuthenticationInfo)) - { + if (!Utilities.isEmpty(validatedAuthenticationInfo)) { system.setAuthenticationInfo(validatedAuthenticationInfo); } return systemRepository.saveAndFlush(system); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -306,51 +256,39 @@ public System mergeSystem(final long systemId, final String systemName, final St //------------------------------------------------------------------------------------------------- - public DeviceResponseDTO getDeviceById(long deviceId) - { + public DeviceResponseDTO getDeviceById(long deviceId) { logger.debug("getDeviceById started..."); - try - { + try { final Optional deviceOptional = deviceRepository.findById(deviceId); - if (deviceOptional.isEmpty()) - { + if (deviceOptional.isEmpty()) { throw new InvalidParameterException("Device with id " + deviceId + " not found."); } return DTOConverter.convertDeviceToDeviceResponseDTO(deviceOptional.get()); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) - { + public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) { logger.debug("getDeviceList started..."); final String validatedSortField = Utilities.isEmpty(sortField) ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); - if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) - { + if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) { throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); } - try - { + try { final Page devices = deviceRepository.findAll(PageRequest.of(pageParams.getValidatedPage(), pageParams.getValidatedSize(), - pageParams.getValidatedDirection(), validatedSortField)); + pageParams.getValidatedDirection(), validatedSortField)); return DTOConverter.convertDeviceEntryListToDeviceListResponseDTO(devices); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -358,8 +296,7 @@ public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageP //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public DeviceResponseDTO createDevice(final String name, final String address, final String macAddress, final String authenticationInfo) - { + public DeviceResponseDTO createDevice(final String name, final String address, final String macAddress, final String authenticationInfo) { final Device device = new Device(name, address, macAddress, authenticationInfo); return DTOConverter.convertDeviceToDeviceResponseDTO(deviceRepository.save(device)); } @@ -385,13 +322,9 @@ public DeviceResponseDTO updateDeviceByIdResponse(final long id, final String na device.setAuthenticationInfo(newDevice.getAuthenticationInfo()); return DTOConverter.convertDeviceToDeviceResponseDTO(deviceRepository.saveAndFlush(device)); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -402,118 +335,181 @@ public DeviceResponseDTO updateDeviceByIdResponse(final long id, final String na public void removeDeviceById(final long id) { logger.debug("removeDeviceById started..."); - try - { - if (!deviceRepository.existsById(id)) - { + try { + if (!deviceRepository.existsById(id)) { throw new InvalidParameterException(COULD_NOT_DELETE_DEVICE_ERROR_MESSAGE); } deviceRepository.deleteById(id); deviceRepository.flush(); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemRegistryListResponseDTO getSystemRegistryEntries(final CoreUtilities.ValidatedPageParams params, final String sortField) { + logger.debug("getSystemRegistryEntries started..."); + final String validatedSortField = sortField == null ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); + + if (!SystemRegistry.SORTABLE_FIELDS_BY.contains(validatedSortField)) { + throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); } - catch (final Exception ex) - { + + try { + final PageRequest pageRequest = PageRequest.of(params.getValidatedPage(), + params.getValidatedSize(), + params.getValidatedDirection(), + validatedSortField); + final Page systemRegistryPage = systemRegistryRepository.findAll(pageRequest); + return DTOConverter.convertSystemRegistryPageToSystemRegistryListResponseDTO(systemRegistryPage); + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemRegistryResponseDTO getSystemRegistryById(final long id) { + logger.debug("getSystemRegistryById started..."); + + return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(getSystemRegistryEntryById(id)); + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public void removeSystemRegistryEntryById(final long id) { + logger.debug("removeSystemRegistryEntryById started..."); + + try { + if (!systemRegistryRepository.existsById(id)) { + throw new InvalidParameterException("System Registry entry with id '" + id + "' does not exists"); + } + + systemRegistryRepository.deleteById(id); + systemRegistryRepository.flush(); + } catch (final InvalidParameterException ex) { + throw ex; + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemRegistryResponseDTO registerSystemRegistry(final SystemRegistryRequestDTO request) { + return null; + } + + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemRegistryResponseDTO updateSystemRegistryById(final long id, final SystemRegistryRequestDTO request) { + return null; + } + + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemRegistryResponseDTO mergeSystemRegistryById(final long id, final SystemRegistryRequestDTO request) { + return null; + } + + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemRegistryListResponseDTO getSystemRegistryEntriesBySystemName(final String systemName, final CoreUtilities.ValidatedPageParams pageParameters, final String sortField) { + } + + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public void removeSystemRegistryByNameAndAddressAndPort(final String systemName, final String address, final int port) { + } + + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemQueryResultDTO queryRegistry(final SystemQueryFormDTO form) { + } + + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemResponseDTO getSystemByNameAndAddressAndPort(final String systemName, final String address, final int port) { + } + //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- @SuppressWarnings("squid:S1126") private boolean checkSystemIfUniqueValidationNeeded(final System system, final String validatedSystemName, final String validatedAddress, - final Integer validatedPort) - { + final Integer validatedPort) { logger.debug("checkSystemIfUniqueValidationNeeded started..."); final String actualSystemName = system.getSystemName(); final String actualAddress = system.getAddress(); final int actualPort = system.getPort(); - if (validatedSystemName != null && !actualSystemName.equalsIgnoreCase(validatedSystemName)) - { + if (validatedSystemName != null && !actualSystemName.equalsIgnoreCase(validatedSystemName)) { return true; - } - - if (validatedAddress != null && !actualAddress.equalsIgnoreCase(validatedAddress)) - { - return true; - } - - if (validatedPort != null && actualPort != validatedPort.intValue()) - { + } else if (validatedAddress != null && !actualAddress.equalsIgnoreCase(validatedAddress)) { return true; - } - - return false; + } else return validatedPort != null && actualPort != validatedPort; } //------------------------------------------------------------------------------------------------- - private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) - { + private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) { logger.debug("checkConstraintsOfSystemTable started..."); - try - { + try { final Optional find = systemRepository .findBySystemNameAndAddressAndPort(validatedSystemName.toLowerCase().trim(), validatedAddress.toLowerCase().trim(), validatedPort); - if (find.isPresent()) - { + if (find.isPresent()) { throw new InvalidParameterException( "System with name: " + validatedSystemName + ", address: " + validatedAddress + ", port: " + validatedPort + " already exists."); } - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private void checkConstraintsOfDeviceTable(final String validatedDeviceName, final String validatedMacAddress) - { + private void checkConstraintsOfDeviceTable(final String validatedDeviceName, final String validatedMacAddress) { logger.debug("checkConstraintsOfDeviceTable started..."); - try - { + try { final Optional find = deviceRepository.findByDeviceNameAndMacAddress(validatedDeviceName, validatedMacAddress); - if (find.isPresent()) - { + if (find.isPresent()) { throw new InvalidParameterException( "Device with name: " + validatedDeviceName + ", MAC address: " + validatedMacAddress + " already exists."); } - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) - { + private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) { logger.debug("validateNonNullSystemParameters started..."); validateNonNullParameters(systemName, address, authenticationInfo); - if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) - { + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); } @@ -527,14 +523,12 @@ private System validateNonNullSystemParameters(final String systemName, final St } //------------------------------------------------------------------------------------------------- - private Device validateNonNullDeviceParameters(final String deviceName, final String address, final String macAddress, final String authenticationInfo) - { + private Device validateNonNullDeviceParameters(final String deviceName, final String address, final String macAddress, final String authenticationInfo) { logger.debug("validateNonNullDeviceParameters started..."); validateNonNullParameters(deviceName, address, authenticationInfo); - if (Utilities.isEmpty(macAddress)) - { + if (Utilities.isEmpty(macAddress)) { throw new InvalidParameterException("MAC address is null or empty"); } @@ -549,33 +543,27 @@ private Device validateNonNullDeviceParameters(final String deviceName, final St } //------------------------------------------------------------------------------------------------- - private void validateNonNullParameters(final String name, final String address, final String authenticationInfo) - { + private void validateNonNullParameters(final String name, final String address, final String authenticationInfo) { logger.debug("validateNonNullParameters started..."); - if (Utilities.isEmpty(name)) - { + if (Utilities.isEmpty(name)) { throw new InvalidParameterException("Name is null or empty"); } - if (Utilities.isEmpty(address)) - { + if (Utilities.isEmpty(address)) { throw new InvalidParameterException("Address is null or empty"); } - if (name.contains(".")) - { + if (name.contains(".")) { throw new InvalidParameterException("Name can't contain dot (.)"); } } //------------------------------------------------------------------------------------------------- - private String validateParamString(final String param) - { + private String validateParamString(final String param) { logger.debug("validateSystemParamString started..."); - if (Utilities.isEmpty(param)) - { + if (Utilities.isEmpty(param)) { throw new InvalidParameterException("parameter null or empty"); } @@ -583,12 +571,10 @@ private String validateParamString(final String param) } //------------------------------------------------------------------------------------------------- - private int validateSystemPort(final int port) - { + private int validateSystemPort(final int port) { logger.debug("validateSystemPort started..."); - if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) - { + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); } @@ -596,12 +582,10 @@ private int validateSystemPort(final int port) } //------------------------------------------------------------------------------------------------- - private long validateId(final long id) - { + private long validateId(final long id) { logger.debug("validateId started..."); - if (id < 1) - { + if (id < 1) { throw new IllegalArgumentException("Id must be greater than zero"); } @@ -609,12 +593,10 @@ private long validateId(final long id) } //------------------------------------------------------------------------------------------------- - private Integer validateAllowNullSystemPort(final Integer port) - { + private Integer validateAllowNullSystemPort(final Integer port) { logger.debug("validateAllowNullSystemPort started..."); - if (port != null && (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX)) - { + if (port != null && (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX)) { throw new IllegalArgumentException(PORT_RANGE_ERROR_MESSAGE); } @@ -622,61 +604,45 @@ private Integer validateAllowNullSystemPort(final Integer port) } //------------------------------------------------------------------------------------------------- - private String validateAllowNullParamString(final String param) - { + private String validateAllowNullParamString(final String param) { logger.debug("validateAllowNullParamString started..."); - if (Utilities.isEmpty(param)) - { + if (Utilities.isEmpty(param)) { return null; } return param.trim().toLowerCase(); } + //------------------------------------------------------------------------------------------------- - private System findOrCreateSystem(final String systemName, final String address, final int port, final String authenticationInfo) - { + private SystemRegistry getSystemRegistryEntryById(final long id) { + logger.debug("getSystemRegistryEntryById started..."); + try { + final Optional systemRegistry = systemRegistryRepository.findById(id); + return systemRegistry.orElseThrow(() -> new InvalidParameterException("System Registry with id of '" + id + "' not exists")); + } catch (final InvalidParameterException ex) { + throw ex; + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + private System findOrCreateSystem(final String systemName, final String address, final int port, final String authenticationInfo) { final Optional optProvider = systemRepository .findBySystemNameAndAddressAndPort(systemName.toLowerCase().trim(), address.toLowerCase().trim(), port); System provider; - if (optProvider.isPresent()) - { + if (optProvider.isPresent()) { provider = optProvider.get(); - if (!Objects.equals(authenticationInfo, provider.getAuthenticationInfo())) - { // authentication info has changed + if (!Objects.equals(authenticationInfo, provider.getAuthenticationInfo())) { // authentication info has changed provider.setAuthenticationInfo(authenticationInfo); provider = systemRepository.saveAndFlush(provider); } - } - else - { + } else { provider = createSystem(systemName, address, port, authenticationInfo); } return provider; } - - public SystemRegistryListResponseDTO getSystemRegistryEntriesResponse(final CoreUtilities.ValidatedPageParams params, final String sortField) { - return null; - } - - public SystemRegistryResponseDTO getSystemRegistryEntryByIdResponse(final long id) { - return null; - } - - public void removeSystemRegistryEntryById(long id) { - - } - - public SystemRegistryResponseDTO registerSystemResponse(SystemRegistryRequestDTO request) { - return null; - } - - public SystemRegistryResponseDTO updateSystemByIdResponse(long id, SystemRegistryRequestDTO request) { - return null; - } - - public SystemRegistryResponseDTO mergeSystemByIdResponse(long id, SystemRegistryRequestDTO request) { - return null; - } } From bcb1718fc8601ce2bdb0b1f45bf62e93b1786895 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Thu, 23 Jan 2020 11:17:29 +0100 Subject: [PATCH 022/301] fixing annotations in entity class new unique constraint added --- .../arrowhead/common/database/entity/QoSIntraMeasurement.java | 3 ++- .../common/database/entity/QoSIntraPingMeasurement.java | 3 +-- scripts/create_arrowhead_tables.sql | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraMeasurement.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraMeasurement.java index 9a0c0a6c0..a6b3e40d3 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraMeasurement.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraMeasurement.java @@ -15,12 +15,13 @@ import javax.persistence.PrePersist; import javax.persistence.PreUpdate; import javax.persistence.Table; +import javax.persistence.UniqueConstraint; import eu.arrowhead.common.CoreDefaults; import eu.arrowhead.common.dto.shared.QoSMeasurementType; @Entity -@Table(name = "qos_intra_measurement") +@Table(name = "qos_intra_measurement", uniqueConstraints = @UniqueConstraint(columnNames = {"systemId", "measurementType"})) public class QoSIntraMeasurement { //================================================================================================= diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java index e4cf71ccc..dc55a2a2f 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java @@ -26,8 +26,7 @@ public class QoSIntraPingMeasurement { private long id; @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = "measurementId", referencedColumnName = "id", nullable = false) - @Column(unique = true) + @JoinColumn(name = "measurementId", referencedColumnName = "id", nullable = false, unique = true) private QoSIntraMeasurement measurement; @Column(nullable = false) diff --git a/scripts/create_arrowhead_tables.sql b/scripts/create_arrowhead_tables.sql index 3280499b3..bc55cb185 100644 --- a/scripts/create_arrowhead_tables.sql +++ b/scripts/create_arrowhead_tables.sql @@ -342,7 +342,8 @@ CREATE TABLE IF NOT EXISTS `qos_intra_measurement` ( `last_measurement_at` timestamp NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - CONSTRAINT `fk_system` FOREIGN KEY (`system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE + CONSTRAINT `fk_system` FOREIGN KEY (`system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE, + UNIQUE KEY `unique_system_id_measurement_type` (`system_id`, `measurement_type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement` ( From a094ea469ffb6647d34cdc2ab103a38c317bc808 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 23 Jan 2020 11:55:49 +0100 Subject: [PATCH 023/301] implemented countRestarterTask releted skeletons --- .../qos/quartz/task/CountRestarterTask.java | 36 ++++++++ .../quartz/task/CountRestarterTaskConfig.java | 84 +++++++++++++++++++ ...itional-spring-configuration-metadata.json | 20 +++++ 3 files changed, 140 insertions(+) create mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java create mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java new file mode 100644 index 000000000..d4e0674b4 --- /dev/null +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java @@ -0,0 +1,36 @@ +package eu.arrowhead.core.qos.quartz.task; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.quartz.DisallowConcurrentExecution; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.stereotype.Component; + +@Component +@DisallowConcurrentExecution +public class CountRestarterTask implements Job { + + //================================================================================================= + // members + + protected Logger logger = LogManager.getLogger(CountRestarterTask.class); + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Override + public void execute(final JobExecutionContext context) throws JobExecutionException { + logger.debug("STARTED: count restarter task"); + + logger.debug("Finished: count restarter task"); + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + +} \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java new file mode 100644 index 000000000..aa5ac95b3 --- /dev/null +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java @@ -0,0 +1,84 @@ +package eu.arrowhead.core.qos.quartz.task; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.quartz.CronTriggerFactoryBean; +import org.springframework.scheduling.quartz.JobDetailFactoryBean; +import org.springframework.scheduling.quartz.SchedulerFactoryBean; + +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.quartz.AutoWiringSpringBeanQuartzTaskFactory; + +@Configuration +public class CountRestarterTaskConfig { + + //================================================================================================= + // members + + protected Logger logger = LogManager.getLogger(CountRestarterTaskConfig.class); + + @Autowired + private ApplicationContext applicationContext; //NOSONAR + + @Value(CoreCommonConstants.$PING_TTL_SCHEDULED_WD) + private boolean ttlScheduled; + + @Value(CoreCommonConstants.$PING_TTL_INTERVAL_WD) + private int ttlInterval; + + private static final int SCHEDULER_DELAY = 7; + + private static final String NAME_OF_TRIGGER = "Counter_Restart_Task_Trigger"; + private static final String NAME_OF_TASK = "Counter_Restart_Task_Detail"; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Bean + public SchedulerFactoryBean counterRestarterTaskSheduler() { + final AutoWiringSpringBeanQuartzTaskFactory jobFactory = new AutoWiringSpringBeanQuartzTaskFactory(); + jobFactory.setApplicationContext(applicationContext); + + final SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean(); + if (ttlScheduled) { + schedulerFactory.setJobFactory(jobFactory); + schedulerFactory.setJobDetails(counterRestartTaskDetails().getObject()); + schedulerFactory.setTriggers(counterRestartTaskTrigger().getObject()); + schedulerFactory.setStartupDelay(SCHEDULER_DELAY); + logger.info("Pin task adjusted with ttl interval: {} minutes", ttlInterval); + } else { + logger.info("Ping task is not adjusted"); + } + + return schedulerFactory; + } + + //------------------------------------------------------------------------------------------------- + @Bean + public CronTriggerFactoryBean counterRestartTaskTrigger() { + + CronTriggerFactoryBean trigger = new CronTriggerFactoryBean(); + trigger.setJobDetail(counterRestartTaskDetails().getObject()); + trigger.setCronExpression("0/30 * * ? * * *"); + trigger.setName(NAME_OF_TRIGGER); + + return trigger; + } + + //------------------------------------------------------------------------------------------------- + @Bean + public JobDetailFactoryBean counterRestartTaskDetails() { + final JobDetailFactoryBean jobDetailFactory = new JobDetailFactoryBean(); + jobDetailFactory.setJobClass(CountRestarterTask.class); + jobDetailFactory.setName(NAME_OF_TASK); + jobDetailFactory.setDurability(true); + + return jobDetailFactory; + } +} \ No newline at end of file diff --git a/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 2143ab2f5..3251c0d4f 100644 --- a/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -38,5 +38,25 @@ "name": "gatekeeper_is_present", "type": "java.lang.Boolean", "description": "A description for 'gatekeeper_is_present'" + }, + { + "name": "cloud_ping_ttl_scheduled", + "type": "java.lang.String", + "description": "A description for 'cloud_ping_ttl_scheduled'" + }, + { + "name": "cloud_ping_ttl_interval", + "type": "java.lang.String", + "description": "A description for 'cloud_ping_ttl_interval'" + }, + { + "name": "ping_ttl_scheduled", + "type": "java.lang.String", + "description": "A description for 'ping_ttl_scheduled'" + }, + { + "name": "ping_ttl_interval", + "type": "java.lang.String", + "description": "A description for 'ping_ttl_interval'" } ]} \ No newline at end of file From 8ab4c6d3ba8ac2ebc551d338b35fb76663ba0646 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 23 Jan 2020 15:37:52 +0100 Subject: [PATCH 024/301] created CRONE_EXPRESSION constant --- .../core/qos/quartz/task/CountRestarterTaskConfig.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java index aa5ac95b3..2f4c36b7a 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java @@ -32,6 +32,7 @@ public class CountRestarterTaskConfig { private int ttlInterval; private static final int SCHEDULER_DELAY = 7; + private static final String CRONE_EXPRESSION_MIDNIGHT_EVERY_DAY= "0 0 0 ? * * *"; private static final String NAME_OF_TRIGGER = "Counter_Restart_Task_Trigger"; private static final String NAME_OF_TASK = "Counter_Restart_Task_Detail"; @@ -65,7 +66,7 @@ public CronTriggerFactoryBean counterRestartTaskTrigger() { CronTriggerFactoryBean trigger = new CronTriggerFactoryBean(); trigger.setJobDetail(counterRestartTaskDetails().getObject()); - trigger.setCronExpression("0/30 * * ? * * *"); + trigger.setCronExpression(CRONE_EXPRESSION_MIDNIGHT_EVERY_DAY); trigger.setName(NAME_OF_TRIGGER); return trigger; From 78b4f742f503ce595d3259e208322694bb009e0f Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 23 Jan 2020 16:24:05 +0100 Subject: [PATCH 025/301] started to implement pingSystem --- .../core/qos/quartz/task/PingTask.java | 51 +++++++++++++++++-- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index c5005dfd5..26d7071e8 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -2,35 +2,80 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.icmp4j.IcmpPingRequest; +import org.icmp4j.IcmpPingResponse; +import org.icmp4j.IcmpPingUtil; import org.quartz.DisallowConcurrentExecution; import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import org.springframework.stereotype.Component; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import eu.arrowhead.common.exception.InvalidParameterException; + @Component @DisallowConcurrentExecution public class PingTask implements Job { //================================================================================================= // members + private static final String NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE = " is null or blank."; + private static final int TIMES_TO_REPEAT = 10; protected Logger logger = LogManager.getLogger(PingTask.class); //================================================================================================= // methods - + //------------------------------------------------------------------------------------------------- @Override public void execute(final JobExecutionContext context) throws JobExecutionException { logger.debug("STARTED: ping task"); - + + final SystemResponseDTO system = getSystemToMessure(); + pingSystem(system); + logger.debug("Finished: ping task"); } //================================================================================================= // assistant methods - + //------------------------------------------------------------------------------------------------- + private SystemResponseDTO getSystemToMessure() { + logger.debug("getSystemToMessure started..."); + // TODO Implement method logic here + return null; + } + + //------------------------------------------------------------------------------------------------- + private void pingSystem(final SystemResponseDTO system ) { + logger.debug("pingSystem started..."); + + if (system == null || Utilities.isEmpty(system.getAddress())) { + //throw new InvalidParameterException("System.address" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE); + } + + //final String address = system.getAddress(); + try { + final IcmpPingRequest request = IcmpPingUtil.createIcmpPingRequest (); + //request.setHost (address); + request.setHost ("github.com"); + for (int count = 0; count < TIMES_TO_REPEAT; count ++) { + // delegate + final IcmpPingResponse response = IcmpPingUtil.executePingRequest (request); + // log + final String formattedResponse = IcmpPingUtil.formatResponse (response); + logger.info(formattedResponse); + // rest + Thread.sleep (1000); + } + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } } \ No newline at end of file From 4a6b58e813a086976d7fadc9dc7ef43cefa6c364 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 23 Jan 2020 16:27:54 +0100 Subject: [PATCH 026/301] fixing typo in eventhandler --- .../core/eventhandler/service/EventHandlerDriver.java | 4 ++-- .../core/eventhandler/service/EventHandlerService.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/service/EventHandlerDriver.java b/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/service/EventHandlerDriver.java index e6bbb38f0..b1c4a6c8e 100644 --- a/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/service/EventHandlerDriver.java +++ b/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/service/EventHandlerDriver.java @@ -128,12 +128,12 @@ private void checkPublishRequestDTO(final EventPublishRequestDTO request) { throw new InvalidParameterException("Payload" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE); } - ckeckTimeStamp(request.getTimeStamp()); + checkTimeStamp(request.getTimeStamp()); checkSystemRequestDTO(request.getSource()); } //------------------------------------------------------------------------------------------------- - private void ckeckTimeStamp(final String timeStampString) { + private void checkTimeStamp(final String timeStampString) { logger.debug("ckeckTimeStamp started..."); if (Utilities.isEmpty(timeStampString)) { diff --git a/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/service/EventHandlerService.java b/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/service/EventHandlerService.java index 1ff8ca61a..3805dc383 100644 --- a/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/service/EventHandlerService.java +++ b/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/service/EventHandlerService.java @@ -161,12 +161,12 @@ private void checkPublishRequestDTO(final EventPublishRequestDTO request) { throw new InvalidParameterException("Payload" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE); } - ckeckTimeStamp(request.getTimeStamp()); + checkTimeStamp(request.getTimeStamp()); checkSystemRequestDTO(request.getSource()); } //------------------------------------------------------------------------------------------------- - private void ckeckTimeStamp(final String timeStampString) { + private void checkTimeStamp(final String timeStampString) { logger.debug("ckeckTimeStamp started..."); if (Utilities.isEmpty(timeStampString)) { From baa4629895f3f695cb5cf7f91ccba39297c09a33 Mon Sep 17 00:00:00 2001 From: mzsilak Date: Thu, 23 Jan 2020 19:12:39 +0100 Subject: [PATCH 027/301] WIP on SystemRegistryDBService --- .../java/eu/arrowhead/common/Utilities.java | 199 +++++--- .../repository/SystemRegistryRepository.java | 8 +- .../dto/shared/SystemRegistryRequestDTO.java | 6 +- .../SystemRegistryController.java | 8 +- .../service/SystemRegistryDBService.java | 462 +++++++++++++++--- 5 files changed, 531 insertions(+), 152 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/Utilities.java b/core-common/src/main/java/eu/arrowhead/common/Utilities.java index 790ea5832..80c59259f 100644 --- a/core-common/src/main/java/eu/arrowhead/common/Utilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/Utilities.java @@ -24,20 +24,15 @@ import java.time.format.DateTimeParseException; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAccessor; -import java.util.ArrayList; -import java.util.Base64; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Map; +import java.util.*; import java.util.Map.Entry; -import java.util.NoSuchElementException; -import java.util.ServiceConfigurationError; import java.util.regex.Pattern; import javax.naming.InvalidNameException; import javax.naming.ldap.LdapName; import javax.naming.ldap.Rdn; +import com.fasterxml.jackson.databind.ser.std.ObjectArraySerializer; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.http.HttpStatus; @@ -45,6 +40,7 @@ import org.springframework.util.Assert; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; +import org.springframework.util.StringUtils; import org.springframework.web.util.UriComponents; import org.springframework.web.util.UriComponentsBuilder; @@ -66,25 +62,25 @@ public class Utilities { //================================================================================================= // members - + private static final int SERVICE_CN_NAME_LENGTH = 5; @SuppressWarnings("unused") private static final int CLOUD_CN_NAME_LENGTH = 4; @SuppressWarnings("unused") private static final int AH_MASTER_CN_NAME_LENGTH = 2; - + private static final String AH_MASTER_SUFFIX = "eu"; private static final String AH_MASTER_NAME = "arrowhead"; - + private static final String KEY_FACTORY_ALGORHITM_NAME = "RSA"; private static final KeyFactory keyFactory; private static final Pattern PEM_PATTERN = Pattern.compile("(?m)(?s)^---*BEGIN.*---*$(.*)^---*END.*---*$.*"); - + private static final Logger logger = LogManager.getLogger(Utilities.class); private static final ObjectMapper mapper = new ObjectMapper(); private static final String dateTimePattern = "yyyy-MM-dd HH:mm:ss"; static final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(dateTimePattern); - + static { mapper.configure(SerializationFeature.INDENT_OUTPUT, true); try { @@ -94,7 +90,7 @@ public class Utilities { throw new ServiceConfigurationError("KeyFactory.getInstance(String) throws NoSuchAlgorithmException, code needs to be changed!", ex); } } - + //================================================================================================= // methods @@ -102,34 +98,39 @@ public class Utilities { public static boolean isEmpty(final String str) { return str == null || str.isBlank(); } - + + //------------------------------------------------------------------------------------------------- + public static boolean notEmpty(final String str) { + return StringUtils.hasText(str); + } + //------------------------------------------------------------------------------------------------- @Nullable public static String stripEndSlash(final String uri) { if (uri != null && uri.endsWith("/")) { return uri.substring(0, uri.length() - 1); } - + return uri; } - + //------------------------------------------------------------------------------------------------- public static String convertZonedDateTimeToUTCString(final ZonedDateTime time) { if (time == null) { return null; } - + final LocalDateTime localDateTime = LocalDateTime.ofInstant(time.toInstant(), ZoneOffset.UTC); return dateTimeFormatter.format(localDateTime); } - + //------------------------------------------------------------------------------------------------- @SuppressWarnings("squid:RedundantThrowsDeclarationCheck") public static ZonedDateTime parseUTCStringToLocalZonedDateTime(final String timeStr) throws DateTimeParseException { if (isEmpty(timeStr)) { return null; } - + final TemporalAccessor tempAcc = dateTimeFormatter.parse(timeStr); final ZonedDateTime parsedDateTime = ZonedDateTime.of(tempAcc.get(ChronoField.YEAR), tempAcc.get(ChronoField.MONTH_OF_YEAR), @@ -139,11 +140,11 @@ public static ZonedDateTime parseUTCStringToLocalZonedDateTime(final String time tempAcc.get(ChronoField.SECOND_OF_MINUTE), 0, ZoneOffset.UTC); - + final ZoneOffset offset = OffsetDateTime.now().getOffset(); return ZonedDateTime.ofInstant(parsedDateTime.toInstant(), offset); } - + //------------------------------------------------------------------------------------------------- @Nullable public static String toPrettyJson(final String jsonString) { @@ -161,45 +162,45 @@ public static String toPrettyJson(final String jsonString) { } catch (final IOException ex) { // it seems it is not a JSON string, so we just return untouched } - + return jsonString; } - + //------------------------------------------------------------------------------------------------- @Nullable public static String toJson(final Object object) { if (object == null) { return null; } - + try { return mapper.writeValueAsString(object); } catch (final JsonProcessingException ex) { throw new ArrowheadException("The specified object cannot be converted to text.", ex); } } - + //------------------------------------------------------------------------------------------------- @Nullable public static T fromJson(final String json, final Class parsedClass) { if (json == null || parsedClass == null) { return null; } - + try { return mapper.readValue(json, parsedClass); } catch (final IOException ex) { throw new ArrowheadException("The specified string cannot be converted to a(n) " + parsedClass.getSimpleName() + " object.", ex); } } - + //------------------------------------------------------------------------------------------------- @Nullable public static Map text2Map(final String text) { if (text == null) { return null; } - + final Map result = new HashMap<>(); if (!isEmpty(text.trim())) { final String[] parts = text.split(","); @@ -208,30 +209,30 @@ public static Map text2Map(final String text) { result.put(URLDecoder.decode(pair[0].trim(), StandardCharsets.UTF_8), pair.length == 1 ? "" : URLDecoder.decode(pair[1].trim(), StandardCharsets.UTF_8)); } } - + return result; } - + //------------------------------------------------------------------------------------------------- @Nullable public static String map2Text(final Map map) { if (map == null) { return null; } - + final StringBuilder sb = new StringBuilder(); for (final Entry entry : map.entrySet()) { final String key = URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8); final String value = URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8); sb.append(key).append("=").append(value).append(", "); } - + return map.isEmpty() ? "" : sb.substring(0, sb.length() - 2); } - + //------------------------------------------------------------------------------------------------- /** - * + * * @param scheme default: http * @param host default: 127.0.0.1 * @param port default: 80 @@ -244,54 +245,54 @@ public static UriComponents createURI(final String scheme, final String host, fi builder.scheme(scheme == null ? CommonConstants.HTTP : scheme) .host(host == null ? CommonConstants.LOCALHOST : host) .port(port <= 0 ? CommonConstants.HTTP_PORT : port); - + if (queryParams != null) { builder.queryParams(queryParams); } - + if (pathSegments != null && pathSegments.length > 0) { builder.pathSegment(pathSegments); } - + if (!Utilities.isEmpty(path)) { builder.path(path); } - + return builder.build(); } - + //------------------------------------------------------------------------------------------------- public static UriComponents createURI(final String scheme, final String host, final int port, final String path) { return createURI(scheme, host, port, null, path, (String[]) null); } - + //------------------------------------------------------------------------------------------------- public static UriComponents createURI(final String scheme, final String host, final int port, final String path, final String... queryParams) { if (queryParams.length % 2 != 0) { throw new InvalidParameterException("queryParams variable arguments conatins a key without value"); } - - final LinkedMultiValueMap query = new LinkedMultiValueMap<>(); - + + final LinkedMultiValueMap query = new LinkedMultiValueMap<>(); + int count = 1; String key = ""; for (final String vararg : queryParams) { if (count % 2 != 0) { - query.putIfAbsent(vararg, new ArrayList<>()); + query.putIfAbsent(vararg, new ArrayList<>()); key = vararg; } else { - query.get(key).add(vararg); + query.get(key).add(vararg); } count++; } - + return createURI(scheme, host, port, query, path); } - + //------------------------------------------------------------------------------------------------- public static HttpStatus calculateHttpStatusFromArrowheadException(final ArrowheadException ex) { Assert.notNull(ex, "Exception is null."); - + HttpStatus status = HttpStatus.resolve(ex.getErrorCode()); if (status == null) { switch (ex.getExceptionType()) { @@ -313,30 +314,30 @@ public static HttpStatus calculateHttpStatusFromArrowheadException(final Arrowhe status = HttpStatus.INTERNAL_SERVER_ERROR; } } - + return status; } - + //------------------------------------------------------------------------------------------------- public static RelayType convertStringToRelayType(final String str) { if (isEmpty(str)) { return RelayType.GENERAL_RELAY; } - + try { - return RelayType.valueOf(str.toUpperCase().trim()); + return RelayType.valueOf(str.toUpperCase().trim()); } catch (final IllegalArgumentException ex) { return null; } } - + //------------------------------------------------------------------------------------------------- @Nullable public static String getCertCNFromSubject(final String subjectName) { if (subjectName == null) { return null; } - + try { // Subject is in LDAP format, we can use the LdapName object for parsing final LdapName ldapname = new LdapName(subjectName); @@ -353,19 +354,19 @@ public static String getCertCNFromSubject(final String subjectName) { return null; } - + //------------------------------------------------------------------------------------------------- public static String getCloudCommonName(final String cloudOperator, final String cloudName) { Assert.isTrue(!isEmpty(cloudOperator), "Cloud operator is null or blank."); Assert.isTrue(!isEmpty(cloudName), "Cloud name is null or blank."); - - return (cloudName.trim() + "." + cloudOperator.trim() + ".arrowhead.eu").toLowerCase(); + + return (cloudName.trim() + "." + cloudOperator.trim() + ".arrowhead.eu").toLowerCase(); } - + //------------------------------------------------------------------------------------------------- public static X509Certificate getFirstCertFromKeyStore(final KeyStore keystore) { Assert.notNull(keystore, "Key store is not defined."); - + try { final Enumeration enumeration = keystore.aliases(); final String alias = enumeration.nextElement(); @@ -375,12 +376,12 @@ public static X509Certificate getFirstCertFromKeyStore(final KeyStore keystore) throw new ServiceConfigurationError("Getting the first cert from keystore failed...", ex); } } - + //------------------------------------------------------------------------------------------------- public static PrivateKey getPrivateKey(final KeyStore keystore, final String keyPass) { Assert.notNull(keystore, "Key store is not defined."); Assert.notNull(keyPass, "Password is not defined."); - + PrivateKey privateKey = null; String element; try { @@ -400,14 +401,14 @@ public static PrivateKey getPrivateKey(final KeyStore keystore, final String key if (privateKey == null) { throw new ServiceConfigurationError("Getting the private key failed, key store aliases do not identify a key."); } - + return privateKey; } - + //------------------------------------------------------------------------------------------------- public static PublicKey getPublicKeyFromBase64EncodedString(final String encodedKey) { Assert.isTrue(!isEmpty(encodedKey), "Encoded key is null or blank"); - + final byte[] keyBytes = Base64.getDecoder().decode(encodedKey); return generatePublicKeyFromByteArray(keyBytes); } @@ -421,47 +422,47 @@ public static PublicKey getPublicKeyFromPEMFile(final InputStream is) { for (int read = 0; read != -1; read = is.read(buf)) { baos.write(buf, 0, read); } - + final String pem = new String(baos.toByteArray(), StandardCharsets.ISO_8859_1); baos.close(); final String encoded = PEM_PATTERN.matcher(pem).replaceFirst("$1"); final byte[] keyBytes = Base64.getMimeDecoder().decode(encoded); - + return generatePublicKeyFromByteArray(keyBytes); } catch (final IOException ex) { throw new ArrowheadException("IOException occurred during PEM file loading from input stream.", ex); - } + } } - + //------------------------------------------------------------------------------------------------- public static boolean isKeyStoreCNArrowheadValid(final String commonName) { if (isEmpty(commonName)) { return false; } - + final String[] cnFields = commonName.split("\\.", 0); return cnFields.length == SERVICE_CN_NAME_LENGTH && cnFields[cnFields.length - 1].equals(AH_MASTER_SUFFIX) && cnFields[cnFields.length - 2].equals(AH_MASTER_NAME); } - + //------------------------------------------------------------------------------------------------- public static boolean isKeyStoreCNArrowheadValid(final String clientCN, final String cloudCN) { if (isEmpty(clientCN) || isEmpty(cloudCN)) { return false; } - + final String[] clientFields = clientCN.split("\\.", 2); // valid clientFields contains clientServiceName, cloudName.operator.arrowhead.eu - + return clientFields.length >= 2 && cloudCN.equalsIgnoreCase(clientFields[1]); } - + //------------------------------------------------------------------------------------------------- public static String getDatetimePattern() { return dateTimePattern; } - + //------------------------------------------------------------------------------------------------- public static void createExceptionFromErrorMessageDTO(final ErrorMessageDTO dto) { Assert.notNull(dto, "Error message object is null."); Assert.notNull(dto.getExceptionType(), "Exception type is null."); - + switch (dto.getExceptionType()) { case ARROWHEAD: throw new ArrowheadException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); @@ -484,15 +485,57 @@ public static void createExceptionFromErrorMessageDTO(final ErrorMessageDTO dto) throw new ArrowheadException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); } } - + + //------------------------------------------------------------------------------------------------- + public static String lowerCaseTrim(final String text) + { + if(isEmpty(text)) + { + return text; + } + + return text.toLowerCase().trim(); + } + + //------------------------------------------------------------------------------------------------- + public static String firstNotNull(final String first, final String second) + { + return Utilities.notEmpty(first) ? Utilities.lowerCaseTrim(first) : Utilities.lowerCaseTrim(second); + } + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings("unchecked") + public static T firstNotNull(final T first, final T second) + { + if(first instanceof String && second instanceof String) + { + return (T) firstNotNull((String) first, (String) second); + } + return Objects.nonNull(first) ? first : second; + } + + //------------------------------------------------------------------------------------------------- + public static String firstNotNull(final String... args) + { + for(final String candidate : args) + { + if(Utilities.notEmpty(candidate)) + { + return Utilities.lowerCaseTrim(candidate); + } + } + + return null; + } + //================================================================================================= // assistant methods - + //------------------------------------------------------------------------------------------------- private Utilities() { throw new UnsupportedOperationException(); } - + //------------------------------------------------------------------------------------------------- private static PublicKey generatePublicKeyFromByteArray(final byte[] keyBytes) { try { diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java index 9dc42ca5f..8193b33a0 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java @@ -3,6 +3,7 @@ import eu.arrowhead.common.database.entity.*; import eu.arrowhead.common.database.entity.System; import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Repository; @@ -16,6 +17,9 @@ public interface SystemRegistryRepository extends RefreshableRepository findBySystem(final System system); - public List findByDevice(final Device device); + Optional findBySystem(final System system); + List findByDevice(final Device device); + Optional findBySystemAndDevice(final System systemDb, final Device deviceDb); + + Page findAllBySystem(final List systemList, final PageRequest pageRequest); } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java index 7ccbedb67..e9d00893b 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java @@ -18,7 +18,7 @@ public class SystemRegistryRequestDTO implements Serializable { private DeviceRequestDTO provider; private String endOfValidity; private Map metadata; - private int version; + private Integer version; //================================================================================================= // methods @@ -28,12 +28,12 @@ public class SystemRegistryRequestDTO implements Serializable { public DeviceRequestDTO getProvider() { return provider; } public String getEndOfValidity() { return endOfValidity; } public Map getMetadata() { return metadata; } - public int getVersion() { return version; } + public Integer getVersion() { return version; } //------------------------------------------------------------------------------------------------- public void setSystem(final SystemRequestDTO system) { this.system = system; } public void setProvider(final DeviceRequestDTO provider) { this.provider = provider; } public void setEndOfValidity(final String endOfValidity) { this.endOfValidity = endOfValidity; } public void setMetadata(final Map metadata) { this.metadata = metadata; } - public void setVersion(final int version) { this.version = version; } + public void setVersion(final Integer version) { this.version = version; } } \ No newline at end of file diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java index 4c8f49725..32190fae8 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java @@ -289,7 +289,7 @@ public DeviceResponseDTO addDevice(@RequestBody final DeviceRequestDTO dto) { validateDevice(dto); - final DeviceResponseDTO responseDTO = systemRegistryDBService.createDevice(dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); + final DeviceResponseDTO responseDTO = systemRegistryDBService.createDeviceDto(dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); logger.debug("{} successfully registered.", responseDTO); return responseDTO; @@ -608,7 +608,7 @@ public SystemResponseDTO queryRegistryBySystemDTO(@RequestBody final SystemReque final String address = request.getAddress(); final int port = request.getPort(); - final SystemResponseDTO result = systemRegistryDBService.getSystemByNameAndAddressAndPort(systemName, address, port); + final SystemResponseDTO result = systemRegistryDBService.getSystemDtoByNameAndAddressAndPort(systemName, address, port); logger.debug("Return system by name: {}, address: {}, port: {}", systemName, address, port); return result; @@ -628,7 +628,7 @@ private SystemResponseDTO callCreateSystem(final SystemRequestDTO request) { final int port = request.getPort(); final String authenticationInfo = request.getAuthenticationInfo(); - return systemRegistryDBService.createSystemResponse(systemName, address, port, authenticationInfo); + return systemRegistryDBService.createSystemDto(systemName, address, port, authenticationInfo); } //------------------------------------------------------------------------------------------------- @@ -642,7 +642,7 @@ private SystemResponseDTO callUpdateSystem(final SystemRequestDTO request, final final int validatedPort = request.getPort(); final String validatedAuthenticationInfo = request.getAuthenticationInfo(); - return systemRegistryDBService.updateSystemResponse(systemId, validatedSystemName, validatedAddress, validatedPort, validatedAuthenticationInfo); + return systemRegistryDBService.updateSystemDto(systemId, validatedSystemName, validatedAddress, validatedPort, validatedAuthenticationInfo); } //------------------------------------------------------------------------------------------------- diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java index 9393d94b6..b73cf137b 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java @@ -1,10 +1,8 @@ package eu.arrowhead.core.systemregistry.database.service; import eu.arrowhead.common.*; -import eu.arrowhead.common.database.entity.Device; -import eu.arrowhead.common.database.entity.ServiceRegistry; +import eu.arrowhead.common.database.entity.*; import eu.arrowhead.common.database.entity.System; -import eu.arrowhead.common.database.entity.SystemRegistry; import eu.arrowhead.common.database.repository.DeviceRepository; import eu.arrowhead.common.database.repository.SystemRegistryRepository; import eu.arrowhead.common.database.repository.SystemRepository; @@ -15,17 +13,22 @@ import eu.arrowhead.common.dto.shared.*; import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.exception.InvalidParameterException; +import jdk.jshell.execution.Util; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; +import org.springframework.http.RequestEntity; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.Assert; -import java.util.Objects; -import java.util.Optional; +import java.time.ZonedDateTime; +import java.time.format.DateTimeParseException; +import java.util.*; @Service public class SystemRegistryDBService { @@ -101,22 +104,7 @@ public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageP //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) { - logger.debug("createSystem started..."); - - final System system = validateNonNullSystemParameters(systemName, address, port, authenticationInfo); - - try { - return systemRepository.saveAndFlush(system); - } catch (final Exception ex) { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } - } - - //------------------------------------------------------------------------------------------------- - @Transactional(rollbackFor = ArrowheadException.class) - public SystemResponseDTO createSystemResponse(final String systemName, final String address, final int port, final String authenticationInfo) { + public SystemResponseDTO createSystemDto(final String systemName, final String address, final int port, final String authenticationInfo) { logger.debug("createSystemResponse started..."); return DTOConverter.convertSystemToSystemResponseDTO(createSystem(systemName, address, port, authenticationInfo)); @@ -124,8 +112,8 @@ public SystemResponseDTO createSystemResponse(final String systemName, final Str //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemResponseDTO updateSystemResponse(final long systemId, final String systemName, final String address, final int port, - final String authenticationInfo) { + public SystemResponseDTO updateSystemDto(final long systemId, final String systemName, final String address, final int port, + final String authenticationInfo) { logger.debug("updateSystemResponse started..."); return DTOConverter.convertSystemToSystemResponseDTO(updateSystem(systemId, systemName, address, port, authenticationInfo)); @@ -143,12 +131,11 @@ public System updateSystem(final long systemId, final String systemName, final S throw new InvalidParameterException("System name can't contain dot (.)"); } final String validatedAddress = validateParamString(address); - final String validatedAuthenticationInfo = authenticationInfo; try { final Optional systemOptional = systemRepository.findById(validatedSystemId); - if (!systemOptional.isPresent()) { + if (systemOptional.isEmpty()) { throw new InvalidParameterException("No system with id : " + validatedSystemId); } @@ -161,7 +148,7 @@ public System updateSystem(final long systemId, final String systemName, final S system.setSystemName(validatedSystemName); system.setAddress(validatedAddress); system.setPort(validatedPort); - system.setAuthenticationInfo(validatedAuthenticationInfo); + system.setAuthenticationInfo(authenticationInfo); return systemRepository.saveAndFlush(system); } catch (final InvalidParameterException ex) { @@ -213,11 +200,10 @@ public System mergeSystem(final long systemId, final String systemName, final St throw new InvalidParameterException("System name can't contain dot (.)"); } final String validatedAddress = validateAllowNullParamString(address); - final String validatedAuthenticationInfo = authenticationInfo; try { final Optional systemOptional = systemRepository.findById(validatedSystemId); - if (!systemOptional.isPresent()) { + if (systemOptional.isEmpty()) { throw new InvalidParameterException("No system with id : " + validatedSystemId); } @@ -226,14 +212,14 @@ public System mergeSystem(final long systemId, final String systemName, final St if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) { checkConstraintsOfSystemTable(validatedSystemName != null ? validatedSystemName : system.getSystemName(), validatedAddress != null ? validatedAddress : system.getAddress(), - validatedPort != null ? validatedPort.intValue() : system.getPort()); + validatedPort != null ? validatedPort : system.getPort()); } - if (!Utilities.isEmpty(validatedSystemName)) { + if (Utilities.notEmpty(validatedSystemName)) { system.setSystemName(validatedSystemName); } - if (!Utilities.isEmpty(validatedAddress)) { + if (Utilities.notEmpty(validatedAddress)) { system.setAddress(validatedAddress); } @@ -241,8 +227,8 @@ public System mergeSystem(final long systemId, final String systemName, final St system.setPort(validatedPort); } - if (!Utilities.isEmpty(validatedAuthenticationInfo)) { - system.setAuthenticationInfo(validatedAuthenticationInfo); + if (Utilities.notEmpty(authenticationInfo)) { + system.setAuthenticationInfo(authenticationInfo); } return systemRepository.saveAndFlush(system); @@ -296,12 +282,10 @@ public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageP //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public DeviceResponseDTO createDevice(final String name, final String address, final String macAddress, final String authenticationInfo) { - final Device device = new Device(name, address, macAddress, authenticationInfo); - return DTOConverter.convertDeviceToDeviceResponseDTO(deviceRepository.save(device)); + public DeviceResponseDTO createDeviceDto(final String name, final String address, final String macAddress, final String authenticationInfo) { + return DTOConverter.convertDeviceToDeviceResponseDTO(createDevice(name, address, macAddress, authenticationInfo)); } - //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public DeviceResponseDTO updateDeviceByIdResponse(final long id, final String name, final String address, final String macAddress, final String authenticationInfo) { @@ -313,7 +297,7 @@ public DeviceResponseDTO updateDeviceByIdResponse(final long id, final String na final long validatedId = validateId(id); final Device newDevice = validateNonNullDeviceParameters(name, address, macAddress, authenticationInfo); - final Optional optionalDevice = deviceRepository.findById(id); + final Optional optionalDevice = deviceRepository.findById(validatedId); final Device device = optionalDevice.orElseThrow(() -> new InvalidParameterException("No device with id : " + id)); device.setDeviceName(newDevice.getDeviceName()); @@ -362,9 +346,9 @@ public SystemRegistryListResponseDTO getSystemRegistryEntries(final CoreUtilitie try { final PageRequest pageRequest = PageRequest.of(params.getValidatedPage(), - params.getValidatedSize(), - params.getValidatedDirection(), - validatedSortField); + params.getValidatedSize(), + params.getValidatedDirection(), + validatedSortField); final Page systemRegistryPage = systemRegistryRepository.findAll(pageRequest); return DTOConverter.convertSystemRegistryPageToSystemRegistryListResponseDTO(systemRegistryPage); } catch (final Exception ex) { @@ -405,49 +389,217 @@ public void removeSystemRegistryEntryById(final long id) { //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public SystemRegistryResponseDTO registerSystemRegistry(final SystemRegistryRequestDTO request) { - return null; - } + logger.debug("registerSystemRegistry started..."); + checkSystemRegistryRequest(request); + try { + final System systemDb = findOrCreateSystem(request.getSystem()); + final Device deviceDb = findOrCreateDevice(request.getProvider()); + + final ZonedDateTime endOfValidity = getZonedDateTime(request); + final String metadataStr = Utilities.map2Text(request.getMetadata()); + final int version = (request.getVersion() != null) ? request.getVersion() : 1; + final SystemRegistry srEntry = createSystemRegistry(systemDb, deviceDb, endOfValidity, metadataStr, version); + + return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(srEntry); + } catch (final DateTimeParseException ex) { + logger.debug(ex.getMessage(), ex); + throw new InvalidParameterException("End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); + } catch (final InvalidParameterException ex) { + throw ex; + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public SystemRegistryResponseDTO updateSystemRegistryById(final long id, final SystemRegistryRequestDTO request) { - return null; - } + logger.debug("updateSystemRegistryById started..."); + Assert.isTrue(0 < id, "id is not greater than zero"); + checkSystemRegistryRequest(request); + + try { + final SystemRegistry srEntry; + final SystemRegistry updateSrEntry; + + final Optional srEntryOptional = systemRegistryRepository.findById(id); + srEntry = srEntryOptional.orElseThrow(() -> new InvalidParameterException("System Registry entry with id '" + id + "' not exists")); + + final System systemDb = findOrCreateSystem(request.getSystem()); + final Device deviceDb = findOrCreateDevice(request.getProvider()); + + final ZonedDateTime endOfValidity = getZonedDateTime(request); + final String metadataStr = Utilities.map2Text(request.getMetadata()); + final int version = (request.getVersion() != null) ? request.getVersion() : 1; + updateSrEntry = updateSystemRegistry(srEntry, systemDb, deviceDb, endOfValidity, metadataStr, version); + + return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(updateSrEntry); + } catch (final DateTimeParseException ex) { + logger.debug(ex.getMessage(), ex); + throw new InvalidParameterException("End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); + } catch (final InvalidParameterException ex) { + throw ex; + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + + } //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public SystemRegistryResponseDTO mergeSystemRegistryById(final long id, final SystemRegistryRequestDTO request) { - return null; - } + logger.debug("mergeSystemRegistryById started..."); + Assert.notNull(request, "request is null."); + Assert.isTrue(0 < id, "id is not greater than zero"); + + try { + final SystemRegistry srEntry; + final SystemRegistry updateSrEntry; + + final Optional srEntryOptional = systemRegistryRepository.findById(id); + srEntry = srEntryOptional.orElseThrow(() -> new InvalidParameterException("System Registry entry with id '" + id + "' not exists")); + + final System systemDb = mergeSystem(request.getSystem(), srEntry.getSystem()); + final Device deviceDb = mergeDevice(request.getProvider(), srEntry.getDevice()); + + final ZonedDateTime endOfValidity = Utilities.notEmpty(request.getEndOfValidity()) ? + Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()) : + srEntry.getEndOfValidity(); + + final String validatedMetadataStr = Objects.nonNull(request.getMetadata()) ? + Utilities.map2Text(request.getMetadata()) : + srEntry.getMetadata(); + + final int validatedVersion = (request.getVersion() != null) ? request.getVersion() : srEntry.getVersion(); + + updateSrEntry = updateSystemRegistry(srEntry, systemDb, deviceDb, endOfValidity, validatedMetadataStr, validatedVersion); + + return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(updateSrEntry); + } catch (final InvalidParameterException ex) { + throw ex; + } catch (final DateTimeParseException ex) { + logger.debug(ex.getMessage(), ex); + throw new InvalidParameterException("End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public SystemRegistryListResponseDTO getSystemRegistryEntriesBySystemName(final String systemName, final CoreUtilities.ValidatedPageParams pageParameters, final String sortField) { + final List systemList = systemRepository.findBySystemName(systemName); + final PageRequest pageRequest = PageRequest.of(pageParameters.getValidatedPage(), pageParameters.getValidatedSize(), pageParameters.getValidatedDirection()); + + final Page systemRegistries = systemRegistryRepository.findAllBySystem(systemList, pageRequest); + return DTOConverter.convertSystemRegistryPageToSystemRegistryListResponseDTO(systemRegistries); } //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public void removeSystemRegistryByNameAndAddressAndPort(final String systemName, final String address, final int port) { + final System system = getSystemByNameAndAddressAndPort(systemName, address, port); + + final Optional optionalSystemRegistry = systemRegistryRepository.findBySystem(system); + final SystemRegistry systemRegistry = optionalSystemRegistry.orElseThrow( + () -> new InvalidParameterException("System Registry entry for System with name '" + systemName + "', address '" + address + "' and port '" + port + "' does not exists")); + + systemRegistryRepository.delete(systemRegistry); + systemRegistryRepository.flush(); } //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public SystemQueryResultDTO queryRegistry(final SystemQueryFormDTO form) { + logger.debug("queryRegistry is started..."); + Assert.notNull(form, "Form is null."); + Assert.isTrue(!Utilities.isEmpty(form.getServiceDefinitionRequirement()), "Service definition requirement is null or blank"); + + final String serviceDefinitionRequirement = form.getServiceDefinitionRequirement().toLowerCase().trim(); + try { + final Optional optServiceDefinition = serviceDefinitionRepository.findByServiceDefinition(serviceDefinitionRequirement); + if (optServiceDefinition.isEmpty()) { + // no service definition found + logger.debug("Service definition not found: {}", serviceDefinitionRequirement); + return DTOConverter.convertListOfServiceRegistryEntriesToServiceQueryResultDTO(null, 0); + } + + final List providedServices = new ArrayList<>(serviceRegistryRepository.findByServiceDefinition(optServiceDefinition.get())); + final int unfilteredHits = providedServices.size(); + logger.debug("Potential service providers before filtering: {}", unfilteredHits); + if (providedServices.isEmpty()) { + // no providers found + return DTOConverter.convertListOfServiceRegistryEntriesToServiceQueryResultDTO(providedServices, unfilteredHits); + } + + // filter on interfaces + if (form.getInterfaceRequirements() != null && !form.getInterfaceRequirements().isEmpty()) { + final List normalizedInterfaceRequirements = RegistryUtils.normalizeInterfaceNames(form.getInterfaceRequirements()); + RegistryUtils.filterOnInterfaces(providedServices, normalizedInterfaceRequirements); + } + + // filter on security type + if (!providedServices.isEmpty() && form.getSecurityRequirements() != null && !form.getSecurityRequirements().isEmpty()) { + final List normalizedSecurityTypes = RegistryUtils.normalizeSecurityTypes(form.getSecurityRequirements()); + RegistryUtils.filterOnSecurityType(providedServices, normalizedSecurityTypes); + } + + // filter on version + if (!providedServices.isEmpty()) { + if (form.getVersionRequirement() != null) { + RegistryUtils.filterOnVersion(providedServices, form.getVersionRequirement().intValue()); + } else if (form.getMinVersionRequirement() != null || form.getMaxVersionRequirement() != null) { + final int minVersion = form.getMinVersionRequirement() == null ? 1 : form.getMinVersionRequirement().intValue(); + final int maxVersion = form.getMaxVersionRequirement() == null ? Integer.MAX_VALUE : form.getMaxVersionRequirement().intValue(); + RegistryUtils.filterOnVersion(providedServices, minVersion, maxVersion); + } + } + + // filter on metadata + if (!providedServices.isEmpty() && form.getMetadataRequirements() != null && !form.getMetadataRequirements().isEmpty()) { + final Map normalizedMetadata = RegistryUtils.normalizeMetadata(form.getMetadataRequirements()); + RegistryUtils.filterOnMeta(providedServices, normalizedMetadata); + } + + // filter on ping + if (!providedServices.isEmpty() && form.getPingProviders()) { + RegistryUtils.filterOnPing(providedServices, pingTimeout); + } + + logger.debug("Potential service providers after filtering: {}", providedServices.size()); + + return DTOConverter.convertListOfServiceRegistryEntriesToServiceQueryResultDTO(providedServices, unfilteredHits); + } catch (final IllegalStateException e) { + throw new InvalidParameterException("Invalid keys in the metadata requirements (whitespace only differences)"); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } } //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemResponseDTO getSystemByNameAndAddressAndPort(final String systemName, final String address, final int port) { + public SystemResponseDTO getSystemDtoByNameAndAddressAndPort(final String systemName, final String address, final int port) { + final System system = getSystemByNameAndAddressAndPort(systemName, address, port); + return DTOConverter.convertSystemToSystemResponseDTO(system); } //================================================================================================= // assistant methods + //------------------------------------------------------------------------------------------------- + private System getSystemByNameAndAddressAndPort(final String systemName, final String address, final int port) { + final Optional optionalSystem = systemRepository.findBySystemNameAndAddressAndPort(systemName, address, port); + return optionalSystem.orElseThrow(() -> new InvalidParameterException("System entry with name '" + systemName + "', address '" + address + "' and port '" + port + "' does not exists")); + } //------------------------------------------------------------------------------------------------- @SuppressWarnings("squid:S1126") @@ -513,13 +665,12 @@ private System validateNonNullSystemParameters(final String systemName, final St throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); } - final String validatedSystemName = systemName.trim().toLowerCase(); - final String validatedAddress = address.trim().toLowerCase(); - final String validatedAuthenticationInfo = authenticationInfo; + final String validatedSystemName = Utilities.lowerCaseTrim(systemName); + final String validatedAddress = Utilities.lowerCaseTrim(address); checkConstraintsOfSystemTable(validatedSystemName, validatedAddress, port); - return new System(validatedSystemName, validatedAddress, port, validatedAuthenticationInfo); + return new System(validatedSystemName, validatedAddress, port, authenticationInfo); } //------------------------------------------------------------------------------------------------- @@ -532,14 +683,13 @@ private Device validateNonNullDeviceParameters(final String deviceName, final St throw new InvalidParameterException("MAC address is null or empty"); } - final String validatedDeviceName = deviceName.trim().toLowerCase(); - final String validatedAddress = address.trim().toLowerCase(); + final String validatedDeviceName = Utilities.lowerCaseTrim(deviceName); + final String validatedAddress = Utilities.lowerCaseTrim(address); final String validatedMacAddress = macAddress.trim().toUpperCase(); - final String validatedAuthenticationInfo = authenticationInfo; checkConstraintsOfDeviceTable(validatedDeviceName, validatedMacAddress); - return new Device(validatedDeviceName, validatedAddress, validatedMacAddress, validatedAuthenticationInfo); + return new Device(validatedDeviceName, validatedAddress, validatedMacAddress, authenticationInfo); } //------------------------------------------------------------------------------------------------- @@ -567,7 +717,7 @@ private String validateParamString(final String param) { throw new InvalidParameterException("parameter null or empty"); } - return param.trim().toLowerCase(); + return Utilities.lowerCaseTrim(param); } //------------------------------------------------------------------------------------------------- @@ -611,7 +761,7 @@ private String validateAllowNullParamString(final String param) { return null; } - return param.trim().toLowerCase(); + return Utilities.lowerCaseTrim(param); } @@ -630,19 +780,201 @@ private SystemRegistry getSystemRegistryEntryById(final long id) { } //------------------------------------------------------------------------------------------------- - private System findOrCreateSystem(final String systemName, final String address, final int port, final String authenticationInfo) { - final Optional optProvider = systemRepository - .findBySystemNameAndAddressAndPort(systemName.toLowerCase().trim(), address.toLowerCase().trim(), port); + private System findOrCreateSystem(SystemRequestDTO requestSystemDto) { + return findOrCreateSystem(requestSystemDto.getSystemName(), + requestSystemDto.getAddress(), + requestSystemDto.getPort(), + requestSystemDto.getAuthenticationInfo()); + } + + //------------------------------------------------------------------------------------------------- + private System findOrCreateSystem(final String name, final String address, final int port, final String authenticationInfo) { + + final String validatedName = Utilities.lowerCaseTrim(name); + final String validatedAddress = Utilities.lowerCaseTrim(address); + final String validatedAuthenticationInfo = Utilities.lowerCaseTrim(authenticationInfo); + + final Optional optSystem = systemRepository.findBySystemNameAndAddressAndPort(validatedName, validatedAddress, port); System provider; + + if (optSystem.isPresent()) { + provider = optSystem.get(); + if (!Objects.equals(validatedAuthenticationInfo, provider.getAuthenticationInfo()) || + !Objects.equals(validatedAddress, provider.getAddress())) { // authentication info or system has changed + provider.setAuthenticationInfo(validatedAuthenticationInfo); + provider.setAddress(validatedAddress); + provider = systemRepository.saveAndFlush(provider); + } + } else { + provider = createSystem(validatedName, validatedAddress, port, validatedAuthenticationInfo); + } + return provider; + } + + //------------------------------------------------------------------------------------------------- + private System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) { + logger.debug("createSystem started..."); + + final System system = validateNonNullSystemParameters(systemName, address, port, authenticationInfo); + + try { + return systemRepository.saveAndFlush(system); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + private Device findOrCreateDevice(DeviceRequestDTO requestDeviceDto) { + return findOrCreateDevice(requestDeviceDto.getDeviceName(), + requestDeviceDto.getAddress(), + requestDeviceDto.getMacAddress(), + requestDeviceDto.getAuthenticationInfo()); + } + + //------------------------------------------------------------------------------------------------- + private Device findOrCreateDevice(String deviceName, String address, String macAddress, String authenticationInfo) { + + final String validateName = Utilities.lowerCaseTrim(deviceName); + final String validateAddress = Utilities.lowerCaseTrim(address); + final String validatedMacAddress = Utilities.lowerCaseTrim(macAddress); + final String validatedAuthenticationInfo = Utilities.lowerCaseTrim(authenticationInfo); + + final Optional optProvider = deviceRepository.findByDeviceNameAndMacAddress(validateName, validatedMacAddress); + Device provider; + if (optProvider.isPresent()) { provider = optProvider.get(); - if (!Objects.equals(authenticationInfo, provider.getAuthenticationInfo())) { // authentication info has changed - provider.setAuthenticationInfo(authenticationInfo); - provider = systemRepository.saveAndFlush(provider); + if (!Objects.equals(validatedAuthenticationInfo, provider.getAuthenticationInfo()) || + !Objects.equals(validateAddress, provider.getAddress())) { // authentication info or provider has changed + provider.setAuthenticationInfo(validatedAuthenticationInfo); + provider.setAddress(validateAddress); + provider = deviceRepository.saveAndFlush(provider); } } else { - provider = createSystem(systemName, address, port, authenticationInfo); + provider = createDevice(validateName, validateAddress, validatedMacAddress, validatedAuthenticationInfo); } return provider; } + + //------------------------------------------------------------------------------------------------- + private Device createDevice(final String name, final String address, final String macAddress, final String authenticationInfo) { + final Device device = new Device(name, address, macAddress, authenticationInfo); + return deviceRepository.save(device); + } + + //------------------------------------------------------------------------------------------------- + private void checkSystemRegistryRequest(final SystemRegistryRequestDTO request) { + logger.debug("checkSystemRegistryRequest started..."); + Assert.notNull(request, "Request is null."); + + Assert.notNull(request.getSystem(), "System is not specified."); + Assert.isTrue(Utilities.notEmpty(request.getSystem().getSystemName()), "System name is not specified."); + Assert.isTrue(Utilities.notEmpty(request.getSystem().getAddress()), "System address is not specified."); + Assert.notNull(request.getSystem().getPort(), "System port is not specified."); + + Assert.notNull(request.getProvider(), "Provider Device is not specified."); + Assert.isTrue(Utilities.notEmpty(request.getProvider().getDeviceName()), "Provider Device name is not specified."); + Assert.isTrue(Utilities.notEmpty(request.getProvider().getAddress()), "Provider Device address is not specified."); + Assert.isTrue(Utilities.notEmpty(request.getProvider().getMacAddress()), "Provider Device MAC is not specified."); + } + + //------------------------------------------------------------------------------------------------- + private void checkConstraintsOfSystemRegistryTable(final System systemDb, final Device deviceDb) { + logger.debug("checkConstraintOfSystemRegistryTable started..."); + + try { + final Optional find = systemRegistryRepository.findBySystemAndDevice(systemDb, deviceDb); + if (find.isPresent()) { + throw new InvalidParameterException("System Registry entry with provider: (" + deviceDb.getDeviceName() + ", " + deviceDb.getMacAddress() + + ") and system : " + systemDb.getSystemName() + " already exists."); + } + } catch (final InvalidParameterException ex) { + throw ex; + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + private Device mergeDevice(final DeviceRequestDTO request, final Device device) { + final String name = Utilities.firstNotNull(request.getDeviceName(), device.getDeviceName()); + final String address = Utilities.firstNotNull(request.getAddress(), device.getAddress()); + final String macAddress = Utilities.firstNotNull(request.getDeviceName(), device.getDeviceName()); + final String authenticationInfo = Utilities.firstNotNull(request.getAuthenticationInfo(), device.getAuthenticationInfo()); + return findOrCreateDevice(name, address, macAddress, authenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private System mergeSystem(final SystemRequestDTO request, final System system) { + final String name = Utilities.firstNotNull(request.getSystemName(), system.getSystemName()); + final String address = Utilities.firstNotNull(request.getAddress(), system.getAddress()); + final int port = request.getPort() > 0 ? request.getPort() : system.getPort(); + final String authenticationInfo = Utilities.firstNotNull(request.getAuthenticationInfo(), system.getAuthenticationInfo()); + return findOrCreateSystem(name, address, port, authenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private SystemRegistry createSystemRegistry(final System systemDb, final Device deviceDb, final ZonedDateTime endOfValidity, final String metadataStr, final int version) { + logger.debug("createSystemRegistry started..."); + + checkConstraintsOfSystemRegistryTable(systemDb, deviceDb); + + try { + return systemRegistryRepository.saveAndFlush(new SystemRegistry(systemDb, deviceDb, endOfValidity, metadataStr, version)); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + private boolean checkSystemRegistryIfUniqueValidationNeeded(final SystemRegistry srEntry, final System system, final Device device) { + logger.debug("checkSystemRegistryIfUniqueValidationNeeded started..."); + + return srEntry.getSystem().getId() != system.getId() || srEntry.getDevice().getId() != device.getId(); + + } + + //------------------------------------------------------------------------------------------------- + private SystemRegistry updateSystemRegistry(final SystemRegistry srEntry, final System system, final Device device, + final ZonedDateTime endOfValidity, final String metadataStr, final int version) { + logger.debug("updateSystemRegistry started..."); + Assert.notNull(srEntry, "SystemRegistry Entry is not specified."); + Assert.notNull(system, "System is not specified."); + Assert.notNull(device, "Device is not specified."); + + if (checkSystemRegistryIfUniqueValidationNeeded(srEntry, system, device)) { + checkConstraintsOfSystemRegistryTable(system, device); + } + + return setModifiedValuesOfSystemRegistryEntryFields(srEntry, system, device, endOfValidity, metadataStr, version); + } + + //------------------------------------------------------------------------------------------------- + private ZonedDateTime getZonedDateTime(SystemRegistryRequestDTO request) { + return Utilities.isEmpty(request.getEndOfValidity()) ? null : Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()); + } + + //------------------------------------------------------------------------------------------------- + private SystemRegistry setModifiedValuesOfSystemRegistryEntryFields(final SystemRegistry srEntry, final System system, final Device device, + final ZonedDateTime endOfValidity, final String metadataStr, final int version) { + + logger.debug("setModifiedValuesOfSystemRegistryEntryFields started..."); + + try { + srEntry.setSystem(system); + srEntry.setDevice(device); + srEntry.setEndOfValidity(endOfValidity); + srEntry.setMetadata(metadataStr); + srEntry.setVersion(version); + + return systemRegistryRepository.saveAndFlush(srEntry); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } } From 59ffe2bb5f4306132e95a0570237446f6348435c Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Fri, 24 Jan 2020 01:29:27 +0100 Subject: [PATCH 028/301] wip on deviceregistry --- .../arrowhead/common/CoreCommonConstants.java | 8 +- .../eu/arrowhead/common/CoreDefaults.java | 7 +- .../repository/SystemRegistryRepository.java | 25 +- .../common/dto/internal/DTOConverter.java | 38 +- .../dto/shared/DeviceRegistryRequestDTO.java | 36 + .../dto/shared/DeviceRegistryResponseDTO.java | 45 + .../common/dto/shared/SystemQueryFormDTO.java | 15 +- .../dto/shared/SystemQueryResultDTO.java | 9 + ...DeviceRegistryApplicationInitListener.java | 114 ++ .../DeviceRegistryController.java | 852 +++++++++++ .../deviceregistry/DeviceRegistryMain.java | 3 +- .../service/DeviceRegistryDBService.java | 1299 +++++++++++++++++ ...SystemRegistryApplicationInitListener.java | 13 +- .../systemregistry/SystemRegistryMain.java | 3 +- .../service/SystemRegistryDBService.java | 810 ++++++---- 15 files changed, 2998 insertions(+), 279 deletions(-) create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryRequestDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryResponseDTO.java create mode 100644 deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java create mode 100644 deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java create mode 100644 deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java index ca394fef5..aa9a2b186 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java @@ -91,12 +91,16 @@ public class CoreCommonConstants { public static final String SERVICE_REGISTRY_PING_INTERVAL = "ping_interval"; public static final String $SERVICE_REGISTRY_PING_INTERVAL_WD = "${" + SERVICE_REGISTRY_PING_INTERVAL + ":" + CoreDefaults.DEFAULT_SERVICE_REGISTRY_PING_INTERVAL_MINUTES + "}"; public static final String SERVICE_REGISTRY_PING_TIMEOUT = "ping_timeout"; - public static final String $SERVICE_REGISTRY_PING_TIMEOUT_WD = "${" + SERVICE_REGISTRY_PING_TIMEOUT + ":" + CoreDefaults.DEFAULT_SERVICE_REGISTRY_PING_TIMEOUT_MILISECONDS + "}"; + public static final String $SERVICE_REGISTRY_PING_TIMEOUT_WD = "${" + SERVICE_REGISTRY_PING_TIMEOUT + ":" + CoreDefaults.DEFAULT_SERVICE_REGISTRY_PING_TIMEOUT_MILLISECONDS + "}"; public static final String SERVICE_REGISTRY_TTL_SCHEDULED = "ttl_scheduled"; public static final String $SERVICE_REGISTRY_TTL_SCHEDULED_WD = "${" + SERVICE_REGISTRY_TTL_SCHEDULED + ":" + CoreDefaults.DEFAULT_SERVICE_REGISTRY_TTL_SCHEDULED + "}"; public static final String SERVICE_REGISTRY_TTL_INTERVAL = "ttl_interval"; public static final String $SERVICE_REGISTRY_TTL_INTERVAL_WD = "${" + SERVICE_REGISTRY_TTL_INTERVAL + ":" + CoreDefaults.DEFAULT_SERVICE_REGISTRY_TTL_INTERVAL_MINUTES + "}"; - + + public static final String SYSTEM_REGISTRY_PING_TIMEOUT = "ping_timeout"; + public static final String $SYSTEM_REGISTRY_PING_TIMEOUT_WD = + "${" + SYSTEM_REGISTRY_PING_TIMEOUT + ":" + CoreDefaults.DEFAULT_SYSTEM_REGISTRY_PING_TIMEOUT_MILLISECONDS + "}"; + public static final String AUTHORIZATION_IS_EVENTHANDLER_PRESENT = "eventhandler_is_present"; public static final String $AUTHORIZATION_IS_EVENTHANDLER_PRESENT_WD = "${" + AUTHORIZATION_IS_EVENTHANDLER_PRESENT + ":" +CoreDefaults.DEFAULT_AUTHORIZATION_IS_EVENTHANDLER_PRESENT + "}"; diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java b/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java index 8ffc12b5c..c32a4096d 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java @@ -16,10 +16,13 @@ public class CoreDefaults { public static final boolean DEFAULT_SERVICE_REGISTRY_PING_SCHEDULED = false; public static final int DEFAULT_SERVICE_REGISTRY_PING_INTERVAL_MINUTES = 60; - public static final int DEFAULT_SERVICE_REGISTRY_PING_TIMEOUT_MILISECONDS = 5000; + public static final int DEFAULT_SERVICE_REGISTRY_PING_TIMEOUT_MILLISECONDS = 5000; public static final boolean DEFAULT_SERVICE_REGISTRY_TTL_SCHEDULED = false; public static final int DEFAULT_SERVICE_REGISTRY_TTL_INTERVAL_MINUTES = 13; - + + public static final int DEFAULT_SYSTEM_REGISTRY_PING_INTERVAL_MINUTES = 60; + public static final int DEFAULT_SYSTEM_REGISTRY_PING_TIMEOUT_MILLISECONDS = 5000; + public static final String DEFAULT_OWN_CLOUD_OPERATOR = "default_operator"; public static final String DEFAULT_OWN_CLOUD_NAME = "default_insecure_cloud"; diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java index 8193b33a0..27e4e1770 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java @@ -1,25 +1,30 @@ package eu.arrowhead.common.database.repository; -import eu.arrowhead.common.database.entity.*; +import eu.arrowhead.common.database.entity.Device; import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.database.entity.SystemRegistry; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Repository; import java.util.List; import java.util.Optional; @Repository -public interface SystemRegistryRepository extends RefreshableRepository { - - //================================================================================================= - // methods - - //------------------------------------------------------------------------------------------------- - Optional findBySystem(final System system); - List findByDevice(final Device device); +public interface SystemRegistryRepository extends RefreshableRepository +{ + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + Optional findBySystem(final System system); + + List findByDevice(final Device device); + Optional findBySystemAndDevice(final System systemDb, final Device deviceDb); + List findAllBySystem(final List systems); + Page findAllBySystem(final List systemList, final PageRequest pageRequest); } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java index 810a4bf85..3c4c69443 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java @@ -193,11 +193,11 @@ public static ServiceInterfaceResponseDTO convertServiceInterfaceToServiceInterf return new ServiceInterfaceResponseDTO(intf.getId(), intf.getInterfaceName(), Utilities.convertZonedDateTimeToUTCString(intf.getCreatedAt()), Utilities.convertZonedDateTimeToUTCString(intf.getUpdatedAt())); } - + //------------------------------------------------------------------------------------------------- public static ServiceQueryResultDTO convertListOfServiceRegistryEntriesToServiceQueryResultDTO(final List entries, final int unfilteredHits) { final ServiceQueryResultDTO result = new ServiceQueryResultDTO(); - + if (entries != null) { Assert.isTrue(unfilteredHits >= entries.size(), "Invalid value of unfiltered hits: " + unfilteredHits); result.setUnfilteredHits(unfilteredHits); @@ -205,10 +205,24 @@ public static ServiceQueryResultDTO convertListOfServiceRegistryEntriesToService result.getServiceQueryData().add(convertServiceRegistryToServiceRegistryResponseDTO(srEntry)); } } - + return result; } - + + //------------------------------------------------------------------------------------------------- + public static SystemQueryResultDTO convertListOfSystemRegistryEntriesToSystemQueryResultDTO(final List entries, final int unfilteredHits) { + final List results = new ArrayList<>(); + + if (entries != null) { + Assert.isTrue(unfilteredHits >= entries.size(), "Invalid value of unfiltered hits: " + unfilteredHits); + for (final SystemRegistry srEntry : entries) { + results.add(convertSystemRegistryToSystemRegistryResponseDTO(srEntry)); + } + } + + return new SystemQueryResultDTO(results, unfilteredHits); + } + //------------------------------------------------------------------------------------------------- public static AuthorizationIntraCloudResponseDTO convertAuthorizationIntraCloudToAuthorizationIntraCloudResponseDTO(final AuthorizationIntraCloud entry) { Assert.notNull(entry, "AuthorizationIntraCloud is null"); @@ -658,10 +672,9 @@ public static SystemRegistryResponseDTO convertSystemRegistryToSystemRegistryRes } //------------------------------------------------------------------------------------------------- + public static SystemRegistryListResponseDTO convertSystemRegistryListToSystemRegistryListResponseDTO(final Iterable page) { - public static SystemRegistryListResponseDTO convertSystemRegistryPageToSystemRegistryListResponseDTO(final Page page) { - - final List list = new ArrayList<>(page.getSize()); + final List list = new ArrayList<>(); for(final SystemRegistry entry : page) { list.add(convertSystemRegistryToSystemRegistryResponseDTO(entry)); @@ -669,6 +682,17 @@ public static SystemRegistryListResponseDTO convertSystemRegistryPageToSystemReg return new SystemRegistryListResponseDTO(list, list.size()); } + //------------------------------------------------------------------------------------------------- + public static SystemQueryResultDTO convertSystemRegistryListToSystemQueryResultDTO(final Iterable page) + { + final List list = new ArrayList<>(); + for(final SystemRegistry entry : page) + { + list.add(convertSystemRegistryToSystemRegistryResponseDTO(entry)); + } + return new SystemQueryResultDTO(list, list.size()); + } + //================================================================================================= // assistant methods diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryRequestDTO.java new file mode 100644 index 000000000..800f90a97 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryRequestDTO.java @@ -0,0 +1,36 @@ +package eu.arrowhead.common.dto.shared; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.Serializable; +import java.util.Map; + +@JsonInclude(Include.NON_NULL) +public class DeviceRegistryRequestDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = -635438605292398404L; + + private DeviceRequestDTO device; + private String endOfValidity; + private Map metadata; + private Integer version; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public DeviceRequestDTO getDevice() { return device; } + public String getEndOfValidity() { return endOfValidity; } + public Map getMetadata() { return metadata; } + public Integer getVersion() { return version; } + + //------------------------------------------------------------------------------------------------- + public void setDevice(final DeviceRequestDTO device) { this.device = device; } + public void setEndOfValidity(final String endOfValidity) { this.endOfValidity = endOfValidity; } + public void setMetadata(final Map metadata) { this.metadata = metadata; } + public void setVersion(final Integer version) { this.version = version; } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryResponseDTO.java new file mode 100644 index 000000000..8bde3da52 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryResponseDTO.java @@ -0,0 +1,45 @@ +package eu.arrowhead.common.dto.shared; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.Serializable; +import java.util.Map; + +@JsonInclude(Include.NON_NULL) +public class DeviceRegistryResponseDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = -635438605292398404L; + + private long id; + private DeviceResponseDTO device; + private String endOfValidity; + private Map metadata; + private int version; + private String createdAt; + private String updatedAt; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public long getId() { return id; } + public DeviceResponseDTO getDevice() { return device; } + public String getEndOfValidity() { return endOfValidity; } + public Map getMetadata() { return metadata; } + public int getVersion() { return version; } + public String getCreatedAt() { return createdAt; } + public String getUpdatedAt() { return updatedAt; } + + //------------------------------------------------------------------------------------------------- + public void setId(final long id) { this.id = id; } + public void setDevice(final DeviceResponseDTO device) { this.device = device; } + public void setEndOfValidity(final String endOfValidity) { this.endOfValidity = endOfValidity; } + public void setMetadata(final Map metadata) { this.metadata = metadata; } + public void setVersion(final int version) { this.version = version; } + public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } + public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryFormDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryFormDTO.java index d8c420310..bd451d2d2 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryFormDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryFormDTO.java @@ -16,6 +16,7 @@ public class SystemQueryFormDTO implements Serializable { private static final long serialVersionUID = -2699823381165019336L; private String systemNameRequirements; + private String deviceNameRequirements; private Map metadataRequirements; // if specified the whole content of the map must match private Integer versionRequirement; // if specified version must match private Integer minVersionRequirement; // if specified version must be equals or higher; ignored if versionRequirement is specified @@ -31,6 +32,7 @@ public SystemQueryFormDTO() {} //------------------------------------------------------------------------------------------------- public String getSystemNameRequirements() { return systemNameRequirements; } + public String getDeviceNameRequirements() { return deviceNameRequirements; } public Map getMetadataRequirements() { return metadataRequirements; } public Integer getVersionRequirement() { return versionRequirement; } public Integer getMinVersionRequirement() { return minVersionRequirement; } @@ -39,6 +41,7 @@ public SystemQueryFormDTO() {} //------------------------------------------------------------------------------------------------- public void setSystemNameRequirements(final String systemNameRequirements) { this.systemNameRequirements = systemNameRequirements; } + public void setDeviceNameRequirements(final String deviceNameRequirements) { this.deviceNameRequirements = deviceNameRequirements; } public void setMetadataRequirements(final Map metadataRequirements) { this.metadataRequirements = metadataRequirements; } public void setVersionRequirement(final Integer versionRequirement) { this.versionRequirement = versionRequirement; } public void setMinVersionRequirement(final Integer minVersionRequirement) { this.minVersionRequirement = minVersionRequirement; } @@ -51,6 +54,7 @@ public SystemQueryFormDTO() {} //------------------------------------------------------------------------------------------------- private SystemQueryFormDTO(final Builder builder) { this.systemNameRequirements = builder.systemNameRequirements; + this.deviceNameRequirements = builder.deiceNameRequirements; this.metadataRequirements = builder.metadataRequirements; this.versionRequirement = builder.versionRequirement; this.minVersionRequirement = builder.minVersionRequirement; @@ -68,6 +72,7 @@ public static class Builder { // members private final String systemNameRequirements; + private String deiceNameRequirements; private Map metadataRequirements; private Integer versionRequirement; private Integer minVersionRequirement; @@ -83,14 +88,20 @@ public Builder(final String systemNameRequirements) { Assert.isTrue(systemNameRequirements != null && !systemNameRequirements.isBlank(), "systemNameRequirements is null or blank."); this.systemNameRequirements = systemNameRequirements; } - + + + //------------------------------------------------------------------------------------------------- + public Builder deviceName(final String deiceNameRequirements) { + this.deiceNameRequirements = deiceNameRequirements; + return this; + } //------------------------------------------------------------------------------------------------- public Builder metadata(final Map metadataRequirements) { this.metadataRequirements = metadataRequirements; return this; } - + //------------------------------------------------------------------------------------------------- public Builder metadata(final String key, final String value) { Assert.isTrue(key != null && !key.isBlank(), "Key is null or blank"); diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryResultDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryResultDTO.java index bf8d3c655..576fabd4c 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryResultDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryResultDTO.java @@ -18,6 +18,15 @@ public class SystemQueryResultDTO implements Serializable { private List systemQueryData = new ArrayList<>(); private int unfilteredHits = 0; + //================================================================================================= + // constructors + + public SystemQueryResultDTO(final List systemQueryData, final int unfilteredHits) + { + this.systemQueryData = systemQueryData; + this.unfilteredHits = unfilteredHits; + } + //================================================================================================= // methods diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java new file mode 100644 index 000000000..a63fad9d1 --- /dev/null +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java @@ -0,0 +1,114 @@ +package eu.arrowhead.core.deviceregistry; + +import eu.arrowhead.common.ApplicationInitListener; +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreDefaults; +import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.database.service.CommonDBService; +import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.common.exception.DataNotFoundException; +import eu.arrowhead.core.deviceregistry.database.service.DeviceRegistryDBService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.context.event.ContextRefreshedEvent; +import org.springframework.stereotype.Component; + +import java.util.Base64; +import java.util.List; +import java.util.Map; + +@Component +public class DeviceRegistryApplicationInitListener extends ApplicationInitListener +{ + + //================================================================================================= + // members + + private final CommonDBService commonDBService; + private final DeviceRegistryDBService deviceRegistryDBService; + + @Autowired + public DeviceRegistryApplicationInitListener(final CommonDBService commonDBService, + final DeviceRegistryDBService deviceRegistryDBService) + { + this.commonDBService = commonDBService; + this.deviceRegistryDBService = deviceRegistryDBService; + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + @Override + protected void customInit(final ContextRefreshedEvent event) + { + logger.debug("customInit started..."); + if (!isOwnCloudRegistered()) + { + registerOwnCloud(event.getApplicationContext()); + } + + try + { + final String name = coreSystemRegistrationProperties.getCoreSystem().name().toLowerCase(); + final List oldSystems = deviceRegistryDBService.getSystemByName(name); + if (!oldSystems.isEmpty()) + { + for (final System system : oldSystems) + { + deviceRegistryDBService.removeSystemById(system.getId()); + } + } + + final String authInfo = sslProperties.isSslEnabled() ? Base64.getEncoder().encodeToString(publicKey.getEncoded()) : null; + deviceRegistryDBService.createSystem(name, + coreSystemRegistrationProperties.getCoreSystemDomainName(), + coreSystemRegistrationProperties.getCoreSystemDomainPort(), + authInfo); + } + catch (final ArrowheadException ex) + { + logger.error("Can't registrate {} as a system.", coreSystemRegistrationProperties.getCoreSystem().name()); + logger.debug("Stacktrace", ex); + } + } + + //------------------------------------------------------------------------------------------------- + private boolean isOwnCloudRegistered() + { + logger.debug("isOwnCloudRegistered started..."); + try + { + commonDBService.getOwnCloud(sslProperties.isSslEnabled()); + return true; + } + catch (final DataNotFoundException ex) + { + return false; + } + } + + //------------------------------------------------------------------------------------------------- + private void registerOwnCloud(final ApplicationContext appContext) + { + logger.debug("registerOwnCloud started..."); + + if (!standaloneMode) + { + String name = CoreDefaults.DEFAULT_OWN_CLOUD_NAME; + String operator = CoreDefaults.DEFAULT_OWN_CLOUD_OPERATOR; + + if (sslProperties.isSslEnabled()) + { + @SuppressWarnings("unchecked") final Map context = appContext.getBean(CommonConstants.ARROWHEAD_CONTEXT, Map.class); + final String serverCN = (String) context.get(CommonConstants.SERVER_COMMON_NAME); + final String[] serverFields = serverCN.split("\\."); + name = serverFields[1]; + operator = serverFields[2]; + } + + commonDBService.insertOwnCloud(operator, name, sslProperties.isSslEnabled(), null); + logger.info("{}.{} own cloud is registered in {} mode.", name, operator, getModeString()); + } + } +} \ No newline at end of file diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java new file mode 100644 index 000000000..22ec1b59f --- /dev/null +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java @@ -0,0 +1,852 @@ +package eu.arrowhead.core.deviceregistry; + +import eu.arrowhead.common.*; +import eu.arrowhead.common.core.CoreDevice; +import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; +import eu.arrowhead.common.dto.internal.DeviceRegistryListResponseDTO; +import eu.arrowhead.common.dto.shared.*; +import eu.arrowhead.common.exception.BadPayloadException; +import eu.arrowhead.core.deviceregistry.database.service.DeviceRegistryDBService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.apache.http.HttpStatus; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; + +import java.time.format.DateTimeParseException; +import java.util.Objects; + +@Api(tags = {CoreCommonConstants.SWAGGER_TAG_ALL}) +@CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, + allowedHeaders = {HttpHeaders.ORIGIN, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT, HttpHeaders.AUTHORIZATION} +) +@RestController +@RequestMapping(CommonConstants.DEVICE_REGISTRY_URI) +public class DeviceRegistryController +{ + + //================================================================================================= + // members + + private static final String GET_SYSTEM_BY_ID_HTTP_200_MESSAGE = "Device by requested id returned"; + private static final String GET_SYSTEM_BY_ID_HTTP_400_MESSAGE = "No Such Device by requested id"; + private static final String PATH_VARIABLE_ID = "id"; + private static final String GET_DEVICES_HTTP_200_MESSAGE = "Devices returned"; + private static final String GET_DEVICES_HTTP_400_MESSAGE = " Invalid parameters"; + private static final String POST_SYSTEM_HTTP_201_MESSAGE = "Device created"; + private static final String POST_SYSTEM_HTTP_400_MESSAGE = "Could not create device"; + private static final String PUT_SYSTEM_HTTP_200_MESSAGE = "Device updated"; + private static final String PUT_SYSTEM_HTTP_400_MESSAGE = "Could not update device"; + private static final String PATCH_SYSTEM_HTTP_200_MESSAGE = "Device updated"; + private static final String PATCH_SYSTEM_HTTP_400_MESSAGE = "Could not update device"; + private static final String DELETE_SYSTEM_HTTP_200_MESSAGE = "Device deleted"; + private static final String DELETE_SYSTEM_HTTP_400_MESSAGE = "Could not delete device"; + + private static final String GET_DEVICE_BY_ID_HTTP_200_MESSAGE = "Device by requested id returned"; + private static final String GET_DEVICE_BY_ID_HTTP_400_MESSAGE = "No Such Device by requested id"; + private static final String DEVICE_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/device/{" + PATH_VARIABLE_ID + "}"; + private static final String DEVICES_URI = CoreCommonConstants.MGMT_URI + "/devices"; + private static final String DEVICES_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/devices/{" + PATH_VARIABLE_ID + "}"; + + private static final String POST_DEVICE_HTTP_201_MESSAGE = "Device created"; + private static final String POST_DEVICE_HTTP_400_MESSAGE = "Could not create device"; + private static final String PUT_DEVICE_HTTP_200_MESSAGE = "Device updated"; + private static final String PUT_DEVICE_HTTP_400_MESSAGE = "Could not update device"; + + private static final String DELETE_DEVICES_HTTP_200_MESSAGE = "Device definition removed"; + private static final String DELETE_DEVICES_HTTP_400_MESSAGE = "Could not remove device definition"; + + private static final String SYSTEM_REGISTRY_REGISTER_DESCRIPTION = "Registers a device"; + private static final String SYSTEM_REGISTRY_REGISTER_201_MESSAGE = "Device registered"; + private static final String SYSTEM_REGISTRY_REGISTER_400_MESSAGE = "Could not register device"; + private static final String SYSTEM_REGISTRY_UNREGISTER_DESCRIPTION = "Remove a registered device"; + private static final String SYSTEM_REGISTRY_UNREGISTER_200_MESSAGE = "Registered device removed"; + private static final String SYSTEM_REGISTRY_UNREGISTER_400_MESSAGE = "Could not remove device"; + private static final String SYSTEM_REGISTRY_QUERY_DESCRIPTION = "Return Device Registry data that fits the specification"; + private static final String SYSTEM_REGISTRY_QUERY_200_MESSAGE = "Device Registry data returned"; + private static final String SYSTEM_REGISTRY_QUERY_400_MESSAGE = "Could not query Device Registry"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_DESCRIPTION = "Return device by requested id"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_200_MESSAGE = "Device data by id returned"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_400_MESSAGE = "Could not query Device Registry by Consumer device id"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_DESCRIPTION = "Return Device by requested dto"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_200_MESSAGE = "Consumer Device data by requestDTO returned"; + private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_400_MESSAGE = "Could not query Device Registry by Consumer device requestDTO"; + private static final String SYSTEM_REGISTRY_UPDATE_DESCRIPTION = "Update a device"; + private static final String SYSTEM_REGISTRY_UPDATE_200_MESSAGE = "Device updated"; + private static final String SYSTEM_REGISTRY_UPDATE_400_MESSAGE = "Could not update device"; + private static final String SYSTEM_REGISTRY_MERGE_DESCRIPTION = "Merge/Patch a device"; + private static final String SYSTEM_REGISTRY_MERGE_200_MESSAGE = "Device merged"; + private static final String SYSTEM_REGISTRY_MERGE_400_MESSAGE = "Could not merge device"; + + private static final String ID_NOT_VALID_ERROR_MESSAGE = "Id must be greater than 0. "; + private static final String SYSTEM_NAME_NULL_ERROR_MESSAGE = " Device name must have value "; + private static final String SYSTEM_ADDRESS_NULL_ERROR_MESSAGE = " Device address must have value "; + private static final String SYSTEM_PORT_NULL_ERROR_MESSAGE = " Device port must have value "; + + private static final String DEVICE_NAME_NULL_ERROR_MESSAGE = " Device name must have value "; + private static final String DEVICE_ADDRESS_NULL_ERROR_MESSAGE = " Device address must have value "; + private static final String DEVICE_MAC_ADDRESS_NULL_ERROR_MESSAGE = " Device MAC address must have value "; + + private static final String SYSTEM_REGISTRY_MGMT_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/{" + PATH_VARIABLE_ID + "}"; + private static final String PATH_VARIABLE_SYSTEM_NAME = "systenName"; + private static final String SYSTEM_REGISTRY_MGMT_BY_SYSTEM_NAME_URI = CoreCommonConstants.MGMT_URI + "/systemname" + "/{" + PATH_VARIABLE_SYSTEM_NAME + "}"; + private static final String GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE = "Device Registry entries returned"; + private static final String GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE = "Could not retrieve device registry entries"; + private static final String DELETE_SYSTEM_REGISTRY_HTTP_200_MESSAGE = "Device Registry entry removed"; + private static final String DELETE_SYSTEM_REGISTRY_HTTP_400_MESSAGE = "Could not remove device registry entry"; + + private final Logger logger = LogManager.getLogger(DeviceRegistryController.class); + + private final DeviceRegistryDBService deviceRegistryDBService; + + @Autowired + public DeviceRegistryController(final DeviceRegistryDBService deviceRegistryDBService) { + this.deviceRegistryDBService = deviceRegistryDBService; + } + + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return an echo message with the purpose of testing the core device availability", response = String.class, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = CoreCommonConstants.SWAGGER_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CommonConstants.ECHO_URI) + public String echoDevice() { + return "Got it!"; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return device by id", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_BY_ID_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_BY_ID_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(SYSTEM_BY_ID_URI) + @ResponseBody + public DeviceResponseDTO getDeviceById(@PathVariable(value = PATH_VARIABLE_ID) final long systemId) { + logger.debug("getDeviceById started ..."); + + if (systemId < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + SYSTEM_BY_ID_URI); + } + + return deviceRegistryDBService.getDeviceById(systemId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return systems by request parameters", response = DeviceListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICES_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICES_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(DEVICES_URI) + @ResponseBody + public DeviceListResponseDTO getDevices( + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("getDevices started ..."); + + final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); + return deviceRegistryDBService.getDeviceEntries(pageParameters, sortField); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return created device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_SYSTEM_HTTP_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = DEVICES_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(org.springframework.http.HttpStatus.CREATED) + @ResponseBody + public DeviceResponseDTO addDevice(@RequestBody final DeviceRequestDTO request) { + return callCreateDevice(request); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return updated device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = PUT_SYSTEM_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PutMapping(path = DEVICES_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public DeviceResponseDTO updateDevice(@PathVariable(value = PATH_VARIABLE_ID) final long systemId, @RequestBody final DeviceRequestDTO request) { + return callUpdateDevice(request, systemId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return device updated by fields", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = PATCH_SYSTEM_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PATCH_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PatchMapping(path = DEVICES_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public DeviceResponseDTO mergeDevice(@PathVariable(value = PATH_VARIABLE_ID) final long systemId, @RequestBody final DeviceRequestDTO request) { + return callMergeDevice(request, systemId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Remove device", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEM_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = DEVICES_BY_ID_URI) + public void removeDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New Device delete request received with id: {}", id); + + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_BY_ID_URI); + } + + deviceRegistryDBService.removeDeviceById(id); + logger.debug("Device with id: '{}' successfully deleted", id); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return device by id", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_BY_ID_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_BY_ID_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(DEVICES_BY_ID_URI) + @ResponseBody + public DeviceResponseDTO getDeviceById(@PathVariable(value = PATH_VARIABLE_ID) final long deviceId) { + logger.debug("getDeviceById started ..."); + + if (deviceId < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + SYSTEM_BY_ID_URI); + } + + return deviceRegistryDBService.getDeviceById(deviceId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested device by the given parameters", response = DeviceListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICES_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICES_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = DEVICES_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public DeviceListResponseDTO getDeviceListByRequestParameters( + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("New DeviceList get request received with page: {} and item_per page: {}", page, size); + + final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); + final DeviceListResponseDTO deviceListResponseDTO = deviceRegistryDBService.getDeviceEntries(pageParameters, sortField); + logger.debug("DeviceList with page: {} and item_per page: {} successfully retrieved", page, size); + + return deviceListResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return created device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_DEVICE_HTTP_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_DEVICE_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = DEVICES_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) + @ResponseBody + public DeviceResponseDTO addDevice(@RequestBody final DeviceRequestDTO dto) { + logger.debug("New device registration request received with name: {}", dto.getDeviceName()); + + validateDevice(dto); + + final DeviceResponseDTO responseDTO = deviceRegistryDBService.createDeviceDto(dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); + logger.debug("{} successfully registered.", responseDTO); + + return responseDTO; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return updated device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = PUT_DEVICE_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_DEVICE_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PutMapping(path = DEVICE_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public DeviceResponseDTO putUpdateDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id, + @RequestBody final DeviceRequestDTO dto) { + logger.debug("New device update request received with id: {}, definition: {}", id, dto); + + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICE_BY_ID_URI); + } + + validateDevice(dto); + + final DeviceResponseDTO deviceResponseDTO = deviceRegistryDBService + .updateDeviceByIdResponse(id, dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); + logger.debug("Device with id: '{}' successfully updated with definition '{}'.", id, deviceResponseDTO); + + return deviceResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Remove device", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_DEVICES_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_DEVICES_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = DEVICE_BY_ID_URI) + public void removeDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New Device Definition delete request received with id: {}", id); + + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICE_BY_ID_URI); + } + + deviceRegistryDBService.removeDeviceById(id); + logger.debug("Device with id: '{}' successfully deleted", id); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested device registry entries by the given parameters", response = DeviceRegistryListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CoreCommonConstants.MGMT_URI) + @ResponseBody + public DeviceRegistryListResponseDTO getDeviceRegistryEntries( + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("New Device Registry get request received with page: {} and item_per page: {}", page, size); + + final CoreUtilities.ValidatedPageParams params = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.DEVICE_REGISTRY_URI + CoreCommonConstants.MGMT_URI); + final DeviceRegistryListResponseDTO systemRegistryEntriesResponse = deviceRegistryDBService + .getDeviceRegistryEntries(params, sortField); + logger.debug("Device Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); + + return systemRegistryEntriesResponse; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested device registry entry", response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI) + @ResponseBody + public DeviceRegistryResponseDTO getDeviceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New Device Registry get request received with id: {}", id); + + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_ID_URI); + } + final DeviceRegistryResponseDTO systemRegistryEntryByIdResponse = deviceRegistryDBService.getDeviceRegistryById(id); + logger.debug("Device Registry entry with id: {} successfully retrieved", id); + + return systemRegistryEntryByIdResponse; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested device registry entries by device definition based on the given parameters", response = DeviceRegistryListResponseDTO.class, + tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = SYSTEM_REGISTRY_MGMT_BY_SYSTEM_NAME_URI) + @ResponseBody + public DeviceRegistryListResponseDTO getDeviceRegistryEntriesByDeviceName( + @PathVariable(value = PATH_VARIABLE_SYSTEM_NAME) final String systemName, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("New Device Registry get by Device Definition request received with page: {} and item_per page: {}", page, size); + + final String origin = CommonConstants.DEVICE_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_SYSTEM_NAME_URI; + if (Utilities.isEmpty(systemName)) { + throw new BadPayloadException("Device name cannot be empty.", HttpStatus.SC_BAD_REQUEST, origin); + } + + final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, origin); + final DeviceRegistryListResponseDTO systemRegistryEntries = deviceRegistryDBService + .getDeviceRegistryEntriesByDeviceName(systemName, pageParameters, sortField); + logger.debug("Device Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); + + return systemRegistryEntries; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Remove the specified device registry entry", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEM_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEM_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI) + public void removeDeviceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New Device Registry delete request received with id: {}", id); + + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_ID_URI); + } + + deviceRegistryDBService.removeDeviceRegistryEntryById(id); + logger.debug("Device Registry with id: '{}' successfully deleted", id); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_REGISTER_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = SYSTEM_REGISTRY_REGISTER_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_REGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) + @PostMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public DeviceRegistryResponseDTO registerDevice(@RequestBody final DeviceRegistryRequestDTO request) { + logger.debug("New device registration request received"); + checkDeviceRegistryRequest(request, false); + + final DeviceRegistryResponseDTO response = deviceRegistryDBService.registerDeviceRegistry(request); + logger.debug("{} successfully registers its device {}", request.getDevice().getDeviceName(), request.getDevice()); + + return response; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_REGISTER_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = SYSTEM_REGISTRY_REGISTER_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_REGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) + @PostMapping(path = CoreCommonConstants.MGMT_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody + DeviceRegistryResponseDTO addDeviceRegistry(@RequestBody final DeviceRegistryRequestDTO request) { + logger.debug("New device registration request received"); + checkDeviceRegistryRequest(request, CoreCommonConstants.MGMT_URI, true); + + final DeviceRegistryResponseDTO response = deviceRegistryDBService.registerDeviceRegistry(request); + logger.debug("{}'s device {} is successfully registered", request.getDevice().getDeviceName(), request.getDevice()); + + return response; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_UPDATE_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_UPDATE_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_UPDATE_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PutMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody + DeviceRegistryResponseDTO updateDeviceRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final DeviceRegistryRequestDTO request) { + logger.debug("New device registry update request received"); + checkDeviceRegistryUpdateRequest(id, request, CoreCommonConstants.MGMT_URI); + + final DeviceRegistryResponseDTO response = deviceRegistryDBService.updateDeviceRegistryById(id, request); + logger.debug("Device Registry entry {} is successfully updated with device {} and device {}", id, request.getDevice().getDeviceName(), request.getDevice()); + + return response; + } + + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_MERGE_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_MERGE_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_MERGE_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PatchMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody + DeviceRegistryResponseDTO mergeDeviceRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final DeviceRegistryRequestDTO request) { + logger.debug("New device registry merge request received"); + checkDeviceRegistryMergeRequest(id, request, CoreCommonConstants.MGMT_URI); + + final DeviceRegistryResponseDTO response = deviceRegistryDBService.mergeDeviceRegistryById(id, request); + logger.debug("Device Registry entry {} is successfully merged witch device {} and device {}", id, response.getDevice(), request.getDevice()); + + return response; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_UNREGISTER_DESCRIPTION, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_UNREGISTER_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_UNREGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_URI) + public void unregisterDevice(@RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_SYSTEM_NAME) final String systemName, + @RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_ADDRESS) final String address, + @RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_PORT) final int port) { + logger.debug("Device removal request received"); + checkUnregisterDeviceParameters(systemName, address, port); + + deviceRegistryDBService.removeDeviceRegistryByNameAndAddressAndPort(systemName, address, port); + logger.debug("{} successfully removed", systemName); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_QUERY_DESCRIPTION, response = DeviceQueryResultDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_QUERY_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_QUERY_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_QUERY_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public DeviceQueryResultDTO queryRegistry(@RequestBody final DeviceQueryFormDTO form) { + logger.debug("Device query request received"); + + if (Utilities.isEmpty(form.getDeviceNameRequirements())) { + throw new BadPayloadException("Device definition requirement is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + + CommonConstants.OP_SYSTEM_REGISTRY_QUERY_URI); + } + + final DeviceQueryResultDTO result = deviceRegistryDBService.queryRegistry(form); + logger.debug("Return {} providers for device {}", result.getDeviceQueryData().size(), form.getDeviceNameRequirements()); + + return result; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_DESCRIPTION, response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_PRIVATE}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public DeviceResponseDTO queryRegistryByDeviceId(@PathVariable(value = PATH_VARIABLE_ID) final long systemId) { + logger.debug("Device query by device id request received"); + + if (systemId < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + + CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI); + } + + final DeviceResponseDTO result = deviceRegistryDBService.getDeviceById(systemId); + + logger.debug("Return device by id: {}", systemId); + return result; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_DESCRIPTION, response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_PRIVATE}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public DeviceResponseDTO queryRegistryByDeviceDTO(@RequestBody final DeviceRequestDTO request) { + logger.debug("Device query by systemRequestDTO request received"); + + checkDeviceRequest(request, CommonConstants.DEVICE_REGISTRY_URI + CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI, false); + + final String systemName = request.getDeviceName(); + final String address = request.getAddress(); + final int port = request.getPort(); + + final DeviceResponseDTO result = deviceRegistryDBService.getDeviceDtoByNameAndAddressAndPort(systemName, address, port); + + logger.debug("Return device by name: {}, address: {}, port: {}", systemName, address, port); + return result; + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private DeviceResponseDTO callCreateDevice(final DeviceRequestDTO request) { + logger.debug("callCreateDevice started..."); + + checkDeviceRequest(request, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI, true); + + final String systemName = request.getDeviceName(); + final String address = request.getAddress(); + final int port = request.getPort(); + final String authenticationInfo = request.getAuthenticationInfo(); + + return deviceRegistryDBService.createDeviceDto(systemName, address, port, authenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private DeviceResponseDTO callUpdateDevice(final DeviceRequestDTO request, final long systemId) { + logger.debug("callUpdateDevice started..."); + + checkDevicePutRequest(request, systemId); + + final String validatedDeviceName = request.getDeviceName().toLowerCase(); + final String validatedAddress = request.getAddress().toLowerCase(); + final int validatedPort = request.getPort(); + final String validatedAuthenticationInfo = request.getAuthenticationInfo(); + + return deviceRegistryDBService.updateDeviceDto(systemId, validatedDeviceName, validatedAddress, validatedPort, validatedAuthenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private DeviceResponseDTO callMergeDevice(final DeviceRequestDTO request, final long systemId) { + logger.debug("callMergeDevice started..."); + + checkDeviceMergeRequest(request, systemId); + + final String validatedDeviceName = request.getDeviceName() != null ? request.getDeviceName().toLowerCase() : ""; + final String validatedAddress = request.getAddress() != null ? request.getAddress().toLowerCase() : ""; + final Integer validatedPort = request.getPort(); + final String validatedAuthenticationInfo = request.getAuthenticationInfo(); + + return deviceRegistryDBService.mergeDeviceResponse(systemId, validatedDeviceName, validatedAddress, validatedPort, validatedAuthenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private void checkDeviceMergeRequest(final DeviceRequestDTO request, final long systemId) { + logger.debug("checkDevicePatchRequest started..."); + final String origin = CommonConstants.DEVICE_REGISTRY_URI + DEVICES_BY_ID_URI; + + if (systemId <= 0) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_BY_ID_URI); + } + + boolean needChange = false; + if (!Utilities.isEmpty(request.getAddress())) { + needChange = true; + } + + + if (!Utilities.isEmpty(request.getDeviceName())) { + needChange = true; + for (final CoreDevice coreSysteam : CoreDevice.values()) { + if (coreSysteam.name().equalsIgnoreCase(request.getDeviceName().trim())) { + throw new BadPayloadException("Device name '" + request.getDeviceName() + "' is a reserved arrowhead core device name.", HttpStatus.SC_BAD_REQUEST, origin); + } + } + } + + if (request.getPort() != null) { + final int validatedPort = request.getPort(); + if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, + origin); + } + + needChange = true; + } + + if (request.getAuthenticationInfo() != null) { + needChange = true; + } + + if (!needChange) { + throw new BadPayloadException("Patch request is empty.", HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + private void checkDevicePutRequest(final DeviceRequestDTO request, final long systemId) { + logger.debug("checkDevicePutRequest started..."); + final String origin = CommonConstants.DEVICE_REGISTRY_URI + DEVICES_BY_ID_URI; + + if (systemId <= 0) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + checkDeviceRequest(request, origin); + } + + //------------------------------------------------------------------------------------------------- + private void checkDeviceRequest(final DeviceRequestDTO request, final String origin) { + logger.debug("checkDeviceRequest started..."); + + if (request == null) { + throw new BadPayloadException("Device is null.", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(request.getDeviceName())) { + throw new BadPayloadException(DEVICE_NAME_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(request.getAddress())) { + throw new BadPayloadException(DEVICE_ADDRESS_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + if (Utilities.isEmpty(request.getMacAddress())) { + throw new BadPayloadException(DEVICE_MAC_ADDRESS_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + private void checkDeviceRegistryRequest(final DeviceRegistryRequestDTO request) { + logger.debug("checkDeviceRegistryRequest started..."); + + final String origin = CommonConstants.DEVICE_REGISTRY_URI + CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI; + checkDeviceRegistryRequest(request, origin); + } + + //------------------------------------------------------------------------------------------------- + private void checkDeviceRegistryRequest(final DeviceRegistryRequestDTO request, final String origin) { + logger.debug("checkDeviceRegistryRequest started..."); + + checkDeviceRequest(request.getDevice(), origin); + + if (!Utilities.isEmpty(request.getEndOfValidity())) { + try { + Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()); + } catch (final DateTimeParseException ex) { + throw new BadPayloadException("End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", + HttpStatus.SC_BAD_REQUEST, origin); + } + } + } + + //------------------------------------------------------------------------------------------------- + private void checkUnregisterDeviceParameters(final String systemName, final String address, final int port) { + // parameters can't be null, but can be empty + logger.debug("checkUnregisterDeviceParameters started..."); + + final String origin = CommonConstants.DEVICE_REGISTRY_URI + CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_URI; + + if (Utilities.isEmpty(systemName)) { + throw new BadPayloadException("Name of the device is blank", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(address)) { + throw new BadPayloadException("Address of the device is blank", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + private void checkDeviceRegistryUpdateRequest(final long id, final DeviceRegistryRequestDTO request, final String origin) { + logger.debug("checkDeviceRegistryUpdateRequest started..."); + + if (id <= 0) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + checkDeviceRegistryRequest(request, origin); + + } + + //------------------------------------------------------------------------------------------------- + private void validateDevice(@RequestBody final DeviceRequestDTO deviceRequestDto) { + if (Utilities.isEmpty(deviceRequestDto.getDeviceName())) { + throw new BadPayloadException("Device name is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); + } + + if (Utilities.isEmpty(deviceRequestDto.getAddress())) { + throw new BadPayloadException("Device address is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); + } + + if (Utilities.isEmpty(deviceRequestDto.getMacAddress())) { + throw new BadPayloadException("Device MAC address is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); + } + } + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings("squid:S3776") + private void checkDeviceRegistryMergeRequest(final long id, final DeviceRegistryRequestDTO request, final String origin) { + logger.debug("checkDeviceRegistryMergeRequest started..."); + + if (id <= 0) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + boolean needChange = false; + + if (Objects.nonNull(request.getDevice())) { + final DeviceRequestDTO device = request.getDevice(); + + if (Utilities.notEmpty(device.getDeviceName())) { + needChange = true; + } else if (Utilities.notEmpty(device.getAddress())) { + needChange = true; + } else if (Utilities.notEmpty(device.getMacAddress())) { + needChange = true; + } else if (Utilities.notEmpty(device.getAuthenticationInfo())) { + needChange = true; + } + } + + if (request.getEndOfValidity() != null) { + needChange = true; + } + + if (request.getMetadata() != null) { + needChange = true; + } + + if (request.getVersion() <= 0) { + needChange = true; + } + + if (!needChange) { + throw new BadPayloadException("Patch request is empty.", HttpStatus.SC_BAD_REQUEST, origin); + } + } +} \ No newline at end of file diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryMain.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryMain.java index 6725ca7c1..9facd3222 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryMain.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryMain.java @@ -11,8 +11,7 @@ import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import springfox.documentation.swagger2.annotations.EnableSwagger2; -@SpringBootApplication -@ComponentScan(CommonConstants.BASE_PACKAGE) +@SpringBootApplication(scanBasePackages = CommonConstants.BASE_PACKAGE) @EntityScan(CoreCommonConstants.DATABASE_ENTITY_PACKAGE) @EnableJpaRepositories(basePackages = CoreCommonConstants.DATABASE_REPOSITORY_PACKAGE, repositoryBaseClass = RefreshableRepositoryImpl.class) @EnableSwagger2 diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java new file mode 100644 index 000000000..2b083c0ee --- /dev/null +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java @@ -0,0 +1,1299 @@ +package eu.arrowhead.core.deviceregistry.database.service; + +import eu.arrowhead.common.*; +import eu.arrowhead.common.database.entity.Device; +import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.database.entity.SystemRegistry; +import eu.arrowhead.common.database.repository.DeviceRegistryRepository; +import eu.arrowhead.common.database.repository.DeviceRepository; +import eu.arrowhead.common.database.repository.SystemRegistryRepository; +import eu.arrowhead.common.database.repository.SystemRepository; +import eu.arrowhead.common.dto.internal.DTOConverter; +import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; +import eu.arrowhead.common.dto.internal.SystemListResponseDTO; +import eu.arrowhead.common.dto.internal.SystemRegistryListResponseDTO; +import eu.arrowhead.common.dto.shared.*; +import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.common.exception.InvalidParameterException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.Assert; + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.time.ZonedDateTime; +import java.time.format.DateTimeParseException; +import java.util.*; + +@Service +public class DeviceRegistryDBService +{ + + //================================================================================================= + // members + + private static final String COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE = "Could not delete System, with given parameters"; + private static final String COULD_NOT_DELETE_DEVICE_ERROR_MESSAGE = "Could not delete Device, with given parameters"; + private static final String PORT_RANGE_ERROR_MESSAGE = "Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + "."; + + private final Logger logger = LogManager.getLogger(DeviceRegistryDBService.class); + + private final DeviceRegistryRepository deviceRegistryRepository; + + private final SystemRegistryRepository systemRegistryRepository; + + private final SystemRepository systemRepository; + + private final DeviceRepository deviceRepository; + + private final SSLProperties sslProperties; + + @Value(CoreCommonConstants.$SYSTEM_REGISTRY_PING_TIMEOUT_WD) + private int pingTimeout; + + @Autowired + public DeviceRegistryDBService(final DeviceRegistryRepository deviceRegistryRepository, + final SystemRegistryRepository systemRegistryRepository, + final SystemRepository systemRepository, + final DeviceRepository deviceRepository, + final SSLProperties sslProperties) + { + this.deviceRegistryRepository = deviceRegistryRepository; + this.systemRegistryRepository = systemRegistryRepository; + this.systemRepository = systemRepository; + this.deviceRepository = deviceRepository; + this.sslProperties = sslProperties; + } + + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public SystemResponseDTO getSystemById(final long systemId) + { + logger.debug("getSystemById started..."); + + try + { + final Optional systemOption = systemRepository.findById(systemId); + if (systemOption.isEmpty()) + { + throw new InvalidParameterException("System with id " + systemId + " not found."); + } + + return DTOConverter.convertSystemToSystemResponseDTO(systemOption.get()); + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + + //------------------------------------------------------------------------------------------------- + public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) + { + logger.debug("getSystemEntries started..."); + + final int validatedPage = pageParams.getValidatedPage(); + final int validatedSize = pageParams.getValidatedSize(); + final Sort.Direction validatedDirection = pageParams.getValidatedDirection(); + final String validatedSortField = Utilities.isEmpty(sortField) ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); + + if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) + { + throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); + } + + try + { + return DTOConverter.convertSystemEntryListToSystemListResponseDTO( + systemRepository.findAll(PageRequest.of(validatedPage, validatedSize, validatedDirection, validatedSortField))); + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemResponseDTO createSystemDto(final String systemName, final String address, final int port, final String authenticationInfo) + { + logger.debug("createSystemResponse started..."); + + return DTOConverter.convertSystemToSystemResponseDTO(createSystem(systemName, address, port, authenticationInfo)); + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemResponseDTO updateSystemDto(final long systemId, final String systemName, final String address, final int port, + final String authenticationInfo) + { + logger.debug("updateSystemResponse started..."); + + return DTOConverter.convertSystemToSystemResponseDTO(updateSystem(systemId, systemName, address, port, authenticationInfo)); + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public System updateSystem(final long systemId, final String systemName, final String address, final int port, final String authenticationInfo) + { + logger.debug("updateSystem started..."); + + final long validatedSystemId = validateId(systemId); + final int validatedPort = validateSystemPort(port); + final String validatedSystemName = validateParamString(systemName); + if (validatedSystemName.contains(".")) + { + throw new InvalidParameterException("System name can't contain dot (.)"); + } + final String validatedAddress = validateParamString(address); + + + try + { + final Optional systemOptional = systemRepository.findById(validatedSystemId); + if (systemOptional.isEmpty()) + { + throw new InvalidParameterException("No system with id : " + validatedSystemId); + } + + final System system = systemOptional.get(); + + if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) + { + checkConstraintsOfSystemTable(validatedSystemName, validatedAddress, validatedPort); + } + + system.setSystemName(validatedSystemName); + system.setAddress(validatedAddress); + system.setPort(validatedPort); + system.setAuthenticationInfo(authenticationInfo); + + return systemRepository.saveAndFlush(system); + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public void removeSystemById(final long id) + { + logger.debug("removeSystemById started..."); + + try + { + if (!systemRepository.existsById(id)) + { + throw new InvalidParameterException(COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE); + } + + systemRepository.deleteById(id); + systemRepository.flush(); + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemResponseDTO mergeSystemResponse(final long systemId, final String systemName, final String address, final Integer port, + final String authenticationInfo) + { + logger.debug("mergeSystemResponse started..."); + + return DTOConverter.convertSystemToSystemResponseDTO(mergeSystem(systemId, systemName, address, port, authenticationInfo)); + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public System mergeSystem(final long systemId, final String systemName, final String address, final Integer port, final String authenticationInfo) + { + logger.debug("mergeSystem started..."); + + final long validatedSystemId = validateId(systemId); + final Integer validatedPort = validateAllowNullSystemPort(port); + final String validatedSystemName = validateAllowNullParamString(systemName); + if (validatedSystemName != null && validatedSystemName.contains(".")) + { + throw new InvalidParameterException("System name can't contain dot (.)"); + } + final String validatedAddress = validateAllowNullParamString(address); + + try + { + final Optional systemOptional = systemRepository.findById(validatedSystemId); + if (systemOptional.isEmpty()) + { + throw new InvalidParameterException("No system with id : " + validatedSystemId); + } + + final System system = systemOptional.get(); + + if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) + { + checkConstraintsOfSystemTable(validatedSystemName != null ? validatedSystemName : system.getSystemName(), + validatedAddress != null ? validatedAddress : system.getAddress(), + validatedPort != null ? validatedPort : system.getPort()); + } + + if (Utilities.notEmpty(validatedSystemName)) + { + system.setSystemName(validatedSystemName); + } + + if (Utilities.notEmpty(validatedAddress)) + { + system.setAddress(validatedAddress); + } + + if (validatedPort != null) + { + system.setPort(validatedPort); + } + + if (Utilities.notEmpty(authenticationInfo)) + { + system.setAuthenticationInfo(authenticationInfo); + } + + return systemRepository.saveAndFlush(system); + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + + //------------------------------------------------------------------------------------------------- + public DeviceResponseDTO getDeviceById(long deviceId) + { + logger.debug("getDeviceById started..."); + + try + { + final Optional deviceOptional = deviceRepository.findById(deviceId); + if (deviceOptional.isEmpty()) + { + throw new InvalidParameterException("Device with id " + deviceId + " not found."); + } + + return DTOConverter.convertDeviceToDeviceResponseDTO(deviceOptional.get()); + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) + { + logger.debug("getDeviceList started..."); + + final String validatedSortField = Utilities.isEmpty(sortField) ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); + + if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) + { + throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); + } + + try + { + final Page devices = deviceRepository.findAll(PageRequest.of(pageParams.getValidatedPage(), pageParams.getValidatedSize(), + pageParams.getValidatedDirection(), validatedSortField)); + return DTOConverter.convertDeviceEntryListToDeviceListResponseDTO(devices); + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public DeviceResponseDTO createDeviceDto(final String name, final String address, final String macAddress, final String authenticationInfo) + { + return DTOConverter.convertDeviceToDeviceResponseDTO(createDevice(name, address, macAddress, authenticationInfo)); + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public DeviceResponseDTO updateDeviceByIdResponse(final long id, final String name, final String address, final String macAddress, + final String authenticationInfo) + { + + logger.debug("updateDeviceByIdResponse started..."); + + try + { + + final long validatedId = validateId(id); + final Device newDevice = validateNonNullDeviceParameters(name, address, macAddress, authenticationInfo); + + final Optional optionalDevice = deviceRepository.findById(validatedId); + final Device device = optionalDevice.orElseThrow(() -> new InvalidParameterException("No device with id : " + id)); + + device.setDeviceName(newDevice.getDeviceName()); + device.setAddress(newDevice.getAddress()); + device.setMacAddress(newDevice.getMacAddress()); + device.setAuthenticationInfo(newDevice.getAuthenticationInfo()); + + return DTOConverter.convertDeviceToDeviceResponseDTO(deviceRepository.saveAndFlush(device)); + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public void removeDeviceById(final long id) + { + logger.debug("removeDeviceById started..."); + + try + { + if (!deviceRepository.existsById(id)) + { + throw new InvalidParameterException(COULD_NOT_DELETE_DEVICE_ERROR_MESSAGE); + } + + deviceRepository.deleteById(id); + deviceRepository.flush(); + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemRegistryListResponseDTO getSystemRegistryEntries(final CoreUtilities.ValidatedPageParams params, final String sortField) + { + logger.debug("getSystemRegistryEntries started..."); + final String validatedSortField = sortField == null ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); + + if (!SystemRegistry.SORTABLE_FIELDS_BY.contains(validatedSortField)) + { + throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); + } + + try + { + final PageRequest pageRequest = PageRequest.of(params.getValidatedPage(), + params.getValidatedSize(), + params.getValidatedDirection(), + validatedSortField); + final Page systemRegistryPage = systemRegistryRepository.findAll(pageRequest); + return DTOConverter.convertSystemRegistryListToSystemRegistryListResponseDTO(systemRegistryPage); + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemRegistryResponseDTO getSystemRegistryById(final long id) + { + logger.debug("getSystemRegistryById started..."); + + return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(getSystemRegistryEntryById(id)); + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public void removeSystemRegistryEntryById(final long id) + { + logger.debug("removeSystemRegistryEntryById started..."); + + try + { + if (!systemRegistryRepository.existsById(id)) + { + throw new InvalidParameterException("System Registry entry with id '" + id + "' does not exists"); + } + + systemRegistryRepository.deleteById(id); + systemRegistryRepository.flush(); + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemRegistryResponseDTO registerSystemRegistry(final SystemRegistryRequestDTO request) + { + logger.debug("registerSystemRegistry started..."); + checkSystemRegistryRequest(request); + + try + { + final System systemDb = findOrCreateSystem(request.getSystem()); + final Device deviceDb = findOrCreateDevice(request.getProvider()); + + final ZonedDateTime endOfValidity = getZonedDateTime(request); + final String metadataStr = Utilities.map2Text(request.getMetadata()); + final int version = (request.getVersion() != null) ? request.getVersion() : 1; + final SystemRegistry srEntry = createSystemRegistry(systemDb, deviceDb, endOfValidity, metadataStr, version); + + return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(srEntry); + } + catch (final DateTimeParseException ex) + { + logger.debug(ex.getMessage(), ex); + throw new InvalidParameterException( + "End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemRegistryResponseDTO updateSystemRegistryById(final long id, final SystemRegistryRequestDTO request) + { + logger.debug("updateSystemRegistryById started..."); + + Assert.isTrue(0 < id, "id is not greater than zero"); + checkSystemRegistryRequest(request); + + try + { + final SystemRegistry srEntry; + final SystemRegistry updateSrEntry; + + final Optional srEntryOptional = systemRegistryRepository.findById(id); + srEntry = srEntryOptional.orElseThrow(() -> new InvalidParameterException("System Registry entry with id '" + id + "' not exists")); + + final System systemDb = findOrCreateSystem(request.getSystem()); + final Device deviceDb = findOrCreateDevice(request.getProvider()); + + final ZonedDateTime endOfValidity = getZonedDateTime(request); + final String metadataStr = Utilities.map2Text(request.getMetadata()); + final int version = (request.getVersion() != null) ? request.getVersion() : 1; + updateSrEntry = updateSystemRegistry(srEntry, systemDb, deviceDb, endOfValidity, metadataStr, version); + + return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(updateSrEntry); + } + catch (final DateTimeParseException ex) + { + logger.debug(ex.getMessage(), ex); + throw new InvalidParameterException( + "End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemRegistryResponseDTO mergeSystemRegistryById(final long id, final SystemRegistryRequestDTO request) + { + + logger.debug("mergeSystemRegistryById started..."); + Assert.notNull(request, "request is null."); + Assert.isTrue(0 < id, "id is not greater than zero"); + + try + { + final SystemRegistry srEntry; + final SystemRegistry updateSrEntry; + + final Optional srEntryOptional = systemRegistryRepository.findById(id); + srEntry = srEntryOptional.orElseThrow(() -> new InvalidParameterException("System Registry entry with id '" + id + "' not exists")); + + final System systemDb = mergeSystem(request.getSystem(), srEntry.getSystem()); + final Device deviceDb = mergeDevice(request.getProvider(), srEntry.getDevice()); + + final ZonedDateTime endOfValidity = Utilities.notEmpty(request.getEndOfValidity()) ? + Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()) : + srEntry.getEndOfValidity(); + + final String validatedMetadataStr = Objects.nonNull(request.getMetadata()) ? + Utilities.map2Text(request.getMetadata()) : + srEntry.getMetadata(); + + final int validatedVersion = (request.getVersion() != null) ? request.getVersion() : srEntry.getVersion(); + + updateSrEntry = updateSystemRegistry(srEntry, systemDb, deviceDb, endOfValidity, validatedMetadataStr, validatedVersion); + + return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(updateSrEntry); + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final DateTimeParseException ex) + { + logger.debug(ex.getMessage(), ex); + throw new InvalidParameterException( + "End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemRegistryListResponseDTO getSystemRegistryEntriesBySystemName(final String systemName, final CoreUtilities.ValidatedPageParams pageParameters, + final String sortField) + { + logger.debug("getSystemRegistryEntriesBySystemName is started..."); + + if (!System.SORTABLE_FIELDS_BY.contains(sortField)) + { + throw new InvalidParameterException("Sortable field with reference '" + sortField + "' is not available"); + } + + final List systemList = systemRepository.findBySystemName(systemName); + final PageRequest pageRequest = PageRequest.of(pageParameters.getValidatedPage(), pageParameters.getValidatedSize(), + pageParameters.getValidatedDirection(), sortField); + + final Page systemRegistries = systemRegistryRepository.findAllBySystem(systemList, pageRequest); + return DTOConverter.convertSystemRegistryListToSystemRegistryListResponseDTO(systemRegistries); + } + + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public void removeSystemRegistryByNameAndAddressAndPort(final String systemName, final String address, final int port) + { + logger.debug("removeSystemRegistryByNameAndAddressAndPort is started..."); + final System system = getSystemByNameAndAddressAndPort(systemName, address, port); + + final Optional optionalSystemRegistry = systemRegistryRepository.findBySystem(system); + final SystemRegistry systemRegistry = optionalSystemRegistry.orElseThrow( + () -> new InvalidParameterException( + "System Registry entry for System with name '" + systemName + "', address '" + address + "' and port '" + port + "' does not exists")); + + systemRegistryRepository.delete(systemRegistry); + systemRegistryRepository.flush(); + } + + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemQueryResultDTO queryRegistry(final SystemQueryFormDTO form) + { + logger.debug("queryRegistry is started..."); + Assert.notNull(form, "Form is null."); + + try + { + final List systems; + final List devices; + final List registryList; + final int unfilteredHits; + + if (Utilities.notEmpty(form.getSystemNameRequirements())) + { + final String systemName = Utilities.lowerCaseTrim(form.getSystemNameRequirements()); + systems = systemRepository.findBySystemName(systemName); + + if (systems.isEmpty()) + { + // no service definition found + logger.debug("System not found: {}", systemName); + return DTOConverter.convertSystemRegistryListToSystemQueryResultDTO(Collections.emptyList()); + } + } + else + { + throw new InvalidParameterException("System Name must not be null"); + } + + registryList = systemRegistryRepository.findAllBySystem(systems); + unfilteredHits = registryList.size(); + + if (Utilities.notEmpty(form.getDeviceNameRequirements())) + { + final String deviceName = Utilities.lowerCaseTrim(form.getDeviceNameRequirements()); + devices = deviceRepository.findByDeviceName(deviceName); + + if (devices.isEmpty()) + { + // no service definition found + logger.debug("Device not found: {}", deviceName); + return DTOConverter.convertSystemRegistryListToSystemQueryResultDTO(Collections.emptyList()); + } + + registryList.removeIf(e -> !devices.contains(e.getDevice())); + } + + // filter on version + if (Objects.nonNull(form.getVersionRequirement())) + { + registryList.removeIf(e -> Objects.equals(form.getVersionRequirement(), e.getVersion())); + } + else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(form.getMaxVersionRequirement())) + { + final int minVersion = form.getMinVersionRequirement() == null ? 1 : form.getMinVersionRequirement(); + final int maxVersion = form.getMaxVersionRequirement() == null ? Integer.MAX_VALUE : form.getMaxVersionRequirement(); + + registryList.removeIf(e -> (e.getVersion() < minVersion) || (e.getVersion() > maxVersion)); + } + + // filter on metadata + if (form.getMetadataRequirements() != null && !form.getMetadataRequirements().isEmpty()) + { + final Map requiredMetadata = normalizeMetadata(form.getMetadataRequirements()); + registryList.removeIf(e -> + { + final Map metadata = Utilities.text2Map(e.getMetadata()); + if (Objects.isNull(metadata)) + { + // we have requirements but no metadata -> remove + return true; + } + + return !metadata.entrySet().containsAll(requiredMetadata.entrySet()); + }); + } + + // filter on ping + if (form.getPingProviders()) + { + filterOnPing(registryList, pingTimeout); + } + + logger.debug("Potential system providers after filtering: {}", registryList.size()); + return DTOConverter.convertListOfSystemRegistryEntriesToSystemQueryResultDTO(registryList, unfilteredHits); + } + catch (final IllegalStateException e) + { + throw new InvalidParameterException("Invalid keys in the metadata requirements (whitespace only differences)"); + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public SystemResponseDTO getSystemDtoByNameAndAddressAndPort(final String systemName, final String address, final int port) + { + final System system = getSystemByNameAndAddressAndPort(systemName, address, port); + return DTOConverter.convertSystemToSystemResponseDTO(system); + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public List getSystemByName(final String name) + { + try { + return systemRepository.findBySystemName(Utilities.lowerCaseTrim(name)); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) + { + logger.debug("createSystem started..."); + + final System system = validateNonNullSystemParameters(systemName, address, port, authenticationInfo); + + try + { + return systemRepository.saveAndFlush(system); + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //================================================================================================= + // assistant methods + //------------------------------------------------------------------------------------------------- + private System getSystemByNameAndAddressAndPort(final String systemName, final String address, final int port) + { + final Optional optionalSystem = systemRepository.findBySystemNameAndAddressAndPort(systemName, address, port); + return optionalSystem.orElseThrow(() -> new InvalidParameterException( + "System entry with name '" + systemName + "', address '" + address + "' and port '" + port + "' does not exists")); + } + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings("squid:S1126") + private boolean checkSystemIfUniqueValidationNeeded(final System system, final String validatedSystemName, final String validatedAddress, + final Integer validatedPort) + { + logger.debug("checkSystemIfUniqueValidationNeeded started..."); + + final String actualSystemName = system.getSystemName(); + final String actualAddress = system.getAddress(); + final int actualPort = system.getPort(); + + if (validatedSystemName != null && !actualSystemName.equalsIgnoreCase(validatedSystemName)) + { + return true; + } + else if (validatedAddress != null && !actualAddress.equalsIgnoreCase(validatedAddress)) + { + return true; + } + else { return validatedPort != null && actualPort != validatedPort; } + } + + //------------------------------------------------------------------------------------------------- + // This method may CHANGE the content of providedServices + private void filterOnPing(final List systems, final int timeout) + { + if (systems == null || systems.isEmpty() || timeout <= 0) + { + return; + } + + systems.removeIf(sr -> !pingService(sr.getSystem().getAddress(), sr.getSystem().getPort(), timeout)); + } + + //------------------------------------------------------------------------------------------------- + private boolean pingService(final String address, final int port, final int timeout) + { + final InetSocketAddress host = new InetSocketAddress(address, port); + try (final Socket socket = new Socket()) + { + socket.connect(host, timeout); + return true; + } + catch (final IOException ex) + { + return false; + } + } + + //------------------------------------------------------------------------------------------------- + private Map normalizeMetadata(final Map metadata) throws IllegalStateException + { + logger.debug("normalizeMetadata started..."); + if (metadata == null) + { + return Map.of(); + } + + final Map map = new HashMap<>(); + + metadata.forEach((k, v) -> + { + if (Objects.nonNull(v)) + { + map.put(k.trim(), v.trim()); + } + }); + + return map; + } + + //------------------------------------------------------------------------------------------------- + private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) + { + logger.debug("checkConstraintsOfSystemTable started..."); + + try + { + final Optional find = systemRepository + .findBySystemNameAndAddressAndPort(validatedSystemName.toLowerCase().trim(), validatedAddress.toLowerCase().trim(), validatedPort); + if (find.isPresent()) + { + throw new InvalidParameterException( + "System with name: " + validatedSystemName + ", address: " + validatedAddress + ", port: " + validatedPort + " already exists."); + } + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + private void checkConstraintsOfDeviceTable(final String validatedDeviceName, final String validatedMacAddress) + { + logger.debug("checkConstraintsOfDeviceTable started..."); + + try + { + final Optional find = deviceRepository.findByDeviceNameAndMacAddress(validatedDeviceName, validatedMacAddress); + if (find.isPresent()) + { + throw new InvalidParameterException( + "Device with name: " + validatedDeviceName + ", MAC address: " + validatedMacAddress + " already exists."); + } + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) + { + logger.debug("validateNonNullSystemParameters started..."); + + validateNonNullParameters(systemName, address); + + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) + { + throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); + } + + final String validatedSystemName = Utilities.lowerCaseTrim(systemName); + final String validatedAddress = Utilities.lowerCaseTrim(address); + + checkConstraintsOfSystemTable(validatedSystemName, validatedAddress, port); + + return new System(validatedSystemName, validatedAddress, port, authenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private Device validateNonNullDeviceParameters(final String deviceName, final String address, final String macAddress, final String authenticationInfo) + { + logger.debug("validateNonNullDeviceParameters started..."); + + validateNonNullParameters(deviceName, address); + + if (Utilities.isEmpty(macAddress)) + { + throw new InvalidParameterException("MAC address is null or empty"); + } + + final String validatedDeviceName = Utilities.lowerCaseTrim(deviceName); + final String validatedAddress = Utilities.lowerCaseTrim(address); + final String validatedMacAddress = Utilities.lowerCaseTrim(macAddress); + + checkConstraintsOfDeviceTable(validatedDeviceName, validatedMacAddress); + + return new Device(validatedDeviceName, validatedAddress, validatedMacAddress, authenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private void validateNonNullParameters(final String name, final String address) + { + logger.debug("validateNonNullParameters started..."); + + if (Utilities.isEmpty(name)) + { + throw new InvalidParameterException("Name is null or empty"); + } + + if (Utilities.isEmpty(address)) + { + throw new InvalidParameterException("Address is null or empty"); + } + + if (name.contains(".")) + { + throw new InvalidParameterException("Name can't contain dot (.)"); + } + } + + //------------------------------------------------------------------------------------------------- + private String validateParamString(final String param) + { + logger.debug("validateSystemParamString started..."); + + if (Utilities.isEmpty(param)) + { + throw new InvalidParameterException("parameter null or empty"); + } + + return Utilities.lowerCaseTrim(param); + } + + //------------------------------------------------------------------------------------------------- + private int validateSystemPort(final int port) + { + logger.debug("validateSystemPort started..."); + + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) + { + throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); + } + + return port; + } + + //------------------------------------------------------------------------------------------------- + private long validateId(final long id) + { + logger.debug("validateId started..."); + + if (id < 1) + { + throw new IllegalArgumentException("Id must be greater than zero"); + } + + return id; + } + + //------------------------------------------------------------------------------------------------- + private Integer validateAllowNullSystemPort(final Integer port) + { + logger.debug("validateAllowNullSystemPort started..."); + + if (port != null && (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX)) + { + throw new IllegalArgumentException(PORT_RANGE_ERROR_MESSAGE); + } + + return port; + } + + //------------------------------------------------------------------------------------------------- + private String validateAllowNullParamString(final String param) + { + logger.debug("validateAllowNullParamString started..."); + + if (Utilities.isEmpty(param)) + { + return null; + } + + return Utilities.lowerCaseTrim(param); + } + + + //------------------------------------------------------------------------------------------------- + private SystemRegistry getSystemRegistryEntryById(final long id) + { + logger.debug("getSystemRegistryEntryById started..."); + try + { + final Optional systemRegistry = systemRegistryRepository.findById(id); + return systemRegistry.orElseThrow(() -> new InvalidParameterException("System Registry with id of '" + id + "' not exists")); + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + private System findOrCreateSystem(SystemRequestDTO requestSystemDto) + { + return findOrCreateSystem(requestSystemDto.getSystemName(), + requestSystemDto.getAddress(), + requestSystemDto.getPort(), + requestSystemDto.getAuthenticationInfo()); + } + + //------------------------------------------------------------------------------------------------- + private System findOrCreateSystem(final String name, final String address, final int port, final String authenticationInfo) + { + + final String validatedName = Utilities.lowerCaseTrim(name); + final String validatedAddress = Utilities.lowerCaseTrim(address); + final String validatedAuthenticationInfo = Utilities.lowerCaseTrim(authenticationInfo); + + final Optional optSystem = systemRepository.findBySystemNameAndAddressAndPort(validatedName, validatedAddress, port); + System provider; + + if (optSystem.isPresent()) + { + provider = optSystem.get(); + if (!Objects.equals(validatedAuthenticationInfo, provider.getAuthenticationInfo()) || + !Objects.equals(validatedAddress, provider.getAddress())) + { // authentication info or system has changed + provider.setAuthenticationInfo(validatedAuthenticationInfo); + provider.setAddress(validatedAddress); + provider = systemRepository.saveAndFlush(provider); + } + } + else + { + provider = createSystem(validatedName, validatedAddress, port, validatedAuthenticationInfo); + } + return provider; + } + + //------------------------------------------------------------------------------------------------- + private Device findOrCreateDevice(DeviceRequestDTO requestDeviceDto) + { + return findOrCreateDevice(requestDeviceDto.getDeviceName(), + requestDeviceDto.getAddress(), + requestDeviceDto.getMacAddress(), + requestDeviceDto.getAuthenticationInfo()); + } + + //------------------------------------------------------------------------------------------------- + private Device findOrCreateDevice(String deviceName, String address, String macAddress, String authenticationInfo) + { + + final String validateName = Utilities.lowerCaseTrim(deviceName); + final String validateAddress = Utilities.lowerCaseTrim(address); + final String validatedMacAddress = Utilities.lowerCaseTrim(macAddress); + final String validatedAuthenticationInfo = Utilities.lowerCaseTrim(authenticationInfo); + + final Optional optProvider = deviceRepository.findByDeviceNameAndMacAddress(validateName, validatedMacAddress); + Device provider; + + if (optProvider.isPresent()) + { + provider = optProvider.get(); + if (!Objects.equals(validatedAuthenticationInfo, provider.getAuthenticationInfo()) || + !Objects.equals(validateAddress, provider.getAddress())) + { // authentication info or provider has changed + provider.setAuthenticationInfo(validatedAuthenticationInfo); + provider.setAddress(validateAddress); + provider = deviceRepository.saveAndFlush(provider); + } + } + else + { + provider = createDevice(validateName, validateAddress, validatedMacAddress, validatedAuthenticationInfo); + } + return provider; + } + + //------------------------------------------------------------------------------------------------- + private Device createDevice(final String name, final String address, final String macAddress, final String authenticationInfo) + { + final Device device = new Device(name, address, macAddress, authenticationInfo); + return deviceRepository.save(device); + } + + //------------------------------------------------------------------------------------------------- + private void checkSystemRegistryRequest(final SystemRegistryRequestDTO request) + { + logger.debug("checkSystemRegistryRequest started..."); + Assert.notNull(request, "Request is null."); + + Assert.notNull(request.getSystem(), "System is not specified."); + Assert.isTrue(Utilities.notEmpty(request.getSystem().getSystemName()), "System name is not specified."); + Assert.isTrue(Utilities.notEmpty(request.getSystem().getAddress()), "System address is not specified."); + Assert.notNull(request.getSystem().getPort(), "System port is not specified."); + + Assert.notNull(request.getProvider(), "Provider Device is not specified."); + Assert.isTrue(Utilities.notEmpty(request.getProvider().getDeviceName()), "Provider Device name is not specified."); + Assert.isTrue(Utilities.notEmpty(request.getProvider().getAddress()), "Provider Device address is not specified."); + Assert.isTrue(Utilities.notEmpty(request.getProvider().getMacAddress()), "Provider Device MAC is not specified."); + } + + //------------------------------------------------------------------------------------------------- + private void checkConstraintsOfSystemRegistryTable(final System systemDb, final Device deviceDb) + { + logger.debug("checkConstraintOfSystemRegistryTable started..."); + + try + { + final Optional find = systemRegistryRepository.findBySystemAndDevice(systemDb, deviceDb); + if (find.isPresent()) + { + throw new InvalidParameterException("System Registry entry with provider: (" + deviceDb.getDeviceName() + ", " + deviceDb.getMacAddress() + + ") and system : " + systemDb.getSystemName() + " already exists."); + } + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + private Device mergeDevice(final DeviceRequestDTO request, final Device device) + { + final String name = Utilities.firstNotNull(request.getDeviceName(), device.getDeviceName()); + final String address = Utilities.firstNotNull(request.getAddress(), device.getAddress()); + final String macAddress = Utilities.firstNotNull(request.getDeviceName(), device.getDeviceName()); + final String authenticationInfo = Utilities.firstNotNull(request.getAuthenticationInfo(), device.getAuthenticationInfo()); + return findOrCreateDevice(name, address, macAddress, authenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private System mergeSystem(final SystemRequestDTO request, final System system) + { + final String name = Utilities.firstNotNull(request.getSystemName(), system.getSystemName()); + final String address = Utilities.firstNotNull(request.getAddress(), system.getAddress()); + final int port = request.getPort() > 0 ? request.getPort() : system.getPort(); + final String authenticationInfo = Utilities.firstNotNull(request.getAuthenticationInfo(), system.getAuthenticationInfo()); + return findOrCreateSystem(name, address, port, authenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private SystemRegistry createSystemRegistry(final System systemDb, final Device deviceDb, final ZonedDateTime endOfValidity, final String metadataStr, + final int version) + { + logger.debug("createSystemRegistry started..."); + + checkConstraintsOfSystemRegistryTable(systemDb, deviceDb); + + try + { + return systemRegistryRepository.saveAndFlush(new SystemRegistry(systemDb, deviceDb, endOfValidity, metadataStr, version)); + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + private boolean checkSystemRegistryIfUniqueValidationNeeded(final SystemRegistry srEntry, final System system, final Device device) + { + logger.debug("checkSystemRegistryIfUniqueValidationNeeded started..."); + + return srEntry.getSystem().getId() != system.getId() || srEntry.getDevice().getId() != device.getId(); + + } + + //------------------------------------------------------------------------------------------------- + private SystemRegistry updateSystemRegistry(final SystemRegistry srEntry, final System system, final Device device, + final ZonedDateTime endOfValidity, final String metadataStr, final int version) + { + logger.debug("updateSystemRegistry started..."); + Assert.notNull(srEntry, "SystemRegistry Entry is not specified."); + Assert.notNull(system, "System is not specified."); + Assert.notNull(device, "Device is not specified."); + + if (checkSystemRegistryIfUniqueValidationNeeded(srEntry, system, device)) + { + checkConstraintsOfSystemRegistryTable(system, device); + } + + return setModifiedValuesOfSystemRegistryEntryFields(srEntry, system, device, endOfValidity, metadataStr, version); + } + + //------------------------------------------------------------------------------------------------- + private ZonedDateTime getZonedDateTime(SystemRegistryRequestDTO request) + { + return Utilities.isEmpty(request.getEndOfValidity()) ? null : Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()); + } + + //------------------------------------------------------------------------------------------------- + private SystemRegistry setModifiedValuesOfSystemRegistryEntryFields(final SystemRegistry srEntry, final System system, final Device device, + final ZonedDateTime endOfValidity, final String metadataStr, final int version) + { + + logger.debug("setModifiedValuesOfSystemRegistryEntryFields started..."); + + try + { + srEntry.setSystem(system); + srEntry.setDevice(device); + srEntry.setEndOfValidity(endOfValidity); + srEntry.setMetadata(metadataStr); + srEntry.setVersion(version); + + return systemRegistryRepository.saveAndFlush(srEntry); + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + +} diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryApplicationInitListener.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryApplicationInitListener.java index d9c307f6d..c76d2a422 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryApplicationInitListener.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryApplicationInitListener.java @@ -23,11 +23,16 @@ public class SystemRegistryApplicationInitListener extends ApplicationInitListen //================================================================================================= // members + private final CommonDBService commonDBService; + private final SystemRegistryDBService systemRegistryDBService; + @Autowired - private CommonDBService commonDBService; - - @Autowired - private SystemRegistryDBService systemRegistryDBService; + public SystemRegistryApplicationInitListener(final CommonDBService commonDBService, + final SystemRegistryDBService systemRegistryDBService) + { + this.commonDBService = commonDBService; + this.systemRegistryDBService = systemRegistryDBService; + } //================================================================================================= // assistant methods diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryMain.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryMain.java index bf8aead53..40c635956 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryMain.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryMain.java @@ -11,8 +11,7 @@ import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import springfox.documentation.swagger2.annotations.EnableSwagger2; -@SpringBootApplication -@ComponentScan(CommonConstants.BASE_PACKAGE) +@SpringBootApplication(scanBasePackages = CommonConstants.BASE_PACKAGE) @EntityScan(CoreCommonConstants.DATABASE_ENTITY_PACKAGE) @EnableJpaRepositories(basePackages = CoreCommonConstants.DATABASE_REPOSITORY_PACKAGE, repositoryBaseClass = RefreshableRepositoryImpl.class) @EnableSwagger2 diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java index b73cf137b..5506ed3e6 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java @@ -1,8 +1,9 @@ package eu.arrowhead.core.systemregistry.database.service; import eu.arrowhead.common.*; -import eu.arrowhead.common.database.entity.*; +import eu.arrowhead.common.database.entity.Device; import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.database.entity.SystemRegistry; import eu.arrowhead.common.database.repository.DeviceRepository; import eu.arrowhead.common.database.repository.SystemRegistryRepository; import eu.arrowhead.common.database.repository.SystemRepository; @@ -13,25 +14,27 @@ import eu.arrowhead.common.dto.shared.*; import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.exception.InvalidParameterException; -import jdk.jshell.execution.Util; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; -import org.springframework.http.RequestEntity; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.Socket; import java.time.ZonedDateTime; import java.time.format.DateTimeParseException; import java.util.*; @Service -public class SystemRegistryDBService { +public class SystemRegistryDBService +{ //================================================================================================= // members @@ -40,40 +43,56 @@ public class SystemRegistryDBService { private static final String COULD_NOT_DELETE_DEVICE_ERROR_MESSAGE = "Could not delete Device, with given parameters"; private static final String PORT_RANGE_ERROR_MESSAGE = "Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + "."; - private static final int MAX_BATCH_SIZE = 200; - private final Logger logger = LogManager.getLogger(SystemRegistryDBService.class); + private final SystemRegistryRepository systemRegistryRepository; - @Autowired - private SystemRegistryRepository systemRegistryRepository; + private final SystemRepository systemRepository; - @Autowired - private SystemRepository systemRepository; + private final DeviceRepository deviceRepository; - @Autowired - private DeviceRepository deviceRepository; + private final SSLProperties sslProperties; + + @Value(CoreCommonConstants.$SYSTEM_REGISTRY_PING_TIMEOUT_WD) + private int pingTimeout; @Autowired - private SSLProperties sslProperties; + public SystemRegistryDBService(final SystemRegistryRepository systemRegistryRepository, + final SystemRepository systemRepository, + final DeviceRepository deviceRepository, + final SSLProperties sslProperties) + { + this.systemRegistryRepository = systemRegistryRepository; + this.systemRepository = systemRepository; + this.deviceRepository = deviceRepository; + this.sslProperties = sslProperties; + } + //================================================================================================= // methods //------------------------------------------------------------------------------------------------- - public SystemResponseDTO getSystemById(final long systemId) { + public SystemResponseDTO getSystemById(final long systemId) + { logger.debug("getSystemById started..."); - try { + try + { final Optional systemOption = systemRepository.findById(systemId); - if (systemOption.isEmpty()) { + if (systemOption.isEmpty()) + { throw new InvalidParameterException("System with id " + systemId + " not found."); } return DTOConverter.convertSystemToSystemResponseDTO(systemOption.get()); - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -81,7 +100,8 @@ public SystemResponseDTO getSystemById(final long systemId) { //------------------------------------------------------------------------------------------------- - public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) { + public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) + { logger.debug("getSystemEntries started..."); final int validatedPage = pageParams.getValidatedPage(); @@ -89,14 +109,18 @@ public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageP final Sort.Direction validatedDirection = pageParams.getValidatedDirection(); final String validatedSortField = Utilities.isEmpty(sortField) ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); - if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) { + if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) + { throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); } - try { + try + { return DTOConverter.convertSystemEntryListToSystemListResponseDTO( systemRepository.findAll(PageRequest.of(validatedPage, validatedSize, validatedDirection, validatedSortField))); - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -104,7 +128,8 @@ public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageP //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemResponseDTO createSystemDto(final String systemName, final String address, final int port, final String authenticationInfo) { + public SystemResponseDTO createSystemDto(final String systemName, final String address, final int port, final String authenticationInfo) + { logger.debug("createSystemResponse started..."); return DTOConverter.convertSystemToSystemResponseDTO(createSystem(systemName, address, port, authenticationInfo)); @@ -113,7 +138,8 @@ public SystemResponseDTO createSystemDto(final String systemName, final String a //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public SystemResponseDTO updateSystemDto(final long systemId, final String systemName, final String address, final int port, - final String authenticationInfo) { + final String authenticationInfo) + { logger.debug("updateSystemResponse started..."); return DTOConverter.convertSystemToSystemResponseDTO(updateSystem(systemId, systemName, address, port, authenticationInfo)); @@ -121,27 +147,32 @@ public SystemResponseDTO updateSystemDto(final long systemId, final String syste //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public System updateSystem(final long systemId, final String systemName, final String address, final int port, final String authenticationInfo) { + public System updateSystem(final long systemId, final String systemName, final String address, final int port, final String authenticationInfo) + { logger.debug("updateSystem started..."); final long validatedSystemId = validateId(systemId); final int validatedPort = validateSystemPort(port); final String validatedSystemName = validateParamString(systemName); - if (validatedSystemName.contains(".")) { + if (validatedSystemName.contains(".")) + { throw new InvalidParameterException("System name can't contain dot (.)"); } final String validatedAddress = validateParamString(address); - try { + try + { final Optional systemOptional = systemRepository.findById(validatedSystemId); - if (systemOptional.isEmpty()) { + if (systemOptional.isEmpty()) + { throw new InvalidParameterException("No system with id : " + validatedSystemId); } final System system = systemOptional.get(); - if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) { + if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) + { checkConstraintsOfSystemTable(validatedSystemName, validatedAddress, validatedPort); } @@ -151,9 +182,13 @@ public System updateSystem(final long systemId, final String systemName, final S system.setAuthenticationInfo(authenticationInfo); return systemRepository.saveAndFlush(system); - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -161,19 +196,26 @@ public System updateSystem(final long systemId, final String systemName, final S //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public void removeSystemById(final long id) { + public void removeSystemById(final long id) + { logger.debug("removeSystemById started..."); - try { - if (!systemRepository.existsById(id)) { + try + { + if (!systemRepository.existsById(id)) + { throw new InvalidParameterException(COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE); } systemRepository.deleteById(id); systemRepository.flush(); - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -182,7 +224,8 @@ public void removeSystemById(final long id) { //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public SystemResponseDTO mergeSystemResponse(final long systemId, final String systemName, final String address, final Integer port, - final String authenticationInfo) { + final String authenticationInfo) + { logger.debug("mergeSystemResponse started..."); return DTOConverter.convertSystemToSystemResponseDTO(mergeSystem(systemId, systemName, address, port, authenticationInfo)); @@ -190,51 +233,64 @@ public SystemResponseDTO mergeSystemResponse(final long systemId, final String s //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public System mergeSystem(final long systemId, final String systemName, final String address, final Integer port, final String authenticationInfo) { + public System mergeSystem(final long systemId, final String systemName, final String address, final Integer port, final String authenticationInfo) + { logger.debug("mergeSystem started..."); final long validatedSystemId = validateId(systemId); final Integer validatedPort = validateAllowNullSystemPort(port); final String validatedSystemName = validateAllowNullParamString(systemName); - if (validatedSystemName != null && validatedSystemName.contains(".")) { + if (validatedSystemName != null && validatedSystemName.contains(".")) + { throw new InvalidParameterException("System name can't contain dot (.)"); } final String validatedAddress = validateAllowNullParamString(address); - try { + try + { final Optional systemOptional = systemRepository.findById(validatedSystemId); - if (systemOptional.isEmpty()) { + if (systemOptional.isEmpty()) + { throw new InvalidParameterException("No system with id : " + validatedSystemId); } final System system = systemOptional.get(); - if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) { + if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) + { checkConstraintsOfSystemTable(validatedSystemName != null ? validatedSystemName : system.getSystemName(), - validatedAddress != null ? validatedAddress : system.getAddress(), - validatedPort != null ? validatedPort : system.getPort()); + validatedAddress != null ? validatedAddress : system.getAddress(), + validatedPort != null ? validatedPort : system.getPort()); } - if (Utilities.notEmpty(validatedSystemName)) { + if (Utilities.notEmpty(validatedSystemName)) + { system.setSystemName(validatedSystemName); } - if (Utilities.notEmpty(validatedAddress)) { + if (Utilities.notEmpty(validatedAddress)) + { system.setAddress(validatedAddress); } - if (validatedPort != null) { + if (validatedPort != null) + { system.setPort(validatedPort); } - if (Utilities.notEmpty(authenticationInfo)) { + if (Utilities.notEmpty(authenticationInfo)) + { system.setAuthenticationInfo(authenticationInfo); } return systemRepository.saveAndFlush(system); - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -242,39 +298,51 @@ public System mergeSystem(final long systemId, final String systemName, final St //------------------------------------------------------------------------------------------------- - public DeviceResponseDTO getDeviceById(long deviceId) { + public DeviceResponseDTO getDeviceById(long deviceId) + { logger.debug("getDeviceById started..."); - try { + try + { final Optional deviceOptional = deviceRepository.findById(deviceId); - if (deviceOptional.isEmpty()) { + if (deviceOptional.isEmpty()) + { throw new InvalidParameterException("Device with id " + deviceId + " not found."); } return DTOConverter.convertDeviceToDeviceResponseDTO(deviceOptional.get()); - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) { + public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) + { logger.debug("getDeviceList started..."); final String validatedSortField = Utilities.isEmpty(sortField) ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); - if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) { + if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) + { throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); } - try { + try + { final Page devices = deviceRepository.findAll(PageRequest.of(pageParams.getValidatedPage(), pageParams.getValidatedSize(), - pageParams.getValidatedDirection(), validatedSortField)); + pageParams.getValidatedDirection(), validatedSortField)); return DTOConverter.convertDeviceEntryListToDeviceListResponseDTO(devices); - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -282,17 +350,21 @@ public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageP //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public DeviceResponseDTO createDeviceDto(final String name, final String address, final String macAddress, final String authenticationInfo) { + public DeviceResponseDTO createDeviceDto(final String name, final String address, final String macAddress, final String authenticationInfo) + { return DTOConverter.convertDeviceToDeviceResponseDTO(createDevice(name, address, macAddress, authenticationInfo)); } //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public DeviceResponseDTO updateDeviceByIdResponse(final long id, final String name, final String address, final String macAddress, final String authenticationInfo) { + public DeviceResponseDTO updateDeviceByIdResponse(final long id, final String name, final String address, final String macAddress, + final String authenticationInfo) + { logger.debug("updateDeviceByIdResponse started..."); - try { + try + { final long validatedId = validateId(id); final Device newDevice = validateNonNullDeviceParameters(name, address, macAddress, authenticationInfo); @@ -306,9 +378,13 @@ public DeviceResponseDTO updateDeviceByIdResponse(final long id, final String na device.setAuthenticationInfo(newDevice.getAuthenticationInfo()); return DTOConverter.convertDeviceToDeviceResponseDTO(deviceRepository.saveAndFlush(device)); - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -316,19 +392,26 @@ public DeviceResponseDTO updateDeviceByIdResponse(final long id, final String na //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public void removeDeviceById(final long id) { + public void removeDeviceById(final long id) + { logger.debug("removeDeviceById started..."); - try { - if (!deviceRepository.existsById(id)) { + try + { + if (!deviceRepository.existsById(id)) + { throw new InvalidParameterException(COULD_NOT_DELETE_DEVICE_ERROR_MESSAGE); } deviceRepository.deleteById(id); deviceRepository.flush(); - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -336,22 +419,27 @@ public void removeDeviceById(final long id) { //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemRegistryListResponseDTO getSystemRegistryEntries(final CoreUtilities.ValidatedPageParams params, final String sortField) { + public SystemRegistryListResponseDTO getSystemRegistryEntries(final CoreUtilities.ValidatedPageParams params, final String sortField) + { logger.debug("getSystemRegistryEntries started..."); final String validatedSortField = sortField == null ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); - if (!SystemRegistry.SORTABLE_FIELDS_BY.contains(validatedSortField)) { + if (!SystemRegistry.SORTABLE_FIELDS_BY.contains(validatedSortField)) + { throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); } - try { + try + { final PageRequest pageRequest = PageRequest.of(params.getValidatedPage(), - params.getValidatedSize(), - params.getValidatedDirection(), - validatedSortField); + params.getValidatedSize(), + params.getValidatedDirection(), + validatedSortField); final Page systemRegistryPage = systemRegistryRepository.findAll(pageRequest); - return DTOConverter.convertSystemRegistryPageToSystemRegistryListResponseDTO(systemRegistryPage); - } catch (final Exception ex) { + return DTOConverter.convertSystemRegistryListToSystemRegistryListResponseDTO(systemRegistryPage); + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -359,7 +447,8 @@ public SystemRegistryListResponseDTO getSystemRegistryEntries(final CoreUtilitie //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemRegistryResponseDTO getSystemRegistryById(final long id) { + public SystemRegistryResponseDTO getSystemRegistryById(final long id) + { logger.debug("getSystemRegistryById started..."); return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(getSystemRegistryEntryById(id)); @@ -367,19 +456,26 @@ public SystemRegistryResponseDTO getSystemRegistryById(final long id) { //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public void removeSystemRegistryEntryById(final long id) { + public void removeSystemRegistryEntryById(final long id) + { logger.debug("removeSystemRegistryEntryById started..."); - try { - if (!systemRegistryRepository.existsById(id)) { + try + { + if (!systemRegistryRepository.existsById(id)) + { throw new InvalidParameterException("System Registry entry with id '" + id + "' does not exists"); } systemRegistryRepository.deleteById(id); systemRegistryRepository.flush(); - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -388,11 +484,13 @@ public void removeSystemRegistryEntryById(final long id) { //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemRegistryResponseDTO registerSystemRegistry(final SystemRegistryRequestDTO request) { + public SystemRegistryResponseDTO registerSystemRegistry(final SystemRegistryRequestDTO request) + { logger.debug("registerSystemRegistry started..."); checkSystemRegistryRequest(request); - try { + try + { final System systemDb = findOrCreateSystem(request.getSystem()); final Device deviceDb = findOrCreateDevice(request.getProvider()); @@ -402,12 +500,19 @@ public SystemRegistryResponseDTO registerSystemRegistry(final SystemRegistryRequ final SystemRegistry srEntry = createSystemRegistry(systemDb, deviceDb, endOfValidity, metadataStr, version); return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(srEntry); - } catch (final DateTimeParseException ex) { + } + catch (final DateTimeParseException ex) + { logger.debug(ex.getMessage(), ex); - throw new InvalidParameterException("End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); - } catch (final InvalidParameterException ex) { + throw new InvalidParameterException( + "End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -415,13 +520,15 @@ public SystemRegistryResponseDTO registerSystemRegistry(final SystemRegistryRequ //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemRegistryResponseDTO updateSystemRegistryById(final long id, final SystemRegistryRequestDTO request) { + public SystemRegistryResponseDTO updateSystemRegistryById(final long id, final SystemRegistryRequestDTO request) + { logger.debug("updateSystemRegistryById started..."); Assert.isTrue(0 < id, "id is not greater than zero"); checkSystemRegistryRequest(request); - try { + try + { final SystemRegistry srEntry; final SystemRegistry updateSrEntry; @@ -437,12 +544,19 @@ public SystemRegistryResponseDTO updateSystemRegistryById(final long id, final S updateSrEntry = updateSystemRegistry(srEntry, systemDb, deviceDb, endOfValidity, metadataStr, version); return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(updateSrEntry); - } catch (final DateTimeParseException ex) { + } + catch (final DateTimeParseException ex) + { logger.debug(ex.getMessage(), ex); - throw new InvalidParameterException("End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); - } catch (final InvalidParameterException ex) { + throw new InvalidParameterException( + "End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -451,13 +565,15 @@ public SystemRegistryResponseDTO updateSystemRegistryById(final long id, final S //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemRegistryResponseDTO mergeSystemRegistryById(final long id, final SystemRegistryRequestDTO request) { + public SystemRegistryResponseDTO mergeSystemRegistryById(final long id, final SystemRegistryRequestDTO request) + { logger.debug("mergeSystemRegistryById started..."); Assert.notNull(request, "request is null."); Assert.isTrue(0 < id, "id is not greater than zero"); - try { + try + { final SystemRegistry srEntry; final SystemRegistry updateSrEntry; @@ -470,22 +586,29 @@ public SystemRegistryResponseDTO mergeSystemRegistryById(final long id, final Sy final ZonedDateTime endOfValidity = Utilities.notEmpty(request.getEndOfValidity()) ? Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()) : srEntry.getEndOfValidity(); - - final String validatedMetadataStr = Objects.nonNull(request.getMetadata()) ? - Utilities.map2Text(request.getMetadata()) : + + final String validatedMetadataStr = Objects.nonNull(request.getMetadata()) ? + Utilities.map2Text(request.getMetadata()) : srEntry.getMetadata(); - + final int validatedVersion = (request.getVersion() != null) ? request.getVersion() : srEntry.getVersion(); updateSrEntry = updateSystemRegistry(srEntry, systemDb, deviceDb, endOfValidity, validatedMetadataStr, validatedVersion); return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(updateSrEntry); - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final DateTimeParseException ex) { + } + catch (final DateTimeParseException ex) + { logger.debug(ex.getMessage(), ex); - throw new InvalidParameterException("End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); - } catch (final Exception ex) { + throw new InvalidParameterException( + "End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -493,23 +616,36 @@ public SystemRegistryResponseDTO mergeSystemRegistryById(final long id, final Sy //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemRegistryListResponseDTO getSystemRegistryEntriesBySystemName(final String systemName, final CoreUtilities.ValidatedPageParams pageParameters, final String sortField) { + public SystemRegistryListResponseDTO getSystemRegistryEntriesBySystemName(final String systemName, final CoreUtilities.ValidatedPageParams pageParameters, + final String sortField) + { + logger.debug("getSystemRegistryEntriesBySystemName is started..."); + + if (!System.SORTABLE_FIELDS_BY.contains(sortField)) + { + throw new InvalidParameterException("Sortable field with reference '" + sortField + "' is not available"); + } + final List systemList = systemRepository.findBySystemName(systemName); - final PageRequest pageRequest = PageRequest.of(pageParameters.getValidatedPage(), pageParameters.getValidatedSize(), pageParameters.getValidatedDirection()); + final PageRequest pageRequest = PageRequest.of(pageParameters.getValidatedPage(), pageParameters.getValidatedSize(), + pageParameters.getValidatedDirection(), sortField); final Page systemRegistries = systemRegistryRepository.findAllBySystem(systemList, pageRequest); - return DTOConverter.convertSystemRegistryPageToSystemRegistryListResponseDTO(systemRegistries); + return DTOConverter.convertSystemRegistryListToSystemRegistryListResponseDTO(systemRegistries); } //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public void removeSystemRegistryByNameAndAddressAndPort(final String systemName, final String address, final int port) { + public void removeSystemRegistryByNameAndAddressAndPort(final String systemName, final String address, final int port) + { + logger.debug("removeSystemRegistryByNameAndAddressAndPort is started..."); final System system = getSystemByNameAndAddressAndPort(systemName, address, port); final Optional optionalSystemRegistry = systemRegistryRepository.findBySystem(system); final SystemRegistry systemRegistry = optionalSystemRegistry.orElseThrow( - () -> new InvalidParameterException("System Registry entry for System with name '" + systemName + "', address '" + address + "' and port '" + port + "' does not exists")); + () -> new InvalidParameterException( + "System Registry entry for System with name '" + systemName + "', address '" + address + "' and port '" + port + "' does not exists")); systemRegistryRepository.delete(systemRegistry); systemRegistryRepository.flush(); @@ -518,150 +654,283 @@ public void removeSystemRegistryByNameAndAddressAndPort(final String systemName, //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemQueryResultDTO queryRegistry(final SystemQueryFormDTO form) { + public SystemQueryResultDTO queryRegistry(final SystemQueryFormDTO form) + { logger.debug("queryRegistry is started..."); Assert.notNull(form, "Form is null."); - Assert.isTrue(!Utilities.isEmpty(form.getServiceDefinitionRequirement()), "Service definition requirement is null or blank"); - final String serviceDefinitionRequirement = form.getServiceDefinitionRequirement().toLowerCase().trim(); - try { - final Optional optServiceDefinition = serviceDefinitionRepository.findByServiceDefinition(serviceDefinitionRequirement); - if (optServiceDefinition.isEmpty()) { - // no service definition found - logger.debug("Service definition not found: {}", serviceDefinitionRequirement); - return DTOConverter.convertListOfServiceRegistryEntriesToServiceQueryResultDTO(null, 0); + try + { + final List systems; + final List devices; + final List registryList; + final int unfilteredHits; + + if (Utilities.notEmpty(form.getSystemNameRequirements())) + { + final String systemName = Utilities.lowerCaseTrim(form.getSystemNameRequirements()); + systems = systemRepository.findBySystemName(systemName); + + if (systems.isEmpty()) + { + // no service definition found + logger.debug("System not found: {}", systemName); + return DTOConverter.convertSystemRegistryListToSystemQueryResultDTO(Collections.emptyList()); + } } - - final List providedServices = new ArrayList<>(serviceRegistryRepository.findByServiceDefinition(optServiceDefinition.get())); - final int unfilteredHits = providedServices.size(); - logger.debug("Potential service providers before filtering: {}", unfilteredHits); - if (providedServices.isEmpty()) { - // no providers found - return DTOConverter.convertListOfServiceRegistryEntriesToServiceQueryResultDTO(providedServices, unfilteredHits); + else + { + throw new InvalidParameterException("System Name must not be null"); } - // filter on interfaces - if (form.getInterfaceRequirements() != null && !form.getInterfaceRequirements().isEmpty()) { - final List normalizedInterfaceRequirements = RegistryUtils.normalizeInterfaceNames(form.getInterfaceRequirements()); - RegistryUtils.filterOnInterfaces(providedServices, normalizedInterfaceRequirements); - } + registryList = systemRegistryRepository.findAllBySystem(systems); + unfilteredHits = registryList.size(); + + if (Utilities.notEmpty(form.getDeviceNameRequirements())) + { + final String deviceName = Utilities.lowerCaseTrim(form.getDeviceNameRequirements()); + devices = deviceRepository.findByDeviceName(deviceName); - // filter on security type - if (!providedServices.isEmpty() && form.getSecurityRequirements() != null && !form.getSecurityRequirements().isEmpty()) { - final List normalizedSecurityTypes = RegistryUtils.normalizeSecurityTypes(form.getSecurityRequirements()); - RegistryUtils.filterOnSecurityType(providedServices, normalizedSecurityTypes); + if (devices.isEmpty()) + { + // no service definition found + logger.debug("Device not found: {}", deviceName); + return DTOConverter.convertSystemRegistryListToSystemQueryResultDTO(Collections.emptyList()); + } + + registryList.removeIf(e -> !devices.contains(e.getDevice())); } // filter on version - if (!providedServices.isEmpty()) { - if (form.getVersionRequirement() != null) { - RegistryUtils.filterOnVersion(providedServices, form.getVersionRequirement().intValue()); - } else if (form.getMinVersionRequirement() != null || form.getMaxVersionRequirement() != null) { - final int minVersion = form.getMinVersionRequirement() == null ? 1 : form.getMinVersionRequirement().intValue(); - final int maxVersion = form.getMaxVersionRequirement() == null ? Integer.MAX_VALUE : form.getMaxVersionRequirement().intValue(); - RegistryUtils.filterOnVersion(providedServices, minVersion, maxVersion); - } + if (Objects.nonNull(form.getVersionRequirement())) + { + registryList.removeIf(e -> Objects.equals(form.getVersionRequirement(), e.getVersion())); + } + else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(form.getMaxVersionRequirement())) + { + final int minVersion = form.getMinVersionRequirement() == null ? 1 : form.getMinVersionRequirement(); + final int maxVersion = form.getMaxVersionRequirement() == null ? Integer.MAX_VALUE : form.getMaxVersionRequirement(); + + registryList.removeIf(e -> (e.getVersion() < minVersion) || (e.getVersion() > maxVersion)); } // filter on metadata - if (!providedServices.isEmpty() && form.getMetadataRequirements() != null && !form.getMetadataRequirements().isEmpty()) { - final Map normalizedMetadata = RegistryUtils.normalizeMetadata(form.getMetadataRequirements()); - RegistryUtils.filterOnMeta(providedServices, normalizedMetadata); + if (form.getMetadataRequirements() != null && !form.getMetadataRequirements().isEmpty()) + { + final Map requiredMetadata = normalizeMetadata(form.getMetadataRequirements()); + registryList.removeIf(e -> + { + final Map metadata = Utilities.text2Map(e.getMetadata()); + if (Objects.isNull(metadata)) + { + // we have requirements but no metadata -> remove + return true; + } + + return !metadata.entrySet().containsAll(requiredMetadata.entrySet()); + }); } // filter on ping - if (!providedServices.isEmpty() && form.getPingProviders()) { - RegistryUtils.filterOnPing(providedServices, pingTimeout); + if (form.getPingProviders()) + { + filterOnPing(registryList, pingTimeout); } - logger.debug("Potential service providers after filtering: {}", providedServices.size()); - - return DTOConverter.convertListOfServiceRegistryEntriesToServiceQueryResultDTO(providedServices, unfilteredHits); - } catch (final IllegalStateException e) { + logger.debug("Potential system providers after filtering: {}", registryList.size()); + return DTOConverter.convertListOfSystemRegistryEntriesToSystemQueryResultDTO(registryList, unfilteredHits); + } + catch (final IllegalStateException e) + { throw new InvalidParameterException("Invalid keys in the metadata requirements (whitespace only differences)"); - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } - //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemResponseDTO getSystemDtoByNameAndAddressAndPort(final String systemName, final String address, final int port) { + public SystemResponseDTO getSystemDtoByNameAndAddressAndPort(final String systemName, final String address, final int port) + { final System system = getSystemByNameAndAddressAndPort(systemName, address, port); return DTOConverter.convertSystemToSystemResponseDTO(system); } + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public List getSystemByName(final String name) + { + try { + return systemRepository.findBySystemName(Utilities.lowerCaseTrim(name)); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) + { + logger.debug("createSystem started..."); + + final System system = validateNonNullSystemParameters(systemName, address, port, authenticationInfo); + + try + { + return systemRepository.saveAndFlush(system); + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- - private System getSystemByNameAndAddressAndPort(final String systemName, final String address, final int port) { + private System getSystemByNameAndAddressAndPort(final String systemName, final String address, final int port) + { final Optional optionalSystem = systemRepository.findBySystemNameAndAddressAndPort(systemName, address, port); - return optionalSystem.orElseThrow(() -> new InvalidParameterException("System entry with name '" + systemName + "', address '" + address + "' and port '" + port + "' does not exists")); + return optionalSystem.orElseThrow(() -> new InvalidParameterException( + "System entry with name '" + systemName + "', address '" + address + "' and port '" + port + "' does not exists")); } //------------------------------------------------------------------------------------------------- @SuppressWarnings("squid:S1126") private boolean checkSystemIfUniqueValidationNeeded(final System system, final String validatedSystemName, final String validatedAddress, - final Integer validatedPort) { + final Integer validatedPort) + { logger.debug("checkSystemIfUniqueValidationNeeded started..."); final String actualSystemName = system.getSystemName(); final String actualAddress = system.getAddress(); final int actualPort = system.getPort(); - if (validatedSystemName != null && !actualSystemName.equalsIgnoreCase(validatedSystemName)) { + if (validatedSystemName != null && !actualSystemName.equalsIgnoreCase(validatedSystemName)) + { + return true; + } + else if (validatedAddress != null && !actualAddress.equalsIgnoreCase(validatedAddress)) + { return true; - } else if (validatedAddress != null && !actualAddress.equalsIgnoreCase(validatedAddress)) { + } + else { return validatedPort != null && actualPort != validatedPort; } + } + + //------------------------------------------------------------------------------------------------- + // This method may CHANGE the content of providedServices + private void filterOnPing(final List systems, final int timeout) + { + if (systems == null || systems.isEmpty() || timeout <= 0) + { + return; + } + + systems.removeIf(sr -> !pingService(sr.getSystem().getAddress(), sr.getSystem().getPort(), timeout)); + } + + //------------------------------------------------------------------------------------------------- + private boolean pingService(final String address, final int port, final int timeout) + { + final InetSocketAddress host = new InetSocketAddress(address, port); + try (final Socket socket = new Socket()) + { + socket.connect(host, timeout); return true; - } else return validatedPort != null && actualPort != validatedPort; + } + catch (final IOException ex) + { + return false; + } } //------------------------------------------------------------------------------------------------- - private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) { + private Map normalizeMetadata(final Map metadata) throws IllegalStateException + { + logger.debug("normalizeMetadata started..."); + if (metadata == null) + { + return Map.of(); + } + + final Map map = new HashMap<>(); + + metadata.forEach((k, v) -> + { + if (Objects.nonNull(v)) + { + map.put(k.trim(), v.trim()); + } + }); + + return map; + } + + //------------------------------------------------------------------------------------------------- + private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) + { logger.debug("checkConstraintsOfSystemTable started..."); - try { + try + { final Optional find = systemRepository .findBySystemNameAndAddressAndPort(validatedSystemName.toLowerCase().trim(), validatedAddress.toLowerCase().trim(), validatedPort); - if (find.isPresent()) { + if (find.isPresent()) + { throw new InvalidParameterException( "System with name: " + validatedSystemName + ", address: " + validatedAddress + ", port: " + validatedPort + " already exists."); } - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private void checkConstraintsOfDeviceTable(final String validatedDeviceName, final String validatedMacAddress) { + private void checkConstraintsOfDeviceTable(final String validatedDeviceName, final String validatedMacAddress) + { logger.debug("checkConstraintsOfDeviceTable started..."); - try { + try + { final Optional find = deviceRepository.findByDeviceNameAndMacAddress(validatedDeviceName, validatedMacAddress); - if (find.isPresent()) { + if (find.isPresent()) + { throw new InvalidParameterException( "Device with name: " + validatedDeviceName + ", MAC address: " + validatedMacAddress + " already exists."); } - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) { + private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) + { logger.debug("validateNonNullSystemParameters started..."); - validateNonNullParameters(systemName, address, authenticationInfo); + validateNonNullParameters(systemName, address); - if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) + { throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); } @@ -674,18 +943,20 @@ private System validateNonNullSystemParameters(final String systemName, final St } //------------------------------------------------------------------------------------------------- - private Device validateNonNullDeviceParameters(final String deviceName, final String address, final String macAddress, final String authenticationInfo) { + private Device validateNonNullDeviceParameters(final String deviceName, final String address, final String macAddress, final String authenticationInfo) + { logger.debug("validateNonNullDeviceParameters started..."); - validateNonNullParameters(deviceName, address, authenticationInfo); + validateNonNullParameters(deviceName, address); - if (Utilities.isEmpty(macAddress)) { + if (Utilities.isEmpty(macAddress)) + { throw new InvalidParameterException("MAC address is null or empty"); } final String validatedDeviceName = Utilities.lowerCaseTrim(deviceName); final String validatedAddress = Utilities.lowerCaseTrim(address); - final String validatedMacAddress = macAddress.trim().toUpperCase(); + final String validatedMacAddress = Utilities.lowerCaseTrim(macAddress); checkConstraintsOfDeviceTable(validatedDeviceName, validatedMacAddress); @@ -693,27 +964,33 @@ private Device validateNonNullDeviceParameters(final String deviceName, final St } //------------------------------------------------------------------------------------------------- - private void validateNonNullParameters(final String name, final String address, final String authenticationInfo) { + private void validateNonNullParameters(final String name, final String address) + { logger.debug("validateNonNullParameters started..."); - if (Utilities.isEmpty(name)) { + if (Utilities.isEmpty(name)) + { throw new InvalidParameterException("Name is null or empty"); } - if (Utilities.isEmpty(address)) { + if (Utilities.isEmpty(address)) + { throw new InvalidParameterException("Address is null or empty"); } - if (name.contains(".")) { + if (name.contains(".")) + { throw new InvalidParameterException("Name can't contain dot (.)"); } } //------------------------------------------------------------------------------------------------- - private String validateParamString(final String param) { + private String validateParamString(final String param) + { logger.debug("validateSystemParamString started..."); - if (Utilities.isEmpty(param)) { + if (Utilities.isEmpty(param)) + { throw new InvalidParameterException("parameter null or empty"); } @@ -721,10 +998,12 @@ private String validateParamString(final String param) { } //------------------------------------------------------------------------------------------------- - private int validateSystemPort(final int port) { + private int validateSystemPort(final int port) + { logger.debug("validateSystemPort started..."); - if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) + { throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); } @@ -732,10 +1011,12 @@ private int validateSystemPort(final int port) { } //------------------------------------------------------------------------------------------------- - private long validateId(final long id) { + private long validateId(final long id) + { logger.debug("validateId started..."); - if (id < 1) { + if (id < 1) + { throw new IllegalArgumentException("Id must be greater than zero"); } @@ -743,10 +1024,12 @@ private long validateId(final long id) { } //------------------------------------------------------------------------------------------------- - private Integer validateAllowNullSystemPort(final Integer port) { + private Integer validateAllowNullSystemPort(final Integer port) + { logger.debug("validateAllowNullSystemPort started..."); - if (port != null && (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX)) { + if (port != null && (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX)) + { throw new IllegalArgumentException(PORT_RANGE_ERROR_MESSAGE); } @@ -754,10 +1037,12 @@ private Integer validateAllowNullSystemPort(final Integer port) { } //------------------------------------------------------------------------------------------------- - private String validateAllowNullParamString(final String param) { + private String validateAllowNullParamString(final String param) + { logger.debug("validateAllowNullParamString started..."); - if (Utilities.isEmpty(param)) { + if (Utilities.isEmpty(param)) + { return null; } @@ -766,29 +1051,37 @@ private String validateAllowNullParamString(final String param) { //------------------------------------------------------------------------------------------------- - private SystemRegistry getSystemRegistryEntryById(final long id) { + private SystemRegistry getSystemRegistryEntryById(final long id) + { logger.debug("getSystemRegistryEntryById started..."); - try { + try + { final Optional systemRegistry = systemRegistryRepository.findById(id); return systemRegistry.orElseThrow(() -> new InvalidParameterException("System Registry with id of '" + id + "' not exists")); - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private System findOrCreateSystem(SystemRequestDTO requestSystemDto) { + private System findOrCreateSystem(SystemRequestDTO requestSystemDto) + { return findOrCreateSystem(requestSystemDto.getSystemName(), - requestSystemDto.getAddress(), - requestSystemDto.getPort(), - requestSystemDto.getAuthenticationInfo()); + requestSystemDto.getAddress(), + requestSystemDto.getPort(), + requestSystemDto.getAuthenticationInfo()); } //------------------------------------------------------------------------------------------------- - private System findOrCreateSystem(final String name, final String address, final int port, final String authenticationInfo) { + private System findOrCreateSystem(final String name, final String address, final int port, final String authenticationInfo) + { final String validatedName = Utilities.lowerCaseTrim(name); final String validatedAddress = Utilities.lowerCaseTrim(address); @@ -797,44 +1090,36 @@ private System findOrCreateSystem(final String name, final String address, final final Optional optSystem = systemRepository.findBySystemNameAndAddressAndPort(validatedName, validatedAddress, port); System provider; - if (optSystem.isPresent()) { + if (optSystem.isPresent()) + { provider = optSystem.get(); if (!Objects.equals(validatedAuthenticationInfo, provider.getAuthenticationInfo()) || - !Objects.equals(validatedAddress, provider.getAddress())) { // authentication info or system has changed + !Objects.equals(validatedAddress, provider.getAddress())) + { // authentication info or system has changed provider.setAuthenticationInfo(validatedAuthenticationInfo); provider.setAddress(validatedAddress); provider = systemRepository.saveAndFlush(provider); } - } else { + } + else + { provider = createSystem(validatedName, validatedAddress, port, validatedAuthenticationInfo); } return provider; } //------------------------------------------------------------------------------------------------- - private System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) { - logger.debug("createSystem started..."); - - final System system = validateNonNullSystemParameters(systemName, address, port, authenticationInfo); - - try { - return systemRepository.saveAndFlush(system); - } catch (final Exception ex) { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } - } - - //------------------------------------------------------------------------------------------------- - private Device findOrCreateDevice(DeviceRequestDTO requestDeviceDto) { + private Device findOrCreateDevice(DeviceRequestDTO requestDeviceDto) + { return findOrCreateDevice(requestDeviceDto.getDeviceName(), - requestDeviceDto.getAddress(), - requestDeviceDto.getMacAddress(), - requestDeviceDto.getAuthenticationInfo()); + requestDeviceDto.getAddress(), + requestDeviceDto.getMacAddress(), + requestDeviceDto.getAuthenticationInfo()); } //------------------------------------------------------------------------------------------------- - private Device findOrCreateDevice(String deviceName, String address, String macAddress, String authenticationInfo) { + private Device findOrCreateDevice(String deviceName, String address, String macAddress, String authenticationInfo) + { final String validateName = Utilities.lowerCaseTrim(deviceName); final String validateAddress = Utilities.lowerCaseTrim(address); @@ -844,28 +1129,34 @@ private Device findOrCreateDevice(String deviceName, String address, String macA final Optional optProvider = deviceRepository.findByDeviceNameAndMacAddress(validateName, validatedMacAddress); Device provider; - if (optProvider.isPresent()) { + if (optProvider.isPresent()) + { provider = optProvider.get(); if (!Objects.equals(validatedAuthenticationInfo, provider.getAuthenticationInfo()) || - !Objects.equals(validateAddress, provider.getAddress())) { // authentication info or provider has changed + !Objects.equals(validateAddress, provider.getAddress())) + { // authentication info or provider has changed provider.setAuthenticationInfo(validatedAuthenticationInfo); provider.setAddress(validateAddress); provider = deviceRepository.saveAndFlush(provider); } - } else { + } + else + { provider = createDevice(validateName, validateAddress, validatedMacAddress, validatedAuthenticationInfo); } return provider; } //------------------------------------------------------------------------------------------------- - private Device createDevice(final String name, final String address, final String macAddress, final String authenticationInfo) { + private Device createDevice(final String name, final String address, final String macAddress, final String authenticationInfo) + { final Device device = new Device(name, address, macAddress, authenticationInfo); return deviceRepository.save(device); } //------------------------------------------------------------------------------------------------- - private void checkSystemRegistryRequest(final SystemRegistryRequestDTO request) { + private void checkSystemRegistryRequest(final SystemRegistryRequestDTO request) + { logger.debug("checkSystemRegistryRequest started..."); Assert.notNull(request, "Request is null."); @@ -881,25 +1172,33 @@ private void checkSystemRegistryRequest(final SystemRegistryRequestDTO request) } //------------------------------------------------------------------------------------------------- - private void checkConstraintsOfSystemRegistryTable(final System systemDb, final Device deviceDb) { + private void checkConstraintsOfSystemRegistryTable(final System systemDb, final Device deviceDb) + { logger.debug("checkConstraintOfSystemRegistryTable started..."); - try { + try + { final Optional find = systemRegistryRepository.findBySystemAndDevice(systemDb, deviceDb); - if (find.isPresent()) { + if (find.isPresent()) + { throw new InvalidParameterException("System Registry entry with provider: (" + deviceDb.getDeviceName() + ", " + deviceDb.getMacAddress() + - ") and system : " + systemDb.getSystemName() + " already exists."); + ") and system : " + systemDb.getSystemName() + " already exists."); } - } catch (final InvalidParameterException ex) { + } + catch (final InvalidParameterException ex) + { throw ex; - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private Device mergeDevice(final DeviceRequestDTO request, final Device device) { + private Device mergeDevice(final DeviceRequestDTO request, final Device device) + { final String name = Utilities.firstNotNull(request.getDeviceName(), device.getDeviceName()); final String address = Utilities.firstNotNull(request.getAddress(), device.getAddress()); final String macAddress = Utilities.firstNotNull(request.getDeviceName(), device.getDeviceName()); @@ -908,7 +1207,8 @@ private Device mergeDevice(final DeviceRequestDTO request, final Device device) } //------------------------------------------------------------------------------------------------- - private System mergeSystem(final SystemRequestDTO request, final System system) { + private System mergeSystem(final SystemRequestDTO request, final System system) + { final String name = Utilities.firstNotNull(request.getSystemName(), system.getSystemName()); final String address = Utilities.firstNotNull(request.getAddress(), system.getAddress()); final int port = request.getPort() > 0 ? request.getPort() : system.getPort(); @@ -917,21 +1217,27 @@ private System mergeSystem(final SystemRequestDTO request, final System system) } //------------------------------------------------------------------------------------------------- - private SystemRegistry createSystemRegistry(final System systemDb, final Device deviceDb, final ZonedDateTime endOfValidity, final String metadataStr, final int version) { + private SystemRegistry createSystemRegistry(final System systemDb, final Device deviceDb, final ZonedDateTime endOfValidity, final String metadataStr, + final int version) + { logger.debug("createSystemRegistry started..."); checkConstraintsOfSystemRegistryTable(systemDb, deviceDb); - try { + try + { return systemRegistryRepository.saveAndFlush(new SystemRegistry(systemDb, deviceDb, endOfValidity, metadataStr, version)); - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private boolean checkSystemRegistryIfUniqueValidationNeeded(final SystemRegistry srEntry, final System system, final Device device) { + private boolean checkSystemRegistryIfUniqueValidationNeeded(final SystemRegistry srEntry, final System system, final Device device) + { logger.debug("checkSystemRegistryIfUniqueValidationNeeded started..."); return srEntry.getSystem().getId() != system.getId() || srEntry.getDevice().getId() != device.getId(); @@ -940,13 +1246,15 @@ private boolean checkSystemRegistryIfUniqueValidationNeeded(final SystemRegistry //------------------------------------------------------------------------------------------------- private SystemRegistry updateSystemRegistry(final SystemRegistry srEntry, final System system, final Device device, - final ZonedDateTime endOfValidity, final String metadataStr, final int version) { + final ZonedDateTime endOfValidity, final String metadataStr, final int version) + { logger.debug("updateSystemRegistry started..."); Assert.notNull(srEntry, "SystemRegistry Entry is not specified."); Assert.notNull(system, "System is not specified."); Assert.notNull(device, "Device is not specified."); - if (checkSystemRegistryIfUniqueValidationNeeded(srEntry, system, device)) { + if (checkSystemRegistryIfUniqueValidationNeeded(srEntry, system, device)) + { checkConstraintsOfSystemRegistryTable(system, device); } @@ -954,17 +1262,20 @@ private SystemRegistry updateSystemRegistry(final SystemRegistry srEntry, final } //------------------------------------------------------------------------------------------------- - private ZonedDateTime getZonedDateTime(SystemRegistryRequestDTO request) { + private ZonedDateTime getZonedDateTime(SystemRegistryRequestDTO request) + { return Utilities.isEmpty(request.getEndOfValidity()) ? null : Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()); } //------------------------------------------------------------------------------------------------- private SystemRegistry setModifiedValuesOfSystemRegistryEntryFields(final SystemRegistry srEntry, final System system, final Device device, - final ZonedDateTime endOfValidity, final String metadataStr, final int version) { + final ZonedDateTime endOfValidity, final String metadataStr, final int version) + { logger.debug("setModifiedValuesOfSystemRegistryEntryFields started..."); - try { + try + { srEntry.setSystem(system); srEntry.setDevice(device); srEntry.setEndOfValidity(endOfValidity); @@ -972,9 +1283,12 @@ private SystemRegistry setModifiedValuesOfSystemRegistryEntryFields(final System srEntry.setVersion(version); return systemRegistryRepository.saveAndFlush(srEntry); - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } + } From c17a7452ddc0842283905f7fcaf8cb3dacf578ec Mon Sep 17 00:00:00 2001 From: rbocsi Date: Fri, 24 Jan 2020 12:08:08 +0100 Subject: [PATCH 029/301] DTO extension for using QoS features --- .../shared/OrchestrationFormRequestDTO.java | 51 +++++++++++++++++-- ...itional-spring-configuration-metadata.json | 5 ++ .../src/main/resources/application.properties | 3 ++ 3 files changed, 54 insertions(+), 5 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OrchestrationFormRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OrchestrationFormRequestDTO.java index fe81c1f69..484ca714a 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OrchestrationFormRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OrchestrationFormRequestDTO.java @@ -14,18 +14,25 @@ import eu.arrowhead.common.exception.BadPayloadException; public class OrchestrationFormRequestDTO implements Serializable { + + public static final String QOS_REQUIREMENT_MINIMUM_RESPONSE_TIME = "qosMinRespTime"; // in milliseconds + public static final String QOS_REQUIREMENT_MAXIMUM_RECENT_PACKET_LOSS = "qosMaxRecentPacketLoss"; // in percent, for example 20% is 20 + public static final String QOS_REQUIREMENT_MAXIMUM_PACKET_LOSS = "qosMaxPacketLost"; // in percent + + public static final String QOS_COMMAND_EXCLUSIVITY = "qosExclusivity"; // in seconds //================================================================================================= // members - private static final long serialVersionUID = -3595427649312358521L; - + private static final long serialVersionUID = 5875552294338921238L; + private SystemRequestDTO requesterSystem; private CloudRequestDTO requesterCloud; private ServiceQueryFormDTO requestedService; private OrchestrationFlags orchestrationFlags = new OrchestrationFlags(); private List preferredProviders = new ArrayList<>(); private Map commands = new HashMap<>(); + private Map qosRequirements = new HashMap<>(); //================================================================================================= // methods @@ -40,13 +47,20 @@ public OrchestrationFormRequestDTO() {} public OrchestrationFlags getOrchestrationFlags() { return orchestrationFlags; } public List getPreferredProviders() { return preferredProviders; } public Map getCommands() { return commands; } - + public Map getQosRequirements() { return qosRequirements; } + //------------------------------------------------------------------------------------------------- public void setRequesterSystem(final SystemRequestDTO requesterSystem) { this.requesterSystem = requesterSystem; } public void setRequesterCloud(final CloudRequestDTO requesterCloud) { this.requesterCloud = requesterCloud; } public void setRequestedService(final ServiceQueryFormDTO requestedService) { this.requestedService = requestedService; } public void setOrchestrationFlags(final Map orchestrationFlags) { this.orchestrationFlags = new OrchestrationFlags(orchestrationFlags); } - public void setCommands(final Map commands) { this.commands = commands; } + + //------------------------------------------------------------------------------------------------- + public void setCommands(final Map commands) { + if (commands != null) { + this.commands = commands; + } + } //------------------------------------------------------------------------------------------------- public void setPreferredProviders(final List preferredProviders) { @@ -55,6 +69,13 @@ public void setPreferredProviders(final List preferred } } + //------------------------------------------------------------------------------------------------- + public void setQosRequirements(final Map qosRequirements) { + if (qosRequirements != null) { + this.qosRequirements = qosRequirements; + } + } + //------------------------------------------------------------------------------------------------- public OrchestrationFormRequestDTO validateCrossParameterConstraints() { if (requestedService == null && orchestrationFlags.get(Flag.OVERRIDE_STORE)) { @@ -91,7 +112,8 @@ private OrchestrationFormRequestDTO(final Builder builder) { this.requestedService = builder.requestedService; this.orchestrationFlags = builder.orchestrationFlags; this.preferredProviders = builder.preferredProviders; - this.commands = builder.commands; + this.setCommands(builder.commands); + this.setQosRequirements(builder.qosRequirements); } //================================================================================================= @@ -109,6 +131,7 @@ public static class Builder { private final OrchestrationFlags orchestrationFlags = new OrchestrationFlags(); private List preferredProviders = new ArrayList<>(); private Map commands = new HashMap<>(); + private Map qosRequirements = new HashMap<>(); //================================================================================================= // methods @@ -168,6 +191,24 @@ public Builder command(final String key, final String value) { } + //------------------------------------------------------------------------------------------------- + public Builder qosRequirements(final Map qosRequirements) { + this.qosRequirements = qosRequirements; + return this; + } + + //------------------------------------------------------------------------------------------------- + public Builder qosRequirement(final String key, final String value) { + Assert.isTrue(key != null && !key.isBlank(), "Key is null or blank"); + + if (this.qosRequirements == null) { + this.qosRequirements = new HashMap<>(); + } + this.qosRequirements.put(key, value); + + return this; + } + //------------------------------------------------------------------------------------------------- public OrchestrationFormRequestDTO build() { return new OrchestrationFormRequestDTO(this).validateCrossParameterConstraints(); diff --git a/orchestrator/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/orchestrator/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 302f0c115..9b58d1302 100644 --- a/orchestrator/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/orchestrator/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -43,5 +43,10 @@ "name": "domain.port", "type": "java.lang.String", "description": "A description for 'domain.port'" + }, + { + "name": "enable_qos", + "type": "java.lang.Boolean", + "description": "A description for 'enable_qos'" } ]} \ No newline at end of file diff --git a/orchestrator/src/main/resources/application.properties b/orchestrator/src/main/resources/application.properties index 939923fd8..69dfb4c13 100644 --- a/orchestrator/src/main/resources/application.properties +++ b/orchestrator/src/main/resources/application.properties @@ -38,6 +38,9 @@ sr_port=8443 #If true, operational gatekeeper must be present gatekeeper_is_present=true +#If true, orchestrator will use QoS verification and reservation (if clients using this feature) +enable_qos=true + # Interface names has to follow this format --, where security can be SECURE or INSECURE and protocol and format must be a sequence of letters, numbers and underscore. # A regexp checker will verify that. If this setting is set to true then the PROTOCOL and FORMAT must come from a predefined set. use_strict_service_intf_name_verifier=false From 6f81a531f99ac35cb8eaefbea10edd22a90a483d Mon Sep 17 00:00:00 2001 From: rbocsi Date: Fri, 24 Jan 2020 13:00:35 +0100 Subject: [PATCH 030/301] add new table for reservation --- scripts/create_arrowhead_tables.sql | 16 ++++++++++++++++ scripts/orchestrator_privileges.sql | 2 ++ 2 files changed, 18 insertions(+) diff --git a/scripts/create_arrowhead_tables.sql b/scripts/create_arrowhead_tables.sql index bc55cb185..3cd1c8190 100644 --- a/scripts/create_arrowhead_tables.sql +++ b/scripts/create_arrowhead_tables.sql @@ -366,3 +366,19 @@ CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- QoS Manager + +CREATE TABLE IF NOT EXISTS `qos_reservation` ( + `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, + `reserved_service_id` bigint(20) NOT NULL, + `consumer_cloud_id` bigint(20), + `consumer_system_name` varchar(255) NOT NULL, + `consumer_address` varchar(255) NOT NULL, + `consumer_port` int(11) NOT NULL, + `reserved_to` timestamp NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + CONSTRAINT `fk_reserved_service` FOREIGN KEY (`reserved_service_id`) REFERENCES `service_registry` (`id`) ON DELETE CASCADE, + CONSTRAINT `fk_consumer_cloud` FOREIGN KEY (`consumer_cloud_id`) REFERENCES `cloud` (`id`) ON DELETE CASCADE, + UNIQUE KEY `unique_reserved_service` (`reserved_service_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/scripts/orchestrator_privileges.sql b/scripts/orchestrator_privileges.sql index 9595b3157..b1a4b7803 100644 --- a/scripts/orchestrator_privileges.sql +++ b/scripts/orchestrator_privileges.sql @@ -11,6 +11,7 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'orchestrator'@' GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'orchestrator'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'orchestrator'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'orchestrator'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_reservation` TO 'orchestrator'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'orchestrator'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'orchestrator'@'%'; @@ -24,6 +25,7 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'orchestrator'@' GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'orchestrator'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'orchestrator'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'orchestrator'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_reservation` TO 'orchestrator'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'orchestrator'@'%'; FLUSH PRIVILEGES; \ No newline at end of file From 4eefab9aa96b88f704c66bb6cae7072e8ae96dd5 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 24 Jan 2020 13:26:28 +0100 Subject: [PATCH 031/301] implemented QoS Manager releted endpoint at ServiceRegistry --- .../arrowhead/common/CoreCommonConstants.java | 2 ++ .../ServiceRegistryController.java | 23 +++++++++++++++++++ .../security/SRAccessControlFilter.java | 4 ++++ 3 files changed, 29 insertions(+) diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java index 3b8c884e0..06ed3abbf 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java @@ -21,6 +21,7 @@ public class CoreCommonConstants { public static final String SR_QUERY_URI = "service.registry.query.uri"; public static final String SR_QUERY_BY_SYSTEM_ID_URI = "service.registry.query.by.system.id.uri"; public static final String SR_QUERY_BY_SYSTEM_DTO_URI = "service.registry.query.by.system.dto.uri"; + public static final String SR_QUERY_ALL = "service.registry.query.all.uri"; public static final String REQUIRED_URI_LIST = "required.uri.list"; public static final String URI_SUFFIX = "-uri"; @@ -36,6 +37,7 @@ public class CoreCommonConstants { public static final String OP_SERVICE_REGISTRY_QUERY_BY_SYSTEM_ID_URI = "/query/system/{" + COMMON_FIELD_NAME_ID + "}"; public static final String OP_SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_URI = "/query/system"; + public static final String OP_SERVICE_REGISTRY_QUERY_ALL_URI = "/query/all"; public static final String ORCHESTRATOR_STORE_MGMT_URI = "/mgmt/store"; diff --git a/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/ServiceRegistryController.java b/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/ServiceRegistryController.java index f01b54f9a..ca3497483 100644 --- a/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/ServiceRegistryController.java +++ b/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/ServiceRegistryController.java @@ -735,6 +735,29 @@ public void unregisterService(@RequestParam(CommonConstants.OP_SERVICE_REGISTRY_ logger.debug("Return system by name: {}, address: {}, port: {}", systemName, address, port); return result; } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return all service registry entries", response = ServiceRegistryListResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_PRIVATE }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SERVICE_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SERVICE_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CoreCommonConstants.OP_SERVICE_REGISTRY_QUERY_ALL_URI) + @ResponseBody public ServiceRegistryListResponseDTO getServiceRegistryEntries() { + logger.debug("New Service Registry get request recieved"); + + final int page = 0; + final int size = Integer.MAX_VALUE; + final Direction direction = Direction.ASC; + final String sortField = CommonConstants.COMMON_FIELD_NAME_ID; + + final ServiceRegistryListResponseDTO serviceRegistryEntriesResponse = serviceRegistryDBService.getServiceRegistryEntriesResponse(page, size, direction, sortField); + logger.debug("Service Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); + + return serviceRegistryEntriesResponse; + } //================================================================================================= // assistant methods diff --git a/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/security/SRAccessControlFilter.java b/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/security/SRAccessControlFilter.java index d46a21ad5..6c300a0b7 100644 --- a/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/security/SRAccessControlFilter.java +++ b/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/security/SRAccessControlFilter.java @@ -27,6 +27,7 @@ public class SRAccessControlFilter extends CoreSystemAccessControlFilter { CoreSystem.AUTHORIZATION }; private static final CoreSystem[] allowedCoreSystemsForQueryBySystemId = { CoreSystem.ORCHESTRATOR }; private static final CoreSystem[] allowedCoreSystemsForQueryBySystemDTO = { CoreSystem.ORCHESTRATOR }; + private static final CoreSystem[] allowedCoreSystemsForQueryAll = { CoreSystem.QOS_MONITOR }; //================================================================================================= // assistant methods @@ -61,6 +62,9 @@ protected void checkClientAuthorized(final String clientCN, final String method, } else if (requestTarget.endsWith(CoreCommonConstants.OP_SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_URI)) { // Only dedicated core systems can use this service checkIfClientIsAnAllowedCoreSystem(clientCN, cloudCN, allowedCoreSystemsForQueryBySystemDTO, requestTarget); + } else if (requestTarget.endsWith(CoreCommonConstants.OP_SERVICE_REGISTRY_QUERY_ALL_URI)) { + // Only dedicated core systems can use this service + checkIfClientIsAnAllowedCoreSystem(clientCN, cloudCN, allowedCoreSystemsForQueryAll, requestTarget); } } From 98c64363c83f569e509a263cb812cd8d3ff9a3eb Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 24 Jan 2020 13:28:25 +0100 Subject: [PATCH 032/301] implemented queryAll ServiceRegistry entries --- .../QoSMonitorApplicationInitListener.java | 34 +++++++ .../core/qos/quartz/task/PingTask.java | 97 +++++++++++++++---- .../core/qos/quartz/task/PingTaskConfig.java | 44 ++++----- 3 files changed, 136 insertions(+), 39 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorApplicationInitListener.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorApplicationInitListener.java index a314e2303..3458d0022 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorApplicationInitListener.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorApplicationInitListener.java @@ -1,10 +1,44 @@ package eu.arrowhead.core.qos; +import java.util.Map; + +import org.springframework.context.ApplicationContext; +import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.stereotype.Component; +import org.springframework.web.util.UriComponents; import eu.arrowhead.common.ApplicationInitListener; +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.Utilities; @Component public class QoSMonitorApplicationInitListener extends ApplicationInitListener { + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + @Override + protected void customInit(final ContextRefreshedEvent event) { + logger.debug("customInit started..."); + + final ApplicationContext appContext = event.getApplicationContext(); + @SuppressWarnings("unchecked") + final Map context = appContext.getBean(CommonConstants.ARROWHEAD_CONTEXT, Map.class); + + final String scheme = sslProperties.isSslEnabled() ? CommonConstants.HTTPS : CommonConstants.HTTP; + + final UriComponents queryAll = createQueryAllUri(scheme); + context.put(CoreCommonConstants.SR_QUERY_ALL, queryAll); + } + + //------------------------------------------------------------------------------------------------- + private UriComponents createQueryAllUri(final String scheme) { + logger.debug("createQueryAllUri started..."); + + final String registyUriStr = CommonConstants.SERVICE_REGISTRY_URI + CoreCommonConstants.OP_SERVICE_REGISTRY_QUERY_ALL_URI; + + return Utilities.createURI(scheme, coreSystemRegistrationProperties.getServiceRegistryAddress(), coreSystemRegistrationProperties.getServiceRegistryPort(), registyUriStr); + } } \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 26d7071e8..8584d1a4e 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -1,5 +1,12 @@ package eu.arrowhead.core.qos.quartz.task; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.icmp4j.IcmpPingRequest; @@ -9,11 +16,22 @@ import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; +import org.springframework.web.util.UriComponents; +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.database.repository.QoSIntraMeasurementRepository; +import eu.arrowhead.common.dto.internal.ServiceRegistryListResponseDTO; +import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.exception.InvalidParameterException; +import eu.arrowhead.common.http.HttpService; @Component @DisallowConcurrentExecution @@ -23,8 +41,18 @@ public class PingTask implements Job { // members private static final String NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE = " is null or blank."; private static final int TIMES_TO_REPEAT = 10; + private static final int REST_BETWEEN_PINGS_MILLSEC = 1000; protected Logger logger = LogManager.getLogger(PingTask.class); + + @Autowired + private QoSIntraMeasurementRepository qoSIntraMeasurementRepository; + + @Autowired + private HttpService httpService; + + @Resource(name = CommonConstants.ARROWHEAD_CONTEXT) + private Map arrowheadContext; //================================================================================================= // methods @@ -34,8 +62,12 @@ public class PingTask implements Job { public void execute(final JobExecutionContext context) throws JobExecutionException { logger.debug("STARTED: ping task"); - final SystemResponseDTO system = getSystemToMessure(); - pingSystem(system); + Set systems = getSystemsToMessure(); + for (final SystemResponseDTO systemResponseDTO : systems) { + + pingSystem(systemResponseDTO); + + } logger.debug("Finished: ping task"); } @@ -44,10 +76,14 @@ public void execute(final JobExecutionContext context) throws JobExecutionExcept // assistant methods //------------------------------------------------------------------------------------------------- - private SystemResponseDTO getSystemToMessure() { + private Set getSystemsToMessure() { logger.debug("getSystemToMessure started..."); - // TODO Implement method logic here - return null; + + final ServiceRegistryListResponseDTO serviceRegistryListResponseDTO = queryServiceRegistryAll(); + + final Set systemList = serviceRegistryListResponseDTO.getData().stream().map(ServiceRegistryResponseDTO::getProvider).collect(Collectors.toSet()); + + return systemList; } //------------------------------------------------------------------------------------------------- @@ -55,27 +91,54 @@ private void pingSystem(final SystemResponseDTO system ) { logger.debug("pingSystem started..."); if (system == null || Utilities.isEmpty(system.getAddress())) { - //throw new InvalidParameterException("System.address" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE); + throw new InvalidParameterException("System.address" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE); } - - //final String address = system.getAddress(); + + final String address = system.getAddress(); try { final IcmpPingRequest request = IcmpPingUtil.createIcmpPingRequest (); - //request.setHost (address); - request.setHost ("github.com"); + request.setHost (address); for (int count = 0; count < TIMES_TO_REPEAT; count ++) { - // delegate final IcmpPingResponse response = IcmpPingUtil.executePingRequest (request); - // log final String formattedResponse = IcmpPingUtil.formatResponse (response); logger.info(formattedResponse); - // rest - Thread.sleep (1000); + + Thread.sleep (REST_BETWEEN_PINGS_MILLSEC); } - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); + } catch ( final InterruptedException | IllegalArgumentException ex) { + logger.debug("" + ex.getMessage()); } } + + //------------------------------------------------------------------------------------------------- + private ServiceRegistryListResponseDTO queryServiceRegistryAll() { + logger.debug("queryServiceRegistryAll started..."); + + try { + final UriComponents queryBySystemDTOUri = getQueryAllUri(); + final ResponseEntity response = httpService.sendRequest(queryBySystemDTOUri, HttpMethod.GET, ServiceRegistryListResponseDTO.class); + + return response.getBody(); + + } catch (final ClassCastException ex) { + throw new ArrowheadException("QoS Mointor can't find Service Registry Query All URI."); + } + + } + + //------------------------------------------------------------------------------------------------- + private UriComponents getQueryAllUri() { + logger.debug("getQueryUri started..."); + + if (arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)) { + try { + return (UriComponents) arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL); + } catch (final ClassCastException ex) { + throw new ArrowheadException("QoS Mointor can't find Service Registry Query All URI."); + } + } + + throw new ArrowheadException("QoS Mointor can't find Service Registry Query All URI."); + } } \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java index 18e69e03f..7f2942e2c 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java @@ -25,7 +25,7 @@ public class PingTaskConfig { protected Logger logger = LogManager.getLogger(PingTaskConfig.class); @Autowired - private ApplicationContext applicationContext; //NOSONAR + private ApplicationContext applicationContext; //NOSONAR @Value(CoreCommonConstants.$PING_TTL_SCHEDULED_WD) private boolean ttlScheduled; @@ -46,41 +46,41 @@ public class PingTaskConfig { public SchedulerFactoryBean pingSheduler() { final AutoWiringSpringBeanQuartzTaskFactory jobFactory = new AutoWiringSpringBeanQuartzTaskFactory(); jobFactory.setApplicationContext(applicationContext); - + final SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean(); if (ttlScheduled) { schedulerFactory.setJobFactory(jobFactory); - schedulerFactory.setJobDetails(intraCloudPingTaskDetails().getObject()); - schedulerFactory.setTriggers(intraCloudPingTaskTrigger().getObject()); - schedulerFactory.setStartupDelay(SCHEDULER_DELAY); - logger.info("Pin task adjusted with ttl interval: {} minutes", ttlInterval); + schedulerFactory.setJobDetails(intraCloudPingTaskDetails().getObject()); + schedulerFactory.setTriggers(intraCloudPingTaskTrigger().getObject()); + schedulerFactory.setStartupDelay(SCHEDULER_DELAY); + logger.info("Pin task adjusted with ttl interval: {} minutes", ttlInterval); } else { logger.info("Ping task is not adjusted"); } - return schedulerFactory; - } - + return schedulerFactory; + } + //------------------------------------------------------------------------------------------------- @Bean - public SimpleTriggerFactoryBean intraCloudPingTaskTrigger() { + public SimpleTriggerFactoryBean intraCloudPingTaskTrigger() { final SimpleTriggerFactoryBean trigger = new SimpleTriggerFactoryBean(); trigger.setJobDetail(intraCloudPingTaskDetails().getObject()); - trigger.setRepeatInterval(ttlInterval * CommonConstants.CONVERSION_MILLISECOND_TO_MINUTE); - trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY); - trigger.setName(NAME_OF_TRIGGER); - - return trigger; - } - + trigger.setRepeatInterval(ttlInterval * CommonConstants.CONVERSION_MILLISECOND_TO_MINUTE); + trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY); + trigger.setName(NAME_OF_TRIGGER); + + return trigger; + } + //------------------------------------------------------------------------------------------------- @Bean public JobDetailFactoryBean intraCloudPingTaskDetails() { final JobDetailFactoryBean jobDetailFactory = new JobDetailFactoryBean(); jobDetailFactory.setJobClass(PingTask.class); - jobDetailFactory.setName(NAME_OF_TASK); - jobDetailFactory.setDurability(true); - - return jobDetailFactory; - } + jobDetailFactory.setName(NAME_OF_TASK); + jobDetailFactory.setDurability(true); + + return jobDetailFactory; + } } \ No newline at end of file From 0e069f27529569166b848ebce636dbee2d0fbd2f Mon Sep 17 00:00:00 2001 From: rbocsi Date: Fri, 24 Jan 2020 14:36:21 +0100 Subject: [PATCH 033/301] entity class and repository --- .../database/entity/QoSReservation.java | 100 ++++++++++++++++++ .../repository/QoSReservationRepository.java | 12 +++ 2 files changed, 112 insertions(+) create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/entity/QoSReservation.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/repository/QoSReservationRepository.java diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSReservation.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSReservation.java new file mode 100644 index 000000000..4ae586bcd --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSReservation.java @@ -0,0 +1,100 @@ +package eu.arrowhead.common.database.entity; + +import java.time.ZonedDateTime; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToOne; +import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; +import javax.persistence.Table; + +@Entity +@Table(name = "qos_reservation") +public class QoSReservation { + + //================================================================================================= + // members + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private long id; + + @OneToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "reservedServiceId", referencedColumnName = "id", nullable = false, unique = true) + private ServiceRegistry reservedService; + + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "consumerCloudId", referencedColumnName = "id", nullable = true) + private Cloud consumerCloud; + + private String consumerSystemName; + private String consumerAddress; + private int consumerPort; + + private ZonedDateTime reservedTo; + + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") + private ZonedDateTime createdAt; + + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") + private ZonedDateTime updatedAt; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public QoSReservation() {} + + //------------------------------------------------------------------------------------------------- + public QoSReservation(final ServiceRegistry reservedService, final Cloud consumerCloud, final String consumerSystemName, final String consumerAddress, final int consumerPort, + final ZonedDateTime reservedTo) { + this.reservedService = reservedService; + this.consumerCloud = consumerCloud; + this.consumerSystemName = consumerSystemName; + this.consumerAddress = consumerAddress; + this.consumerPort = consumerPort; + this.reservedTo = reservedTo; + } + + //------------------------------------------------------------------------------------------------- + @PrePersist + public void onCreate() { + this.createdAt = ZonedDateTime.now(); + this.updatedAt = this.createdAt; + } + + //------------------------------------------------------------------------------------------------- + @PreUpdate + public void onUpdate() { + this.updatedAt = ZonedDateTime.now(); + } + + //------------------------------------------------------------------------------------------------- + public long getId() { return id; } + public ServiceRegistry getReservedService() { return reservedService; } + public Cloud getConsumerCloud() { return consumerCloud; } + public String getConsumerSystemName() { return consumerSystemName; } + public String getConsumerAddress() { return consumerAddress; } + public int getConsumerPort() { return consumerPort; } + public ZonedDateTime getReservedTo() { return reservedTo; } + public ZonedDateTime getCreatedAt() { return createdAt; } + public ZonedDateTime getUpdatedAt() { return updatedAt; } + + //------------------------------------------------------------------------------------------------- + public void setId(final long id) { this.id = id; } + public void setReservedService(final ServiceRegistry reservedService) { this.reservedService = reservedService; } + public void setConsumerCloud(final Cloud consumerCloud) { this.consumerCloud = consumerCloud; } + public void setConsumerSystemName(final String consumerSystemName) { this.consumerSystemName = consumerSystemName; } + public void setConsumerAddress(final String consumerAddress) { this.consumerAddress = consumerAddress; } + public void setConsumerPort(final int consumerPort) { this.consumerPort = consumerPort; } + public void setReservedTo(final ZonedDateTime reservedTo) { this.reservedTo = reservedTo; } + public void setCreatedAt(final ZonedDateTime createdAt) { this.createdAt = createdAt; } + public void setUpdatedAt(final ZonedDateTime updatedAt) { this.updatedAt = updatedAt; } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSReservationRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSReservationRepository.java new file mode 100644 index 000000000..26d5598a4 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSReservationRepository.java @@ -0,0 +1,12 @@ +package eu.arrowhead.common.database.repository; + +import org.springframework.stereotype.Repository; + +import eu.arrowhead.common.database.entity.QoSReservation; + +@Repository +public interface QoSReservationRepository extends RefreshableRepository { + + //================================================================================================= + // methods +} \ No newline at end of file From 8314cecf2914341d7904ba0a538d955aaf837028 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Fri, 24 Jan 2020 15:20:10 +0100 Subject: [PATCH 034/301] implemented device and service registry --- .../eu/arrowhead/common/CommonConstants.java | 5 +- .../arrowhead/common/CoreCommonConstants.java | 3 + .../repository/DeviceRegistryRepository.java | 17 +- .../common/dto/internal/DTOConverter.java | 56 +- .../DeviceRegistryListResponseDTO.java | 46 + .../dto/internal/SystemListResponseDTO.java | 4 +- .../common/dto/shared/DeviceQueryFormDTO.java | 137 +++ .../dto/shared/DeviceQueryResultDTO.java | 48 ++ .../DeviceRegistryController.java | 531 ++++-------- .../service/DeviceRegistryDBService.java | 807 +++++------------- .../SystemRegistryController.java | 24 +- 11 files changed, 723 insertions(+), 955 deletions(-) create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/internal/DeviceRegistryListResponseDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceQueryFormDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceQueryResultDTO.java diff --git a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java index c16b1ebda..fad5be9b6 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java @@ -89,7 +89,6 @@ public class CommonConstants { public static final String OP_SYSTEM_REGISTRY_REGISTER_URI = "/register"; public static final String OP_SYSTEM_REGISTRY_UNREGISTER_URI = "/unregister"; public static final String OP_SYSTEM_REGISTRY_QUERY_URI = "/query"; - public static final String OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_SYSTEM_NAME = "system_name"; public static final String OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_ADDRESS = "address"; public static final String OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_PORT = "port"; @@ -98,7 +97,9 @@ public class CommonConstants { public static final String OP_DEVICE_REGISTRY_REGISTER_URI = "/register"; public static final String OP_DEVICE_REGISTRY_UNREGISTER_URI = "/unregister"; public static final String OP_DEVICE_REGISTRY_QUERY_URI = "/query"; - + public static final String OP_DEVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_DEVICE_NAME = "device_name"; + public static final String OP_DEVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_ADDRESS = "address"; + public static final String OP_DEVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_MAC_ADDRESS = "mac_address"; public static final String ONBOARDING_URI = "/onboarding"; public static final String OP_ONBOARDING_PLAIN = "/plain"; diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java index aa9a2b186..d9237fa1b 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java @@ -34,6 +34,9 @@ public class CoreCommonConstants { public static final String SERVER_ERROR_URI = "/error"; public static final String MGMT_URI = "/mgmt"; + public static final String OP_DEVICE_REGISTRY_QUERY_BY_DEVICE_ID_URI = "/query/device/{" + COMMON_FIELD_NAME_ID + "}"; + public static final String OP_DEVICE_REGISTRY_QUERY_BY_DEVICE_DTO_URI = "/query/device"; + public static final String OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI = "/query/system/{" + COMMON_FIELD_NAME_ID + "}"; public static final String OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_URI = "/query/system"; diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRegistryRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRegistryRepository.java index 0ccff6e2a..7e25a7074 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRegistryRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRegistryRepository.java @@ -2,19 +2,22 @@ import eu.arrowhead.common.database.entity.Device; import eu.arrowhead.common.database.entity.DeviceRegistry; -import eu.arrowhead.common.database.entity.System; -import eu.arrowhead.common.database.entity.SystemRegistry; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; import org.springframework.stereotype.Repository; import java.util.List; import java.util.Optional; @Repository -public interface DeviceRegistryRepository extends RefreshableRepository { +public interface DeviceRegistryRepository extends RefreshableRepository +{ - //================================================================================================= - // methods + //================================================================================================= + // methods - //------------------------------------------------------------------------------------------------- - public Optional findByDevice(final Device device); + //------------------------------------------------------------------------------------------------- + Optional findByDevice(final Device device); + Page findAllByDevice(final List devices, final PageRequest pageRequest); + List findAllByDevice(final List devices); } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java index 3c4c69443..99b868518 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java @@ -223,6 +223,20 @@ public static SystemQueryResultDTO convertListOfSystemRegistryEntriesToSystemQue return new SystemQueryResultDTO(results, unfilteredHits); } + //------------------------------------------------------------------------------------------------- + public static DeviceQueryResultDTO convertListOfDeviceRegistryEntriesToDeviceQueryResultDTO(final List entries, final int unfilteredHits) { + final List results = new ArrayList<>(); + + if (entries != null) { + Assert.isTrue(unfilteredHits >= entries.size(), "Invalid value of unfiltered hits: " + unfilteredHits); + for (final DeviceRegistry srEntry : entries) { + results.add(convertDeviceRegistryToDeviceRegistryResponseDTO(srEntry)); + } + } + + return new DeviceQueryResultDTO(results, unfilteredHits); + } + //------------------------------------------------------------------------------------------------- public static AuthorizationIntraCloudResponseDTO convertAuthorizationIntraCloudToAuthorizationIntraCloudResponseDTO(final AuthorizationIntraCloud entry) { Assert.notNull(entry, "AuthorizationIntraCloud is null"); @@ -693,6 +707,47 @@ public static SystemQueryResultDTO convertSystemRegistryListToSystemQueryResultD return new SystemQueryResultDTO(list, list.size()); } + //------------------------------------------------------------------------------------------------- + public static DeviceRegistryResponseDTO convertDeviceRegistryToDeviceRegistryResponseDTO(final DeviceRegistry entry) { + + Assert.notNull(entry, "DR entry is null."); + Assert.notNull(entry.getDevice(), "Related device is null."); + + final DeviceResponseDTO deviceResponseDTO = convertDeviceToDeviceResponseDTO(entry.getDevice()); + + final DeviceRegistryResponseDTO dto = new DeviceRegistryResponseDTO(); + dto.setId(entry.getId()); + dto.setDevice(deviceResponseDTO); + dto.setEndOfValidity(Utilities.convertZonedDateTimeToUTCString(entry.getEndOfValidity())); + dto.setMetadata(Utilities.text2Map(entry.getMetadata())); + dto.setVersion(entry.getVersion()); + dto.setCreatedAt(Utilities.convertZonedDateTimeToUTCString(entry.getCreatedAt())); + dto.setUpdatedAt(Utilities.convertZonedDateTimeToUTCString(entry.getUpdatedAt())); + + return dto; + } + //------------------------------------------------------------------------------------------------- + public static DeviceRegistryListResponseDTO convertDeviceRegistryListToDeviceRegistryListResponseDTO(final Iterable page) { + + final List list = new ArrayList<>(); + for(final DeviceRegistry entry : page) + { + list.add(convertDeviceRegistryToDeviceRegistryResponseDTO(entry)); + } + return new DeviceRegistryListResponseDTO(list, list.size()); + } + + //------------------------------------------------------------------------------------------------- + public static DeviceQueryResultDTO convertDeviceRegistryListToDeviceQueryResultDTO(final Iterable page) + { + final List list = new ArrayList<>(); + for(final DeviceRegistry entry : page) + { + list.add(convertDeviceRegistryToDeviceRegistryResponseDTO(entry)); + } + return new DeviceQueryResultDTO(list, list.size()); + } + //================================================================================================= // assistant methods @@ -808,5 +863,4 @@ private static Set collectAuthorizedPublishersFromSubscriptio return result; } - } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DeviceRegistryListResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DeviceRegistryListResponseDTO.java new file mode 100644 index 000000000..f1b71c91d --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DeviceRegistryListResponseDTO.java @@ -0,0 +1,46 @@ +package eu.arrowhead.common.dto.internal; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import eu.arrowhead.common.dto.shared.DeviceRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryResponseDTO; + +import java.io.Serializable; +import java.util.List; + +@JsonInclude(Include.NON_NULL) +public class DeviceRegistryListResponseDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = 3892383727230105100L; + + private List data; + private long count; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public DeviceRegistryListResponseDTO() {} + + //------------------------------------------------------------------------------------------------- + public DeviceRegistryListResponseDTO(final List data) { + this(data, data.size()); + } + + //------------------------------------------------------------------------------------------------- + public DeviceRegistryListResponseDTO(final List data, final long count) { + this.data = data; + this.count = count; + } + + //------------------------------------------------------------------------------------------------- + public List getData() {return data;} + public long getCount() {return count;} + + //------------------------------------------------------------------------------------------------- + public void setData(final List data) {this.data = data;} + public void setCount(final long count) {this.count = count;} +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/SystemListResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/SystemListResponseDTO.java index fd1c94b31..abd8d004a 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/SystemListResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/SystemListResponseDTO.java @@ -27,9 +27,9 @@ public class SystemListResponseDTO implements Serializable { public SystemListResponseDTO() {} //------------------------------------------------------------------------------------------------- - public SystemListResponseDTO(final List systemResponeDTOList, final int totalNumberOfSystems) { + public SystemListResponseDTO(final List systemResponseDTOList, final int totalNumberOfSystems) { super(); - this.data = systemResponeDTOList; + this.data = systemResponseDTOList; this.count = totalNumberOfSystems; } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceQueryFormDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceQueryFormDTO.java new file mode 100644 index 000000000..2cfb30276 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceQueryFormDTO.java @@ -0,0 +1,137 @@ +package eu.arrowhead.common.dto.shared; + +import org.springframework.util.Assert; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +public class DeviceQueryFormDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = -2699823381165019336L; + + private String deviceNameRequirements; + private String addressRequirement; + private String macAddressRequirement; + private Map metadataRequirements; // if specified the whole content of the map must match + private Integer versionRequirement; // if specified version must match + private Integer minVersionRequirement; // if specified version must be equals or higher; ignored if versionRequirement is specified + private Integer maxVersionRequirement; // if specified version must be equals or lower; ignored if versionRequirement is specified + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public DeviceQueryFormDTO() {} + + //------------------------------------------------------------------------------------------------- + public String getDeviceNameRequirements() { return deviceNameRequirements; } + public String getAddressRequirement() { return addressRequirement; } + public String getMacAddressRequirement() { return macAddressRequirement; } + public Map getMetadataRequirements() { return metadataRequirements; } + public Integer getVersionRequirement() { return versionRequirement; } + public Integer getMinVersionRequirement() { return minVersionRequirement; } + public Integer getMaxVersionRequirement() { return maxVersionRequirement; } + + //------------------------------------------------------------------------------------------------- + public void setDeviceNameRequirements(final String deviceNameRequirements) { this.deviceNameRequirements = deviceNameRequirements; } + public void setAddressRequirement(final String addressRequirement) { this.addressRequirement = addressRequirement; } + public void setMacAddressRequirement(final String macAddressRequirement) { this.macAddressRequirement = macAddressRequirement; } + public void setMetadataRequirements(final Map metadataRequirements) { this.metadataRequirements = metadataRequirements; } + public void setVersionRequirement(final Integer versionRequirement) { this.versionRequirement = versionRequirement; } + public void setMinVersionRequirement(final Integer minVersionRequirement) { this.minVersionRequirement = minVersionRequirement; } + public void setMaxVersionRequirement(final Integer maxVersionRequirement) { this.maxVersionRequirement = maxVersionRequirement; } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private DeviceQueryFormDTO(final Builder builder) { + this.deviceNameRequirements = builder.deviceNameRequirements; + this.addressRequirement = builder.addressRequirements; + this.macAddressRequirement = builder.macAddressRequirement; + this.metadataRequirements = builder.metadataRequirements; + this.versionRequirement = builder.versionRequirement; + this.minVersionRequirement = builder.minVersionRequirement; + this.maxVersionRequirement = builder.maxVersionRequirement; + } + + //================================================================================================= + // nested classes + + //------------------------------------------------------------------------------------------------- + public static class Builder { + + //================================================================================================= + // members + + private final String deviceNameRequirements; + private String addressRequirements; + private String macAddressRequirement; + private Map metadataRequirements; + private Integer versionRequirement; + private Integer minVersionRequirement; + private Integer maxVersionRequirement; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public Builder(final String deviceNameRequirements) { + Assert.isTrue(deviceNameRequirements != null && !deviceNameRequirements.isBlank(), "deviceNameRequirements is null or blank."); + this.deviceNameRequirements = deviceNameRequirements; + } + + + //------------------------------------------------------------------------------------------------- + public Builder address(final String address) { + this.addressRequirements = address; + return this; + } + + //------------------------------------------------------------------------------------------------- + public Builder macAddress(final String macAddress) { + this.macAddressRequirement = macAddress; + return this; + } + + //------------------------------------------------------------------------------------------------- + public Builder metadata(final Map metadataRequirements) { + this.metadataRequirements = metadataRequirements; + return this; + } + + //------------------------------------------------------------------------------------------------- + public Builder metadata(final String key, final String value) { + Assert.isTrue(key != null && !key.isBlank(), "Key is null or blank"); + + if (this.metadataRequirements == null) { + this.metadataRequirements = new HashMap<>(); + } + this.metadataRequirements.put(key, value); + + return this; + } + + //------------------------------------------------------------------------------------------------- + public Builder version(final Integer versionRequirement) { + this.versionRequirement = versionRequirement; + return this; + } + + //------------------------------------------------------------------------------------------------- + public Builder version(final Integer minVersionRequirement, final Integer maxVersionRequirement) { + this.minVersionRequirement = minVersionRequirement; + this.maxVersionRequirement = maxVersionRequirement; + return this; + } + + //------------------------------------------------------------------------------------------------- + public DeviceQueryFormDTO build() { + return new DeviceQueryFormDTO(this); + } + } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceQueryResultDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceQueryResultDTO.java new file mode 100644 index 000000000..300577034 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceQueryResultDTO.java @@ -0,0 +1,48 @@ +package eu.arrowhead.common.dto.shared; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +@JsonInclude(Include.NON_NULL) +public class DeviceQueryResultDTO implements Serializable +{ + + //================================================================================================= + // members + + private static final long serialVersionUID = -1822444510232108526L; + + private List deviceQueryData = null; + private int unfilteredHits = 0; + + //================================================================================================= + // constructors + + public DeviceQueryResultDTO() + { + this(new ArrayList<>(), 0); + } + + public DeviceQueryResultDTO(final List deviceQueryData, final int unfilteredHits) + { + this.deviceQueryData = deviceQueryData; + this.unfilteredHits = unfilteredHits; + } + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public List getDeviceQueryData() { return deviceQueryData; } + + //------------------------------------------------------------------------------------------------- + public void setDeviceQueryData(final List deviceQueryData) { this.deviceQueryData = deviceQueryData; } + + public int getUnfilteredHits() { return unfilteredHits; } + + public void setUnfilteredHits(final int unfilteredHits) { this.unfilteredHits = unfilteredHits; } +} \ No newline at end of file diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java index 22ec1b59f..e9ea4907a 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java @@ -1,7 +1,6 @@ package eu.arrowhead.core.deviceregistry; import eu.arrowhead.common.*; -import eu.arrowhead.common.core.CoreDevice; import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; import eu.arrowhead.common.dto.internal.DeviceRegistryListResponseDTO; import eu.arrowhead.common.dto.shared.*; @@ -21,6 +20,8 @@ import java.time.format.DateTimeParseException; import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; @Api(tags = {CoreCommonConstants.SWAGGER_TAG_ALL}) @CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, @@ -34,75 +35,64 @@ public class DeviceRegistryController //================================================================================================= // members - private static final String GET_SYSTEM_BY_ID_HTTP_200_MESSAGE = "Device by requested id returned"; - private static final String GET_SYSTEM_BY_ID_HTTP_400_MESSAGE = "No Such Device by requested id"; - private static final String PATH_VARIABLE_ID = "id"; + private static final String GET_DEVICE_BY_ID_HTTP_200_MESSAGE = "Device by requested deviceId returned"; + private static final String GET_DEVICE_BY_ID_HTTP_400_MESSAGE = "No Such Device by requested deviceId"; + private static final String PATH_VARIABLE_ID = "deviceId"; private static final String GET_DEVICES_HTTP_200_MESSAGE = "Devices returned"; private static final String GET_DEVICES_HTTP_400_MESSAGE = " Invalid parameters"; - private static final String POST_SYSTEM_HTTP_201_MESSAGE = "Device created"; - private static final String POST_SYSTEM_HTTP_400_MESSAGE = "Could not create device"; - private static final String PUT_SYSTEM_HTTP_200_MESSAGE = "Device updated"; - private static final String PUT_SYSTEM_HTTP_400_MESSAGE = "Could not update device"; - private static final String PATCH_SYSTEM_HTTP_200_MESSAGE = "Device updated"; - private static final String PATCH_SYSTEM_HTTP_400_MESSAGE = "Could not update device"; - private static final String DELETE_SYSTEM_HTTP_200_MESSAGE = "Device deleted"; - private static final String DELETE_SYSTEM_HTTP_400_MESSAGE = "Could not delete device"; - - private static final String GET_DEVICE_BY_ID_HTTP_200_MESSAGE = "Device by requested id returned"; - private static final String GET_DEVICE_BY_ID_HTTP_400_MESSAGE = "No Such Device by requested id"; - private static final String DEVICE_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/device/{" + PATH_VARIABLE_ID + "}"; - private static final String DEVICES_URI = CoreCommonConstants.MGMT_URI + "/devices"; - private static final String DEVICES_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/devices/{" + PATH_VARIABLE_ID + "}"; - private static final String POST_DEVICE_HTTP_201_MESSAGE = "Device created"; private static final String POST_DEVICE_HTTP_400_MESSAGE = "Could not create device"; private static final String PUT_DEVICE_HTTP_200_MESSAGE = "Device updated"; private static final String PUT_DEVICE_HTTP_400_MESSAGE = "Could not update device"; + private static final String PATCH_DEVICE_HTTP_200_MESSAGE = "Device updated"; + private static final String PATCH_DEVICE_HTTP_400_MESSAGE = "Could not update device"; + private static final String DELETE_DEVICE_HTTP_200_MESSAGE = "Device deleted"; + private static final String DELETE_DEVICE_HTTP_400_MESSAGE = "Could not delete device"; - private static final String DELETE_DEVICES_HTTP_200_MESSAGE = "Device definition removed"; - private static final String DELETE_DEVICES_HTTP_400_MESSAGE = "Could not remove device definition"; - - private static final String SYSTEM_REGISTRY_REGISTER_DESCRIPTION = "Registers a device"; - private static final String SYSTEM_REGISTRY_REGISTER_201_MESSAGE = "Device registered"; - private static final String SYSTEM_REGISTRY_REGISTER_400_MESSAGE = "Could not register device"; - private static final String SYSTEM_REGISTRY_UNREGISTER_DESCRIPTION = "Remove a registered device"; - private static final String SYSTEM_REGISTRY_UNREGISTER_200_MESSAGE = "Registered device removed"; - private static final String SYSTEM_REGISTRY_UNREGISTER_400_MESSAGE = "Could not remove device"; - private static final String SYSTEM_REGISTRY_QUERY_DESCRIPTION = "Return Device Registry data that fits the specification"; - private static final String SYSTEM_REGISTRY_QUERY_200_MESSAGE = "Device Registry data returned"; - private static final String SYSTEM_REGISTRY_QUERY_400_MESSAGE = "Could not query Device Registry"; - private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_DESCRIPTION = "Return device by requested id"; - private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_200_MESSAGE = "Device data by id returned"; - private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_400_MESSAGE = "Could not query Device Registry by Consumer device id"; - private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_DESCRIPTION = "Return Device by requested dto"; - private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_200_MESSAGE = "Consumer Device data by requestDTO returned"; - private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_400_MESSAGE = "Could not query Device Registry by Consumer device requestDTO"; - private static final String SYSTEM_REGISTRY_UPDATE_DESCRIPTION = "Update a device"; - private static final String SYSTEM_REGISTRY_UPDATE_200_MESSAGE = "Device updated"; - private static final String SYSTEM_REGISTRY_UPDATE_400_MESSAGE = "Could not update device"; - private static final String SYSTEM_REGISTRY_MERGE_DESCRIPTION = "Merge/Patch a device"; - private static final String SYSTEM_REGISTRY_MERGE_200_MESSAGE = "Device merged"; - private static final String SYSTEM_REGISTRY_MERGE_400_MESSAGE = "Could not merge device"; + private static final String GET_DEVICE_REGISTRY_HTTP_200_MESSAGE = "Device Registry entries returned"; + private static final String GET_DEVICE_REGISTRY_HTTP_400_MESSAGE = "Could not retrieve device registry entries"; + private static final String DELETE_DEVICE_REGISTRY_HTTP_200_MESSAGE = "Device Registry entry removed"; + private static final String DELETE_DEVICE_REGISTRY_HTTP_400_MESSAGE = "Could not remove device registry entry"; - private static final String ID_NOT_VALID_ERROR_MESSAGE = "Id must be greater than 0. "; - private static final String SYSTEM_NAME_NULL_ERROR_MESSAGE = " Device name must have value "; - private static final String SYSTEM_ADDRESS_NULL_ERROR_MESSAGE = " Device address must have value "; - private static final String SYSTEM_PORT_NULL_ERROR_MESSAGE = " Device port must have value "; + private static final String DEVICE_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/device/{" + PATH_VARIABLE_ID + "}"; + private static final String DEVICES_URI = CoreCommonConstants.MGMT_URI + "/devices"; + private static final String DEVICES_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/devices/{" + PATH_VARIABLE_ID + "}"; + + private static final String DEVICE_REGISTRY_REGISTER_DESCRIPTION = "Registers a device"; + private static final String DEVICE_REGISTRY_REGISTER_201_MESSAGE = "Device registered"; + private static final String DEVICE_REGISTRY_REGISTER_400_MESSAGE = "Could not register device"; + private static final String DEVICE_REGISTRY_UNREGISTER_DESCRIPTION = "Remove a registered device"; + private static final String DEVICE_REGISTRY_UNREGISTER_200_MESSAGE = "Registered device removed"; + private static final String DEVICE_REGISTRY_UNREGISTER_400_MESSAGE = "Could not remove device"; + private static final String DEVICE_REGISTRY_QUERY_DESCRIPTION = "Return Device Registry data that fits the specification"; + private static final String DEVICE_REGISTRY_QUERY_200_MESSAGE = "Device Registry data returned"; + private static final String DEVICE_REGISTRY_QUERY_400_MESSAGE = "Could not query Device Registry"; + private static final String DEVICE_REGISTRY_QUERY_BY_DEVICE_ID_DESCRIPTION = "Return device by requested deviceId"; + private static final String DEVICE_REGISTRY_QUERY_BY_DEVICE_ID_200_MESSAGE = "Device data by deviceId returned"; + private static final String DEVICE_REGISTRY_QUERY_BY_DEVICE_ID_400_MESSAGE = "Could not query Device Registry by Consumer device deviceId"; + private static final String DEVICE_REGISTRY_QUERY_BY_DEVICE_DTO_DESCRIPTION = "Return Device by requested dto"; + private static final String DEVICE_REGISTRY_QUERY_BY_DEVICE_DTO_200_MESSAGE = "Consumer Device data by requestDTO returned"; + private static final String DEVICE_REGISTRY_QUERY_BY_DEVICE_DTO_400_MESSAGE = "Could not query Device Registry by Consumer device requestDTO"; + private static final String DEVICE_REGISTRY_UPDATE_DESCRIPTION = "Update a device"; + private static final String DEVICE_REGISTRY_UPDATE_200_MESSAGE = "Device updated"; + private static final String DEVICE_REGISTRY_UPDATE_400_MESSAGE = "Could not update device"; + private static final String DEVICE_REGISTRY_MERGE_DESCRIPTION = "Merge/Patch a device"; + private static final String DEVICE_REGISTRY_MERGE_200_MESSAGE = "Device merged"; + private static final String DEVICE_REGISTRY_MERGE_400_MESSAGE = "Could not merge device"; + private static final String ID_NOT_VALID_ERROR_MESSAGE = "Id must be greater than 0. "; private static final String DEVICE_NAME_NULL_ERROR_MESSAGE = " Device name must have value "; private static final String DEVICE_ADDRESS_NULL_ERROR_MESSAGE = " Device address must have value "; private static final String DEVICE_MAC_ADDRESS_NULL_ERROR_MESSAGE = " Device MAC address must have value "; - private static final String SYSTEM_REGISTRY_MGMT_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/{" + PATH_VARIABLE_ID + "}"; - private static final String PATH_VARIABLE_SYSTEM_NAME = "systenName"; - private static final String SYSTEM_REGISTRY_MGMT_BY_SYSTEM_NAME_URI = CoreCommonConstants.MGMT_URI + "/systemname" + "/{" + PATH_VARIABLE_SYSTEM_NAME + "}"; - private static final String GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE = "Device Registry entries returned"; - private static final String GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE = "Could not retrieve device registry entries"; - private static final String DELETE_SYSTEM_REGISTRY_HTTP_200_MESSAGE = "Device Registry entry removed"; - private static final String DELETE_SYSTEM_REGISTRY_HTTP_400_MESSAGE = "Could not remove device registry entry"; + private static final String PATH_VARIABLE_DEVICE_NAME = "deviceName"; + private static final String DEVICE_REGISTRY_MGMT_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/{" + PATH_VARIABLE_ID + "}"; + private static final String DEVICE_REGISTRY_MGMT_BY_DEVICE_NAME_URI = CoreCommonConstants.MGMT_URI + "/devicename" + "/{" + PATH_VARIABLE_DEVICE_NAME + "}"; - private final Logger logger = LogManager.getLogger(DeviceRegistryController.class); + private static final String MAC_ADDRESS_PATTERN = "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"; + private final Pattern macAddressPattern = Pattern.compile(MAC_ADDRESS_PATTERN); + private final Logger logger = LogManager.getLogger(DeviceRegistryController.class); private final DeviceRegistryDBService deviceRegistryDBService; @Autowired @@ -127,27 +117,27 @@ public String echoDevice() { } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return device by id", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiOperation(value = "Return device by deviceId", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_BY_ID_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_BY_ID_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_BY_ID_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_BY_ID_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @GetMapping(SYSTEM_BY_ID_URI) + @GetMapping(DEVICE_BY_ID_URI) @ResponseBody - public DeviceResponseDTO getDeviceById(@PathVariable(value = PATH_VARIABLE_ID) final long systemId) { + public DeviceResponseDTO getDeviceById(@PathVariable(value = PATH_VARIABLE_ID) final long deviceId) { logger.debug("getDeviceById started ..."); - if (systemId < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + SYSTEM_BY_ID_URI); + if (deviceId < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICE_BY_ID_URI); } - return deviceRegistryDBService.getDeviceById(systemId); + return deviceRegistryDBService.getDeviceById(deviceId); } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return systems by request parameters", response = DeviceListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiOperation(value = "Return devices by request parameters", response = DeviceListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICES_HTTP_200_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICES_HTTP_400_MESSAGE), @@ -170,84 +160,87 @@ public DeviceListResponseDTO getDevices( //------------------------------------------------------------------------------------------------- @ApiOperation(value = "Return created device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_SYSTEM_HTTP_201_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_DEVICE_HTTP_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_DEVICE_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) @PostMapping(path = DEVICES_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(org.springframework.http.HttpStatus.CREATED) @ResponseBody - public DeviceResponseDTO addDevice(@RequestBody final DeviceRequestDTO request) { - return callCreateDevice(request); + public DeviceResponseDTO addDevice(@RequestBody final DeviceRequestDTO dto) { + logger.debug("New device registration request received with name: {}", dto.getDeviceName()); + + checkDeviceRequest(dto, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); + + final DeviceResponseDTO responseDTO = deviceRegistryDBService.createDeviceDto(dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); + logger.debug("{} successfully registered.", responseDTO); + + return responseDTO; } //------------------------------------------------------------------------------------------------- @ApiOperation(value = "Return updated device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = PUT_SYSTEM_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_CREATED, message = PUT_DEVICE_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_DEVICE_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) @PutMapping(path = DEVICES_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody - public DeviceResponseDTO updateDevice(@PathVariable(value = PATH_VARIABLE_ID) final long systemId, @RequestBody final DeviceRequestDTO request) { - return callUpdateDevice(request, systemId); + public DeviceResponseDTO updateDevice(@PathVariable(value = PATH_VARIABLE_ID) final long deviceId, @RequestBody final DeviceRequestDTO dto) { + logger.debug("New device update request received with deviceId: {}, definition: {}", deviceId, dto); + + final String origin = CommonConstants.DEVICE_REGISTRY_URI + DEVICE_BY_ID_URI; + if (deviceId < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + checkDevicePutRequest(dto, deviceId); + + final DeviceResponseDTO deviceResponseDTO = deviceRegistryDBService + .updateDeviceByIdResponse(deviceId, dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); + logger.debug("Device with deviceId: '{}' successfully updated with definition '{}'.", deviceId, deviceResponseDTO); + + return deviceResponseDTO; } //------------------------------------------------------------------------------------------------- @ApiOperation(value = "Return device updated by fields", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = PATCH_SYSTEM_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PATCH_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_CREATED, message = PATCH_DEVICE_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PATCH_DEVICE_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) @PatchMapping(path = DEVICES_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody - public DeviceResponseDTO mergeDevice(@PathVariable(value = PATH_VARIABLE_ID) final long systemId, @RequestBody final DeviceRequestDTO request) { - return callMergeDevice(request, systemId); + public DeviceResponseDTO mergeDevice(@PathVariable(value = PATH_VARIABLE_ID) final long deviceId, @RequestBody final DeviceRequestDTO request) { + logger.debug("mergeDevice started..."); + + checkDeviceMergeRequest(request, deviceId); + return deviceRegistryDBService.mergeDevice(deviceId, request); } //------------------------------------------------------------------------------------------------- @ApiOperation(value = "Remove device", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEM_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_DEVICE_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_DEVICE_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) @DeleteMapping(path = DEVICES_BY_ID_URI) public void removeDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New Device delete request received with id: {}", id); + logger.debug("New Device delete request received with deviceId: {}", id); if (id < 1) { throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_BY_ID_URI); } deviceRegistryDBService.removeDeviceById(id); - logger.debug("Device with id: '{}' successfully deleted", id); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return device by id", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_BY_ID_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_BY_ID_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(DEVICES_BY_ID_URI) - @ResponseBody - public DeviceResponseDTO getDeviceById(@PathVariable(value = PATH_VARIABLE_ID) final long deviceId) { - logger.debug("getDeviceById started ..."); - - if (deviceId < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + SYSTEM_BY_ID_URI); - } - - return deviceRegistryDBService.getDeviceById(deviceId); + logger.debug("Device with deviceId: '{}' successfully deleted", id); } //------------------------------------------------------------------------------------------------- @@ -274,80 +267,11 @@ public DeviceListResponseDTO getDeviceListByRequestParameters( return deviceListResponseDTO; } - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return created device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_DEVICE_HTTP_201_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_DEVICE_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PostMapping(path = DEVICES_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) - @ResponseBody - public DeviceResponseDTO addDevice(@RequestBody final DeviceRequestDTO dto) { - logger.debug("New device registration request received with name: {}", dto.getDeviceName()); - - validateDevice(dto); - - final DeviceResponseDTO responseDTO = deviceRegistryDBService.createDeviceDto(dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); - logger.debug("{} successfully registered.", responseDTO); - - return responseDTO; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return updated device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = PUT_DEVICE_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_DEVICE_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PutMapping(path = DEVICE_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public DeviceResponseDTO putUpdateDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id, - @RequestBody final DeviceRequestDTO dto) { - logger.debug("New device update request received with id: {}, definition: {}", id, dto); - - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICE_BY_ID_URI); - } - - validateDevice(dto); - - final DeviceResponseDTO deviceResponseDTO = deviceRegistryDBService - .updateDeviceByIdResponse(id, dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); - logger.debug("Device with id: '{}' successfully updated with definition '{}'.", id, deviceResponseDTO); - - return deviceResponseDTO; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Remove device", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_DEVICES_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_DEVICES_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @DeleteMapping(path = DEVICE_BY_ID_URI) - public void removeDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New Device Definition delete request received with id: {}", id); - - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICE_BY_ID_URI); - } - - deviceRegistryDBService.removeDeviceById(id); - logger.debug("Device with id: '{}' successfully deleted", id); - } - //------------------------------------------------------------------------------------------------- @ApiOperation(value = "Return requested device registry entries by the given parameters", response = DeviceRegistryListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_REGISTRY_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) @@ -371,21 +295,21 @@ public DeviceRegistryListResponseDTO getDeviceRegistryEntries( //------------------------------------------------------------------------------------------------- @ApiOperation(value = "Return requested device registry entry", response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_REGISTRY_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @GetMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI) + @GetMapping(path = DEVICE_REGISTRY_MGMT_BY_ID_URI) @ResponseBody public DeviceRegistryResponseDTO getDeviceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New Device Registry get request received with id: {}", id); + logger.debug("New Device Registry get request received with deviceId: {}", id); if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_ID_URI); + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICE_REGISTRY_MGMT_BY_ID_URI); } final DeviceRegistryResponseDTO systemRegistryEntryByIdResponse = deviceRegistryDBService.getDeviceRegistryById(id); - logger.debug("Device Registry entry with id: {} successfully retrieved", id); + logger.debug("Device Registry entry with deviceId: {} successfully retrieved", id); return systemRegistryEntryByIdResponse; } @@ -394,29 +318,29 @@ public DeviceRegistryResponseDTO getDeviceRegistryEntryById(@PathVariable(value @ApiOperation(value = "Return requested device registry entries by device definition based on the given parameters", response = DeviceRegistryListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_REGISTRY_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @GetMapping(path = SYSTEM_REGISTRY_MGMT_BY_SYSTEM_NAME_URI) + @GetMapping(path = DEVICE_REGISTRY_MGMT_BY_DEVICE_NAME_URI) @ResponseBody public DeviceRegistryListResponseDTO getDeviceRegistryEntriesByDeviceName( - @PathVariable(value = PATH_VARIABLE_SYSTEM_NAME) final String systemName, + @PathVariable(value = PATH_VARIABLE_DEVICE_NAME) final String deviceName, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { logger.debug("New Device Registry get by Device Definition request received with page: {} and item_per page: {}", page, size); - final String origin = CommonConstants.DEVICE_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_SYSTEM_NAME_URI; - if (Utilities.isEmpty(systemName)) { + final String origin = CommonConstants.DEVICE_REGISTRY_URI + DEVICE_REGISTRY_MGMT_BY_DEVICE_NAME_URI; + if (Utilities.isEmpty(deviceName)) { throw new BadPayloadException("Device name cannot be empty.", HttpStatus.SC_BAD_REQUEST, origin); } final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, origin); final DeviceRegistryListResponseDTO systemRegistryEntries = deviceRegistryDBService - .getDeviceRegistryEntriesByDeviceName(systemName, pageParameters, sortField); + .getDeviceRegistryEntriesByDeviceName(deviceName, pageParameters, sortField); logger.debug("Device Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); return systemRegistryEntries; @@ -425,37 +349,38 @@ public DeviceRegistryListResponseDTO getDeviceRegistryEntriesByDeviceName( //------------------------------------------------------------------------------------------------- @ApiOperation(value = "Remove the specified device registry entry", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEM_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEM_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_DEVICE_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_DEVICE_REGISTRY_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @DeleteMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI) + @DeleteMapping(path = DEVICE_REGISTRY_MGMT_BY_ID_URI) public void removeDeviceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New Device Registry delete request received with id: {}", id); + logger.debug("New Device Registry delete request received with deviceId: {}", id); if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_ID_URI); + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICE_REGISTRY_MGMT_BY_ID_URI); } deviceRegistryDBService.removeDeviceRegistryEntryById(id); - logger.debug("Device Registry with id: '{}' successfully deleted", id); + logger.debug("Device Registry with deviceId: '{}' successfully deleted", id); } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_REGISTER_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) + @ApiOperation(value = DEVICE_REGISTRY_REGISTER_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = SYSTEM_REGISTRY_REGISTER_201_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_REGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_CREATED, message = DEVICE_REGISTRY_REGISTER_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DEVICE_REGISTRY_REGISTER_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) - @PostMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(path = {CommonConstants.OP_DEVICE_REGISTRY_REGISTER_URI, CoreCommonConstants.MGMT_URI}, + consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public DeviceRegistryResponseDTO registerDevice(@RequestBody final DeviceRegistryRequestDTO request) { logger.debug("New device registration request received"); - checkDeviceRegistryRequest(request, false); + checkDeviceRegistryRequest(request, CommonConstants.DEVICE_REGISTRY_URI + CommonConstants.OP_DEVICE_REGISTRY_REGISTER_URI); final DeviceRegistryResponseDTO response = deviceRegistryDBService.registerDeviceRegistry(request); logger.debug("{} successfully registers its device {}", request.getDevice().getDeviceName(), request.getDevice()); @@ -464,35 +389,14 @@ public DeviceRegistryResponseDTO registerDevice(@RequestBody final DeviceRegistr } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_REGISTER_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = SYSTEM_REGISTRY_REGISTER_201_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_REGISTER_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) - @PostMapping(path = CoreCommonConstants.MGMT_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public @ResponseBody - DeviceRegistryResponseDTO addDeviceRegistry(@RequestBody final DeviceRegistryRequestDTO request) { - logger.debug("New device registration request received"); - checkDeviceRegistryRequest(request, CoreCommonConstants.MGMT_URI, true); - - final DeviceRegistryResponseDTO response = deviceRegistryDBService.registerDeviceRegistry(request); - logger.debug("{}'s device {} is successfully registered", request.getDevice().getDeviceName(), request.getDevice()); - - return response; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_UPDATE_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiOperation(value = DEVICE_REGISTRY_UPDATE_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_UPDATE_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_UPDATE_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = DEVICE_REGISTRY_UPDATE_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DEVICE_REGISTRY_UPDATE_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @PutMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @PutMapping(path = DEVICE_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody DeviceRegistryResponseDTO updateDeviceRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final DeviceRegistryRequestDTO request) { logger.debug("New device registry update request received"); @@ -506,14 +410,14 @@ DeviceRegistryResponseDTO updateDeviceRegistry(@PathVariable(value = PATH_VARIAB //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_MERGE_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiOperation(value = DEVICE_REGISTRY_MERGE_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_MERGE_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_MERGE_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = DEVICE_REGISTRY_MERGE_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DEVICE_REGISTRY_MERGE_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @PatchMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @PatchMapping(path = DEVICE_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody DeviceRegistryResponseDTO mergeDeviceRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final DeviceRegistryRequestDTO request) { logger.debug("New device registry merge request received"); @@ -526,40 +430,39 @@ DeviceRegistryResponseDTO mergeDeviceRegistry(@PathVariable(value = PATH_VARIABL } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_UNREGISTER_DESCRIPTION, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) + @ApiOperation(value = DEVICE_REGISTRY_UNREGISTER_DESCRIPTION, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_UNREGISTER_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_UNREGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = DEVICE_REGISTRY_UNREGISTER_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DEVICE_REGISTRY_UNREGISTER_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @DeleteMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_URI) - public void unregisterDevice(@RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_SYSTEM_NAME) final String systemName, - @RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_ADDRESS) final String address, - @RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_PORT) final int port) { + @DeleteMapping(path = CommonConstants.OP_DEVICE_REGISTRY_UNREGISTER_URI) + public void unregisterDevice(@RequestParam(CommonConstants.OP_DEVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_DEVICE_NAME) final String deviceName, + @RequestParam(CommonConstants.OP_DEVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_MAC_ADDRESS) final String macAddress) { logger.debug("Device removal request received"); - checkUnregisterDeviceParameters(systemName, address, port); + checkUnregisterDeviceParameters(deviceName, macAddress); - deviceRegistryDBService.removeDeviceRegistryByNameAndAddressAndPort(systemName, address, port); - logger.debug("{} successfully removed", systemName); + deviceRegistryDBService.removeDeviceRegistryByNameAndMacAddress(deviceName, macAddress); + logger.debug("{} successfully removed", deviceName); } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_QUERY_DESCRIPTION, response = DeviceQueryResultDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) + @ApiOperation(value = DEVICE_REGISTRY_QUERY_DESCRIPTION, response = DeviceQueryResultDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_QUERY_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_QUERY_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = DEVICE_REGISTRY_QUERY_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DEVICE_REGISTRY_QUERY_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @PostMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_QUERY_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(path = CommonConstants.OP_DEVICE_REGISTRY_QUERY_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public DeviceQueryResultDTO queryRegistry(@RequestBody final DeviceQueryFormDTO form) { logger.debug("Device query request received"); if (Utilities.isEmpty(form.getDeviceNameRequirements())) { throw new BadPayloadException("Device definition requirement is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + - CommonConstants.OP_SYSTEM_REGISTRY_QUERY_URI); + CommonConstants.OP_DEVICE_REGISTRY_QUERY_URI); } final DeviceQueryResultDTO result = deviceRegistryDBService.queryRegistry(form); @@ -569,51 +472,50 @@ public DeviceQueryResultDTO queryRegistry(@RequestBody final DeviceQueryFormDTO } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_DESCRIPTION, response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_PRIVATE}) + @ApiOperation(value = DEVICE_REGISTRY_QUERY_BY_DEVICE_ID_DESCRIPTION, response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_PRIVATE}) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = DEVICE_REGISTRY_QUERY_BY_DEVICE_ID_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DEVICE_REGISTRY_QUERY_BY_DEVICE_ID_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @GetMapping(path = CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(path = CoreCommonConstants.OP_DEVICE_REGISTRY_QUERY_BY_DEVICE_ID_URI, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody - public DeviceResponseDTO queryRegistryByDeviceId(@PathVariable(value = PATH_VARIABLE_ID) final long systemId) { - logger.debug("Device query by device id request received"); + public DeviceResponseDTO queryRegistryByDeviceId(@PathVariable(value = PATH_VARIABLE_ID) final long deviceId) { + logger.debug("Device query by device deviceId request received"); - if (systemId < 1) { + if (deviceId < 1) { throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + - CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI); + CoreCommonConstants.OP_DEVICE_REGISTRY_QUERY_BY_DEVICE_ID_URI); } - final DeviceResponseDTO result = deviceRegistryDBService.getDeviceById(systemId); + final DeviceResponseDTO result = deviceRegistryDBService.getDeviceById(deviceId); - logger.debug("Return device by id: {}", systemId); + logger.debug("Return device by deviceId: {}", deviceId); return result; } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_DESCRIPTION, response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_PRIVATE}) + @ApiOperation(value = DEVICE_REGISTRY_QUERY_BY_DEVICE_DTO_DESCRIPTION, response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_PRIVATE}) @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_OK, message = DEVICE_REGISTRY_QUERY_BY_DEVICE_DTO_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DEVICE_REGISTRY_QUERY_BY_DEVICE_DTO_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @PostMapping(path = CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(path = CoreCommonConstants.OP_DEVICE_REGISTRY_QUERY_BY_DEVICE_DTO_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public DeviceResponseDTO queryRegistryByDeviceDTO(@RequestBody final DeviceRequestDTO request) { logger.debug("Device query by systemRequestDTO request received"); - checkDeviceRequest(request, CommonConstants.DEVICE_REGISTRY_URI + CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI, false); + checkDeviceRequest(request, CommonConstants.DEVICE_REGISTRY_URI + CoreCommonConstants.OP_DEVICE_REGISTRY_QUERY_BY_DEVICE_ID_URI); final String systemName = request.getDeviceName(); - final String address = request.getAddress(); - final int port = request.getPort(); + final String macAddress = request.getMacAddress(); - final DeviceResponseDTO result = deviceRegistryDBService.getDeviceDtoByNameAndAddressAndPort(systemName, address, port); + final DeviceResponseDTO result = deviceRegistryDBService.getDeviceDtoByNameAndMacAddress(systemName, macAddress); - logger.debug("Return device by name: {}, address: {}, port: {}", systemName, address, port); + logger.debug("Return device by name: {}, macAddress: {}", systemName, macAddress); return result; } @@ -621,82 +523,28 @@ public DeviceResponseDTO queryRegistryByDeviceDTO(@RequestBody final DeviceReque // assistant methods //------------------------------------------------------------------------------------------------- - private DeviceResponseDTO callCreateDevice(final DeviceRequestDTO request) { - logger.debug("callCreateDevice started..."); - - checkDeviceRequest(request, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI, true); - - final String systemName = request.getDeviceName(); - final String address = request.getAddress(); - final int port = request.getPort(); - final String authenticationInfo = request.getAuthenticationInfo(); - - return deviceRegistryDBService.createDeviceDto(systemName, address, port, authenticationInfo); - } - - //------------------------------------------------------------------------------------------------- - private DeviceResponseDTO callUpdateDevice(final DeviceRequestDTO request, final long systemId) { - logger.debug("callUpdateDevice started..."); - - checkDevicePutRequest(request, systemId); - - final String validatedDeviceName = request.getDeviceName().toLowerCase(); - final String validatedAddress = request.getAddress().toLowerCase(); - final int validatedPort = request.getPort(); - final String validatedAuthenticationInfo = request.getAuthenticationInfo(); - - return deviceRegistryDBService.updateDeviceDto(systemId, validatedDeviceName, validatedAddress, validatedPort, validatedAuthenticationInfo); - } - - //------------------------------------------------------------------------------------------------- - private DeviceResponseDTO callMergeDevice(final DeviceRequestDTO request, final long systemId) { - logger.debug("callMergeDevice started..."); - - checkDeviceMergeRequest(request, systemId); - - final String validatedDeviceName = request.getDeviceName() != null ? request.getDeviceName().toLowerCase() : ""; - final String validatedAddress = request.getAddress() != null ? request.getAddress().toLowerCase() : ""; - final Integer validatedPort = request.getPort(); - final String validatedAuthenticationInfo = request.getAuthenticationInfo(); - - return deviceRegistryDBService.mergeDeviceResponse(systemId, validatedDeviceName, validatedAddress, validatedPort, validatedAuthenticationInfo); - } - - //------------------------------------------------------------------------------------------------- - private void checkDeviceMergeRequest(final DeviceRequestDTO request, final long systemId) { + private void checkDeviceMergeRequest(final DeviceRequestDTO request, final long deviceId) { logger.debug("checkDevicePatchRequest started..."); final String origin = CommonConstants.DEVICE_REGISTRY_URI + DEVICES_BY_ID_URI; - if (systemId <= 0) { + if (deviceId <= 0) { throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_BY_ID_URI); } boolean needChange = false; - if (!Utilities.isEmpty(request.getAddress())) { + if (Utilities.notEmpty(request.getAddress())) { needChange = true; } - - if (!Utilities.isEmpty(request.getDeviceName())) { + if (Utilities.notEmpty(request.getDeviceName())) { needChange = true; - for (final CoreDevice coreSysteam : CoreDevice.values()) { - if (coreSysteam.name().equalsIgnoreCase(request.getDeviceName().trim())) { - throw new BadPayloadException("Device name '" + request.getDeviceName() + "' is a reserved arrowhead core device name.", HttpStatus.SC_BAD_REQUEST, origin); - } - } } - if (request.getPort() != null) { - final int validatedPort = request.getPort(); - if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { - throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, - origin); - } - + if (Utilities.notEmpty(request.getMacAddress())) { needChange = true; } - if (request.getAuthenticationInfo() != null) { + if (Utilities.notEmpty(request.getAuthenticationInfo())) { needChange = true; } @@ -706,11 +554,11 @@ private void checkDeviceMergeRequest(final DeviceRequestDTO request, final long } //------------------------------------------------------------------------------------------------- - private void checkDevicePutRequest(final DeviceRequestDTO request, final long systemId) { + private void checkDevicePutRequest(final DeviceRequestDTO request, final long deviceId) { logger.debug("checkDevicePutRequest started..."); final String origin = CommonConstants.DEVICE_REGISTRY_URI + DEVICES_BY_ID_URI; - if (systemId <= 0) { + if (deviceId <= 0) { throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); } @@ -737,14 +585,6 @@ private void checkDeviceRequest(final DeviceRequestDTO request, final String ori } } - //------------------------------------------------------------------------------------------------- - private void checkDeviceRegistryRequest(final DeviceRegistryRequestDTO request) { - logger.debug("checkDeviceRegistryRequest started..."); - - final String origin = CommonConstants.DEVICE_REGISTRY_URI + CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI; - checkDeviceRegistryRequest(request, origin); - } - //------------------------------------------------------------------------------------------------- private void checkDeviceRegistryRequest(final DeviceRegistryRequestDTO request, final String origin) { logger.debug("checkDeviceRegistryRequest started..."); @@ -762,22 +602,27 @@ private void checkDeviceRegistryRequest(final DeviceRegistryRequestDTO request, } //------------------------------------------------------------------------------------------------- - private void checkUnregisterDeviceParameters(final String systemName, final String address, final int port) { + private void checkUnregisterDeviceParameters(final String systemName, final String macAddress) + { // parameters can't be null, but can be empty logger.debug("checkUnregisterDeviceParameters started..."); - final String origin = CommonConstants.DEVICE_REGISTRY_URI + CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_URI; + final String origin = CommonConstants.DEVICE_REGISTRY_URI + CommonConstants.OP_DEVICE_REGISTRY_UNREGISTER_URI; - if (Utilities.isEmpty(systemName)) { + if (Utilities.isEmpty(systemName)) + { throw new BadPayloadException("Name of the device is blank", HttpStatus.SC_BAD_REQUEST, origin); } - if (Utilities.isEmpty(address)) { - throw new BadPayloadException("Address of the device is blank", HttpStatus.SC_BAD_REQUEST, origin); + if (Utilities.isEmpty(macAddress)) + { + throw new BadPayloadException("MAC Address of the device is blank", HttpStatus.SC_BAD_REQUEST, origin); } - if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { - throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, origin); + final Matcher matcher = macAddressPattern.matcher(macAddress); + if (matcher.matches()) + { + throw new BadPayloadException("Unrecognized format of MAC Address", HttpStatus.SC_BAD_REQUEST, origin); } } @@ -790,22 +635,6 @@ private void checkDeviceRegistryUpdateRequest(final long id, final DeviceRegistr } checkDeviceRegistryRequest(request, origin); - - } - - //------------------------------------------------------------------------------------------------- - private void validateDevice(@RequestBody final DeviceRequestDTO deviceRequestDto) { - if (Utilities.isEmpty(deviceRequestDto.getDeviceName())) { - throw new BadPayloadException("Device name is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); - } - - if (Utilities.isEmpty(deviceRequestDto.getAddress())) { - throw new BadPayloadException("Device address is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); - } - - if (Utilities.isEmpty(deviceRequestDto.getMacAddress())) { - throw new BadPayloadException("Device MAC address is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); - } } //------------------------------------------------------------------------------------------------- diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java index 2b083c0ee..5541edce7 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java @@ -2,16 +2,14 @@ import eu.arrowhead.common.*; import eu.arrowhead.common.database.entity.Device; +import eu.arrowhead.common.database.entity.DeviceRegistry; import eu.arrowhead.common.database.entity.System; -import eu.arrowhead.common.database.entity.SystemRegistry; import eu.arrowhead.common.database.repository.DeviceRegistryRepository; import eu.arrowhead.common.database.repository.DeviceRepository; -import eu.arrowhead.common.database.repository.SystemRegistryRepository; import eu.arrowhead.common.database.repository.SystemRepository; import eu.arrowhead.common.dto.internal.DTOConverter; import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; -import eu.arrowhead.common.dto.internal.SystemListResponseDTO; -import eu.arrowhead.common.dto.internal.SystemRegistryListResponseDTO; +import eu.arrowhead.common.dto.internal.DeviceRegistryListResponseDTO; import eu.arrowhead.common.dto.shared.*; import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.exception.InvalidParameterException; @@ -21,14 +19,10 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.Socket; import java.time.ZonedDateTime; import java.time.format.DateTimeParseException; import java.util.*; @@ -48,8 +42,6 @@ public class DeviceRegistryDBService private final DeviceRegistryRepository deviceRegistryRepository; - private final SystemRegistryRepository systemRegistryRepository; - private final SystemRepository systemRepository; private final DeviceRepository deviceRepository; @@ -61,13 +53,11 @@ public class DeviceRegistryDBService @Autowired public DeviceRegistryDBService(final DeviceRegistryRepository deviceRegistryRepository, - final SystemRegistryRepository systemRegistryRepository, final SystemRepository systemRepository, final DeviceRepository deviceRepository, final SSLProperties sslProperties) { this.deviceRegistryRepository = deviceRegistryRepository; - this.systemRegistryRepository = systemRegistryRepository; this.systemRepository = systemRepository; this.deviceRepository = deviceRepository; this.sslProperties = sslProperties; @@ -77,128 +67,6 @@ public DeviceRegistryDBService(final DeviceRegistryRepository deviceRegistryRepo //================================================================================================= // methods - //------------------------------------------------------------------------------------------------- - public SystemResponseDTO getSystemById(final long systemId) - { - logger.debug("getSystemById started..."); - - try - { - final Optional systemOption = systemRepository.findById(systemId); - if (systemOption.isEmpty()) - { - throw new InvalidParameterException("System with id " + systemId + " not found."); - } - - return DTOConverter.convertSystemToSystemResponseDTO(systemOption.get()); - } - catch (final InvalidParameterException ex) - { - throw ex; - } - catch (final Exception ex) - { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } - } - - - //------------------------------------------------------------------------------------------------- - public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) - { - logger.debug("getSystemEntries started..."); - - final int validatedPage = pageParams.getValidatedPage(); - final int validatedSize = pageParams.getValidatedSize(); - final Sort.Direction validatedDirection = pageParams.getValidatedDirection(); - final String validatedSortField = Utilities.isEmpty(sortField) ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); - - if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) - { - throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); - } - - try - { - return DTOConverter.convertSystemEntryListToSystemListResponseDTO( - systemRepository.findAll(PageRequest.of(validatedPage, validatedSize, validatedDirection, validatedSortField))); - } - catch (final Exception ex) - { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } - } - - //------------------------------------------------------------------------------------------------- - @Transactional(rollbackFor = ArrowheadException.class) - public SystemResponseDTO createSystemDto(final String systemName, final String address, final int port, final String authenticationInfo) - { - logger.debug("createSystemResponse started..."); - - return DTOConverter.convertSystemToSystemResponseDTO(createSystem(systemName, address, port, authenticationInfo)); - } - - //------------------------------------------------------------------------------------------------- - @Transactional(rollbackFor = ArrowheadException.class) - public SystemResponseDTO updateSystemDto(final long systemId, final String systemName, final String address, final int port, - final String authenticationInfo) - { - logger.debug("updateSystemResponse started..."); - - return DTOConverter.convertSystemToSystemResponseDTO(updateSystem(systemId, systemName, address, port, authenticationInfo)); - } - - //------------------------------------------------------------------------------------------------- - @Transactional(rollbackFor = ArrowheadException.class) - public System updateSystem(final long systemId, final String systemName, final String address, final int port, final String authenticationInfo) - { - logger.debug("updateSystem started..."); - - final long validatedSystemId = validateId(systemId); - final int validatedPort = validateSystemPort(port); - final String validatedSystemName = validateParamString(systemName); - if (validatedSystemName.contains(".")) - { - throw new InvalidParameterException("System name can't contain dot (.)"); - } - final String validatedAddress = validateParamString(address); - - - try - { - final Optional systemOptional = systemRepository.findById(validatedSystemId); - if (systemOptional.isEmpty()) - { - throw new InvalidParameterException("No system with id : " + validatedSystemId); - } - - final System system = systemOptional.get(); - - if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) - { - checkConstraintsOfSystemTable(validatedSystemName, validatedAddress, validatedPort); - } - - system.setSystemName(validatedSystemName); - system.setAddress(validatedAddress); - system.setPort(validatedPort); - system.setAuthenticationInfo(authenticationInfo); - - return systemRepository.saveAndFlush(system); - } - catch (final InvalidParameterException ex) - { - throw ex; - } - catch (final Exception ex) - { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } - } - //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public void removeSystemById(final long id) @@ -226,82 +94,6 @@ public void removeSystemById(final long id) } } - //------------------------------------------------------------------------------------------------- - @Transactional(rollbackFor = ArrowheadException.class) - public SystemResponseDTO mergeSystemResponse(final long systemId, final String systemName, final String address, final Integer port, - final String authenticationInfo) - { - logger.debug("mergeSystemResponse started..."); - - return DTOConverter.convertSystemToSystemResponseDTO(mergeSystem(systemId, systemName, address, port, authenticationInfo)); - } - - //------------------------------------------------------------------------------------------------- - @Transactional(rollbackFor = ArrowheadException.class) - public System mergeSystem(final long systemId, final String systemName, final String address, final Integer port, final String authenticationInfo) - { - logger.debug("mergeSystem started..."); - - final long validatedSystemId = validateId(systemId); - final Integer validatedPort = validateAllowNullSystemPort(port); - final String validatedSystemName = validateAllowNullParamString(systemName); - if (validatedSystemName != null && validatedSystemName.contains(".")) - { - throw new InvalidParameterException("System name can't contain dot (.)"); - } - final String validatedAddress = validateAllowNullParamString(address); - - try - { - final Optional systemOptional = systemRepository.findById(validatedSystemId); - if (systemOptional.isEmpty()) - { - throw new InvalidParameterException("No system with id : " + validatedSystemId); - } - - final System system = systemOptional.get(); - - if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) - { - checkConstraintsOfSystemTable(validatedSystemName != null ? validatedSystemName : system.getSystemName(), - validatedAddress != null ? validatedAddress : system.getAddress(), - validatedPort != null ? validatedPort : system.getPort()); - } - - if (Utilities.notEmpty(validatedSystemName)) - { - system.setSystemName(validatedSystemName); - } - - if (Utilities.notEmpty(validatedAddress)) - { - system.setAddress(validatedAddress); - } - - if (validatedPort != null) - { - system.setPort(validatedPort); - } - - if (Utilities.notEmpty(authenticationInfo)) - { - system.setAuthenticationInfo(authenticationInfo); - } - - return systemRepository.saveAndFlush(system); - } - catch (final InvalidParameterException ex) - { - throw ex; - } - catch (final Exception ex) - { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } - } - - //------------------------------------------------------------------------------------------------- public DeviceResponseDTO getDeviceById(long deviceId) { @@ -424,24 +216,80 @@ public void removeDeviceById(final long id) //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemRegistryListResponseDTO getSystemRegistryEntries(final CoreUtilities.ValidatedPageParams params, final String sortField) + public DeviceResponseDTO mergeDevice(final long deviceId, final DeviceRequestDTO request) + { + logger.debug("mergeDevice started..."); + + try + { + final Optional deviceOptional = deviceRepository.findById(deviceId); + final Device device = deviceOptional.orElseThrow(() -> new InvalidParameterException("Device with id " + deviceId + " not found.")); + + return DTOConverter.convertDeviceToDeviceResponseDTO(mergeDevice(request, device)); + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public DeviceRegistryListResponseDTO getDeviceRegistryEntries(final CoreUtilities.ValidatedPageParams params, final String sortField) + { + logger.debug("getDeviceRegistryEntries started..."); + final String validatedSortField = sortField == null ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); + + if (!DeviceRegistry.SORTABLE_FIELDS_BY.contains(validatedSortField)) + { + throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); + } + + try + { + final PageRequest pageRequest = PageRequest.of(params.getValidatedPage(), + params.getValidatedSize(), + params.getValidatedDirection(), + validatedSortField); + final Page deviceRegistryPage = deviceRegistryRepository.findAll(pageRequest); + return DTOConverter.convertDeviceRegistryListToDeviceRegistryListResponseDTO(deviceRegistryPage); + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public DeviceRegistryListResponseDTO getDeviceRegistryEntriesByDeviceName(final String deviceName, + final CoreUtilities.ValidatedPageParams params, + final String sortField) { - logger.debug("getSystemRegistryEntries started..."); + logger.debug("getDeviceRegistryEntriesByDeviceName started..."); final String validatedSortField = sortField == null ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); - if (!SystemRegistry.SORTABLE_FIELDS_BY.contains(validatedSortField)) + if (!DeviceRegistry.SORTABLE_FIELDS_BY.contains(validatedSortField)) { throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); } try { + final List devices = deviceRepository.findByDeviceName(Utilities.lowerCaseTrim(deviceName)); + final PageRequest pageRequest = PageRequest.of(params.getValidatedPage(), params.getValidatedSize(), params.getValidatedDirection(), validatedSortField); - final Page systemRegistryPage = systemRegistryRepository.findAll(pageRequest); - return DTOConverter.convertSystemRegistryListToSystemRegistryListResponseDTO(systemRegistryPage); + final Page deviceRegistryPage = deviceRegistryRepository.findAllByDevice(devices, pageRequest); + return DTOConverter.convertDeviceRegistryListToDeviceRegistryListResponseDTO(deviceRegistryPage); } catch (final Exception ex) { @@ -452,28 +300,28 @@ public SystemRegistryListResponseDTO getSystemRegistryEntries(final CoreUtilitie //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemRegistryResponseDTO getSystemRegistryById(final long id) + public DeviceRegistryResponseDTO getDeviceRegistryById(final long id) { - logger.debug("getSystemRegistryById started..."); + logger.debug("getDeviceRegistryById started..."); - return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(getSystemRegistryEntryById(id)); + return DTOConverter.convertDeviceRegistryToDeviceRegistryResponseDTO(getDeviceRegistryEntryById(id)); } //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public void removeSystemRegistryEntryById(final long id) + public void removeDeviceRegistryEntryById(final long id) { - logger.debug("removeSystemRegistryEntryById started..."); + logger.debug("removeDeviceRegistryEntryById started..."); try { - if (!systemRegistryRepository.existsById(id)) + if (!deviceRegistryRepository.existsById(id)) { - throw new InvalidParameterException("System Registry entry with id '" + id + "' does not exists"); + throw new InvalidParameterException("Device Registry entry with id '" + id + "' does not exists"); } - systemRegistryRepository.deleteById(id); - systemRegistryRepository.flush(); + deviceRegistryRepository.deleteById(id); + deviceRegistryRepository.flush(); } catch (final InvalidParameterException ex) { @@ -489,22 +337,21 @@ public void removeSystemRegistryEntryById(final long id) //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemRegistryResponseDTO registerSystemRegistry(final SystemRegistryRequestDTO request) + public DeviceRegistryResponseDTO registerDeviceRegistry(final DeviceRegistryRequestDTO request) { - logger.debug("registerSystemRegistry started..."); - checkSystemRegistryRequest(request); + logger.debug("registerDeviceRegistry started..."); + checkDeviceRegistryRequest(request); try { - final System systemDb = findOrCreateSystem(request.getSystem()); - final Device deviceDb = findOrCreateDevice(request.getProvider()); + final Device deviceDb = findOrCreateDevice(request.getDevice()); final ZonedDateTime endOfValidity = getZonedDateTime(request); final String metadataStr = Utilities.map2Text(request.getMetadata()); final int version = (request.getVersion() != null) ? request.getVersion() : 1; - final SystemRegistry srEntry = createSystemRegistry(systemDb, deviceDb, endOfValidity, metadataStr, version); + final DeviceRegistry drEntry = createDeviceRegistry(deviceDb, endOfValidity, metadataStr, version); - return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(srEntry); + return DTOConverter.convertDeviceRegistryToDeviceRegistryResponseDTO(drEntry); } catch (final DateTimeParseException ex) { @@ -525,30 +372,29 @@ public SystemRegistryResponseDTO registerSystemRegistry(final SystemRegistryRequ //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemRegistryResponseDTO updateSystemRegistryById(final long id, final SystemRegistryRequestDTO request) + public DeviceRegistryResponseDTO updateDeviceRegistryById(final long id, final DeviceRegistryRequestDTO request) { - logger.debug("updateSystemRegistryById started..."); + logger.debug("updateDeviceRegistryById started..."); Assert.isTrue(0 < id, "id is not greater than zero"); - checkSystemRegistryRequest(request); + checkDeviceRegistryRequest(request); try { - final SystemRegistry srEntry; - final SystemRegistry updateSrEntry; + final DeviceRegistry drEntry; + final DeviceRegistry updateDrEntry; - final Optional srEntryOptional = systemRegistryRepository.findById(id); - srEntry = srEntryOptional.orElseThrow(() -> new InvalidParameterException("System Registry entry with id '" + id + "' not exists")); + final Optional drEntryOptional = deviceRegistryRepository.findById(id); + drEntry = drEntryOptional.orElseThrow(() -> new InvalidParameterException("Device Registry entry with id '" + id + "' not exists")); - final System systemDb = findOrCreateSystem(request.getSystem()); - final Device deviceDb = findOrCreateDevice(request.getProvider()); + final Device deviceDb = findOrCreateDevice(request.getDevice()); final ZonedDateTime endOfValidity = getZonedDateTime(request); final String metadataStr = Utilities.map2Text(request.getMetadata()); final int version = (request.getVersion() != null) ? request.getVersion() : 1; - updateSrEntry = updateSystemRegistry(srEntry, systemDb, deviceDb, endOfValidity, metadataStr, version); + updateDrEntry = updateDeviceRegistry(drEntry, deviceDb, endOfValidity, metadataStr, version); - return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(updateSrEntry); + return DTOConverter.convertDeviceRegistryToDeviceRegistryResponseDTO(updateDrEntry); } catch (final DateTimeParseException ex) { @@ -570,37 +416,35 @@ public SystemRegistryResponseDTO updateSystemRegistryById(final long id, final S //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemRegistryResponseDTO mergeSystemRegistryById(final long id, final SystemRegistryRequestDTO request) + public DeviceRegistryResponseDTO mergeDeviceRegistryById(final long id, final DeviceRegistryRequestDTO request) { - - logger.debug("mergeSystemRegistryById started..."); + logger.debug("mergeDeviceRegistryById started..."); Assert.notNull(request, "request is null."); Assert.isTrue(0 < id, "id is not greater than zero"); try { - final SystemRegistry srEntry; - final SystemRegistry updateSrEntry; + final DeviceRegistry drEntry; + final DeviceRegistry updateDrEntry; - final Optional srEntryOptional = systemRegistryRepository.findById(id); - srEntry = srEntryOptional.orElseThrow(() -> new InvalidParameterException("System Registry entry with id '" + id + "' not exists")); + final Optional drEntryOptional = deviceRegistryRepository.findById(id); + drEntry = drEntryOptional.orElseThrow(() -> new InvalidParameterException("System Registry entry with id '" + id + "' not exists")); - final System systemDb = mergeSystem(request.getSystem(), srEntry.getSystem()); - final Device deviceDb = mergeDevice(request.getProvider(), srEntry.getDevice()); + final Device deviceDb = mergeDevice(request.getDevice(), drEntry.getDevice()); final ZonedDateTime endOfValidity = Utilities.notEmpty(request.getEndOfValidity()) ? Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()) : - srEntry.getEndOfValidity(); + drEntry.getEndOfValidity(); final String validatedMetadataStr = Objects.nonNull(request.getMetadata()) ? Utilities.map2Text(request.getMetadata()) : - srEntry.getMetadata(); + drEntry.getMetadata(); - final int validatedVersion = (request.getVersion() != null) ? request.getVersion() : srEntry.getVersion(); + final int validatedVersion = (request.getVersion() != null) ? request.getVersion() : drEntry.getVersion(); - updateSrEntry = updateSystemRegistry(srEntry, systemDb, deviceDb, endOfValidity, validatedMetadataStr, validatedVersion); + updateDrEntry = updateDeviceRegistry(drEntry, deviceDb, endOfValidity, validatedMetadataStr, validatedVersion); - return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(updateSrEntry); + return DTOConverter.convertDeviceRegistryToDeviceRegistryResponseDTO(updateDrEntry); } catch (final InvalidParameterException ex) { @@ -621,89 +465,85 @@ public SystemRegistryResponseDTO mergeSystemRegistryById(final long id, final Sy //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemRegistryListResponseDTO getSystemRegistryEntriesBySystemName(final String systemName, final CoreUtilities.ValidatedPageParams pageParameters, - final String sortField) + public DeviceResponseDTO getDeviceDtoByNameAndMacAddress(final String deviceName, final String macAddress) { - logger.debug("getSystemRegistryEntriesBySystemName is started..."); - - if (!System.SORTABLE_FIELDS_BY.contains(sortField)) - { - throw new InvalidParameterException("Sortable field with reference '" + sortField + "' is not available"); - } - - final List systemList = systemRepository.findBySystemName(systemName); - final PageRequest pageRequest = PageRequest.of(pageParameters.getValidatedPage(), pageParameters.getValidatedSize(), - pageParameters.getValidatedDirection(), sortField); - - final Page systemRegistries = systemRegistryRepository.findAllBySystem(systemList, pageRequest); - return DTOConverter.convertSystemRegistryListToSystemRegistryListResponseDTO(systemRegistries); + final Device device = getDeviceByNameAndMacAddress(deviceName, macAddress); + return DTOConverter.convertDeviceToDeviceResponseDTO(device); } - //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public void removeSystemRegistryByNameAndAddressAndPort(final String systemName, final String address, final int port) + public void removeDeviceRegistryByNameAndMacAddress(final String deviceName, final String macAddress) { - logger.debug("removeSystemRegistryByNameAndAddressAndPort is started..."); - final System system = getSystemByNameAndAddressAndPort(systemName, address, port); + logger.debug("removeDeviceRegistryByNameAndMacAddress is started..."); + final Device device = getDeviceByNameAndMacAddress(deviceName, macAddress); - final Optional optionalSystemRegistry = systemRegistryRepository.findBySystem(system); - final SystemRegistry systemRegistry = optionalSystemRegistry.orElseThrow( + final Optional optionalDeviceRegistry = deviceRegistryRepository.findByDevice(device); + final DeviceRegistry deviceRegistry = optionalDeviceRegistry.orElseThrow( () -> new InvalidParameterException( - "System Registry entry for System with name '" + systemName + "', address '" + address + "' and port '" + port + "' does not exists")); + "Device Registry entry for System with name '" + deviceName + + "' and MAC address '" + macAddress + "' does not exists")); - systemRegistryRepository.delete(systemRegistry); - systemRegistryRepository.flush(); + deviceRegistryRepository.delete(deviceRegistry); + deviceRegistryRepository.flush(); } //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemQueryResultDTO queryRegistry(final SystemQueryFormDTO form) + public DeviceQueryResultDTO queryRegistry(final DeviceQueryFormDTO form) { logger.debug("queryRegistry is started..."); Assert.notNull(form, "Form is null."); try { - final List systems; final List devices; - final List registryList; + final List registryList; final int unfilteredHits; - if (Utilities.notEmpty(form.getSystemNameRequirements())) + if (Utilities.isEmpty(form.getDeviceNameRequirements())) { - final String systemName = Utilities.lowerCaseTrim(form.getSystemNameRequirements()); - systems = systemRepository.findBySystemName(systemName); + throw new InvalidParameterException("Device Name must not be null"); + } + + final String deviceName = Utilities.lowerCaseTrim(form.getDeviceNameRequirements()); - if (systems.isEmpty()) + if (Utilities.notEmpty(form.getMacAddressRequirement())) + { + // exact match or no match + final String macAddress = Utilities.lowerCaseTrim(form.getMacAddressRequirement()); + final Optional optionalDevice = deviceRepository.findByDeviceNameAndMacAddress(deviceName, macAddress); + + if (optionalDevice.isPresent()) { - // no service definition found - logger.debug("System not found: {}", systemName); - return DTOConverter.convertSystemRegistryListToSystemQueryResultDTO(Collections.emptyList()); + devices = new ArrayList<>(); + devices.add(optionalDevice.get()); + } + else + { + return DTOConverter.convertDeviceRegistryListToDeviceQueryResultDTO(Collections.emptyList()); } } else { - throw new InvalidParameterException("System Name must not be null"); - } - - registryList = systemRegistryRepository.findAllBySystem(systems); - unfilteredHits = registryList.size(); - - if (Utilities.notEmpty(form.getDeviceNameRequirements())) - { - final String deviceName = Utilities.lowerCaseTrim(form.getDeviceNameRequirements()); devices = deviceRepository.findByDeviceName(deviceName); if (devices.isEmpty()) { // no service definition found logger.debug("Device not found: {}", deviceName); - return DTOConverter.convertSystemRegistryListToSystemQueryResultDTO(Collections.emptyList()); + return DTOConverter.convertDeviceRegistryListToDeviceQueryResultDTO(Collections.emptyList()); } + } - registryList.removeIf(e -> !devices.contains(e.getDevice())); + registryList = deviceRegistryRepository.findAllByDevice(devices); + unfilteredHits = registryList.size(); + + if (Utilities.notEmpty(form.getAddressRequirement())) + { + final String address = Utilities.lowerCaseTrim(form.getMacAddressRequirement()); + devices.removeIf(e -> !e.getAddress().startsWith(address)); } // filter on version @@ -736,14 +576,8 @@ else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(for }); } - // filter on ping - if (form.getPingProviders()) - { - filterOnPing(registryList, pingTimeout); - } - logger.debug("Potential system providers after filtering: {}", registryList.size()); - return DTOConverter.convertListOfSystemRegistryEntriesToSystemQueryResultDTO(registryList, unfilteredHits); + return DTOConverter.convertListOfDeviceRegistryEntriesToDeviceQueryResultDTO(registryList, unfilteredHits); } catch (final IllegalStateException e) { @@ -756,21 +590,16 @@ else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(for } } - //------------------------------------------------------------------------------------------------- - @Transactional(rollbackFor = ArrowheadException.class) - public SystemResponseDTO getSystemDtoByNameAndAddressAndPort(final String systemName, final String address, final int port) - { - final System system = getSystemByNameAndAddressAndPort(systemName, address, port); - return DTOConverter.convertSystemToSystemResponseDTO(system); - } - //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public List getSystemByName(final String name) { - try { + try + { return systemRepository.findBySystemName(Utilities.lowerCaseTrim(name)); - } catch (final Exception ex) { + } + catch (final Exception ex) + { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -798,60 +627,11 @@ public System createSystem(final String systemName, final String address, final //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- - private System getSystemByNameAndAddressAndPort(final String systemName, final String address, final int port) - { - final Optional optionalSystem = systemRepository.findBySystemNameAndAddressAndPort(systemName, address, port); - return optionalSystem.orElseThrow(() -> new InvalidParameterException( - "System entry with name '" + systemName + "', address '" + address + "' and port '" + port + "' does not exists")); - } - - //------------------------------------------------------------------------------------------------- - @SuppressWarnings("squid:S1126") - private boolean checkSystemIfUniqueValidationNeeded(final System system, final String validatedSystemName, final String validatedAddress, - final Integer validatedPort) - { - logger.debug("checkSystemIfUniqueValidationNeeded started..."); - - final String actualSystemName = system.getSystemName(); - final String actualAddress = system.getAddress(); - final int actualPort = system.getPort(); - - if (validatedSystemName != null && !actualSystemName.equalsIgnoreCase(validatedSystemName)) - { - return true; - } - else if (validatedAddress != null && !actualAddress.equalsIgnoreCase(validatedAddress)) - { - return true; - } - else { return validatedPort != null && actualPort != validatedPort; } - } - - //------------------------------------------------------------------------------------------------- - // This method may CHANGE the content of providedServices - private void filterOnPing(final List systems, final int timeout) + private Device getDeviceByNameAndMacAddress(final String deviceName, final String macAddress) { - if (systems == null || systems.isEmpty() || timeout <= 0) - { - return; - } - - systems.removeIf(sr -> !pingService(sr.getSystem().getAddress(), sr.getSystem().getPort(), timeout)); - } - - //------------------------------------------------------------------------------------------------- - private boolean pingService(final String address, final int port, final int timeout) - { - final InetSocketAddress host = new InetSocketAddress(address, port); - try (final Socket socket = new Socket()) - { - socket.connect(host, timeout); - return true; - } - catch (final IOException ex) - { - return false; - } + final Optional optionalDevice = deviceRepository.findByDeviceNameAndMacAddress(deviceName, macAddress); + return optionalDevice.orElseThrow(() -> new InvalidParameterException( + "Device entry with name '" + deviceName + "' and MAC address '" + macAddress + "' does not exists")); } //------------------------------------------------------------------------------------------------- @@ -876,32 +656,6 @@ private Map normalizeMetadata(final Map metadata return map; } - //------------------------------------------------------------------------------------------------- - private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) - { - logger.debug("checkConstraintsOfSystemTable started..."); - - try - { - final Optional find = systemRepository - .findBySystemNameAndAddressAndPort(validatedSystemName.toLowerCase().trim(), validatedAddress.toLowerCase().trim(), validatedPort); - if (find.isPresent()) - { - throw new InvalidParameterException( - "System with name: " + validatedSystemName + ", address: " + validatedAddress + ", port: " + validatedPort + " already exists."); - } - } - catch (final InvalidParameterException ex) - { - throw ex; - } - catch (final Exception ex) - { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } - } - //------------------------------------------------------------------------------------------------- private void checkConstraintsOfDeviceTable(final String validatedDeviceName, final String validatedMacAddress) { @@ -927,37 +681,12 @@ private void checkConstraintsOfDeviceTable(final String validatedDeviceName, fin } } - //------------------------------------------------------------------------------------------------- - private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) - { - logger.debug("validateNonNullSystemParameters started..."); - - validateNonNullParameters(systemName, address); - - if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) - { - throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); - } - - final String validatedSystemName = Utilities.lowerCaseTrim(systemName); - final String validatedAddress = Utilities.lowerCaseTrim(address); - - checkConstraintsOfSystemTable(validatedSystemName, validatedAddress, port); - - return new System(validatedSystemName, validatedAddress, port, authenticationInfo); - } - //------------------------------------------------------------------------------------------------- private Device validateNonNullDeviceParameters(final String deviceName, final String address, final String macAddress, final String authenticationInfo) { logger.debug("validateNonNullDeviceParameters started..."); - validateNonNullParameters(deviceName, address); - - if (Utilities.isEmpty(macAddress)) - { - throw new InvalidParameterException("MAC address is null or empty"); - } + validateNonNullParameters(deviceName, macAddress); final String validatedDeviceName = Utilities.lowerCaseTrim(deviceName); final String validatedAddress = Utilities.lowerCaseTrim(address); @@ -969,7 +698,7 @@ private Device validateNonNullDeviceParameters(final String deviceName, final St } //------------------------------------------------------------------------------------------------- - private void validateNonNullParameters(final String name, final String address) + private void validateNonNullParameters(final String name, final String macAddress) { logger.debug("validateNonNullParameters started..."); @@ -978,9 +707,9 @@ private void validateNonNullParameters(final String name, final String address) throw new InvalidParameterException("Name is null or empty"); } - if (Utilities.isEmpty(address)) + if (Utilities.isEmpty(macAddress)) { - throw new InvalidParameterException("Address is null or empty"); + throw new InvalidParameterException("MAC Address is null or empty"); } if (name.contains(".")) @@ -989,32 +718,6 @@ private void validateNonNullParameters(final String name, final String address) } } - //------------------------------------------------------------------------------------------------- - private String validateParamString(final String param) - { - logger.debug("validateSystemParamString started..."); - - if (Utilities.isEmpty(param)) - { - throw new InvalidParameterException("parameter null or empty"); - } - - return Utilities.lowerCaseTrim(param); - } - - //------------------------------------------------------------------------------------------------- - private int validateSystemPort(final int port) - { - logger.debug("validateSystemPort started..."); - - if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) - { - throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); - } - - return port; - } - //------------------------------------------------------------------------------------------------- private long validateId(final long id) { @@ -1029,39 +732,12 @@ private long validateId(final long id) } //------------------------------------------------------------------------------------------------- - private Integer validateAllowNullSystemPort(final Integer port) - { - logger.debug("validateAllowNullSystemPort started..."); - - if (port != null && (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX)) - { - throw new IllegalArgumentException(PORT_RANGE_ERROR_MESSAGE); - } - - return port; - } - - //------------------------------------------------------------------------------------------------- - private String validateAllowNullParamString(final String param) - { - logger.debug("validateAllowNullParamString started..."); - - if (Utilities.isEmpty(param)) - { - return null; - } - - return Utilities.lowerCaseTrim(param); - } - - - //------------------------------------------------------------------------------------------------- - private SystemRegistry getSystemRegistryEntryById(final long id) + private DeviceRegistry getDeviceRegistryEntryById(final long id) { - logger.debug("getSystemRegistryEntryById started..."); + logger.debug("getDeviceRegistryEntryById started..."); try { - final Optional systemRegistry = systemRegistryRepository.findById(id); + final Optional systemRegistry = deviceRegistryRepository.findById(id); return systemRegistry.orElseThrow(() -> new InvalidParameterException("System Registry with id of '" + id + "' not exists")); } catch (final InvalidParameterException ex) @@ -1075,44 +751,6 @@ private SystemRegistry getSystemRegistryEntryById(final long id) } } - //------------------------------------------------------------------------------------------------- - private System findOrCreateSystem(SystemRequestDTO requestSystemDto) - { - return findOrCreateSystem(requestSystemDto.getSystemName(), - requestSystemDto.getAddress(), - requestSystemDto.getPort(), - requestSystemDto.getAuthenticationInfo()); - } - - //------------------------------------------------------------------------------------------------- - private System findOrCreateSystem(final String name, final String address, final int port, final String authenticationInfo) - { - - final String validatedName = Utilities.lowerCaseTrim(name); - final String validatedAddress = Utilities.lowerCaseTrim(address); - final String validatedAuthenticationInfo = Utilities.lowerCaseTrim(authenticationInfo); - - final Optional optSystem = systemRepository.findBySystemNameAndAddressAndPort(validatedName, validatedAddress, port); - System provider; - - if (optSystem.isPresent()) - { - provider = optSystem.get(); - if (!Objects.equals(validatedAuthenticationInfo, provider.getAuthenticationInfo()) || - !Objects.equals(validatedAddress, provider.getAddress())) - { // authentication info or system has changed - provider.setAuthenticationInfo(validatedAuthenticationInfo); - provider.setAddress(validatedAddress); - provider = systemRepository.saveAndFlush(provider); - } - } - else - { - provider = createSystem(validatedName, validatedAddress, port, validatedAuthenticationInfo); - } - return provider; - } - //------------------------------------------------------------------------------------------------- private Device findOrCreateDevice(DeviceRequestDTO requestDeviceDto) { @@ -1152,6 +790,52 @@ private Device findOrCreateDevice(String deviceName, String address, String macA return provider; } + //------------------------------------------------------------------------------------------------- + private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) + { + logger.debug("validateNonNullSystemParameters started..."); + + validateNonNullParameters(systemName, address); + + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) + { + throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); + } + + final String validatedSystemName = Utilities.lowerCaseTrim(systemName); + final String validatedAddress = Utilities.lowerCaseTrim(address); + + checkConstraintsOfSystemTable(validatedSystemName, validatedAddress, port); + + return new System(validatedSystemName, validatedAddress, port, authenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) + { + logger.debug("checkConstraintsOfSystemTable started..."); + + try + { + final Optional find = systemRepository + .findBySystemNameAndAddressAndPort(validatedSystemName.toLowerCase().trim(), validatedAddress.toLowerCase().trim(), validatedPort); + if (find.isPresent()) + { + throw new InvalidParameterException( + "System with name: " + validatedSystemName + ", address: " + validatedAddress + ", port: " + validatedPort + " already exists."); + } + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + //------------------------------------------------------------------------------------------------- private Device createDevice(final String name, final String address, final String macAddress, final String authenticationInfo) { @@ -1160,34 +844,30 @@ private Device createDevice(final String name, final String address, final Strin } //------------------------------------------------------------------------------------------------- - private void checkSystemRegistryRequest(final SystemRegistryRequestDTO request) + private void checkDeviceRegistryRequest(final DeviceRegistryRequestDTO request) { - logger.debug("checkSystemRegistryRequest started..."); + logger.debug("checkDeviceRegistryRequest started..."); Assert.notNull(request, "Request is null."); - Assert.notNull(request.getSystem(), "System is not specified."); - Assert.isTrue(Utilities.notEmpty(request.getSystem().getSystemName()), "System name is not specified."); - Assert.isTrue(Utilities.notEmpty(request.getSystem().getAddress()), "System address is not specified."); - Assert.notNull(request.getSystem().getPort(), "System port is not specified."); - - Assert.notNull(request.getProvider(), "Provider Device is not specified."); - Assert.isTrue(Utilities.notEmpty(request.getProvider().getDeviceName()), "Provider Device name is not specified."); - Assert.isTrue(Utilities.notEmpty(request.getProvider().getAddress()), "Provider Device address is not specified."); - Assert.isTrue(Utilities.notEmpty(request.getProvider().getMacAddress()), "Provider Device MAC is not specified."); + Assert.notNull(request.getDevice(), "Device is not specified."); + Assert.isTrue(Utilities.notEmpty(request.getDevice().getDeviceName()), "Device name is not specified."); + Assert.isTrue(Utilities.notEmpty(request.getDevice().getMacAddress()), "Device MAC address is not specified."); } //------------------------------------------------------------------------------------------------- - private void checkConstraintsOfSystemRegistryTable(final System systemDb, final Device deviceDb) + private void checkConstraintsOfDeviceRegistryTable(final Device deviceDb) { - logger.debug("checkConstraintOfSystemRegistryTable started..."); + logger.debug("checkConstraintOfDeviceRegistryTable started..."); try { - final Optional find = systemRegistryRepository.findBySystemAndDevice(systemDb, deviceDb); + final Optional find = deviceRegistryRepository.findByDevice(deviceDb); if (find.isPresent()) { - throw new InvalidParameterException("System Registry entry with provider: (" + deviceDb.getDeviceName() + ", " + deviceDb.getMacAddress() + - ") and system : " + systemDb.getSystemName() + " already exists."); + throw new InvalidParameterException("System Registry entry with provider: (" + + deviceDb.getDeviceName() + ", " + + deviceDb.getMacAddress() + + ") already exists."); } } catch (final InvalidParameterException ex) @@ -1212,26 +892,15 @@ private Device mergeDevice(final DeviceRequestDTO request, final Device device) } //------------------------------------------------------------------------------------------------- - private System mergeSystem(final SystemRequestDTO request, final System system) - { - final String name = Utilities.firstNotNull(request.getSystemName(), system.getSystemName()); - final String address = Utilities.firstNotNull(request.getAddress(), system.getAddress()); - final int port = request.getPort() > 0 ? request.getPort() : system.getPort(); - final String authenticationInfo = Utilities.firstNotNull(request.getAuthenticationInfo(), system.getAuthenticationInfo()); - return findOrCreateSystem(name, address, port, authenticationInfo); - } - - //------------------------------------------------------------------------------------------------- - private SystemRegistry createSystemRegistry(final System systemDb, final Device deviceDb, final ZonedDateTime endOfValidity, final String metadataStr, - final int version) + private DeviceRegistry createDeviceRegistry(final Device deviceDb, final ZonedDateTime endOfValidity, final String metadataStr, final int version) { - logger.debug("createSystemRegistry started..."); + logger.debug("createDeviceRegistry started..."); - checkConstraintsOfSystemRegistryTable(systemDb, deviceDb); + checkConstraintsOfDeviceRegistryTable(deviceDb); try { - return systemRegistryRepository.saveAndFlush(new SystemRegistry(systemDb, deviceDb, endOfValidity, metadataStr, version)); + return deviceRegistryRepository.saveAndFlush(new DeviceRegistry(deviceDb, endOfValidity, metadataStr, version)); } catch (final Exception ex) { @@ -1241,53 +910,51 @@ private SystemRegistry createSystemRegistry(final System systemDb, final Device } //------------------------------------------------------------------------------------------------- - private boolean checkSystemRegistryIfUniqueValidationNeeded(final SystemRegistry srEntry, final System system, final Device device) + private boolean checkDeviceRegistryIfUniqueValidationNeeded(final DeviceRegistry drEntry, final Device device) { - logger.debug("checkSystemRegistryIfUniqueValidationNeeded started..."); + logger.debug("checkDeviceRegistryIfUniqueValidationNeeded started..."); - return srEntry.getSystem().getId() != system.getId() || srEntry.getDevice().getId() != device.getId(); + return drEntry.getDevice().getId() != device.getId(); } //------------------------------------------------------------------------------------------------- - private SystemRegistry updateSystemRegistry(final SystemRegistry srEntry, final System system, final Device device, + private DeviceRegistry updateDeviceRegistry(final DeviceRegistry drEntry, final Device device, final ZonedDateTime endOfValidity, final String metadataStr, final int version) { - logger.debug("updateSystemRegistry started..."); - Assert.notNull(srEntry, "SystemRegistry Entry is not specified."); - Assert.notNull(system, "System is not specified."); + logger.debug("updateDeviceRegistry started..."); + Assert.notNull(drEntry, "DeviceRegistry Entry is not specified."); Assert.notNull(device, "Device is not specified."); - if (checkSystemRegistryIfUniqueValidationNeeded(srEntry, system, device)) + if (checkDeviceRegistryIfUniqueValidationNeeded(drEntry, device)) { - checkConstraintsOfSystemRegistryTable(system, device); + checkConstraintsOfDeviceRegistryTable(device); } - return setModifiedValuesOfSystemRegistryEntryFields(srEntry, system, device, endOfValidity, metadataStr, version); + return setModifiedValuesOfDeviceRegistryEntryFields(drEntry, device, endOfValidity, metadataStr, version); } //------------------------------------------------------------------------------------------------- - private ZonedDateTime getZonedDateTime(SystemRegistryRequestDTO request) + private ZonedDateTime getZonedDateTime(DeviceRegistryRequestDTO request) { return Utilities.isEmpty(request.getEndOfValidity()) ? null : Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()); } //------------------------------------------------------------------------------------------------- - private SystemRegistry setModifiedValuesOfSystemRegistryEntryFields(final SystemRegistry srEntry, final System system, final Device device, + private DeviceRegistry setModifiedValuesOfDeviceRegistryEntryFields(final DeviceRegistry drEntry, final Device device, final ZonedDateTime endOfValidity, final String metadataStr, final int version) { - logger.debug("setModifiedValuesOfSystemRegistryEntryFields started..."); + logger.debug("setModifiedValuesOfDeviceRegistryEntryFields started..."); try { - srEntry.setSystem(system); - srEntry.setDevice(device); - srEntry.setEndOfValidity(endOfValidity); - srEntry.setMetadata(metadataStr); - srEntry.setVersion(version); + drEntry.setDevice(device); + drEntry.setEndOfValidity(endOfValidity); + drEntry.setMetadata(metadataStr); + drEntry.setVersion(version); - return systemRegistryRepository.saveAndFlush(srEntry); + return deviceRegistryRepository.saveAndFlush(drEntry); } catch (final Exception ex) { diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java index 32190fae8..defccd802 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java @@ -448,7 +448,8 @@ public void removeSystemRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) - @PostMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(path = {CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI, CoreCommonConstants.MGMT_URI}, + consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public SystemRegistryResponseDTO registerSystem(@RequestBody final SystemRegistryRequestDTO request) { logger.debug("New system registration request received"); @@ -460,27 +461,6 @@ public SystemRegistryResponseDTO registerSystem(@RequestBody final SystemRegistr return response; } - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_REGISTER_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = SYSTEM_REGISTRY_REGISTER_201_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_REGISTER_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) - @PostMapping(path = CoreCommonConstants.MGMT_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public @ResponseBody - SystemRegistryResponseDTO addSystemRegistry(@RequestBody final SystemRegistryRequestDTO request) { - logger.debug("New system registration request received"); - checkSystemRegistryRequest(request, CoreCommonConstants.MGMT_URI, true); - - final SystemRegistryResponseDTO response = systemRegistryDBService.registerSystemRegistry(request); - logger.debug("{}'s system {} is successfully registered", request.getSystem().getSystemName(), request.getSystem()); - - return response; - } - //------------------------------------------------------------------------------------------------- @ApiOperation(value = SYSTEM_REGISTRY_UPDATE_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { From 2bd13c39b839577cba4d41e9e1be4ff6c4b75580 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 24 Jan 2020 15:30:00 +0100 Subject: [PATCH 035/301] started implementing pingMeasurement --- .../QoSIntraMeasurementPingRepository.java | 5 +- .../QoSIntraMeasurementRepository.java | 5 + .../core/qos/quartz/task/PingTask.java | 101 ++++++++++++++---- 3 files changed, 90 insertions(+), 21 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementPingRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementPingRepository.java index 5284d11d3..9dfb91be5 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementPingRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementPingRepository.java @@ -1,12 +1,15 @@ package eu.arrowhead.common.database.repository; +import java.util.Optional; + import org.springframework.stereotype.Repository; +import eu.arrowhead.common.database.entity.QoSIntraMeasurement; import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; @Repository public interface QoSIntraMeasurementPingRepository extends RefreshableRepository { //================================================================================================= - // methods + public Optional findByMeasurement(final QoSIntraMeasurement measurement); } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementRepository.java index 4cd8c02a3..ee9a39e53 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementRepository.java @@ -1,12 +1,17 @@ package eu.arrowhead.common.database.repository; +import java.util.Optional; + import org.springframework.stereotype.Repository; import eu.arrowhead.common.database.entity.QoSIntraMeasurement; +import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.dto.shared.QoSMeasurementType; @Repository public interface QoSIntraMeasurementRepository extends RefreshableRepository { //================================================================================================= // methods + public Optional findBySystemAndMeasurementType(final System systemToCheck,final QoSMeasurementType ping); } \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 8584d1a4e..070763da1 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -1,7 +1,10 @@ package eu.arrowhead.core.qos.quartz.task; +import java.time.ZonedDateTime; +import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @@ -25,8 +28,13 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.database.entity.QoSIntraMeasurement; +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; +import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.database.repository.QoSIntraMeasurementPingRepository; import eu.arrowhead.common.database.repository.QoSIntraMeasurementRepository; import eu.arrowhead.common.dto.internal.ServiceRegistryListResponseDTO; +import eu.arrowhead.common.dto.shared.QoSMeasurementType; import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; import eu.arrowhead.common.dto.shared.SystemResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; @@ -48,6 +56,9 @@ public class PingTask implements Job { @Autowired private QoSIntraMeasurementRepository qoSIntraMeasurementRepository; + @Autowired + private QoSIntraMeasurementPingRepository qoSIntraMeasurementPingRepository; + @Autowired private HttpService httpService; @@ -80,37 +91,63 @@ private Set getSystemsToMessure() { logger.debug("getSystemToMessure started..."); final ServiceRegistryListResponseDTO serviceRegistryListResponseDTO = queryServiceRegistryAll(); - final Set systemList = serviceRegistryListResponseDTO.getData().stream().map(ServiceRegistryResponseDTO::getProvider).collect(Collectors.toSet()); - + return systemList; } //------------------------------------------------------------------------------------------------- - private void pingSystem(final SystemResponseDTO system ) { + private void pingSystem(final SystemResponseDTO systemResponseDTO ) { logger.debug("pingSystem started..."); - - if (system == null || Utilities.isEmpty(system.getAddress())) { + + if (systemResponseDTO == null || Utilities.isEmpty(systemResponseDTO.getAddress())) { throw new InvalidParameterException("System.address" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE); } - final String address = system.getAddress(); - try { - final IcmpPingRequest request = IcmpPingUtil.createIcmpPingRequest (); - request.setHost (address); + final System system = new System(); + system.setSystemName(systemResponseDTO.getSystemName()); + system.setAddress(systemResponseDTO.getAddress()); + system.setPort(systemResponseDTO.getPort()); + + final String address = systemResponseDTO.getAddress(); + + final List responseList = getPingResponseList(address); + // TODO continue implementation + //final boolean accesible = calculateAccessible(responseList); + //final int maxResponseTime = calculateMaxResponseTime(responseList); + //final int minResponseTime = calculateMinResponseTime(responseList); + //final int meanResponseTime = calculateMeanResponseTime(responseList); + // + // + //final Optional qoSIntraMeasurementOptional = qoSIntraMeasurementRepository.findBySystemAndMeasurementType(system, QoSMeasurementType.PING); + //if (qoSIntraMeasurementOptional.isEmpty()) { + // + // final QoSIntraMeasurement measurement = new QoSIntraMeasurement(system, QoSMeasurementType.PING, ZonedDateTime.now()); + // qoSIntraMeasurementRepository.saveAndFlush(measurement); + // + // final Optional pingMeasurementOptional = qoSIntraMeasurementPingRepository.findByMeasurement(measurement); + // if (pingMeasurementOptional.isEmpty()) { + // final QoSIntraPingMeasurement pingMeasurement = new QoSIntraPingMeasurement(); + // pingMeasurement.setMeasurement(measurement); + // + // pingMeasurement.setAccessible(accessible); + // pingMeasurement.setMaxResponseTime(maxResponseTime); + // pingMeasurement.setMinResponseTime(minResponseTime); + // pingMeasurement.setMeanResponseTime(meanResponseTime); + // pingMeasurement.setCountStartedAt(countStartedAt); + // pingMeasurement.setLastAccessAt(lastAccessAt); + // pingMeasurement.setSent(sent); + // pingMeasurement.setSentAll(sentAll); + // pingMeasurement.setReceived(received); + // pingMeasurement.setReceivedAll(receivedAll); + // pingMeasurement.setUpdatedAt(updatedAt); + // + // } + //} - for (int count = 0; count < TIMES_TO_REPEAT; count ++) { - final IcmpPingResponse response = IcmpPingUtil.executePingRequest (request); - final String formattedResponse = IcmpPingUtil.formatResponse (response); - logger.info(formattedResponse); - Thread.sleep (REST_BETWEEN_PINGS_MILLSEC); - } - } catch ( final InterruptedException | IllegalArgumentException ex) { - logger.debug("" + ex.getMessage()); - } } - + //------------------------------------------------------------------------------------------------- private ServiceRegistryListResponseDTO queryServiceRegistryAll() { logger.debug("queryServiceRegistryAll started..."); @@ -126,7 +163,7 @@ private ServiceRegistryListResponseDTO queryServiceRegistryAll() { } } - + //------------------------------------------------------------------------------------------------- private UriComponents getQueryAllUri() { logger.debug("getQueryUri started..."); @@ -141,4 +178,28 @@ private UriComponents getQueryAllUri() { throw new ArrowheadException("QoS Mointor can't find Service Registry Query All URI."); } + + //------------------------------------------------------------------------------------------------- + private List getPingResponseList(final String address) { + logger.debug("getPingResponseList started..."); + + final List responseList = new ArrayList<>(TIMES_TO_REPEAT); + try { + final IcmpPingRequest request = IcmpPingUtil.createIcmpPingRequest (); + request.setHost (address); + + for (int count = 0; count < TIMES_TO_REPEAT; count ++) { + final IcmpPingResponse response = IcmpPingUtil.executePingRequest (request); + final String formattedResponse = IcmpPingUtil.formatResponse (response); + logger.info(formattedResponse); + + responseList.add(response); + Thread.sleep (REST_BETWEEN_PINGS_MILLSEC); + } + } catch ( final InterruptedException | IllegalArgumentException ex) { + logger.debug("" + ex.getMessage()); + } + + return responseList; + } } \ No newline at end of file From c6580f72b28d2bf14fa3d379b075815a02d56d66 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Fri, 24 Jan 2020 22:20:23 +0100 Subject: [PATCH 036/301] preparing merge --- .../eu/arrowhead/common/CommonConstants.java | 6 +- .../eu/arrowhead/common/core/CoreSystem.java | 2 +- .../common/core/CoreSystemService.java | 3 +- .../shared/OnboardingWithCsrRequestDTO.java | 55 +++++ .../shared/OnboardingWithCsrResponseDTO.java | 107 ++++++++++ .../shared/OnboardingWithNameRequestDTO.java | 49 +++++ .../shared/OnboardingWithNameResponseDTO.java | 142 +++++++++++++ .../common/dto/shared/ServiceEndpoint.java | 28 +++ ...DeviceRegistryApplicationInitListener.java | 2 +- .../OnboardingApplicationInitListener.java | 114 ++++++++++ .../core/onboarding/OnboardingController.java | 159 ++++++++++++++ .../core/onboarding/OnboardingMain.java | 26 +++ .../database/service/OnboardingDBService.java | 199 ++++++++++++++++++ 13 files changed, 887 insertions(+), 5 deletions(-) create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrRequestDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameRequestDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceEndpoint.java create mode 100644 onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java create mode 100644 onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java create mode 100644 onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingMain.java create mode 100644 onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java diff --git a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java index fad5be9b6..56cdb2a46 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java @@ -54,7 +54,8 @@ public class CommonConstants { public static final String CORE_SERVICE_DEVICE_REGISTRY_REGISTER = "device-register"; public static final String CORE_SERVICE_DEVICE_REGISTRY_UNREGISTER = "device-unregister"; - public static final String CORE_SERVICE_ONBOARDING_PLAIN = "onboarding-plain"; + public static final String CORE_SERVICE_ONBOARDING_NAME = "onboarding-plain"; + public static final String CORE_SERVICE_ONBOARDING_CSR = "onboarding-with-csr"; public static final String COMMON_FIELD_NAME_ID = "id"; @@ -102,7 +103,8 @@ public class CommonConstants { public static final String OP_DEVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_MAC_ADDRESS = "mac_address"; public static final String ONBOARDING_URI = "/onboarding"; - public static final String OP_ONBOARDING_PLAIN = "/plain"; + public static final String OP_ONBOARDING_NAME = "/name"; + public static final String OP_ONBOARDING_CSR = "/csr"; public static final String AUTHORIZATION_URI = "/authorization"; public static final String OP_AUTH_TOKEN_URI = "/token"; diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java index f18b6ccf3..cdfec54bd 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java @@ -18,7 +18,7 @@ public enum CoreSystem SERVICE_REGISTRY(Defaults.DEFAULT_SERVICE_REGISTRY_PORT, List.of(SERVICE_REGISTRY_REGISTER_SERVICE, SERVICE_REGISTRY_UNREGISTER_SERVICE)), SYSTEM_REGISTRY(Defaults.DEFAULT_SYSTEM_REGISTRY_PORT, List.of(SYSTEM_REGISTRY_REGISTER_SERVICE, SYSTEM_REGISTRY_UNREGISTER_SERVICE)), DEVICE_REGISTRY(Defaults.DEFAULT_DEVICE_REGISTRY_PORT, List.of(DEVICE_REGISTRY_REGISTER_SERVICE, DEVICE_REGISTRY_UNREGISTER_SERVICE)), - ONBOARDING(Defaults.DEFAULT_ONBOARDING_PORT, List.of(ONBOARDING_SERVICE)), + ONBOARDING(Defaults.DEFAULT_ONBOARDING_PORT, List.of(ONBOARDING_SERVICE_WITH_NAME)), AUTHORIZATION(Defaults.DEFAULT_AUTHORIZATION_PORT, List.of(AUTH_CONTROL_INTRA_SERVICE, AUTH_CONTROL_INTER_SERVICE, AUTH_TOKEN_GENERATION_SERVICE, AUTH_PUBLIC_KEY_SERVICE, AUTH_CONTROL_SUBSCRIPTION_SERVICE)), diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java index c06b58f0d..444291cc5 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java @@ -37,7 +37,8 @@ public enum CoreSystemService { EVENT_PUBLISH_AUTH_UPDATE_SERVICE(CORE_SERVICE_EVENT_HANDLER_PUBLISH_AUTH_UPDATE, EVENT_HANDLER_URI + OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE), // Onboarding services - ONBOARDING_SERVICE(CORE_SERVICE_ONBOARDING_PLAIN, ONBOARDING_URI + OP_ONBOARDING_PLAIN), + ONBOARDING_SERVICE_WITH_NAME(CORE_SERVICE_ONBOARDING_NAME, ONBOARDING_URI + OP_ONBOARDING_NAME), + ONBOARDING_SERVICE_WITH_CSR(CORE_SERVICE_ONBOARDING_CSR, ONBOARDING_URI + OP_ONBOARDING_CSR), // Device Registry services DEVICE_REGISTRY_REGISTER_SERVICE(CORE_SERVICE_DEVICE_REGISTRY_REGISTER, DEVICE_REGISTRY_URI + OP_DEVICE_REGISTRY_REGISTER_URI), diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrRequestDTO.java new file mode 100644 index 000000000..9cc5675c1 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrRequestDTO.java @@ -0,0 +1,55 @@ +package eu.arrowhead.common.dto.shared; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.Serializable; +import java.util.Objects; + +@JsonInclude(Include.NON_NULL) +public class OnboardingWithCsrRequestDTO implements Serializable +{ + + //================================================================================================= + // members + + private static final long serialVersionUID = 1L; + + private String certificateSigningRequest; + + //================================================================================================= + // methods + //------------------------------------------------------------------------------------------------- + public String getCertificateSigningRequest() { return certificateSigningRequest; } + + //------------------------------------------------------------------------------------------------- + public void setCertificateSigningRequest(final String certificateSigningRequest) { this.certificateSigningRequest = certificateSigningRequest; } + + //------------------------------------------------------------------------------------------------- + @Override + public int hashCode() + { + return Objects.hash(certificateSigningRequest); + } + + //------------------------------------------------------------------------------------------------- + @Override + public boolean equals(final Object obj) + { + if (this == obj) + { + return true; + } + if (obj == null) + { + return false; + } + if (getClass() != obj.getClass()) + { + return false; + } + final OnboardingWithCsrRequestDTO other = (OnboardingWithCsrRequestDTO) obj; + + return Objects.equals(certificateSigningRequest, other.certificateSigningRequest); + } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java new file mode 100644 index 000000000..76759c6e4 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java @@ -0,0 +1,107 @@ +package eu.arrowhead.common.dto.shared; + +import java.io.Serializable; + +public class OnboardingWithCsrResponseDTO implements Serializable +{ + //================================================================================================= + // members + + private static final long serialVersionUID = 1L; + private ServiceEndpoint deviceRegistry; + private ServiceEndpoint systemRegistry; + private ServiceEndpoint serviceRegistry; + + private String onboardingCertificate; + private String intermediateCertificate; + private String rootCertificate; + private byte[] publicKey; + + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public ServiceEndpoint getDeviceRegistry() + { + return deviceRegistry; + } + + //------------------------------------------------------------------------------------------------- + public void setDeviceRegistry(final ServiceEndpoint deviceRegistry) + { + this.deviceRegistry = deviceRegistry; + } + + //------------------------------------------------------------------------------------------------- + public ServiceEndpoint getSystemRegistry() + { + return systemRegistry; + } + + //------------------------------------------------------------------------------------------------- + public void setSystemRegistry(final ServiceEndpoint systemRegistry) + { + this.systemRegistry = systemRegistry; + } + + //------------------------------------------------------------------------------------------------- + public ServiceEndpoint getServiceRegistry() + { + return serviceRegistry; + } + + //------------------------------------------------------------------------------------------------- + public void setServiceRegistry(final ServiceEndpoint serviceRegistry) + { + this.serviceRegistry = serviceRegistry; + } + + //------------------------------------------------------------------------------------------------- + public String getOnboardingCertificate() + { + return onboardingCertificate; + } + + //------------------------------------------------------------------------------------------------- + public void setOnboardingCertificate(final String onboardingCertificate) + { + this.onboardingCertificate = onboardingCertificate; + } + + //------------------------------------------------------------------------------------------------- + public String getIntermediateCertificate() + { + return intermediateCertificate; + } + + //------------------------------------------------------------------------------------------------- + public void setIntermediateCertificate(final String intermediateCertificate) + { + this.intermediateCertificate = intermediateCertificate; + } + + //------------------------------------------------------------------------------------------------- + public String getRootCertificate() + { + return rootCertificate; + } + + //------------------------------------------------------------------------------------------------- + public void setRootCertificate(final String rootCertificate) + { + this.rootCertificate = rootCertificate; + } + + //------------------------------------------------------------------------------------------------- + public byte[] getPublicKey() + { + return publicKey; + } + + //------------------------------------------------------------------------------------------------- + public void setPublicKey(final byte[] publicKey) + { + this.publicKey = publicKey; + } +} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameRequestDTO.java new file mode 100644 index 000000000..d6f8c59f9 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameRequestDTO.java @@ -0,0 +1,49 @@ +package eu.arrowhead.common.dto.shared; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.Serializable; +import java.util.Objects; + +@JsonInclude(Include.NON_NULL) +public class OnboardingWithNameRequestDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = 1L; + + private String deviceName; + + //================================================================================================= + // methods + //------------------------------------------------------------------------------------------------- + public String getDeviceName() { return deviceName; } + + //------------------------------------------------------------------------------------------------- + public void setDeviceName(final String deviceName) { this.deviceName = deviceName; } + + //------------------------------------------------------------------------------------------------- + @Override + public int hashCode() { + return Objects.hash(deviceName); + } + + //------------------------------------------------------------------------------------------------- + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final OnboardingWithNameRequestDTO other = (OnboardingWithNameRequestDTO) obj; + + return Objects.equals(deviceName, other.deviceName); + } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java new file mode 100644 index 000000000..0d12dd178 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java @@ -0,0 +1,142 @@ +package eu.arrowhead.common.dto.shared; + +public class OnboardingWithNameResponseDTO +{ + //================================================================================================= + // members + private ServiceEndpoint deviceRegistry; + private ServiceEndpoint systemRegistry; + private ServiceEndpoint serviceRegistry; + + private String onboardingCertificate; + private String intermediateCertificate; + private String rootCertificate; + private String keyAlgorithm; + private String keyFormat; + private byte[] privateKey; + private byte[] publicKey; + + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public ServiceEndpoint getDeviceRegistry() + { + return deviceRegistry; + } + + //------------------------------------------------------------------------------------------------- + public void setDeviceRegistry(final ServiceEndpoint deviceRegistry) + { + this.deviceRegistry = deviceRegistry; + } + + //------------------------------------------------------------------------------------------------- + public ServiceEndpoint getSystemRegistry() + { + return systemRegistry; + } + + //------------------------------------------------------------------------------------------------- + public void setSystemRegistry(final ServiceEndpoint systemRegistry) + { + this.systemRegistry = systemRegistry; + } + + //------------------------------------------------------------------------------------------------- + public ServiceEndpoint getServiceRegistry() + { + return serviceRegistry; + } + + //------------------------------------------------------------------------------------------------- + public void setServiceRegistry(final ServiceEndpoint serviceRegistry) + { + this.serviceRegistry = serviceRegistry; + } + + //------------------------------------------------------------------------------------------------- + public String getOnboardingCertificate() + { + return onboardingCertificate; + } + + //------------------------------------------------------------------------------------------------- + public void setOnboardingCertificate(final String onboardingCertificate) + { + this.onboardingCertificate = onboardingCertificate; + } + + //------------------------------------------------------------------------------------------------- + public String getIntermediateCertificate() + { + return intermediateCertificate; + } + + //------------------------------------------------------------------------------------------------- + public void setIntermediateCertificate(final String intermediateCertificate) + { + this.intermediateCertificate = intermediateCertificate; + } + + //------------------------------------------------------------------------------------------------- + public String getRootCertificate() + { + return rootCertificate; + } + + //------------------------------------------------------------------------------------------------- + public void setRootCertificate(final String rootCertificate) + { + this.rootCertificate = rootCertificate; + } + + //------------------------------------------------------------------------------------------------- + public String getKeyAlgorithm() + { + return keyAlgorithm; + } + + //------------------------------------------------------------------------------------------------- + public void setKeyAlgorithm(final String keyAlgorithm) + { + this.keyAlgorithm = keyAlgorithm; + } + + //------------------------------------------------------------------------------------------------- + public String getKeyFormat() + { + return keyFormat; + } + + //------------------------------------------------------------------------------------------------- + public void setKeyFormat(final String keyFormat) + { + this.keyFormat = keyFormat; + } + + //------------------------------------------------------------------------------------------------- + public byte[] getPrivateKey() + { + return privateKey; + } + + //------------------------------------------------------------------------------------------------- + public void setPrivateKey(final byte[] privateKey) + { + this.privateKey = privateKey; + } + + //------------------------------------------------------------------------------------------------- + public byte[] getPublicKey() + { + return publicKey; + } + + //------------------------------------------------------------------------------------------------- + public void setPublicKey(final byte[] publicKey) + { + this.publicKey = publicKey; + } +} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceEndpoint.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceEndpoint.java new file mode 100644 index 000000000..a25a2bca4 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceEndpoint.java @@ -0,0 +1,28 @@ +package eu.arrowhead.common.dto.shared; + +import eu.arrowhead.common.core.CoreSystemService; + +import java.net.URI; + +public class ServiceEndpoint +{ + + private final CoreSystemService system; + private final URI uri; + + public ServiceEndpoint(final CoreSystemService service, final URI uri) + { + this.system = service; + this.uri = uri; + } + + public CoreSystemService getService() + { + return system; + } + + public URI getUri() + { + return uri; + } +} diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java index a63fad9d1..76b936d83 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java @@ -68,7 +68,7 @@ protected void customInit(final ContextRefreshedEvent event) } catch (final ArrowheadException ex) { - logger.error("Can't registrate {} as a system.", coreSystemRegistrationProperties.getCoreSystem().name()); + logger.error("Can't register {} as a system.", coreSystemRegistrationProperties.getCoreSystem().name()); logger.debug("Stacktrace", ex); } } diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java new file mode 100644 index 000000000..efed23160 --- /dev/null +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java @@ -0,0 +1,114 @@ +package eu.arrowhead.core.onboarding; + +import eu.arrowhead.common.ApplicationInitListener; +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreDefaults; +import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.database.service.CommonDBService; +import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.common.exception.DataNotFoundException; +import eu.arrowhead.core.onboarding.database.service.OnboardingDBService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.context.event.ContextRefreshedEvent; +import org.springframework.stereotype.Component; + +import java.util.Base64; +import java.util.List; +import java.util.Map; + +@Component +public class OnboardingApplicationInitListener extends ApplicationInitListener +{ + + //================================================================================================= + // members + + private final CommonDBService commonDBService; + private final OnboardingDBService onboardingControllerDBService; + + @Autowired + public OnboardingApplicationInitListener(final CommonDBService commonDBService, + final OnboardingDBService onboardingControllerDBService) + { + this.commonDBService = commonDBService; + this.onboardingControllerDBService = onboardingControllerDBService; + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + @Override + protected void customInit(final ContextRefreshedEvent event) + { + logger.debug("customInit started..."); + if (!isOwnCloudRegistered()) + { + registerOwnCloud(event.getApplicationContext()); + } + + try + { + final String name = coreSystemRegistrationProperties.getCoreSystem().name().toLowerCase(); + final List oldSystems = onboardingControllerDBService.getSystemByName(name); + if (!oldSystems.isEmpty()) + { + for (final System system : oldSystems) + { + onboardingControllerDBService.removeSystemById(system.getId()); + } + } + + final String authInfo = sslProperties.isSslEnabled() ? Base64.getEncoder().encodeToString(publicKey.getEncoded()) : null; + onboardingControllerDBService.createSystem(name, + coreSystemRegistrationProperties.getCoreSystemDomainName(), + coreSystemRegistrationProperties.getCoreSystemDomainPort(), + authInfo); + } + catch (final ArrowheadException ex) + { + logger.error("Can't register {} as a system.", coreSystemRegistrationProperties.getCoreSystem().name()); + logger.debug("Stacktrace", ex); + } + } + + //------------------------------------------------------------------------------------------------- + private boolean isOwnCloudRegistered() + { + logger.debug("isOwnCloudRegistered started..."); + try + { + commonDBService.getOwnCloud(sslProperties.isSslEnabled()); + return true; + } + catch (final DataNotFoundException ex) + { + return false; + } + } + + //------------------------------------------------------------------------------------------------- + private void registerOwnCloud(final ApplicationContext appContext) + { + logger.debug("registerOwnCloud started..."); + + if (!standaloneMode) + { + String name = CoreDefaults.DEFAULT_OWN_CLOUD_NAME; + String operator = CoreDefaults.DEFAULT_OWN_CLOUD_OPERATOR; + + if (sslProperties.isSslEnabled()) + { + @SuppressWarnings("unchecked") final Map context = appContext.getBean(CommonConstants.ARROWHEAD_CONTEXT, Map.class); + final String serverCN = (String) context.get(CommonConstants.SERVER_COMMON_NAME); + final String[] serverFields = serverCN.split("\\."); + name = serverFields[1]; + operator = serverFields[2]; + } + + commonDBService.insertOwnCloud(operator, name, sslProperties.isSslEnabled(), null); + logger.info("{}.{} own cloud is registered in {} mode.", name, operator, getModeString()); + } + } +} \ No newline at end of file diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java new file mode 100644 index 000000000..7839a807e --- /dev/null +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java @@ -0,0 +1,159 @@ +package eu.arrowhead.core.onboarding; + +import eu.arrowhead.common.*; +import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; +import eu.arrowhead.common.dto.internal.DeviceRegistryListResponseDTO; +import eu.arrowhead.common.dto.shared.*; +import eu.arrowhead.common.exception.BadPayloadException; +import eu.arrowhead.core.onboarding.database.service.OnboardingDBService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.apache.http.HttpStatus; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import java.security.cert.X509Certificate; +import java.time.format.DateTimeParseException; +import java.util.Objects; +import java.util.regex.Matcher; + +@Api(tags = {CoreCommonConstants.SWAGGER_TAG_ALL}) +@CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, + allowedHeaders = {HttpHeaders.ORIGIN, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT, HttpHeaders.AUTHORIZATION} +) +@RestController +@RequestMapping(CommonConstants.ONBOARDING_URI) +public class OnboardingController +{ + + //================================================================================================= + // members + + private static final String ONBOARDING_HTTP_200_MESSAGE = "Initial Onboarding successful"; + private static final String ONBOARDING_HTTP_400_MESSAGE = "Request parameter missing"; + private static final String DEVICE_NAME_NULL_ERROR_MESSAGE = " Device name must have value "; + private static final String CSR_NULL_ERROR_MESSAGE = " CertificateSigningRequest must have value "; + + private static final String ONBOARDING_WITH_NAME_URI = "/name"; + private static final String ONBOARDING_WITH_CSR_URI = "/csr"; + + private final Logger logger = LogManager.getLogger(OnboardingController.class); + private final OnboardingDBService onboardingDBService; + + @Autowired + public OnboardingController(final OnboardingDBService onboardingDBService) + { + this.onboardingDBService = onboardingDBService; + } + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return an echo message with the purpose of testing the core device availability", response = String.class, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = CoreCommonConstants.SWAGGER_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CommonConstants.ECHO_URI) + public String echoDevice() + { + return "Got it!"; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return onboarding certificate", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = ONBOARDING_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = ONBOARDING_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(ONBOARDING_WITH_NAME_URI) + @ResponseBody + public OnboardingWithNameResponseDTO onboardWithName(final HttpServletRequest httpServletRequest, + @RequestBody final OnboardingWithNameRequestDTO onboardingRequest) + { + logger.debug("onboardWithName started ..."); + + authenticateRequest(httpServletRequest); + verifyRequest(onboardingRequest, CommonConstants.ONBOARDING_URI + ONBOARDING_WITH_NAME_URI); + + return onboardingDBService.onboarding(onboardingRequest); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return onboarding certificate", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = ONBOARDING_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = ONBOARDING_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(ONBOARDING_WITH_CSR_URI) + @ResponseBody + public OnboardingWithCsrResponseDTO onboardWithCsr(final HttpServletRequest httpServletRequest, + @RequestBody final OnboardingWithCsrRequestDTO onboardingRequest) + { + logger.debug("onboardWithName started ..."); + + authenticateRequest(httpServletRequest); + verifyRequest(onboardingRequest, CommonConstants.ONBOARDING_URI + ONBOARDING_WITH_NAME_URI); + + return onboardingDBService.onboarding(onboardingRequest); + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private void authenticateRequest(final HttpServletRequest httpServletRequest) + { + final X509Certificate[] certificates = (X509Certificate[]) httpServletRequest.getAttribute(CommonConstants.ATTR_JAVAX_SERVLET_REQUEST_X509_CERTIFICATE); + + if (Objects.nonNull(certificates)) + { + // TODO verify certificate with certificate authority + } + } + + //------------------------------------------------------------------------------------------------- + private void verifyRequest(final OnboardingWithNameRequestDTO onboardingRequest, final String origin) + { + logger.debug("verifyRequest started..."); + + if (onboardingRequest == null) + { + throw new BadPayloadException("Request is null.", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(onboardingRequest.getDeviceName())) + { + throw new BadPayloadException(DEVICE_NAME_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + private void verifyRequest(final OnboardingWithCsrRequestDTO onboardingRequest, final String origin) + { + logger.debug("verifyRequest started..."); + + if (onboardingRequest == null) + { + throw new BadPayloadException("Request is null.", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(onboardingRequest.getCertificateSigningRequest())) + { + throw new BadPayloadException(CSR_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + } +} \ No newline at end of file diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingMain.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingMain.java new file mode 100644 index 000000000..a043735eb --- /dev/null +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingMain.java @@ -0,0 +1,26 @@ +package eu.arrowhead.core.onboarding; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.database.repository.RefreshableRepositoryImpl; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@SpringBootApplication(scanBasePackages = CommonConstants.BASE_PACKAGE) +@EntityScan(CoreCommonConstants.DATABASE_ENTITY_PACKAGE) +@EnableJpaRepositories(basePackages = CoreCommonConstants.DATABASE_REPOSITORY_PACKAGE, repositoryBaseClass = RefreshableRepositoryImpl.class) +@EnableSwagger2 +public class OnboardingMain +{ + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public static void main(final String[] args) { + SpringApplication.run(OnboardingMain.class, args); + } +} diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java new file mode 100644 index 000000000..16fd5d7c3 --- /dev/null +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java @@ -0,0 +1,199 @@ +package eu.arrowhead.core.onboarding.database.service; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.SSLProperties; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.database.repository.SystemRepository; +import eu.arrowhead.common.dto.shared.OnboardingWithCsrRequestDTO; +import eu.arrowhead.common.dto.shared.OnboardingWithCsrResponseDTO; +import eu.arrowhead.common.dto.shared.OnboardingWithNameRequestDTO; +import eu.arrowhead.common.dto.shared.OnboardingWithNameResponseDTO; +import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.common.exception.InvalidParameterException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Optional; + +@Service +public class OnboardingDBService +{ + private static final String COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE = "Could not delete System, with given parameters"; + private static final String PORT_RANGE_ERROR_MESSAGE = "Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + "."; + //================================================================================================= + // members + private final Logger logger = LogManager.getLogger(OnboardingDBService.class); + private final SystemRepository systemRepository; + private final SSLProperties sslProperties; + + @Autowired + public OnboardingDBService(final SystemRepository systemRepository, final SSLProperties sslProperties) + { + this.systemRepository = systemRepository; + this.sslProperties = sslProperties; + } + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public OnboardingWithNameResponseDTO onboarding(final OnboardingWithNameRequestDTO onboardingRequest) + { + logger.debug("onboarding started..."); + // TODO contact certificate authority + return null; + } + + //------------------------------------------------------------------------------------------------- + public OnboardingWithCsrResponseDTO onboarding(final OnboardingWithCsrRequestDTO onboardingRequest) + { + logger.debug("onboarding started..."); + // TODO contact certificate authority + return null; + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public List getSystemByName(final String systemName) + { + logger.debug("getSystemByName started..."); + + final String name = validateSystemParamString(systemName); + try + { + return systemRepository.findBySystemName(name); + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public void removeSystemById(final long id) + { + logger.debug("removeSystemById started..."); + + try + { + if (!systemRepository.existsById(id)) + { + throw new InvalidParameterException(COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE); + } + + systemRepository.deleteById(id); + systemRepository.flush(); + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) + { + logger.debug("createSystem started..."); + + final System system = validateNonNullSystemParameters(systemName, address, port, authenticationInfo); + + try + { + return systemRepository.saveAndFlush(system); + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private String validateSystemParamString(final String param) + { + logger.debug("validateSystemParamString started..."); + + if (Utilities.isEmpty(param)) + { + throw new InvalidParameterException("parameter null or empty"); + } + + return param.trim().toLowerCase(); + } + + //------------------------------------------------------------------------------------------------- + private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) + { + logger.debug("validateNonNullSystemParameters started..."); + + if (Utilities.isEmpty(systemName)) + { + throw new InvalidParameterException("System name is null or empty"); + } + + if (Utilities.isEmpty(address)) + { + throw new InvalidParameterException("System address is null or empty"); + } + + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) + { + throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); + } + + final String validatedSystemName = systemName.trim().toLowerCase(); + if (validatedSystemName.contains(".")) + { + throw new InvalidParameterException("System name can't contain dot (.)"); + } + final String validatedAddress = address.trim().toLowerCase(); + + checkConstraintsOfSystemTable(validatedSystemName, validatedAddress, port); + + return new System(validatedSystemName, validatedAddress, port, authenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) + { + logger.debug("checkConstraintsOfSystemTable started..."); + + try + { + final Optional find = systemRepository + .findBySystemNameAndAddressAndPort(validatedSystemName.toLowerCase().trim(), validatedAddress.toLowerCase().trim(), validatedPort); + if (find.isPresent()) + { + throw new InvalidParameterException( + "System with name: " + validatedSystemName + ", address: " + validatedAddress + ", port: " + validatedPort + " already exists."); + } + } + catch (final InvalidParameterException ex) + { + throw ex; + } + catch (final Exception ex) + { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + +} From 6a8f4cc5435e7194c0ee1468d71dda78b30554da Mon Sep 17 00:00:00 2001 From: mzsilak Date: Mon, 27 Jan 2020 13:13:46 +0100 Subject: [PATCH 037/301] implemented changes after review --- .../eu/arrowhead/common/CoreUtilities.java | 2 +- .../java/eu/arrowhead/common/Utilities.java | 995 +++++++++--------- .../eu/arrowhead/common/core/CoreSystem.java | 53 +- .../common/core/CoreSystemService.java | 205 ++-- .../common/database/entity/Device.java | 15 +- .../database/entity/DeviceRegistry.java | 243 +++-- .../common/database/entity/System.java | 4 +- .../database/entity/SystemRegistry.java | 268 +++-- .../repository/DeviceRegistryRepository.java | 4 +- .../repository/SystemRegistryRepository.java | 4 +- .../common/dto/internal/DTOConverter.java | 64 +- .../service/DeviceRegistryDBService.java | 4 +- .../src/main/resources/application.properties | 2 +- ...y.service => arrowhead-onboarding.service} | 0 scripts/authorization_privileges.sql | 4 +- scripts/create_arrowhead_tables.sql | 18 +- scripts/create_empty_arrowhead_db.sql | 10 + scripts/device_registry_privileges.sql | 23 + scripts/event_handler_privileges.sql | 4 +- scripts/gatekeeper_privileges.sql | 4 +- scripts/onboarding_controller_privileges.sql | 2 + scripts/orchestrator_privileges.sql | 4 +- scripts/service_registry_privileges.sql | 4 +- scripts/system_registry_privileges.sql | 23 + .../service/SystemRegistryDBService.java | 4 +- .../src/main/resources/application.properties | 2 +- 26 files changed, 1130 insertions(+), 835 deletions(-) rename onboarding/src/deb/{arrowhead-deviceregistry.service => arrowhead-onboarding.service} (100%) create mode 100644 scripts/device_registry_privileges.sql create mode 100644 scripts/onboarding_controller_privileges.sql create mode 100644 scripts/system_registry_privileges.sql diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreUtilities.java b/core-common/src/main/java/eu/arrowhead/common/CoreUtilities.java index 32b355c42..e669c98cb 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreUtilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreUtilities.java @@ -73,7 +73,7 @@ public static class ValidatedPageParams { //================================================================================================= // members - private static final int MAX_BATCH_SIZE = 200; + private static final int MAX_BATCH_SIZE = Integer.MAX_VALUE; private final int validatedPage; private final int validatedSize; diff --git a/core-common/src/main/java/eu/arrowhead/common/Utilities.java b/core-common/src/main/java/eu/arrowhead/common/Utilities.java index 80c59259f..9c8846817 100644 --- a/core-common/src/main/java/eu/arrowhead/common/Utilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/Utilities.java @@ -1,5 +1,31 @@ package eu.arrowhead.common; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import eu.arrowhead.common.dto.internal.RelayType; +import eu.arrowhead.common.dto.shared.ErrorMessageDTO; +import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.common.exception.AuthException; +import eu.arrowhead.common.exception.BadPayloadException; +import eu.arrowhead.common.exception.DataNotFoundException; +import eu.arrowhead.common.exception.InvalidParameterException; +import eu.arrowhead.common.exception.TimeoutException; +import eu.arrowhead.common.exception.UnavailableServerException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.http.HttpStatus; +import org.springframework.lang.Nullable; +import org.springframework.util.Assert; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.util.StringUtils; +import org.springframework.web.util.UriComponents; +import org.springframework.web.util.UriComponentsBuilder; + +import javax.naming.InvalidNameException; +import javax.naming.ldap.LdapName; +import javax.naming.ldap.Rdn; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; @@ -24,525 +50,496 @@ import java.time.format.DateTimeParseException; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAccessor; -import java.util.*; +import java.util.ArrayList; +import java.util.Base64; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; import java.util.Map.Entry; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.ServiceConfigurationError; import java.util.regex.Pattern; -import javax.naming.InvalidNameException; -import javax.naming.ldap.LdapName; -import javax.naming.ldap.Rdn; +public class Utilities { -import com.fasterxml.jackson.databind.ser.std.ObjectArraySerializer; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.springframework.http.HttpStatus; -import org.springframework.lang.Nullable; -import org.springframework.util.Assert; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.util.StringUtils; -import org.springframework.web.util.UriComponents; -import org.springframework.web.util.UriComponentsBuilder; + //================================================================================================= + // members -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; + private static final int SERVICE_CN_NAME_LENGTH = 5; + @SuppressWarnings("unused") + private static final int CLOUD_CN_NAME_LENGTH = 4; + @SuppressWarnings("unused") + private static final int AH_MASTER_CN_NAME_LENGTH = 2; -import eu.arrowhead.common.dto.internal.RelayType; -import eu.arrowhead.common.dto.shared.ErrorMessageDTO; -import eu.arrowhead.common.exception.ArrowheadException; -import eu.arrowhead.common.exception.AuthException; -import eu.arrowhead.common.exception.BadPayloadException; -import eu.arrowhead.common.exception.DataNotFoundException; -import eu.arrowhead.common.exception.InvalidParameterException; -import eu.arrowhead.common.exception.TimeoutException; -import eu.arrowhead.common.exception.UnavailableServerException; + private static final String AH_MASTER_SUFFIX = "eu"; + private static final String AH_MASTER_NAME = "arrowhead"; -public class Utilities { - - //================================================================================================= - // members - - private static final int SERVICE_CN_NAME_LENGTH = 5; - @SuppressWarnings("unused") - private static final int CLOUD_CN_NAME_LENGTH = 4; - @SuppressWarnings("unused") - private static final int AH_MASTER_CN_NAME_LENGTH = 2; - - private static final String AH_MASTER_SUFFIX = "eu"; - private static final String AH_MASTER_NAME = "arrowhead"; - - private static final String KEY_FACTORY_ALGORHITM_NAME = "RSA"; - private static final KeyFactory keyFactory; - private static final Pattern PEM_PATTERN = Pattern.compile("(?m)(?s)^---*BEGIN.*---*$(.*)^---*END.*---*$.*"); - - private static final Logger logger = LogManager.getLogger(Utilities.class); - private static final ObjectMapper mapper = new ObjectMapper(); - private static final String dateTimePattern = "yyyy-MM-dd HH:mm:ss"; - static final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(dateTimePattern); - - static { - mapper.configure(SerializationFeature.INDENT_OUTPUT, true); - try { - keyFactory = KeyFactory.getInstance(KEY_FACTORY_ALGORHITM_NAME); - } catch (final NoSuchAlgorithmException ex) { - logger.fatal("KeyFactory.getInstance(String) throws NoSuchAlgorithmException, code needs to be changed!"); - throw new ServiceConfigurationError("KeyFactory.getInstance(String) throws NoSuchAlgorithmException, code needs to be changed!", ex); - } - } - - //================================================================================================= - // methods - - //------------------------------------------------------------------------------------------------- - public static boolean isEmpty(final String str) { - return str == null || str.isBlank(); - } - - //------------------------------------------------------------------------------------------------- - public static boolean notEmpty(final String str) { - return StringUtils.hasText(str); - } - - //------------------------------------------------------------------------------------------------- - @Nullable - public static String stripEndSlash(final String uri) { - if (uri != null && uri.endsWith("/")) { - return uri.substring(0, uri.length() - 1); - } - - return uri; - } - - //------------------------------------------------------------------------------------------------- - public static String convertZonedDateTimeToUTCString(final ZonedDateTime time) { - if (time == null) { - return null; - } - - final LocalDateTime localDateTime = LocalDateTime.ofInstant(time.toInstant(), ZoneOffset.UTC); - return dateTimeFormatter.format(localDateTime); - } - - //------------------------------------------------------------------------------------------------- - @SuppressWarnings("squid:RedundantThrowsDeclarationCheck") - public static ZonedDateTime parseUTCStringToLocalZonedDateTime(final String timeStr) throws DateTimeParseException { - if (isEmpty(timeStr)) { - return null; - } - - final TemporalAccessor tempAcc = dateTimeFormatter.parse(timeStr); - final ZonedDateTime parsedDateTime = ZonedDateTime.of(tempAcc.get(ChronoField.YEAR), - tempAcc.get(ChronoField.MONTH_OF_YEAR), - tempAcc.get(ChronoField.DAY_OF_MONTH), - tempAcc.get(ChronoField.HOUR_OF_DAY), - tempAcc.get(ChronoField.MINUTE_OF_HOUR), - tempAcc.get(ChronoField.SECOND_OF_MINUTE), - 0, - ZoneOffset.UTC); - - final ZoneOffset offset = OffsetDateTime.now().getOffset(); - return ZonedDateTime.ofInstant(parsedDateTime.toInstant(), offset); - } - - //------------------------------------------------------------------------------------------------- - @Nullable - public static String toPrettyJson(final String jsonString) { - try { - if (jsonString != null) { - final String jsonString_ = jsonString.trim(); - if (jsonString_.startsWith("{")) { - final Object tempObj = mapper.readValue(jsonString_, Object.class); - return mapper.writeValueAsString(tempObj); - } else { - final Object[] tempObj = mapper.readValue(jsonString_, Object[].class); - return mapper.writeValueAsString(tempObj); - } - } - } catch (final IOException ex) { - // it seems it is not a JSON string, so we just return untouched - } - - return jsonString; - } - - //------------------------------------------------------------------------------------------------- - @Nullable - public static String toJson(final Object object) { - if (object == null) { - return null; - } - - try { - return mapper.writeValueAsString(object); - } catch (final JsonProcessingException ex) { - throw new ArrowheadException("The specified object cannot be converted to text.", ex); - } - } - - //------------------------------------------------------------------------------------------------- - @Nullable - public static T fromJson(final String json, final Class parsedClass) { - if (json == null || parsedClass == null) { - return null; - } - - try { - return mapper.readValue(json, parsedClass); - } catch (final IOException ex) { - throw new ArrowheadException("The specified string cannot be converted to a(n) " + parsedClass.getSimpleName() + " object.", ex); - } - } - - //------------------------------------------------------------------------------------------------- - @Nullable - public static Map text2Map(final String text) { - if (text == null) { - return null; - } - - final Map result = new HashMap<>(); - if (!isEmpty(text.trim())) { - final String[] parts = text.split(","); - for (final String part : parts) { - final String[] pair = part.split("="); - result.put(URLDecoder.decode(pair[0].trim(), StandardCharsets.UTF_8), pair.length == 1 ? "" : URLDecoder.decode(pair[1].trim(), StandardCharsets.UTF_8)); - } - } - - return result; - } - - //------------------------------------------------------------------------------------------------- - @Nullable - public static String map2Text(final Map map) { - if (map == null) { - return null; - } - - final StringBuilder sb = new StringBuilder(); - for (final Entry entry : map.entrySet()) { - final String key = URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8); - final String value = URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8); - sb.append(key).append("=").append(value).append(", "); - } - - return map.isEmpty() ? "" : sb.substring(0, sb.length() - 2); - } - - //------------------------------------------------------------------------------------------------- - /** - * - * @param scheme default: http - * @param host default: 127.0.0.1 - * @param port default: 80 - * @param queryParams default: null - * @param path default: null - * @param pathSegments default: null - */ - public static UriComponents createURI(final String scheme, final String host, final int port, final MultiValueMap queryParams, final String path, final String... pathSegments) { - final UriComponentsBuilder builder = UriComponentsBuilder.newInstance(); - builder.scheme(scheme == null ? CommonConstants.HTTP : scheme) - .host(host == null ? CommonConstants.LOCALHOST : host) - .port(port <= 0 ? CommonConstants.HTTP_PORT : port); - - if (queryParams != null) { - builder.queryParams(queryParams); - } - - if (pathSegments != null && pathSegments.length > 0) { - builder.pathSegment(pathSegments); - } - - if (!Utilities.isEmpty(path)) { - builder.path(path); - } - - return builder.build(); - } - - //------------------------------------------------------------------------------------------------- - public static UriComponents createURI(final String scheme, final String host, final int port, final String path) { - return createURI(scheme, host, port, null, path, (String[]) null); - } - - //------------------------------------------------------------------------------------------------- - public static UriComponents createURI(final String scheme, final String host, final int port, final String path, final String... queryParams) { - if (queryParams.length % 2 != 0) { - throw new InvalidParameterException("queryParams variable arguments conatins a key without value"); - } - - final LinkedMultiValueMap query = new LinkedMultiValueMap<>(); - - int count = 1; - String key = ""; - for (final String vararg : queryParams) { - if (count % 2 != 0) { - query.putIfAbsent(vararg, new ArrayList<>()); - key = vararg; - } else { - query.get(key).add(vararg); - } - count++; - } - - return createURI(scheme, host, port, query, path); - } - - //------------------------------------------------------------------------------------------------- - public static HttpStatus calculateHttpStatusFromArrowheadException(final ArrowheadException ex) { - Assert.notNull(ex, "Exception is null."); - - HttpStatus status = HttpStatus.resolve(ex.getErrorCode()); - if (status == null) { - switch (ex.getExceptionType()) { - case AUTH: - status = HttpStatus.UNAUTHORIZED; - break; - case BAD_PAYLOAD: - case INVALID_PARAMETER: - status = HttpStatus.BAD_REQUEST; - break; - case DATA_NOT_FOUND: - status = HttpStatus.NOT_FOUND; - break; - case UNAVAILABLE: - case TIMEOUT: - status = HttpStatus.GATEWAY_TIMEOUT; - break; - default: - status = HttpStatus.INTERNAL_SERVER_ERROR; - } - } - - return status; - } - - //------------------------------------------------------------------------------------------------- - public static RelayType convertStringToRelayType(final String str) { - if (isEmpty(str)) { - return RelayType.GENERAL_RELAY; - } - - try { - return RelayType.valueOf(str.toUpperCase().trim()); - } catch (final IllegalArgumentException ex) { - return null; - } - } - - //------------------------------------------------------------------------------------------------- - @Nullable - public static String getCertCNFromSubject(final String subjectName) { - if (subjectName == null) { - return null; - } - - try { - // Subject is in LDAP format, we can use the LdapName object for parsing - final LdapName ldapname = new LdapName(subjectName); - for (final Rdn rdn : ldapname.getRdns()) { - // Find the data after the CN field - if (CommonConstants.COMMON_NAME_FIELD_NAME.equalsIgnoreCase(rdn.getType())) { - return (String) rdn.getValue(); - } - } - } catch (final InvalidNameException ex) { - logger.warn("InvalidNameException in getCertCNFromSubject: {}", ex.getMessage()); - logger.debug("Exception", ex); - } - - return null; - } - - //------------------------------------------------------------------------------------------------- - public static String getCloudCommonName(final String cloudOperator, final String cloudName) { - Assert.isTrue(!isEmpty(cloudOperator), "Cloud operator is null or blank."); - Assert.isTrue(!isEmpty(cloudName), "Cloud name is null or blank."); - - return (cloudName.trim() + "." + cloudOperator.trim() + ".arrowhead.eu").toLowerCase(); - } - - //------------------------------------------------------------------------------------------------- - public static X509Certificate getFirstCertFromKeyStore(final KeyStore keystore) { - Assert.notNull(keystore, "Key store is not defined."); + private static final String KEY_FACTORY_ALGORHITM_NAME = "RSA"; + private static final KeyFactory keyFactory; + private static final Pattern PEM_PATTERN = Pattern.compile("(?m)(?s)^---*BEGIN.*---*$(.*)^---*END.*---*$.*"); + + private static final Logger logger = LogManager.getLogger(Utilities.class); + private static final ObjectMapper mapper = new ObjectMapper(); + private static final String dateTimePattern = "yyyy-MM-dd HH:mm:ss"; + static final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(dateTimePattern); + + static { + mapper.configure(SerializationFeature.INDENT_OUTPUT, true); + try { + keyFactory = KeyFactory.getInstance(KEY_FACTORY_ALGORHITM_NAME); + } catch (final NoSuchAlgorithmException ex) { + logger.fatal("KeyFactory.getInstance(String) throws NoSuchAlgorithmException, code needs to be changed!"); + throw new ServiceConfigurationError("KeyFactory.getInstance(String) throws NoSuchAlgorithmException, code needs to be changed!", ex); + } + } + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public static boolean isEmpty(final String str) { + return str == null || str.isBlank(); + } + + //------------------------------------------------------------------------------------------------- + public static boolean notEmpty(final String str) { + return StringUtils.hasText(str); + } + + //------------------------------------------------------------------------------------------------- + @Nullable + public static String stripEndSlash(final String uri) { + if (uri != null && uri.endsWith("/")) { + return uri.substring(0, uri.length() - 1); + } + + return uri; + } + + //------------------------------------------------------------------------------------------------- + public static String convertZonedDateTimeToUTCString(final ZonedDateTime time) { + if (time == null) { + return null; + } + + final LocalDateTime localDateTime = LocalDateTime.ofInstant(time.toInstant(), ZoneOffset.UTC); + return dateTimeFormatter.format(localDateTime); + } + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings("squid:RedundantThrowsDeclarationCheck") + public static ZonedDateTime parseUTCStringToLocalZonedDateTime(final String timeStr) throws DateTimeParseException { + if (isEmpty(timeStr)) { + return null; + } + + final TemporalAccessor tempAcc = dateTimeFormatter.parse(timeStr); + final ZonedDateTime parsedDateTime = ZonedDateTime.of(tempAcc.get(ChronoField.YEAR), + tempAcc.get(ChronoField.MONTH_OF_YEAR), + tempAcc.get(ChronoField.DAY_OF_MONTH), + tempAcc.get(ChronoField.HOUR_OF_DAY), + tempAcc.get(ChronoField.MINUTE_OF_HOUR), + tempAcc.get(ChronoField.SECOND_OF_MINUTE), + 0, + ZoneOffset.UTC); + + final ZoneOffset offset = OffsetDateTime.now().getOffset(); + return ZonedDateTime.ofInstant(parsedDateTime.toInstant(), offset); + } + + //------------------------------------------------------------------------------------------------- + @Nullable + public static String toPrettyJson(final String jsonString) { + try { + if (jsonString != null) { + final String jsonString_ = jsonString.trim(); + if (jsonString_.startsWith("{")) { + final Object tempObj = mapper.readValue(jsonString_, Object.class); + return mapper.writeValueAsString(tempObj); + } else { + final Object[] tempObj = mapper.readValue(jsonString_, Object[].class); + return mapper.writeValueAsString(tempObj); + } + } + } catch (final IOException ex) { + // it seems it is not a JSON string, so we just return untouched + } + + return jsonString; + } + + //------------------------------------------------------------------------------------------------- + @Nullable + public static String toJson(final Object object) { + if (object == null) { + return null; + } + + try { + return mapper.writeValueAsString(object); + } catch (final JsonProcessingException ex) { + throw new ArrowheadException("The specified object cannot be converted to text.", ex); + } + } + + //------------------------------------------------------------------------------------------------- + @Nullable + public static T fromJson(final String json, final Class parsedClass) { + if (json == null || parsedClass == null) { + return null; + } + + try { + return mapper.readValue(json, parsedClass); + } catch (final IOException ex) { + throw new ArrowheadException("The specified string cannot be converted to a(n) " + parsedClass.getSimpleName() + " object.", ex); + } + } + + //------------------------------------------------------------------------------------------------- + @Nullable + public static Map text2Map(final String text) { + if (text == null) { + return null; + } + + final Map result = new HashMap<>(); + if (!isEmpty(text.trim())) { + final String[] parts = text.split(","); + for (final String part : parts) { + final String[] pair = part.split("="); + result.put(URLDecoder.decode(pair[0].trim(), StandardCharsets.UTF_8), pair.length == 1 ? "" : URLDecoder.decode(pair[1].trim(), StandardCharsets.UTF_8)); + } + } + + return result; + } + + //------------------------------------------------------------------------------------------------- + @Nullable + public static String map2Text(final Map map) { + if (map == null) { + return null; + } + + final StringBuilder sb = new StringBuilder(); + for (final Entry entry : map.entrySet()) { + final String key = URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8); + final String value = URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8); + sb.append(key).append("=").append(value).append(", "); + } + + return map.isEmpty() ? "" : sb.substring(0, sb.length() - 2); + } + + //------------------------------------------------------------------------------------------------- + + /** + * @param scheme default: http + * @param host default: 127.0.0.1 + * @param port default: 80 + * @param queryParams default: null + * @param path default: null + * @param pathSegments default: null + */ + public static UriComponents createURI(final String scheme, final String host, final int port, final MultiValueMap queryParams, final String path, final String... pathSegments) { + final UriComponentsBuilder builder = UriComponentsBuilder.newInstance(); + builder.scheme(scheme == null ? CommonConstants.HTTP : scheme) + .host(host == null ? CommonConstants.LOCALHOST : host) + .port(port <= 0 ? CommonConstants.HTTP_PORT : port); + + if (queryParams != null) { + builder.queryParams(queryParams); + } + + if (pathSegments != null && pathSegments.length > 0) { + builder.pathSegment(pathSegments); + } + + if (!Utilities.isEmpty(path)) { + builder.path(path); + } + + return builder.build(); + } + + //------------------------------------------------------------------------------------------------- + public static UriComponents createURI(final String scheme, final String host, final int port, final String path) { + return createURI(scheme, host, port, null, path, (String[]) null); + } + + //------------------------------------------------------------------------------------------------- + public static UriComponents createURI(final String scheme, final String host, final int port, final String path, final String... queryParams) { + if (queryParams.length % 2 != 0) { + throw new InvalidParameterException("queryParams variable arguments conatins a key without value"); + } + + final LinkedMultiValueMap query = new LinkedMultiValueMap<>(); + + int count = 1; + String key = ""; + for (final String vararg : queryParams) { + if (count % 2 != 0) { + query.putIfAbsent(vararg, new ArrayList<>()); + key = vararg; + } else { + query.get(key).add(vararg); + } + count++; + } + + return createURI(scheme, host, port, query, path); + } + + //------------------------------------------------------------------------------------------------- + public static HttpStatus calculateHttpStatusFromArrowheadException(final ArrowheadException ex) { + Assert.notNull(ex, "Exception is null."); + + HttpStatus status = HttpStatus.resolve(ex.getErrorCode()); + if (status == null) { + switch (ex.getExceptionType()) { + case AUTH: + status = HttpStatus.UNAUTHORIZED; + break; + case BAD_PAYLOAD: + case INVALID_PARAMETER: + status = HttpStatus.BAD_REQUEST; + break; + case DATA_NOT_FOUND: + status = HttpStatus.NOT_FOUND; + break; + case UNAVAILABLE: + case TIMEOUT: + status = HttpStatus.GATEWAY_TIMEOUT; + break; + default: + status = HttpStatus.INTERNAL_SERVER_ERROR; + } + } + + return status; + } + + //------------------------------------------------------------------------------------------------- + public static RelayType convertStringToRelayType(final String str) { + if (isEmpty(str)) { + return RelayType.GENERAL_RELAY; + } + + try { + return RelayType.valueOf(str.toUpperCase().trim()); + } catch (final IllegalArgumentException ex) { + return null; + } + } + + //------------------------------------------------------------------------------------------------- + @Nullable + public static String getCertCNFromSubject(final String subjectName) { + if (subjectName == null) { + return null; + } + + try { + // Subject is in LDAP format, we can use the LdapName object for parsing + final LdapName ldapname = new LdapName(subjectName); + for (final Rdn rdn : ldapname.getRdns()) { + // Find the data after the CN field + if (CommonConstants.COMMON_NAME_FIELD_NAME.equalsIgnoreCase(rdn.getType())) { + return (String) rdn.getValue(); + } + } + } catch (final InvalidNameException ex) { + logger.warn("InvalidNameException in getCertCNFromSubject: {}", ex.getMessage()); + logger.debug("Exception", ex); + } + + return null; + } + + //------------------------------------------------------------------------------------------------- + public static String getCloudCommonName(final String cloudOperator, final String cloudName) { + Assert.isTrue(!isEmpty(cloudOperator), "Cloud operator is null or blank."); + Assert.isTrue(!isEmpty(cloudName), "Cloud name is null or blank."); + + return (cloudName.trim() + "." + cloudOperator.trim() + ".arrowhead.eu").toLowerCase(); + } + + //------------------------------------------------------------------------------------------------- + public static X509Certificate getFirstCertFromKeyStore(final KeyStore keystore) { + Assert.notNull(keystore, "Key store is not defined."); try { final Enumeration enumeration = keystore.aliases(); final String alias = enumeration.nextElement(); return (X509Certificate) keystore.getCertificate(alias); } catch (final KeyStoreException | NoSuchElementException ex) { - logger.error("Getting the first cert from key store failed...", ex); + logger.error("Getting the first cert from key store failed...", ex); throw new ServiceConfigurationError("Getting the first cert from keystore failed...", ex); } } - //------------------------------------------------------------------------------------------------- - public static PrivateKey getPrivateKey(final KeyStore keystore, final String keyPass) { - Assert.notNull(keystore, "Key store is not defined."); - Assert.notNull(keyPass, "Password is not defined."); - - PrivateKey privateKey = null; - String element; - try { - final Enumeration enumeration = keystore.aliases(); - while (enumeration.hasMoreElements()) { - element = enumeration.nextElement(); - privateKey = (PrivateKey) keystore.getKey(element, keyPass.toCharArray()); - if (privateKey != null) { - break; - } - } - } catch (final KeyStoreException | UnrecoverableKeyException | NoSuchAlgorithmException ex) { - logger.error("Getting the private key from key store failed...", ex); - throw new ServiceConfigurationError("Getting the private key from key store failed...", ex); - } - - if (privateKey == null) { - throw new ServiceConfigurationError("Getting the private key failed, key store aliases do not identify a key."); - } - - return privateKey; - } - - //------------------------------------------------------------------------------------------------- - public static PublicKey getPublicKeyFromBase64EncodedString(final String encodedKey) { - Assert.isTrue(!isEmpty(encodedKey), "Encoded key is null or blank"); - - final byte[] keyBytes = Base64.getDecoder().decode(encodedKey); - return generatePublicKeyFromByteArray(keyBytes); - } - - //------------------------------------------------------------------------------------------------- - public static PublicKey getPublicKeyFromPEMFile(final InputStream is) { - Assert.notNull(is, "Input stream is null"); - try { - final ByteArrayOutputStream baos = new ByteArrayOutputStream(); - final byte[] buf = new byte[1024]; - for (int read = 0; read != -1; read = is.read(buf)) { - baos.write(buf, 0, read); - } - - final String pem = new String(baos.toByteArray(), StandardCharsets.ISO_8859_1); - baos.close(); - final String encoded = PEM_PATTERN.matcher(pem).replaceFirst("$1"); - final byte[] keyBytes = Base64.getMimeDecoder().decode(encoded); - - return generatePublicKeyFromByteArray(keyBytes); - } catch (final IOException ex) { - throw new ArrowheadException("IOException occurred during PEM file loading from input stream.", ex); - } - } - - //------------------------------------------------------------------------------------------------- - public static boolean isKeyStoreCNArrowheadValid(final String commonName) { - if (isEmpty(commonName)) { - return false; - } + //------------------------------------------------------------------------------------------------- + public static PrivateKey getPrivateKey(final KeyStore keystore, final String keyPass) { + Assert.notNull(keystore, "Key store is not defined."); + Assert.notNull(keyPass, "Password is not defined."); + + PrivateKey privateKey = null; + String element; + try { + final Enumeration enumeration = keystore.aliases(); + while (enumeration.hasMoreElements()) { + element = enumeration.nextElement(); + privateKey = (PrivateKey) keystore.getKey(element, keyPass.toCharArray()); + if (privateKey != null) { + break; + } + } + } catch (final KeyStoreException | UnrecoverableKeyException | NoSuchAlgorithmException ex) { + logger.error("Getting the private key from key store failed...", ex); + throw new ServiceConfigurationError("Getting the private key from key store failed...", ex); + } + + if (privateKey == null) { + throw new ServiceConfigurationError("Getting the private key failed, key store aliases do not identify a key."); + } + + return privateKey; + } + + //------------------------------------------------------------------------------------------------- + public static PublicKey getPublicKeyFromBase64EncodedString(final String encodedKey) { + Assert.isTrue(!isEmpty(encodedKey), "Encoded key is null or blank"); + + final byte[] keyBytes = Base64.getDecoder().decode(encodedKey); + return generatePublicKeyFromByteArray(keyBytes); + } + + //------------------------------------------------------------------------------------------------- + public static PublicKey getPublicKeyFromPEMFile(final InputStream is) { + Assert.notNull(is, "Input stream is null"); + try { + final ByteArrayOutputStream baos = new ByteArrayOutputStream(); + final byte[] buf = new byte[1024]; + for (int read = 0; read != -1; read = is.read(buf)) { + baos.write(buf, 0, read); + } + + final String pem = new String(baos.toByteArray(), StandardCharsets.ISO_8859_1); + baos.close(); + final String encoded = PEM_PATTERN.matcher(pem).replaceFirst("$1"); + final byte[] keyBytes = Base64.getMimeDecoder().decode(encoded); + + return generatePublicKeyFromByteArray(keyBytes); + } catch (final IOException ex) { + throw new ArrowheadException("IOException occurred during PEM file loading from input stream.", ex); + } + } + + //------------------------------------------------------------------------------------------------- + public static boolean isKeyStoreCNArrowheadValid(final String commonName) { + if (isEmpty(commonName)) { + return false; + } final String[] cnFields = commonName.split("\\.", 0); return cnFields.length == SERVICE_CN_NAME_LENGTH && cnFields[cnFields.length - 1].equals(AH_MASTER_SUFFIX) && cnFields[cnFields.length - 2].equals(AH_MASTER_NAME); } - //------------------------------------------------------------------------------------------------- - public static boolean isKeyStoreCNArrowheadValid(final String clientCN, final String cloudCN) { - if (isEmpty(clientCN) || isEmpty(cloudCN)) { - return false; - } - - final String[] clientFields = clientCN.split("\\.", 2); // valid clientFields contains clientServiceName, cloudName.operator.arrowhead.eu - - return clientFields.length >= 2 && cloudCN.equalsIgnoreCase(clientFields[1]); - } - - //------------------------------------------------------------------------------------------------- - public static String getDatetimePattern() { return dateTimePattern; } - - //------------------------------------------------------------------------------------------------- - public static void createExceptionFromErrorMessageDTO(final ErrorMessageDTO dto) { - Assert.notNull(dto, "Error message object is null."); - Assert.notNull(dto.getExceptionType(), "Exception type is null."); - - switch (dto.getExceptionType()) { - case ARROWHEAD: - throw new ArrowheadException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); - case AUTH: - throw new AuthException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); - case BAD_PAYLOAD: - throw new BadPayloadException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); - case INVALID_PARAMETER: - throw new InvalidParameterException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); - case DATA_NOT_FOUND: - throw new DataNotFoundException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); - case GENERIC: - throw new ArrowheadException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); - case TIMEOUT: - throw new TimeoutException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); - case UNAVAILABLE: - throw new UnavailableServerException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); - default: - logger.error("Unknown exception type: {}", dto.getExceptionType()); - throw new ArrowheadException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); - } - } - - //------------------------------------------------------------------------------------------------- - public static String lowerCaseTrim(final String text) - { - if(isEmpty(text)) - { - return text; - } - - return text.toLowerCase().trim(); - } - - //------------------------------------------------------------------------------------------------- - public static String firstNotNull(final String first, final String second) - { - return Utilities.notEmpty(first) ? Utilities.lowerCaseTrim(first) : Utilities.lowerCaseTrim(second); - } - - //------------------------------------------------------------------------------------------------- - @SuppressWarnings("unchecked") - public static T firstNotNull(final T first, final T second) - { - if(first instanceof String && second instanceof String) - { - return (T) firstNotNull((String) first, (String) second); - } - return Objects.nonNull(first) ? first : second; - } - - //------------------------------------------------------------------------------------------------- - public static String firstNotNull(final String... args) - { - for(final String candidate : args) - { - if(Utilities.notEmpty(candidate)) - { - return Utilities.lowerCaseTrim(candidate); - } - } - - return null; - } - - //================================================================================================= - // assistant methods - - //------------------------------------------------------------------------------------------------- - private Utilities() { - throw new UnsupportedOperationException(); - } - - //------------------------------------------------------------------------------------------------- - private static PublicKey generatePublicKeyFromByteArray(final byte[] keyBytes) { - try { - return keyFactory.generatePublic(new X509EncodedKeySpec(keyBytes)); - } catch (final InvalidKeySpecException ex) { - logger.error("getPublicKey: X509 keyspec could not be created from the decoded bytes."); - throw new AuthException("Public key decoding failed due wrong input key", ex); - } - } + //------------------------------------------------------------------------------------------------- + public static boolean isKeyStoreCNArrowheadValid(final String clientCN, final String cloudCN) { + if (isEmpty(clientCN) || isEmpty(cloudCN)) { + return false; + } + + final String[] clientFields = clientCN.split("\\.", 2); // valid clientFields contains clientServiceName, cloudName.operator.arrowhead.eu + + return clientFields.length >= 2 && cloudCN.equalsIgnoreCase(clientFields[1]); + } + + //------------------------------------------------------------------------------------------------- + public static String getDatetimePattern() { + return dateTimePattern; + } + + //------------------------------------------------------------------------------------------------- + public static void createExceptionFromErrorMessageDTO(final ErrorMessageDTO dto) { + Assert.notNull(dto, "Error message object is null."); + Assert.notNull(dto.getExceptionType(), "Exception type is null."); + + switch (dto.getExceptionType()) { + case ARROWHEAD: + throw new ArrowheadException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); + case AUTH: + throw new AuthException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); + case BAD_PAYLOAD: + throw new BadPayloadException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); + case INVALID_PARAMETER: + throw new InvalidParameterException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); + case DATA_NOT_FOUND: + throw new DataNotFoundException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); + case GENERIC: + throw new ArrowheadException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); + case TIMEOUT: + throw new TimeoutException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); + case UNAVAILABLE: + throw new UnavailableServerException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); + default: + logger.error("Unknown exception type: {}", dto.getExceptionType()); + throw new ArrowheadException(dto.getErrorMessage(), dto.getErrorCode(), dto.getOrigin()); + } + } + + //------------------------------------------------------------------------------------------------- + public static String lowerCaseTrim(final String text) { + if (isEmpty(text)) { + return text; + } + + return text.toLowerCase().trim(); + } + + //------------------------------------------------------------------------------------------------- + public static String firstNotNull(final String first, final String second) { + return Utilities.notEmpty(first) ? Utilities.lowerCaseTrim(first) : Utilities.lowerCaseTrim(second); + } + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings("unchecked") + public static T firstNotNull(final T first, final T second) { + if (first instanceof String && second instanceof String) { + return (T) firstNotNull((String) first, (String) second); + } + return Objects.nonNull(first) ? first : second; + } + + //------------------------------------------------------------------------------------------------- + public static String firstNotNull(final String... args) { + for (final String candidate : args) { + if (Utilities.notEmpty(candidate)) { + return Utilities.lowerCaseTrim(candidate); + } + } + + return null; + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private Utilities() { + throw new UnsupportedOperationException(); + } + + //------------------------------------------------------------------------------------------------- + private static PublicKey generatePublicKeyFromByteArray(final byte[] keyBytes) { + try { + return keyFactory.generatePublic(new X509EncodedKeySpec(keyBytes)); + } catch (final InvalidKeySpecException ex) { + logger.error("getPublicKey: X509 keyspec could not be created from the decoded bytes."); + throw new AuthException("Public key decoding failed due wrong input key", ex); + } + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java index cdfec54bd..aae246801 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java @@ -7,10 +7,30 @@ import java.util.Collections; import java.util.List; -import static eu.arrowhead.common.core.CoreSystemService.*; +import static eu.arrowhead.common.core.CoreSystemService.AUTH_CONTROL_INTER_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.AUTH_CONTROL_INTRA_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.AUTH_CONTROL_SUBSCRIPTION_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.AUTH_PUBLIC_KEY_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.AUTH_TOKEN_GENERATION_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.DEVICE_REGISTRY_REGISTER_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.DEVICE_REGISTRY_UNREGISTER_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.EVENT_PUBLISH_AUTH_UPDATE_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.EVENT_PUBLISH_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.EVENT_SUBSCRIBE_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.EVENT_UNSUBSCRIBE_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.GATEKEEPER_GLOBAL_SERVICE_DISCOVERY; +import static eu.arrowhead.common.core.CoreSystemService.GATEKEEPER_INTER_CLOUD_NEGOTIATION; +import static eu.arrowhead.common.core.CoreSystemService.GATEWAY_CONSUMER_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.GATEWAY_PROVIDER_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.GATEWAY_PUBLIC_KEY_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_SERVICE_WITH_NAME; +import static eu.arrowhead.common.core.CoreSystemService.ORCHESTRATION_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.SERVICE_REGISTRY_REGISTER_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.SERVICE_REGISTRY_UNREGISTER_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.SYSTEM_REGISTRY_REGISTER_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.SYSTEM_REGISTRY_UNREGISTER_SERVICE; -public enum CoreSystem -{ +public enum CoreSystem { //================================================================================================= // elements @@ -20,12 +40,12 @@ public enum CoreSystem DEVICE_REGISTRY(Defaults.DEFAULT_DEVICE_REGISTRY_PORT, List.of(DEVICE_REGISTRY_REGISTER_SERVICE, DEVICE_REGISTRY_UNREGISTER_SERVICE)), ONBOARDING(Defaults.DEFAULT_ONBOARDING_PORT, List.of(ONBOARDING_SERVICE_WITH_NAME)), AUTHORIZATION(Defaults.DEFAULT_AUTHORIZATION_PORT, List.of(AUTH_CONTROL_INTRA_SERVICE, AUTH_CONTROL_INTER_SERVICE, - AUTH_TOKEN_GENERATION_SERVICE, AUTH_PUBLIC_KEY_SERVICE, - AUTH_CONTROL_SUBSCRIPTION_SERVICE)), + AUTH_TOKEN_GENERATION_SERVICE, AUTH_PUBLIC_KEY_SERVICE, + AUTH_CONTROL_SUBSCRIPTION_SERVICE)), ORCHESTRATOR(Defaults.DEFAULT_ORCHESTRATOR_PORT, List.of(ORCHESTRATION_SERVICE)), GATEKEEPER(Defaults.DEFAULT_GATEKEEPER_PORT, List.of(GATEKEEPER_GLOBAL_SERVICE_DISCOVERY, GATEKEEPER_INTER_CLOUD_NEGOTIATION)), EVENT_HANDLER(Defaults.DEFAULT_EVENT_HANDLER_PORT, List.of(EVENT_PUBLISH_SERVICE, EVENT_SUBSCRIBE_SERVICE, - EVENT_UNSUBSCRIBE_SERVICE, EVENT_PUBLISH_AUTH_UPDATE_SERVICE)), + EVENT_UNSUBSCRIBE_SERVICE, EVENT_PUBLISH_AUTH_UPDATE_SERVICE)), GATEWAY(Defaults.DEFAULT_GATEWAY_PORT, List.of(GATEWAY_PUBLIC_KEY_SERVICE, GATEWAY_PROVIDER_SERVICE, GATEWAY_CONSUMER_SERVICE)), CHOREOGRAPHER(Defaults.DEFAULT_CHOREOGRAPHER_PORT, List.of()), // TODO: add services CERTIFICATE_AUTHORITY(Defaults.DEFAULT_CERTIFICATE_AUTHORITY_PORT, List.of()); // TODO: add services @@ -40,18 +60,23 @@ public enum CoreSystem // methods //------------------------------------------------------------------------------------------------- - private CoreSystem(final int defaultPort, final List services) - { - Assert.isTrue(defaultPort > CommonConstants.SYSTEM_PORT_RANGE_MIN && defaultPort < CommonConstants.SYSTEM_PORT_RANGE_MAX, "Default port is invalid."); - this.services = services != null ? Collections.unmodifiableList(services) : List.of(); - this.defaultPort = defaultPort; + public int getDefaultPort() { + return defaultPort; } //------------------------------------------------------------------------------------------------- - public int getDefaultPort() { return defaultPort; } + public List getServices() { + return services; + } + //================================================================================================= - // assistant methods + // constructors - public List getServices() { return services; } + //------------------------------------------------------------------------------------------------- + private CoreSystem(final int defaultPort, final List services) { + Assert.isTrue(defaultPort > CommonConstants.SYSTEM_PORT_RANGE_MIN && defaultPort < CommonConstants.SYSTEM_PORT_RANGE_MAX, "Default port is invalid."); + this.services = services != null ? Collections.unmodifiableList(services) : List.of(); + this.defaultPort = defaultPort; + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java index 444291cc5..6a28bb45a 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java @@ -1,81 +1,140 @@ package eu.arrowhead.common.core; -import org.springframework.util.Assert; - import eu.arrowhead.common.Utilities; +import org.springframework.util.Assert; -import static eu.arrowhead.common.CommonConstants.*; +import static eu.arrowhead.common.CommonConstants.AUTHORIZATION_URI; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_AUTH_CONTROL_INTER; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_AUTH_CONTROL_INTRA; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_AUTH_CONTROL_SUBSCRIPTION; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_AUTH_PUBLIC_KEY; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_AUTH_TOKEN_GENERATION; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_DEVICE_REGISTRY_REGISTER; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_DEVICE_REGISTRY_UNREGISTER; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_EVENT_HANDLER_PUBLISH; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_EVENT_HANDLER_PUBLISH_AUTH_UPDATE; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_EVENT_HANDLER_SUBSCRIBE; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_EVENT_HANDLER_UNSUBSCRIBE; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_GATEKEEPER_GSD; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_GATEKEEPER_ICN; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_GATEWAY_CONNECT_CONSUMER; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_GATEWAY_CONNECT_PROVIDER; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_GATEWAY_PUBLIC_KEY; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_CSR; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_NAME; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ORCH_PROCESS; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SERVICE_REGISTRY_REGISTER; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SERVICE_REGISTRY_UNREGISTER; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SYSTEM_REGISTRY_REGISTER; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SYSTEM_REGISTRY_UNREGISTER; +import static eu.arrowhead.common.CommonConstants.DEVICE_REGISTRY_URI; +import static eu.arrowhead.common.CommonConstants.EVENT_HANDLER_URI; +import static eu.arrowhead.common.CommonConstants.GATEKEEPER_URI; +import static eu.arrowhead.common.CommonConstants.GATEWAY_URI; +import static eu.arrowhead.common.CommonConstants.ONBOARDING_URI; +import static eu.arrowhead.common.CommonConstants.OP_AUTH_INTER_CHECK_URI; +import static eu.arrowhead.common.CommonConstants.OP_AUTH_INTRA_CHECK_URI; +import static eu.arrowhead.common.CommonConstants.OP_AUTH_KEY_URI; +import static eu.arrowhead.common.CommonConstants.OP_AUTH_SUBSCRIPTION_CHECK_URI; +import static eu.arrowhead.common.CommonConstants.OP_AUTH_TOKEN_URI; +import static eu.arrowhead.common.CommonConstants.OP_DEVICE_REGISTRY_REGISTER_URI; +import static eu.arrowhead.common.CommonConstants.OP_DEVICE_REGISTRY_UNREGISTER_URI; +import static eu.arrowhead.common.CommonConstants.OP_EVENT_HANDLER_PUBLISH; +import static eu.arrowhead.common.CommonConstants.OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE; +import static eu.arrowhead.common.CommonConstants.OP_EVENT_HANDLER_SUBSCRIBE; +import static eu.arrowhead.common.CommonConstants.OP_EVENT_HANDLER_UNSUBSCRIBE; +import static eu.arrowhead.common.CommonConstants.OP_GATEKEEPER_GSD_SERVICE; +import static eu.arrowhead.common.CommonConstants.OP_GATEKEEPER_ICN_SERVICE; +import static eu.arrowhead.common.CommonConstants.OP_GATEWAY_CONNECT_CONSUMER_URI; +import static eu.arrowhead.common.CommonConstants.OP_GATEWAY_CONNECT_PROVIDER_URI; +import static eu.arrowhead.common.CommonConstants.OP_GATEWAY_KEY_URI; +import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_CSR; +import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_NAME; +import static eu.arrowhead.common.CommonConstants.OP_ORCH_PROCESS; +import static eu.arrowhead.common.CommonConstants.OP_SERVICE_REGISTRY_REGISTER_URI; +import static eu.arrowhead.common.CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_URI; +import static eu.arrowhead.common.CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI; +import static eu.arrowhead.common.CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_URI; +import static eu.arrowhead.common.CommonConstants.ORCHESTRATOR_URI; +import static eu.arrowhead.common.CommonConstants.SERVICE_REGISTRY_URI; +import static eu.arrowhead.common.CommonConstants.SYSTEM_REGISTRY_URI; public enum CoreSystemService { - //================================================================================================= - // elements - - // Authorization services - AUTH_CONTROL_INTRA_SERVICE(CORE_SERVICE_AUTH_CONTROL_INTRA, AUTHORIZATION_URI + OP_AUTH_INTRA_CHECK_URI), - AUTH_CONTROL_INTER_SERVICE(CORE_SERVICE_AUTH_CONTROL_INTER, AUTHORIZATION_URI + OP_AUTH_INTER_CHECK_URI), - AUTH_TOKEN_GENERATION_SERVICE(CORE_SERVICE_AUTH_TOKEN_GENERATION, AUTHORIZATION_URI + OP_AUTH_TOKEN_URI), - AUTH_PUBLIC_KEY_SERVICE(CORE_SERVICE_AUTH_PUBLIC_KEY, AUTHORIZATION_URI + OP_AUTH_KEY_URI), - AUTH_CONTROL_SUBSCRIPTION_SERVICE(CORE_SERVICE_AUTH_CONTROL_SUBSCRIPTION, AUTHORIZATION_URI + OP_AUTH_SUBSCRIPTION_CHECK_URI), - - // Orchestrator services - ORCHESTRATION_SERVICE(CORE_SERVICE_ORCH_PROCESS, ORCHESTRATOR_URI + OP_ORCH_PROCESS), - - // Gatekeeper services - GATEKEEPER_GLOBAL_SERVICE_DISCOVERY(CORE_SERVICE_GATEKEEPER_GSD, GATEKEEPER_URI + OP_GATEKEEPER_GSD_SERVICE), - GATEKEEPER_INTER_CLOUD_NEGOTIATION(CORE_SERVICE_GATEKEEPER_ICN, GATEKEEPER_URI + OP_GATEKEEPER_ICN_SERVICE), - - // Gateway services - GATEWAY_PUBLIC_KEY_SERVICE(CORE_SERVICE_GATEWAY_PUBLIC_KEY, GATEWAY_URI + OP_GATEWAY_KEY_URI), - GATEWAY_PROVIDER_SERVICE(CORE_SERVICE_GATEWAY_CONNECT_PROVIDER, GATEWAY_URI + OP_GATEWAY_CONNECT_PROVIDER_URI), - GATEWAY_CONSUMER_SERVICE(CORE_SERVICE_GATEWAY_CONNECT_CONSUMER, GATEWAY_URI + OP_GATEWAY_CONNECT_CONSUMER_URI), - - // Eventhandler services - EVENT_PUBLISH_SERVICE(CORE_SERVICE_EVENT_HANDLER_PUBLISH, EVENT_HANDLER_URI + OP_EVENT_HANDLER_PUBLISH), - EVENT_SUBSCRIBE_SERVICE(CORE_SERVICE_EVENT_HANDLER_SUBSCRIBE, EVENT_HANDLER_URI + OP_EVENT_HANDLER_SUBSCRIBE), - EVENT_UNSUBSCRIBE_SERVICE(CORE_SERVICE_EVENT_HANDLER_UNSUBSCRIBE, EVENT_HANDLER_URI + OP_EVENT_HANDLER_UNSUBSCRIBE), - EVENT_PUBLISH_AUTH_UPDATE_SERVICE(CORE_SERVICE_EVENT_HANDLER_PUBLISH_AUTH_UPDATE, EVENT_HANDLER_URI + OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE), - - // Onboarding services - ONBOARDING_SERVICE_WITH_NAME(CORE_SERVICE_ONBOARDING_NAME, ONBOARDING_URI + OP_ONBOARDING_NAME), - ONBOARDING_SERVICE_WITH_CSR(CORE_SERVICE_ONBOARDING_CSR, ONBOARDING_URI + OP_ONBOARDING_CSR), - - // Device Registry services - DEVICE_REGISTRY_REGISTER_SERVICE(CORE_SERVICE_DEVICE_REGISTRY_REGISTER, DEVICE_REGISTRY_URI + OP_DEVICE_REGISTRY_REGISTER_URI), - DEVICE_REGISTRY_UNREGISTER_SERVICE(CORE_SERVICE_DEVICE_REGISTRY_UNREGISTER, DEVICE_REGISTRY_URI + OP_DEVICE_REGISTRY_UNREGISTER_URI), - - // System Registry services - SYSTEM_REGISTRY_REGISTER_SERVICE(CORE_SERVICE_SYSTEM_REGISTRY_REGISTER, SYSTEM_REGISTRY_URI + OP_SYSTEM_REGISTRY_REGISTER_URI), - SYSTEM_REGISTRY_UNREGISTER_SERVICE(CORE_SERVICE_SYSTEM_REGISTRY_UNREGISTER, SYSTEM_REGISTRY_URI + OP_SYSTEM_REGISTRY_UNREGISTER_URI), - - // Service Registry services - SERVICE_REGISTRY_REGISTER_SERVICE(CORE_SERVICE_SERVICE_REGISTRY_REGISTER, SERVICE_REGISTRY_URI + OP_SERVICE_REGISTRY_REGISTER_URI), - SERVICE_REGISTRY_UNREGISTER_SERVICE(CORE_SERVICE_SERVICE_REGISTRY_UNREGISTER, SERVICE_REGISTRY_URI + OP_SERVICE_REGISTRY_UNREGISTER_URI); - - //TODO: additional services - - //================================================================================================= - // members - - private final String serviceDefinition; - private final String serviceUri; - - //================================================================================================= - // methods - - //------------------------------------------------------------------------------------------------- - public String getServiceDefinition() { return serviceDefinition; } - public String getServiceUri() { return serviceUri; } - - - //================================================================================================= - // assistant methods - - //------------------------------------------------------------------------------------------------- - private CoreSystemService(final String serviceDefinition, final String serviceUri) { - Assert.isTrue(!Utilities.isEmpty(serviceDefinition), serviceUri); - - this.serviceDefinition = serviceDefinition; - this.serviceUri = serviceUri; - } + //================================================================================================= + // elements + + // Authorization services + AUTH_CONTROL_INTRA_SERVICE(CORE_SERVICE_AUTH_CONTROL_INTRA, AUTHORIZATION_URI + OP_AUTH_INTRA_CHECK_URI), + AUTH_CONTROL_INTER_SERVICE(CORE_SERVICE_AUTH_CONTROL_INTER, AUTHORIZATION_URI + OP_AUTH_INTER_CHECK_URI), + AUTH_TOKEN_GENERATION_SERVICE(CORE_SERVICE_AUTH_TOKEN_GENERATION, AUTHORIZATION_URI + OP_AUTH_TOKEN_URI), + AUTH_PUBLIC_KEY_SERVICE(CORE_SERVICE_AUTH_PUBLIC_KEY, AUTHORIZATION_URI + OP_AUTH_KEY_URI), + AUTH_CONTROL_SUBSCRIPTION_SERVICE(CORE_SERVICE_AUTH_CONTROL_SUBSCRIPTION, AUTHORIZATION_URI + OP_AUTH_SUBSCRIPTION_CHECK_URI), + + // Orchestrator services + ORCHESTRATION_SERVICE(CORE_SERVICE_ORCH_PROCESS, + ORCHESTRATOR_URI + OP_ORCH_PROCESS), + + // Gatekeeper services + GATEKEEPER_GLOBAL_SERVICE_DISCOVERY(CORE_SERVICE_GATEKEEPER_GSD, GATEKEEPER_URI + OP_GATEKEEPER_GSD_SERVICE), + GATEKEEPER_INTER_CLOUD_NEGOTIATION(CORE_SERVICE_GATEKEEPER_ICN, GATEKEEPER_URI + OP_GATEKEEPER_ICN_SERVICE), + + // Gateway services + GATEWAY_PUBLIC_KEY_SERVICE(CORE_SERVICE_GATEWAY_PUBLIC_KEY, GATEWAY_URI + OP_GATEWAY_KEY_URI), + GATEWAY_PROVIDER_SERVICE(CORE_SERVICE_GATEWAY_CONNECT_PROVIDER, GATEWAY_URI + OP_GATEWAY_CONNECT_PROVIDER_URI), + GATEWAY_CONSUMER_SERVICE(CORE_SERVICE_GATEWAY_CONNECT_CONSUMER, GATEWAY_URI + OP_GATEWAY_CONNECT_CONSUMER_URI), + + // Eventhandler services + EVENT_PUBLISH_SERVICE(CORE_SERVICE_EVENT_HANDLER_PUBLISH, EVENT_HANDLER_URI + OP_EVENT_HANDLER_PUBLISH), + EVENT_SUBSCRIBE_SERVICE(CORE_SERVICE_EVENT_HANDLER_SUBSCRIBE, EVENT_HANDLER_URI + OP_EVENT_HANDLER_SUBSCRIBE), + EVENT_UNSUBSCRIBE_SERVICE(CORE_SERVICE_EVENT_HANDLER_UNSUBSCRIBE, EVENT_HANDLER_URI + OP_EVENT_HANDLER_UNSUBSCRIBE), + EVENT_PUBLISH_AUTH_UPDATE_SERVICE(CORE_SERVICE_EVENT_HANDLER_PUBLISH_AUTH_UPDATE, EVENT_HANDLER_URI + OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE), + + // Onboarding services + ONBOARDING_SERVICE_WITH_NAME(CORE_SERVICE_ONBOARDING_NAME, ONBOARDING_URI + OP_ONBOARDING_NAME), + ONBOARDING_SERVICE_WITH_CSR(CORE_SERVICE_ONBOARDING_CSR, ONBOARDING_URI + OP_ONBOARDING_CSR), + + // Device Registry services + DEVICE_REGISTRY_REGISTER_SERVICE(CORE_SERVICE_DEVICE_REGISTRY_REGISTER, DEVICE_REGISTRY_URI + OP_DEVICE_REGISTRY_REGISTER_URI), + DEVICE_REGISTRY_UNREGISTER_SERVICE(CORE_SERVICE_DEVICE_REGISTRY_UNREGISTER, DEVICE_REGISTRY_URI + OP_DEVICE_REGISTRY_UNREGISTER_URI), + + // System Registry services + SYSTEM_REGISTRY_REGISTER_SERVICE(CORE_SERVICE_SYSTEM_REGISTRY_REGISTER, SYSTEM_REGISTRY_URI + OP_SYSTEM_REGISTRY_REGISTER_URI), + SYSTEM_REGISTRY_UNREGISTER_SERVICE(CORE_SERVICE_SYSTEM_REGISTRY_UNREGISTER, SYSTEM_REGISTRY_URI + OP_SYSTEM_REGISTRY_UNREGISTER_URI), + + // Service Registry services + SERVICE_REGISTRY_REGISTER_SERVICE(CORE_SERVICE_SERVICE_REGISTRY_REGISTER, SERVICE_REGISTRY_URI + OP_SERVICE_REGISTRY_REGISTER_URI), + SERVICE_REGISTRY_UNREGISTER_SERVICE(CORE_SERVICE_SERVICE_REGISTRY_UNREGISTER, SERVICE_REGISTRY_URI + OP_SERVICE_REGISTRY_UNREGISTER_URI); + + //TODO: additional services + + //================================================================================================= + // members + + private final String serviceDefinition; + private final String serviceUri; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public String getServiceDefinition() { + return serviceDefinition; + } + + public String getServiceUri() { + return serviceUri; + } + + + //================================================================================================= + // constructors + + //------------------------------------------------------------------------------------------------- + private CoreSystemService(final String serviceDefinition, final String serviceUri) { + Assert.isTrue(!Utilities.isEmpty(serviceDefinition), serviceUri); + + this.serviceDefinition = serviceDefinition; + this.serviceUri = serviceUri; + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java index 46628fad5..3e2b588d8 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java @@ -4,8 +4,19 @@ import org.hibernate.annotations.OnDelete; import org.hibernate.annotations.OnDeleteAction; -import javax.persistence.*; -import javax.validation.constraints.Size; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedAttributeNode; +import javax.persistence.NamedEntityGraph; +import javax.persistence.OneToMany; +import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; +import javax.persistence.Table; +import javax.persistence.UniqueConstraint; import java.time.ZonedDateTime; import java.util.HashSet; import java.util.List; diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/DeviceRegistry.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/DeviceRegistry.java index c0ba43d5e..bc11e3ef8 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/DeviceRegistry.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/DeviceRegistry.java @@ -1,117 +1,168 @@ package eu.arrowhead.common.database.entity; -import javax.persistence.*; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; +import javax.persistence.Table; +import javax.persistence.UniqueConstraint; import java.time.ZonedDateTime; import java.util.List; import java.util.Objects; @Entity @Table(uniqueConstraints = @UniqueConstraint(columnNames = {"deviceId"})) -public class DeviceRegistry -{ +public class DeviceRegistry { - //================================================================================================= - // members - public static final List SORTABLE_FIELDS_BY = List.of("id", "updatedAt", "createdAt"); //NOSONAR + //================================================================================================= + // members + public static final List SORTABLE_FIELDS_BY = List.of("id", "updatedAt", "createdAt"); //NOSONAR - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private long id; - @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = "deviceId", referencedColumnName = "id", nullable = false) - private Device device; + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "deviceId", referencedColumnName = "id", nullable = false) + private Device device; - @Column(nullable = true) - private ZonedDateTime endOfValidity; + @Column(nullable = true) + private ZonedDateTime endOfValidity; - @Column(nullable = true, columnDefinition = "TEXT") - private String metadata; + @Column(nullable = true, columnDefinition = "TEXT") + private String metadata; - @Column(nullable = true) - private Integer version = 1; + @Column(nullable = true) + private Integer version = 1; - @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") - private ZonedDateTime createdAt; + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") + private ZonedDateTime createdAt; - @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") - private ZonedDateTime updatedAt; + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") + private ZonedDateTime updatedAt; - //================================================================================================= - // methods + //================================================================================================= + // methods - //------------------------------------------------------------------------------------------------- - public DeviceRegistry() {} + //------------------------------------------------------------------------------------------------- + public DeviceRegistry() { + } - //------------------------------------------------------------------------------------------------- - public DeviceRegistry(final Device device, final ZonedDateTime endOfValidity, + //------------------------------------------------------------------------------------------------- + public DeviceRegistry(final Device device, final ZonedDateTime endOfValidity, final String metadata, final Integer version) { - this.device = device; - this.endOfValidity = endOfValidity; - this.metadata = metadata; - this.version = version; - } - - //------------------------------------------------------------------------------------------------- - @PrePersist - public void onCreate() { - this.createdAt = ZonedDateTime.now(); - this.updatedAt = this.createdAt; - } - - //------------------------------------------------------------------------------------------------- - @PreUpdate - public void onUpdate() { - this.updatedAt = ZonedDateTime.now(); - } - - //------------------------------------------------------------------------------------------------- - public long getId() { return id; } - public Device getDevice() { return device; } - public ZonedDateTime getEndOfValidity() { return endOfValidity; } - public String getMetadata() { return metadata; } - public Integer getVersion() { return version; } - public ZonedDateTime getCreatedAt() { return createdAt; } - public ZonedDateTime getUpdatedAt() { return updatedAt; } - - //------------------------------------------------------------------------------------------------- - public void setId(final long id) { this.id = id; } - public void setDevice(final Device device) { this.device = device; } - public void setEndOfValidity(final ZonedDateTime endOfValidity) { this.endOfValidity = endOfValidity; } - public void setMetadata(final String metadata) { this.metadata = metadata; } - public void setVersion(final Integer version) { this.version = version; } - public void setCreatedAt(final ZonedDateTime createdAt) { this.createdAt = createdAt; } - public void setUpdatedAt(final ZonedDateTime updatedAt) { this.updatedAt = updatedAt; } - - //------------------------------------------------------------------------------------------------- - @Override - public String toString() { - return "ServiceRegistry [id = " + id + ", device = " + device + ", endOfValidity = " + endOfValidity + ", version = " + version + "]"; - } - - //------------------------------------------------------------------------------------------------- - @Override - public int hashCode() { - return Objects.hash(id); - } - - //------------------------------------------------------------------------------------------------- - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - - if (obj == null) { - return false; - } - - if (getClass() != obj.getClass()) { - return false; - } - - final DeviceRegistry other = (DeviceRegistry) obj; - - return id == other.id; - } + this.device = device; + this.endOfValidity = endOfValidity; + this.metadata = metadata; + this.version = version; + } + + //------------------------------------------------------------------------------------------------- + @PrePersist + public void onCreate() { + this.createdAt = ZonedDateTime.now(); + this.updatedAt = this.createdAt; + } + + //------------------------------------------------------------------------------------------------- + @PreUpdate + public void onUpdate() { + this.updatedAt = ZonedDateTime.now(); + } + + //------------------------------------------------------------------------------------------------- + public long getId() { + return id; + } + + public Device getDevice() { + return device; + } + + public ZonedDateTime getEndOfValidity() { + return endOfValidity; + } + + public String getMetadata() { + return metadata; + } + + public Integer getVersion() { + return version; + } + + public ZonedDateTime getCreatedAt() { + return createdAt; + } + + public ZonedDateTime getUpdatedAt() { + return updatedAt; + } + + //------------------------------------------------------------------------------------------------- + public void setId(final long id) { + this.id = id; + } + + public void setDevice(final Device device) { + this.device = device; + } + + public void setEndOfValidity(final ZonedDateTime endOfValidity) { + this.endOfValidity = endOfValidity; + } + + public void setMetadata(final String metadata) { + this.metadata = metadata; + } + + public void setVersion(final Integer version) { + this.version = version; + } + + public void setCreatedAt(final ZonedDateTime createdAt) { + this.createdAt = createdAt; + } + + public void setUpdatedAt(final ZonedDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + //------------------------------------------------------------------------------------------------- + @Override + public String toString() { + return "ServiceRegistry [id = " + id + ", device = " + device + ", endOfValidity = " + endOfValidity + ", version = " + version + "]"; + } + + //------------------------------------------------------------------------------------------------- + @Override + public int hashCode() { + return Objects.hash(id); + } + + //------------------------------------------------------------------------------------------------- + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + + if (obj == null) { + return false; + } + + if (getClass() != obj.getClass()) { + return false; + } + + final DeviceRegistry other = (DeviceRegistry) obj; + + return id == other.id; + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/System.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/System.java index 9609f2743..1e61799b1 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/System.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/System.java @@ -25,7 +25,7 @@ import eu.arrowhead.common.CoreDefaults; @Entity -@Table(name = "system", uniqueConstraints = @UniqueConstraint(columnNames = { "systemName", "address", "port" })) +@Table(name = "system_", uniqueConstraints = @UniqueConstraint(columnNames = { "systemName", "address", "port" })) @NamedEntityGraph(name = "systemWithServiceRegistryEntries", attributeNodes = { @NamedAttributeNode(value = "serviceRegistryEntries") @@ -59,7 +59,7 @@ public class System { @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") private ZonedDateTime updatedAt; - @OneToMany(mappedBy = "system", fetch = FetchType.LAZY, orphanRemoval = true) + @OneToMany(mappedBy = "system_", fetch = FetchType.LAZY, orphanRemoval = true) @OnDelete(action = OnDeleteAction.CASCADE) private Set serviceRegistryEntries = new HashSet<>(); diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/SystemRegistry.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/SystemRegistry.java index dd70c5270..43bda3ce6 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/SystemRegistry.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/SystemRegistry.java @@ -1,131 +1,181 @@ package eu.arrowhead.common.database.entity; -import eu.arrowhead.common.CoreDefaults; -import eu.arrowhead.common.dto.shared.ServiceSecurityType; -import org.hibernate.annotations.OnDelete; -import org.hibernate.annotations.OnDeleteAction; - -import javax.persistence.*; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; +import javax.persistence.Table; +import javax.persistence.UniqueConstraint; import java.time.ZonedDateTime; -import java.util.HashSet; import java.util.List; import java.util.Objects; -import java.util.Set; @Entity @Table(uniqueConstraints = @UniqueConstraint(columnNames = {"systemId", "deviceId"})) -public class SystemRegistry -{ +public class SystemRegistry { - //================================================================================================= - // members - public static final List SORTABLE_FIELDS_BY = List.of("id", "updatedAt", "createdAt"); //NOSONAR + //================================================================================================= + // members + public static final List SORTABLE_FIELDS_BY = List.of("id", "updatedAt", "createdAt"); //NOSONAR - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private long id; - @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = "systemId", referencedColumnName = "id", nullable = false) - private System system; + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "systemId", referencedColumnName = "id", nullable = false) + private System system; - @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = "deviceId", referencedColumnName = "id", nullable = false) - private Device device; + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "deviceId", referencedColumnName = "id", nullable = false) + private Device device; - @Column(nullable = true) - private ZonedDateTime endOfValidity; + @Column(nullable = true) + private ZonedDateTime endOfValidity; - @Column(nullable = true, columnDefinition = "TEXT") - private String metadata; + @Column(nullable = true, columnDefinition = "TEXT") + private String metadata; - @Column(nullable = true) - private Integer version = 1; + @Column(nullable = true) + private Integer version = 1; - @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") - private ZonedDateTime createdAt; + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") + private ZonedDateTime createdAt; - @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") - private ZonedDateTime updatedAt; + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") + private ZonedDateTime updatedAt; - //================================================================================================= - // methods + //================================================================================================= + // methods - //------------------------------------------------------------------------------------------------- - public SystemRegistry() {} + //------------------------------------------------------------------------------------------------- + public SystemRegistry() { + } - //------------------------------------------------------------------------------------------------- - public SystemRegistry(final System system, final Device device, final ZonedDateTime endOfValidity, + //------------------------------------------------------------------------------------------------- + public SystemRegistry(final System system, final Device device, final ZonedDateTime endOfValidity, final String metadata, final Integer version) { - this.system = system; - this.device = device; - this.endOfValidity = endOfValidity; - this.metadata = metadata; - this.version = version; - } - - //------------------------------------------------------------------------------------------------- - @PrePersist - public void onCreate() { - this.createdAt = ZonedDateTime.now(); - this.updatedAt = this.createdAt; - } - - //------------------------------------------------------------------------------------------------- - @PreUpdate - public void onUpdate() { - this.updatedAt = ZonedDateTime.now(); - } - - //------------------------------------------------------------------------------------------------- - public long getId() { return id; } - public System getSystem() { return system; } - public Device getDevice() { return device; } - public ZonedDateTime getEndOfValidity() { return endOfValidity; } - public String getMetadata() { return metadata; } - public Integer getVersion() { return version; } - public ZonedDateTime getCreatedAt() { return createdAt; } - public ZonedDateTime getUpdatedAt() { return updatedAt; } - - //------------------------------------------------------------------------------------------------- - public void setId(final long id) { this.id = id; } - public void setSystem(final System system) { this.system = system; } - public void setDevice(final Device device) { this.device = device; } - public void setEndOfValidity(final ZonedDateTime endOfValidity) { this.endOfValidity = endOfValidity; } - public void setMetadata(final String metadata) { this.metadata = metadata; } - public void setVersion(final Integer version) { this.version = version; } - public void setCreatedAt(final ZonedDateTime createdAt) { this.createdAt = createdAt; } - public void setUpdatedAt(final ZonedDateTime updatedAt) { this.updatedAt = updatedAt; } - - //------------------------------------------------------------------------------------------------- - @Override - public String toString() { - return "ServiceRegistry [id = " + id + ", system = " + system + ", device = " + device + ", endOfValidity = " + endOfValidity + ", version = " + version + "]"; - } - - //------------------------------------------------------------------------------------------------- - @Override - public int hashCode() { - return Objects.hash(id); - } - - //------------------------------------------------------------------------------------------------- - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - - if (obj == null) { - return false; - } - - if (getClass() != obj.getClass()) { - return false; - } - - final SystemRegistry other = (SystemRegistry) obj; - - return id == other.id; - } + this.system = system; + this.device = device; + this.endOfValidity = endOfValidity; + this.metadata = metadata; + this.version = version; + } + + //------------------------------------------------------------------------------------------------- + @PrePersist + public void onCreate() { + this.createdAt = ZonedDateTime.now(); + this.updatedAt = this.createdAt; + } + + //------------------------------------------------------------------------------------------------- + @PreUpdate + public void onUpdate() { + this.updatedAt = ZonedDateTime.now(); + } + + //------------------------------------------------------------------------------------------------- + public long getId() { + return id; + } + + public System getSystem() { + return system; + } + + public Device getDevice() { + return device; + } + + public ZonedDateTime getEndOfValidity() { + return endOfValidity; + } + + public String getMetadata() { + return metadata; + } + + public Integer getVersion() { + return version; + } + + public ZonedDateTime getCreatedAt() { + return createdAt; + } + + public ZonedDateTime getUpdatedAt() { + return updatedAt; + } + + //------------------------------------------------------------------------------------------------- + public void setId(final long id) { + this.id = id; + } + + public void setSystem(final System system) { + this.system = system; + } + + public void setDevice(final Device device) { + this.device = device; + } + + public void setEndOfValidity(final ZonedDateTime endOfValidity) { + this.endOfValidity = endOfValidity; + } + + public void setMetadata(final String metadata) { + this.metadata = metadata; + } + + public void setVersion(final Integer version) { + this.version = version; + } + + public void setCreatedAt(final ZonedDateTime createdAt) { + this.createdAt = createdAt; + } + + public void setUpdatedAt(final ZonedDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + //------------------------------------------------------------------------------------------------- + @Override + public String toString() { + return "ServiceRegistry [id = " + id + ", system = " + system + ", device = " + device + ", endOfValidity = " + endOfValidity + ", version = " + version + "]"; + } + + //------------------------------------------------------------------------------------------------- + @Override + public int hashCode() { + return Objects.hash(id); + } + + //------------------------------------------------------------------------------------------------- + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + + if (obj == null) { + return false; + } + + if (getClass() != obj.getClass()) { + return false; + } + + final SystemRegistry other = (SystemRegistry) obj; + + return id == other.id; + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRegistryRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRegistryRepository.java index 7e25a7074..95480eec6 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRegistryRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/DeviceRegistryRepository.java @@ -18,6 +18,6 @@ public interface DeviceRegistryRepository extends RefreshableRepository findByDevice(final Device device); - Page findAllByDevice(final List devices, final PageRequest pageRequest); - List findAllByDevice(final List devices); + Page findAllByDeviceIsIn(final List devices, final PageRequest pageRequest); + List findAllByDeviceIsIn(final List devices); } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java index 27e4e1770..88b5425b9 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java @@ -24,7 +24,7 @@ public interface SystemRegistryRepository extends RefreshableRepository findBySystemAndDevice(final System systemDb, final Device deviceDb); - List findAllBySystem(final List systems); + List findAllBySystemIsIn(final List systems); - Page findAllBySystem(final List systemList, final PageRequest pageRequest); + Page findAllBySystemIsIn(final List systemList, final PageRequest pageRequest); } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java index 99b868518..3dafa6acb 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java @@ -1,5 +1,59 @@ package eu.arrowhead.common.dto.internal; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.database.entity.AuthorizationInterCloud; +import eu.arrowhead.common.database.entity.AuthorizationInterCloudInterfaceConnection; +import eu.arrowhead.common.database.entity.AuthorizationIntraCloud; +import eu.arrowhead.common.database.entity.AuthorizationIntraCloudInterfaceConnection; +import eu.arrowhead.common.database.entity.ChoreographerAction; +import eu.arrowhead.common.database.entity.ChoreographerActionActionStepConnection; +import eu.arrowhead.common.database.entity.ChoreographerActionPlan; +import eu.arrowhead.common.database.entity.ChoreographerActionPlanActionConnection; +import eu.arrowhead.common.database.entity.ChoreographerActionStep; +import eu.arrowhead.common.database.entity.ChoreographerActionStepServiceDefinitionConnection; +import eu.arrowhead.common.database.entity.ChoreographerNextActionStep; +import eu.arrowhead.common.database.entity.Cloud; +import eu.arrowhead.common.database.entity.CloudGatekeeperRelay; +import eu.arrowhead.common.database.entity.CloudGatewayRelay; +import eu.arrowhead.common.database.entity.Device; +import eu.arrowhead.common.database.entity.DeviceRegistry; +import eu.arrowhead.common.database.entity.EventType; +import eu.arrowhead.common.database.entity.ForeignSystem; +import eu.arrowhead.common.database.entity.OrchestratorStore; +import eu.arrowhead.common.database.entity.Relay; +import eu.arrowhead.common.database.entity.ServiceDefinition; +import eu.arrowhead.common.database.entity.ServiceInterface; +import eu.arrowhead.common.database.entity.ServiceRegistry; +import eu.arrowhead.common.database.entity.ServiceRegistryInterfaceConnection; +import eu.arrowhead.common.database.entity.Subscription; +import eu.arrowhead.common.database.entity.SubscriptionPublisherConnection; +import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.database.entity.SystemRegistry; +import eu.arrowhead.common.dto.shared.ChoreographerActionPlanResponseDTO; +import eu.arrowhead.common.dto.shared.ChoreographerActionResponseDTO; +import eu.arrowhead.common.dto.shared.ChoreographerActionStepResponseDTO; +import eu.arrowhead.common.dto.shared.ChoreographerNextActionStepResponseDTO; +import eu.arrowhead.common.dto.shared.CloudRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceQueryResultDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.DeviceResponseDTO; +import eu.arrowhead.common.dto.shared.EventDTO; +import eu.arrowhead.common.dto.shared.EventPublishRequestDTO; +import eu.arrowhead.common.dto.shared.EventTypeResponseDTO; +import eu.arrowhead.common.dto.shared.PreferredProviderDataDTO; +import eu.arrowhead.common.dto.shared.ServiceDefinitionResponseDTO; +import eu.arrowhead.common.dto.shared.ServiceInterfaceResponseDTO; +import eu.arrowhead.common.dto.shared.ServiceQueryResultDTO; +import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.SubscriptionListResponseDTO; +import eu.arrowhead.common.dto.shared.SubscriptionResponseDTO; +import eu.arrowhead.common.dto.shared.SystemQueryResultDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import org.springframework.data.domain.Page; +import org.springframework.util.Assert; + import java.util.ArrayList; import java.util.Comparator; import java.util.HashMap; @@ -9,16 +63,6 @@ import java.util.Map.Entry; import java.util.Set; -import eu.arrowhead.common.database.entity.*; -import eu.arrowhead.common.database.entity.System; -import eu.arrowhead.common.dto.shared.*; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Pageable; -import org.springframework.util.Assert; - -import eu.arrowhead.common.Utilities; - public class DTOConverter { //================================================================================================= diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java index 5541edce7..deb1d7713 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java @@ -288,7 +288,7 @@ public DeviceRegistryListResponseDTO getDeviceRegistryEntriesByDeviceName(final params.getValidatedSize(), params.getValidatedDirection(), validatedSortField); - final Page deviceRegistryPage = deviceRegistryRepository.findAllByDevice(devices, pageRequest); + final Page deviceRegistryPage = deviceRegistryRepository.findAllByDeviceIsIn(devices, pageRequest); return DTOConverter.convertDeviceRegistryListToDeviceRegistryListResponseDTO(deviceRegistryPage); } catch (final Exception ex) @@ -537,7 +537,7 @@ public DeviceQueryResultDTO queryRegistry(final DeviceQueryFormDTO form) } } - registryList = deviceRegistryRepository.findAllByDevice(devices); + registryList = deviceRegistryRepository.findAllByDeviceIsIn(devices); unfilteredHits = registryList.size(); if (Utilities.notEmpty(form.getAddressRequirement())) diff --git a/deviceregistry/src/main/resources/application.properties b/deviceregistry/src/main/resources/application.properties index 861ce759b..72f120e1c 100644 --- a/deviceregistry/src/main/resources/application.properties +++ b/deviceregistry/src/main/resources/application.properties @@ -6,7 +6,7 @@ # Change the server timezone if necessary spring.datasource.url=jdbc:mysql://127.0.0.1:3306/arrowhead?serverTimezone=Europe/Budapest spring.datasource.username=device_registry -spring.datasource.password=ZzNNpxrbZGVvfJ8 +spring.datasource.password=iooHU87hNGUalht spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect diff --git a/onboarding/src/deb/arrowhead-deviceregistry.service b/onboarding/src/deb/arrowhead-onboarding.service similarity index 100% rename from onboarding/src/deb/arrowhead-deviceregistry.service rename to onboarding/src/deb/arrowhead-onboarding.service diff --git a/scripts/authorization_privileges.sql b/scripts/authorization_privileges.sql index 2b6c37156..0484c30a3 100644 --- a/scripts/authorization_privileges.sql +++ b/scripts/authorization_privileges.sql @@ -6,7 +6,7 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'authorizatio GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'authorization'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'authorization'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'authorization'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'authorization'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'authorization'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'authorization'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'authorization'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'authorization'@'localhost'; @@ -21,7 +21,7 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'authorizatio GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'authorization'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'authorization'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'authorization'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'authorization'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'authorization'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'authorization'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'authorization'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'authorization'@'%'; diff --git a/scripts/create_arrowhead_tables.sql b/scripts/create_arrowhead_tables.sql index 4345735bf..be3ed88b9 100644 --- a/scripts/create_arrowhead_tables.sql +++ b/scripts/create_arrowhead_tables.sql @@ -54,7 +54,7 @@ CREATE TABLE IF NOT EXISTS `cloud_gateway_relay` ( CONSTRAINT `gw_relay_constr` FOREIGN KEY (`relay_id`) REFERENCES `relay` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `system` ( +CREATE TABLE IF NOT EXISTS `system_` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `system_name` varchar(255) NOT NULL, `address` varchar(255) NOT NULL, @@ -128,7 +128,7 @@ CREATE TABLE IF NOT EXISTS `system_registry` ( PRIMARY KEY (`id`), UNIQUE KEY `system_registry_pair` (`system_id`,`device_id`), KEY `system_registry_device` (`device_id`), - CONSTRAINT `system_registry_system` FOREIGN KEY (`system_id`) REFERENCES `system` (`id`) ON DELETE CASCADE, + CONSTRAINT `system_registry_system` FOREIGN KEY (`system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE, CONSTRAINT `system_registry_device` FOREIGN KEY (`device_id`) REFERENCES `device` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -149,7 +149,7 @@ CREATE TABLE IF NOT EXISTS `service_registry` ( UNIQUE KEY `service_registry_pair` (`service_id`,`system_id`), KEY `service_registry_system` (`system_id`), CONSTRAINT `service_registry_service` FOREIGN KEY (`service_id`) REFERENCES `service_definition` (`id`) ON DELETE CASCADE, - CONSTRAINT `service_registry_system` FOREIGN KEY (`system_id`) REFERENCES `system` (`id`) ON DELETE CASCADE + CONSTRAINT `service_registry_system` FOREIGN KEY (`system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `service_registry_interface_connection` ( @@ -179,8 +179,8 @@ CREATE TABLE IF NOT EXISTS `authorization_intra_cloud` ( KEY `provider` (`provider_system_id`), KEY `service_intra_auth` (`service_id`), CONSTRAINT `service_intra_auth` FOREIGN KEY (`service_id`) REFERENCES `service_definition` (`id`) ON DELETE CASCADE, - CONSTRAINT `provider` FOREIGN KEY (`provider_system_id`) REFERENCES `system` (`id`) ON DELETE CASCADE, - CONSTRAINT `consumer` FOREIGN KEY (`consumer_system_id`) REFERENCES `system` (`id`) ON DELETE CASCADE + CONSTRAINT `provider` FOREIGN KEY (`provider_system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE, + CONSTRAINT `consumer` FOREIGN KEY (`consumer_system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `authorization_inter_cloud` ( @@ -195,7 +195,7 @@ CREATE TABLE IF NOT EXISTS `authorization_inter_cloud` ( KEY `service_inter_auth` (`service_id`), CONSTRAINT `cloud` FOREIGN KEY (`consumer_cloud_id`) REFERENCES `cloud` (`id`) ON DELETE CASCADE, CONSTRAINT `service_inter_auth` FOREIGN KEY (`service_id`) REFERENCES `service_definition` (`id`) ON DELETE CASCADE, - CONSTRAINT `provider_inter_auth` FOREIGN KEY (`provider_system_id`) REFERENCES `system` (id) ON DELETE CASCADE + CONSTRAINT `provider_inter_auth` FOREIGN KEY (`provider_system_id`) REFERENCES `system_` (id) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `authorization_inter_cloud_interface_connection` ( @@ -240,7 +240,7 @@ CREATE TABLE IF NOT EXISTS `orchestrator_store` ( PRIMARY KEY (`id`), UNIQUE KEY `priority_rule` (`service_id`, `service_interface_id`, `consumer_system_id`,`priority`), UNIQUE KEY `duplication_rule` (`service_id`, `service_interface_id`, `consumer_system_id`,`provider_system_id`, `foreign_`), - CONSTRAINT `consumer_orch` FOREIGN KEY (`consumer_system_id`) REFERENCES `system` (`id`) ON DELETE CASCADE, + CONSTRAINT `consumer_orch` FOREIGN KEY (`consumer_system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE, CONSTRAINT `service_orch` FOREIGN KEY (`service_id`) REFERENCES `service_definition` (`id`) ON DELETE CASCADE, CONSTRAINT `service_intf_orch` FOREIGN KEY (`service_interface_id`) REFERENCES `service_interface` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -296,7 +296,7 @@ CREATE TABLE IF NOT EXISTS `subscription` ( `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `pair` (`event_type_id`,`system_id`), - CONSTRAINT `subscriber_system` FOREIGN KEY (`system_id`) REFERENCES `system` (`id`) ON DELETE CASCADE, + CONSTRAINT `subscriber_system` FOREIGN KEY (`system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE, CONSTRAINT `event_type` FOREIGN KEY (`event_type_id`) REFERENCES `event_type` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -310,7 +310,7 @@ CREATE TABLE IF NOT EXISTS `subscription_publisher_connection` ( PRIMARY KEY (`id`), UNIQUE KEY `pair` (`subscription_id`,`system_id`), CONSTRAINT `subscription_constraint` FOREIGN KEY (`subscription_id`) REFERENCES `subscription` (`id`) ON DELETE CASCADE, - CONSTRAINT `system_constraint` FOREIGN KEY (`system_id`) REFERENCES `system` (`id`) ON DELETE CASCADE + CONSTRAINT `system_constraint` FOREIGN KEY (`system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Choreographer diff --git a/scripts/create_empty_arrowhead_db.sql b/scripts/create_empty_arrowhead_db.sql index 27a130088..c1696f460 100644 --- a/scripts/create_empty_arrowhead_db.sql +++ b/scripts/create_empty_arrowhead_db.sql @@ -12,6 +12,16 @@ CREATE USER IF NOT EXISTS 'service_registry'@'localhost' IDENTIFIED BY 'ZzNNpxrb CREATE USER IF NOT EXISTS 'service_registry'@'%' IDENTIFIED BY 'ZzNNpxrbZGVvfJ8'; source service_registry_privileges.sql +-- System Registry +CREATE USER IF NOT EXISTS 'system_registry'@'localhost' IDENTIFIED BY 'Kh12Hhgaxzo7haf'; +CREATE USER IF NOT EXISTS 'system_registry'@'%' IDENTIFIED BY 'Kh12Hhgaxzo7haf'; +source system_registry_privileges.sql + +-- Deviec Registry +CREATE USER IF NOT EXISTS 'device_registry'@'localhost' IDENTIFIED BY 'iooHU87hNGUalht'; +CREATE USER IF NOT EXISTS 'device_registry'@'%' IDENTIFIED BY 'iooHU87hNGUalht'; +source device_registry_privileges.sql + -- Authorization CREATE USER IF NOT EXISTS 'authorization'@'localhost' IDENTIFIED BY 'hqZFUkuHxhekio3'; CREATE USER IF NOT EXISTS 'authorization'@'%' IDENTIFIED BY 'hqZFUkuHxhekio3'; diff --git a/scripts/device_registry_privileges.sql b/scripts/device_registry_privileges.sql new file mode 100644 index 000000000..7a027cba8 --- /dev/null +++ b/scripts/device_registry_privileges.sql @@ -0,0 +1,23 @@ +USE `arrowhead`; + +REVOKE ALL, GRANT OPTION FROM 'device_registry'@'localhost'; + +GRANT ALL PRIVILEGES ON `arrowhead`.`device` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`device_registry` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'device_registry'@'localhost'; + +REVOKE ALL, GRANT OPTION FROM 'device_registry'@'%'; + +GRANT ALL PRIVILEGES ON `arrowhead`.`device` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`device_registry` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'device_registry'@'%'; + +FLUSH PRIVILEGES; \ No newline at end of file diff --git a/scripts/event_handler_privileges.sql b/scripts/event_handler_privileges.sql index a28bfd821..59183f487 100644 --- a/scripts/event_handler_privileges.sql +++ b/scripts/event_handler_privileges.sql @@ -5,7 +5,7 @@ REVOKE ALL, GRANT OPTION FROM 'event_handler'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`event_type` TO 'event_handler'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'event_handler'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'event_handler'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'event_handler'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'event_handler'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'event_handler'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'event_handler'@'%'; @@ -13,7 +13,7 @@ REVOKE ALL, GRANT OPTION FROM 'event_handler'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`event_type` TO 'event_handler'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'event_handler'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'event_handler'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'event_handler'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'event_handler'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'event_handler'@'%'; FLUSH PRIVILEGES; \ No newline at end of file diff --git a/scripts/gatekeeper_privileges.sql b/scripts/gatekeeper_privileges.sql index 212fed558..944fe7cb1 100644 --- a/scripts/gatekeeper_privileges.sql +++ b/scripts/gatekeeper_privileges.sql @@ -4,7 +4,7 @@ REVOKE ALL, GRANT OPTION FROM 'gatekeeper'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'gatekeeper'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'gatekeeper'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'gatekeeper'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'gatekeeper'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'gatekeeper'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'gatekeeper'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'gatekeeper'@'localhost'; @@ -17,7 +17,7 @@ REVOKE ALL, GRANT OPTION FROM 'gatekeeper'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'gatekeeper'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'gatekeeper'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'gatekeeper'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'gatekeeper'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'gatekeeper'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'gatekeeper'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'gatekeeper'@'%'; diff --git a/scripts/onboarding_controller_privileges.sql b/scripts/onboarding_controller_privileges.sql new file mode 100644 index 000000000..4f20d66ba --- /dev/null +++ b/scripts/onboarding_controller_privileges.sql @@ -0,0 +1,2 @@ +USE `arrowhead`; +## intentionally empty \ No newline at end of file diff --git a/scripts/orchestrator_privileges.sql b/scripts/orchestrator_privileges.sql index d6a223f31..9595b3157 100644 --- a/scripts/orchestrator_privileges.sql +++ b/scripts/orchestrator_privileges.sql @@ -4,7 +4,7 @@ REVOKE ALL, GRANT OPTION FROM 'orchestrator'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'orchestrator'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`foreign_system` TO 'orchestrator'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'orchestrator'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'orchestrator'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'orchestrator'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'orchestrator'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'orchestrator'@'localhost'; @@ -17,7 +17,7 @@ REVOKE ALL, GRANT OPTION FROM 'orchestrator'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'orchestrator'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`foreign_system` TO 'orchestrator'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'orchestrator'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'orchestrator'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'orchestrator'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'orchestrator'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'orchestrator'@'%'; diff --git a/scripts/service_registry_privileges.sql b/scripts/service_registry_privileges.sql index 85a994f86..072ae3572 100644 --- a/scripts/service_registry_privileges.sql +++ b/scripts/service_registry_privileges.sql @@ -2,7 +2,7 @@ USE `arrowhead`; REVOKE ALL, GRANT OPTION FROM 'service_registry'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'service_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'service_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'service_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'service_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'service_registry'@'localhost'; @@ -29,7 +29,7 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'service_registry'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'service_registry'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system` TO 'service_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'service_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'service_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'service_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'service_registry'@'%'; diff --git a/scripts/system_registry_privileges.sql b/scripts/system_registry_privileges.sql new file mode 100644 index 000000000..0092def34 --- /dev/null +++ b/scripts/system_registry_privileges.sql @@ -0,0 +1,23 @@ +USE `arrowhead`; + +REVOKE ALL, GRANT OPTION FROM 'system_registry'@'localhost'; + +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_registry` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`device` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'system_registry'@'localhost'; + +REVOKE ALL, GRANT OPTION FROM 'service_registry'@'%'; + +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_registry` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`device` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'system_registry'@'%'; + +FLUSH PRIVILEGES; \ No newline at end of file diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java index 5506ed3e6..190baea26 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java @@ -630,7 +630,7 @@ public SystemRegistryListResponseDTO getSystemRegistryEntriesBySystemName(final final PageRequest pageRequest = PageRequest.of(pageParameters.getValidatedPage(), pageParameters.getValidatedSize(), pageParameters.getValidatedDirection(), sortField); - final Page systemRegistries = systemRegistryRepository.findAllBySystem(systemList, pageRequest); + final Page systemRegistries = systemRegistryRepository.findAllBySystemIsIn(systemList, pageRequest); return DTOConverter.convertSystemRegistryListToSystemRegistryListResponseDTO(systemRegistries); } @@ -683,7 +683,7 @@ public SystemQueryResultDTO queryRegistry(final SystemQueryFormDTO form) throw new InvalidParameterException("System Name must not be null"); } - registryList = systemRegistryRepository.findAllBySystem(systems); + registryList = systemRegistryRepository.findAllBySystemIsIn(systems); unfilteredHits = registryList.size(); if (Utilities.notEmpty(form.getDeviceNameRequirements())) diff --git a/systemregistry/src/main/resources/application.properties b/systemregistry/src/main/resources/application.properties index 5d65990e5..cb017f79c 100644 --- a/systemregistry/src/main/resources/application.properties +++ b/systemregistry/src/main/resources/application.properties @@ -6,7 +6,7 @@ # Change the server timezone if necessary spring.datasource.url=jdbc:mysql://127.0.0.1:3306/arrowhead?serverTimezone=Europe/Budapest spring.datasource.username=system_registry -spring.datasource.password=ZzNNpxrbZGVvfJ8 +spring.datasource.password=Kh12Hhgaxzo7haf spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect From dc2d0dd04cd80feac9c6191cee07aed5acefcdaf Mon Sep 17 00:00:00 2001 From: mzsilak Date: Mon, 27 Jan 2020 13:24:33 +0100 Subject: [PATCH 038/301] fixed wildcard imports in controllers --- .../DeviceRegistryController.java | 28 +++++++++++++-- .../core/onboarding/OnboardingController.java | 24 ++++++++----- .../SystemRegistryController.java | 34 ++++++++++++++++--- 3 files changed, 71 insertions(+), 15 deletions(-) diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java index e9ea4907a..0e2b5e566 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java @@ -1,9 +1,19 @@ package eu.arrowhead.core.deviceregistry; -import eu.arrowhead.common.*; +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.CoreDefaults; +import eu.arrowhead.common.CoreUtilities; +import eu.arrowhead.common.Defaults; +import eu.arrowhead.common.Utilities; import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; import eu.arrowhead.common.dto.internal.DeviceRegistryListResponseDTO; -import eu.arrowhead.common.dto.shared.*; +import eu.arrowhead.common.dto.shared.DeviceQueryFormDTO; +import eu.arrowhead.common.dto.shared.DeviceQueryResultDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.DeviceRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceResponseDTO; import eu.arrowhead.common.exception.BadPayloadException; import eu.arrowhead.core.deviceregistry.database.service.DeviceRegistryDBService; import io.swagger.annotations.Api; @@ -16,7 +26,19 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; import java.time.format.DateTimeParseException; import java.util.Objects; diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java index 7839a807e..1a438e215 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java @@ -1,9 +1,14 @@ package eu.arrowhead.core.onboarding; -import eu.arrowhead.common.*; -import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; -import eu.arrowhead.common.dto.internal.DeviceRegistryListResponseDTO; -import eu.arrowhead.common.dto.shared.*; +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.Defaults; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.dto.shared.DeviceResponseDTO; +import eu.arrowhead.common.dto.shared.OnboardingWithCsrRequestDTO; +import eu.arrowhead.common.dto.shared.OnboardingWithCsrResponseDTO; +import eu.arrowhead.common.dto.shared.OnboardingWithNameRequestDTO; +import eu.arrowhead.common.dto.shared.OnboardingWithNameResponseDTO; import eu.arrowhead.common.exception.BadPayloadException; import eu.arrowhead.core.onboarding.database.service.OnboardingDBService; import io.swagger.annotations.Api; @@ -15,14 +20,17 @@ import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import java.security.cert.X509Certificate; -import java.time.format.DateTimeParseException; import java.util.Objects; -import java.util.regex.Matcher; @Api(tags = {CoreCommonConstants.SWAGGER_TAG_ALL}) @CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java index defccd802..2e7a8c9b4 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java @@ -1,9 +1,23 @@ package eu.arrowhead.core.systemregistry; -import eu.arrowhead.common.*; +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.CoreDefaults; +import eu.arrowhead.common.CoreUtilities; +import eu.arrowhead.common.Defaults; +import eu.arrowhead.common.Utilities; import eu.arrowhead.common.core.CoreSystem; -import eu.arrowhead.common.dto.internal.*; -import eu.arrowhead.common.dto.shared.*; +import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; +import eu.arrowhead.common.dto.internal.SystemListResponseDTO; +import eu.arrowhead.common.dto.internal.SystemRegistryListResponseDTO; +import eu.arrowhead.common.dto.shared.DeviceRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceResponseDTO; +import eu.arrowhead.common.dto.shared.SystemQueryFormDTO; +import eu.arrowhead.common.dto.shared.SystemQueryResultDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryRequestDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; import eu.arrowhead.common.exception.BadPayloadException; import eu.arrowhead.core.systemregistry.database.service.SystemRegistryDBService; import io.swagger.annotations.Api; @@ -16,7 +30,19 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; import java.time.format.DateTimeParseException; import java.util.Objects; From e9a9c9fa0fd8f6b0ccc429badd5303c389023b63 Mon Sep 17 00:00:00 2001 From: mzsilak Date: Mon, 27 Jan 2020 13:30:19 +0100 Subject: [PATCH 039/301] renamed method --- .../main/java/eu/arrowhead/common/Utilities.java | 8 ++++---- .../database/service/DeviceRegistryDBService.java | 8 ++++---- .../database/service/SystemRegistryDBService.java | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/Utilities.java b/core-common/src/main/java/eu/arrowhead/common/Utilities.java index 9c8846817..319ca6cc4 100644 --- a/core-common/src/main/java/eu/arrowhead/common/Utilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/Utilities.java @@ -501,21 +501,21 @@ public static String lowerCaseTrim(final String text) { } //------------------------------------------------------------------------------------------------- - public static String firstNotNull(final String first, final String second) { + public static String firstNotNullIfExists(final String first, final String second) { return Utilities.notEmpty(first) ? Utilities.lowerCaseTrim(first) : Utilities.lowerCaseTrim(second); } //------------------------------------------------------------------------------------------------- @SuppressWarnings("unchecked") - public static T firstNotNull(final T first, final T second) { + public static T firstNotNullIfExists(final T first, final T second) { if (first instanceof String && second instanceof String) { - return (T) firstNotNull((String) first, (String) second); + return (T) firstNotNullIfExists((String) first, (String) second); } return Objects.nonNull(first) ? first : second; } //------------------------------------------------------------------------------------------------- - public static String firstNotNull(final String... args) { + public static String firstNotNullIfExists(final String... args) { for (final String candidate : args) { if (Utilities.notEmpty(candidate)) { return Utilities.lowerCaseTrim(candidate); diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java index deb1d7713..1d3018b8c 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java @@ -884,10 +884,10 @@ private void checkConstraintsOfDeviceRegistryTable(final Device deviceDb) //------------------------------------------------------------------------------------------------- private Device mergeDevice(final DeviceRequestDTO request, final Device device) { - final String name = Utilities.firstNotNull(request.getDeviceName(), device.getDeviceName()); - final String address = Utilities.firstNotNull(request.getAddress(), device.getAddress()); - final String macAddress = Utilities.firstNotNull(request.getDeviceName(), device.getDeviceName()); - final String authenticationInfo = Utilities.firstNotNull(request.getAuthenticationInfo(), device.getAuthenticationInfo()); + final String name = Utilities.firstNotNullIfExists(request.getDeviceName(), device.getDeviceName()); + final String address = Utilities.firstNotNullIfExists(request.getAddress(), device.getAddress()); + final String macAddress = Utilities.firstNotNullIfExists(request.getDeviceName(), device.getDeviceName()); + final String authenticationInfo = Utilities.firstNotNullIfExists(request.getAuthenticationInfo(), device.getAuthenticationInfo()); return findOrCreateDevice(name, address, macAddress, authenticationInfo); } diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java index 190baea26..9ded3fab9 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java @@ -1199,20 +1199,20 @@ private void checkConstraintsOfSystemRegistryTable(final System systemDb, final //------------------------------------------------------------------------------------------------- private Device mergeDevice(final DeviceRequestDTO request, final Device device) { - final String name = Utilities.firstNotNull(request.getDeviceName(), device.getDeviceName()); - final String address = Utilities.firstNotNull(request.getAddress(), device.getAddress()); - final String macAddress = Utilities.firstNotNull(request.getDeviceName(), device.getDeviceName()); - final String authenticationInfo = Utilities.firstNotNull(request.getAuthenticationInfo(), device.getAuthenticationInfo()); + final String name = Utilities.firstNotNullIfExists(request.getDeviceName(), device.getDeviceName()); + final String address = Utilities.firstNotNullIfExists(request.getAddress(), device.getAddress()); + final String macAddress = Utilities.firstNotNullIfExists(request.getDeviceName(), device.getDeviceName()); + final String authenticationInfo = Utilities.firstNotNullIfExists(request.getAuthenticationInfo(), device.getAuthenticationInfo()); return findOrCreateDevice(name, address, macAddress, authenticationInfo); } //------------------------------------------------------------------------------------------------- private System mergeSystem(final SystemRequestDTO request, final System system) { - final String name = Utilities.firstNotNull(request.getSystemName(), system.getSystemName()); - final String address = Utilities.firstNotNull(request.getAddress(), system.getAddress()); + final String name = Utilities.firstNotNullIfExists(request.getSystemName(), system.getSystemName()); + final String address = Utilities.firstNotNullIfExists(request.getAddress(), system.getAddress()); final int port = request.getPort() > 0 ? request.getPort() : system.getPort(); - final String authenticationInfo = Utilities.firstNotNull(request.getAuthenticationInfo(), system.getAuthenticationInfo()); + final String authenticationInfo = Utilities.firstNotNullIfExists(request.getAuthenticationInfo(), system.getAuthenticationInfo()); return findOrCreateSystem(name, address, port, authenticationInfo); } From 241a9054af6056520f411a5b91ad7d405a9eaafa Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Tue, 28 Jan 2020 01:22:03 +0100 Subject: [PATCH 040/301] implemented review comments --- core-common/src/deb/control/templates | 15 + .../java/eu/arrowhead/common/Utilities.java | 4 +- .../repository/SystemRegistryRepository.java | 5 +- .../shared/OnboardingWithCsrRequestDTO.java | 3 +- .../shared/OnboardingWithCsrResponseDTO.java | 4 +- .../shared/OnboardingWithNameResponseDTO.java | 7 +- .../common/dto/shared/ServiceEndpoint.java | 8 +- deviceregistry/src/deb/control/config | 2 +- deviceregistry/src/deb/control/postinst | 34 +- deviceregistry/src/deb/control/postrm | 14 +- .../DeviceRegistryController.java | 106 ++-- .../service/DeviceRegistryDBService.java | 509 ++++++------------ .../src/main/resources/application.properties | 30 +- .../src/main/resources/certificates/sysop.crt | 20 - .../src/main/resources/certificates/sysop.p12 | Bin 6109 -> 0 bytes .../main/resources/swagger/swagger-ui.html | 2 +- onboarding/src/deb/control/config | 2 +- onboarding/src/deb/control/postinst | 36 +- onboarding/src/deb/control/postrm | 8 +- onboarding/src/deb/control/prerm | 4 +- .../src/main/resources/application.properties | 26 +- .../src/main/resources/certificates/sysop.crt | 20 - .../src/main/resources/certificates/sysop.p12 | Bin 6109 -> 0 bytes .../main/resources/swagger/swagger-ui.html | 2 +- scripts/create_empty_arrowhead_db.sql | 7 +- scripts/onboarding_controller_privileges.sql | 8 +- systemregistry/src/deb/control/config | 2 +- systemregistry/src/deb/control/postinst | 34 +- systemregistry/src/deb/control/postrm | 14 +- .../service/SystemRegistryDBService.java | 17 +- .../src/main/resources/application.properties | 19 +- .../src/main/resources/certificates/sysop.crt | 20 - .../src/main/resources/certificates/sysop.p12 | Bin 6109 -> 0 bytes .../main/resources/swagger/swagger-ui.html | 2 +- 34 files changed, 357 insertions(+), 627 deletions(-) delete mode 100644 deviceregistry/src/main/resources/certificates/sysop.crt delete mode 100644 deviceregistry/src/main/resources/certificates/sysop.p12 delete mode 100644 onboarding/src/main/resources/certificates/sysop.crt delete mode 100644 onboarding/src/main/resources/certificates/sysop.p12 delete mode 100644 systemregistry/src/main/resources/certificates/sysop.crt delete mode 100644 systemregistry/src/main/resources/certificates/sysop.p12 diff --git a/core-common/src/deb/control/templates b/core-common/src/deb/control/templates index 83b24eab3..f26a3e854 100644 --- a/core-common/src/deb/control/templates +++ b/core-common/src/deb/control/templates @@ -96,6 +96,21 @@ Type: password Default: Description: MySQL password for Service Registry system (leave empty for random). +Template: arrowhead-core-common/mysql_password_sysr +Type: password +Default: +Description: MySQL password for System Registry system (leave empty for random). + +Template: arrowhead-core-common/mysql_password_dr +Type: password +Default: +Description: MySQL password for Device Registry system (leave empty for random). + +Template: arrowhead-core-common/mysql_password_onboarding +Type: password +Default: +Description: MySQL password for Onboarding controller system (leave empty for random). + Template: arrowhead-core-common/sr_host Type: string Description: Enter the hostname or IP address of the Service Registry (leave empty if the SR on the same computer than the system) diff --git a/core-common/src/main/java/eu/arrowhead/common/Utilities.java b/core-common/src/main/java/eu/arrowhead/common/Utilities.java index 319ca6cc4..bfe1da441 100644 --- a/core-common/src/main/java/eu/arrowhead/common/Utilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/Utilities.java @@ -502,7 +502,7 @@ public static String lowerCaseTrim(final String text) { //------------------------------------------------------------------------------------------------- public static String firstNotNullIfExists(final String first, final String second) { - return Utilities.notEmpty(first) ? Utilities.lowerCaseTrim(first) : Utilities.lowerCaseTrim(second); + return Utilities.notEmpty(first) ? first : second; } //------------------------------------------------------------------------------------------------- @@ -518,7 +518,7 @@ public static T firstNotNullIfExists(final T first, final T second) { public static String firstNotNullIfExists(final String... args) { for (final String candidate : args) { if (Utilities.notEmpty(candidate)) { - return Utilities.lowerCaseTrim(candidate); + return candidate; } } diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java index 88b5425b9..786b77d2a 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java @@ -11,8 +11,7 @@ import java.util.Optional; @Repository -public interface SystemRegistryRepository extends RefreshableRepository -{ +public interface SystemRegistryRepository extends RefreshableRepository { //================================================================================================= // methods @@ -24,7 +23,7 @@ public interface SystemRegistryRepository extends RefreshableRepository findBySystemAndDevice(final System systemDb, final Device deviceDb); - List findAllBySystemIsIn(final List systems); + List findAllBySystemIsIn(final List systems); Page findAllBySystemIsIn(final List systemList, final PageRequest pageRequest); } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrRequestDTO.java index 9cc5675c1..2966a86e5 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrRequestDTO.java @@ -7,8 +7,7 @@ import java.util.Objects; @JsonInclude(Include.NON_NULL) -public class OnboardingWithCsrRequestDTO implements Serializable -{ +public class OnboardingWithCsrRequestDTO implements Serializable { //================================================================================================= // members diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java index 76759c6e4..0365f06ec 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java @@ -2,8 +2,8 @@ import java.io.Serializable; -public class OnboardingWithCsrResponseDTO implements Serializable -{ +public class OnboardingWithCsrResponseDTO implements Serializable { + //================================================================================================= // members diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java index 0d12dd178..dcb7891bb 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java @@ -1,9 +1,12 @@ package eu.arrowhead.common.dto.shared; -public class OnboardingWithNameResponseDTO -{ +import java.io.Serializable; + +public class OnboardingWithNameResponseDTO implements Serializable { + //================================================================================================= // members + private static final long serialVersionUID = 1L; private ServiceEndpoint deviceRegistry; private ServiceEndpoint systemRegistry; private ServiceEndpoint serviceRegistry; diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceEndpoint.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceEndpoint.java index a25a2bca4..8ea924f69 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceEndpoint.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceEndpoint.java @@ -2,10 +2,14 @@ import eu.arrowhead.common.core.CoreSystemService; +import java.io.Serializable; import java.net.URI; -public class ServiceEndpoint -{ +public class ServiceEndpoint implements Serializable { + + //================================================================================================= + // members + private static final long serialVersionUID = 1L; private final CoreSystemService system; private final URI uri; diff --git a/deviceregistry/src/deb/control/config b/deviceregistry/src/deb/control/config index bee242d71..49782702b 100644 --- a/deviceregistry/src/deb/control/config +++ b/deviceregistry/src/deb/control/config @@ -12,7 +12,7 @@ fi # Get installation type db_input high arrowhead-core-common/db_host || true -db_input high arrowhead-core-common/mysql_password_sr || true +db_input high arrowhead-core-common/mysql_password_dr || true # Run dialogs db_go || true diff --git a/deviceregistry/src/deb/control/postinst b/deviceregistry/src/deb/control/postinst index 6afe4019b..d668b89dd 100644 --- a/deviceregistry/src/deb/control/postinst +++ b/deviceregistry/src/deb/control/postinst @@ -26,37 +26,31 @@ case "$1" in configure) dos2unix -q /etc/systemd/system/${PKG_NAME}.service - . /usr/share/arrowhead/conf/ahconf.sh - - SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" + . /usr/share/arrowhead/conf/ahconf.sh + + SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" - db_get arrowhead-core-common/mysql_password_sr; system_passwd=$RET || true - db_unregister arrowhead-core-common/mysql_password_sr + db_get arrowhead-core-common/mysql_password_dr; system_passwd=$RET || true + db_unregister arrowhead-core-common/mysql_password_dr # Generate password (if required) if [ -z "${system_passwd}" ]; then system_passwd="$(openssl rand -base64 12)" fi - echo "Configuring MySQL database..." >&2 - ah_db_tables_and_user ${SYSTEM_NAME} ${SYSTEM_NAME}_privileges.sql ${system_passwd} + echo "Configuring MySQL database..." >&2 + ah_db_tables_and_user ${SYSTEM_NAME} ${SYSTEM_NAME}_privileges.sql ${system_passwd} - if [ ! -d "${SYSTEM_DIR}" ]; then - mkdir -p ${SYSTEM_DIR} - fi + if [ ! -d "${SYSTEM_DIR}" ]; then + mkdir -p ${SYSTEM_DIR} + fi domain_name=${AH_DOMAIN_NAME} if [ -z ${domain_name} ]; then domain_name=${OWN_IP} fi - ah_cert_signed_system ${SYSTEM_NAME} - - if [ ! -d "${AH_SYSTEMS_DIR}/sysop" ]; then - mkdir -p ${AH_SYSTEMS_DIR}/sysop - fi - - ah_cert_signed_system sysop + ah_cert_signed_system ${SYSTEM_NAME} # modify log config and application.properties @@ -79,10 +73,10 @@ case "$1" in chown arrowhead:arrowhead ${SYSTEM_DIR}/application.properties chmod 640 ${SYSTEM_DIR}/application.properties - echo "Starting ${PKG_NAME}..." >&2 - systemctl daemon-reload + echo "Starting ${PKG_NAME}..." >&2 + systemctl daemon-reload systemctl enable ${PKG_NAME}.service - systemctl start ${PKG_NAME}.service + systemctl start ${PKG_NAME}.service ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/deviceregistry/src/deb/control/postrm b/deviceregistry/src/deb/control/postrm index 5e9249779..199816d2d 100644 --- a/deviceregistry/src/deb/control/postrm +++ b/deviceregistry/src/deb/control/postrm @@ -30,15 +30,15 @@ case "$1" in SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" rm -f \ - /var/log/arrowhead/${SYSTEM_NAME}*.log \ - ${SYSTEM_DIR}/log4j2.xml \ - ${SYSTEM_DIR}/application.properties \ - ${SYSTEM_DIR}/${SYSTEM_NAME}.p12 \ - ${AH_SYSTEMS_DIR}/sysop/sysop.p12 - rmdir ${SYSTEM_DIR} 2>/dev/null || true - rmdir ${AH_SYSTEMS_DIR}/sysop 2>/dev/null || true + /var/log/arrowhead/${SYSTEM_NAME}*.log \ + ${SYSTEM_DIR}/log4j2.xml \ + ${SYSTEM_DIR}/application.properties \ + ${SYSTEM_DIR}/${SYSTEM_NAME}.p12 + rmdir ${SYSTEM_DIR} 2>/dev/null || true + rmdir ${AH_SYSTEMS_DIR}/sysop 2>/dev/null || true db_purge ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java index 0e2b5e566..4171ce021 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java @@ -51,8 +51,7 @@ ) @RestController @RequestMapping(CommonConstants.DEVICE_REGISTRY_URI) -public class DeviceRegistryController -{ +public class DeviceRegistryController { //================================================================================================= // members @@ -111,8 +110,8 @@ public class DeviceRegistryController private static final String DEVICE_REGISTRY_MGMT_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/{" + PATH_VARIABLE_ID + "}"; private static final String DEVICE_REGISTRY_MGMT_BY_DEVICE_NAME_URI = CoreCommonConstants.MGMT_URI + "/devicename" + "/{" + PATH_VARIABLE_DEVICE_NAME + "}"; - private static final String MAC_ADDRESS_PATTERN = "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"; - private final Pattern macAddressPattern = Pattern.compile(MAC_ADDRESS_PATTERN); + private static final String MAC_ADDRESS_PATTERN_STRING = "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"; + public static final Pattern MAC_ADDRESS_PATTERN = Pattern.compile(MAC_ADDRESS_PATTERN_STRING); private final Logger logger = LogManager.getLogger(DeviceRegistryController.class); private final DeviceRegistryDBService deviceRegistryDBService; @@ -159,7 +158,7 @@ public DeviceResponseDTO getDeviceById(@PathVariable(value = PATH_VARIABLE_ID) f } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return devices by request parameters", response = DeviceListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiOperation(value = "Return devices by given request parameters", response = DeviceListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICES_HTTP_200_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICES_HTTP_400_MESSAGE), @@ -173,10 +172,14 @@ public DeviceListResponseDTO getDevices( @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("getDevices started ..."); + logger.debug("New DeviceList get request received with page: {} and item_per page: {}", page, size); + + final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities + .validatePageParameters(page, size, direction, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); + final DeviceListResponseDTO deviceListResponseDTO = deviceRegistryDBService.getDeviceEntries(pageParameters, sortField); + logger.debug("DeviceList with page: {} and item_per page: {} successfully retrieved", page, size); - final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); - return deviceRegistryDBService.getDeviceEntries(pageParameters, sortField); + return deviceListResponseDTO; } //------------------------------------------------------------------------------------------------- @@ -195,7 +198,8 @@ public DeviceResponseDTO addDevice(@RequestBody final DeviceRequestDTO dto) { checkDeviceRequest(dto, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); - final DeviceResponseDTO responseDTO = deviceRegistryDBService.createDeviceDto(dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); + final DeviceResponseDTO responseDTO = deviceRegistryDBService + .createDeviceDto(dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); logger.debug("{} successfully registered.", responseDTO); return responseDTO; @@ -265,30 +269,6 @@ public void removeDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id) logger.debug("Device with deviceId: '{}' successfully deleted", id); } - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return requested device by the given parameters", response = DeviceListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICES_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICES_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = DEVICES_URI, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public DeviceListResponseDTO getDeviceListByRequestParameters( - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("New DeviceList get request received with page: {} and item_per page: {}", page, size); - - final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); - final DeviceListResponseDTO deviceListResponseDTO = deviceRegistryDBService.getDeviceEntries(pageParameters, sortField); - logger.debug("DeviceList with page: {} and item_per page: {} successfully retrieved", page, size); - - return deviceListResponseDTO; - } - //------------------------------------------------------------------------------------------------- @ApiOperation(value = "Return requested device registry entries by the given parameters", response = DeviceRegistryListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { @@ -306,12 +286,13 @@ public DeviceRegistryListResponseDTO getDeviceRegistryEntries( @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { logger.debug("New Device Registry get request received with page: {} and item_per page: {}", page, size); - final CoreUtilities.ValidatedPageParams params = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.DEVICE_REGISTRY_URI + CoreCommonConstants.MGMT_URI); - final DeviceRegistryListResponseDTO systemRegistryEntriesResponse = deviceRegistryDBService + final CoreUtilities.ValidatedPageParams params = CoreUtilities + .validatePageParameters(page, size, direction, CommonConstants.DEVICE_REGISTRY_URI + CoreCommonConstants.MGMT_URI); + final DeviceRegistryListResponseDTO deviceRegistryEntriesResponse = deviceRegistryDBService .getDeviceRegistryEntries(params, sortField); logger.debug("Device Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); - return systemRegistryEntriesResponse; + return deviceRegistryEntriesResponse; } //------------------------------------------------------------------------------------------------- @@ -328,12 +309,13 @@ public DeviceRegistryResponseDTO getDeviceRegistryEntryById(@PathVariable(value logger.debug("New Device Registry get request received with deviceId: {}", id); if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICE_REGISTRY_MGMT_BY_ID_URI); + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, + CommonConstants.DEVICE_REGISTRY_URI + DEVICE_REGISTRY_MGMT_BY_ID_URI); } - final DeviceRegistryResponseDTO systemRegistryEntryByIdResponse = deviceRegistryDBService.getDeviceRegistryById(id); + final DeviceRegistryResponseDTO deviceRegistryEntryByIdResponse = deviceRegistryDBService.getDeviceRegistryById(id); logger.debug("Device Registry entry with deviceId: {} successfully retrieved", id); - return systemRegistryEntryByIdResponse; + return deviceRegistryEntryByIdResponse; } //------------------------------------------------------------------------------------------------- @@ -361,11 +343,11 @@ public DeviceRegistryListResponseDTO getDeviceRegistryEntriesByDeviceName( } final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, origin); - final DeviceRegistryListResponseDTO systemRegistryEntries = deviceRegistryDBService + final DeviceRegistryListResponseDTO deviceRegistryEntries = deviceRegistryDBService .getDeviceRegistryEntriesByDeviceName(deviceName, pageParameters, sortField); logger.debug("Device Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); - return systemRegistryEntries; + return deviceRegistryEntries; } //------------------------------------------------------------------------------------------------- @@ -381,7 +363,8 @@ public void removeDeviceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID logger.debug("New Device Registry delete request received with deviceId: {}", id); if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICE_REGISTRY_MGMT_BY_ID_URI); + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, + CommonConstants.DEVICE_REGISTRY_URI + DEVICE_REGISTRY_MGMT_BY_ID_URI); } deviceRegistryDBService.removeDeviceRegistryEntryById(id); @@ -425,7 +408,8 @@ DeviceRegistryResponseDTO updateDeviceRegistry(@PathVariable(value = PATH_VARIAB checkDeviceRegistryUpdateRequest(id, request, CoreCommonConstants.MGMT_URI); final DeviceRegistryResponseDTO response = deviceRegistryDBService.updateDeviceRegistryById(id, request); - logger.debug("Device Registry entry {} is successfully updated with device {} and device {}", id, request.getDevice().getDeviceName(), request.getDevice()); + logger.debug("Device Registry entry {} is successfully updated with device {} and device {}", id, request.getDevice().getDeviceName(), + request.getDevice()); return response; } @@ -528,16 +512,16 @@ public DeviceResponseDTO queryRegistryByDeviceId(@PathVariable(value = PATH_VARI @PostMapping(path = CoreCommonConstants.OP_DEVICE_REGISTRY_QUERY_BY_DEVICE_DTO_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public DeviceResponseDTO queryRegistryByDeviceDTO(@RequestBody final DeviceRequestDTO request) { - logger.debug("Device query by systemRequestDTO request received"); + logger.debug("Device query by DeviceRequestDTO request received"); checkDeviceRequest(request, CommonConstants.DEVICE_REGISTRY_URI + CoreCommonConstants.OP_DEVICE_REGISTRY_QUERY_BY_DEVICE_ID_URI); - final String systemName = request.getDeviceName(); + final String deviceName = request.getDeviceName(); final String macAddress = request.getMacAddress(); - final DeviceResponseDTO result = deviceRegistryDBService.getDeviceDtoByNameAndMacAddress(systemName, macAddress); + final DeviceResponseDTO result = deviceRegistryDBService.getDeviceDtoByNameAndMacAddress(deviceName, macAddress); - logger.debug("Return device by name: {}, macAddress: {}", systemName, macAddress); + logger.debug("Return device by name: {}, macAddress: {}", deviceName, macAddress); return result; } @@ -617,33 +601,30 @@ private void checkDeviceRegistryRequest(final DeviceRegistryRequestDTO request, try { Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()); } catch (final DateTimeParseException ex) { - throw new BadPayloadException("End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", + throw new BadPayloadException( + "End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", HttpStatus.SC_BAD_REQUEST, origin); } } } //------------------------------------------------------------------------------------------------- - private void checkUnregisterDeviceParameters(final String systemName, final String macAddress) - { + private void checkUnregisterDeviceParameters(final String deviceName, final String macAddress) { // parameters can't be null, but can be empty logger.debug("checkUnregisterDeviceParameters started..."); final String origin = CommonConstants.DEVICE_REGISTRY_URI + CommonConstants.OP_DEVICE_REGISTRY_UNREGISTER_URI; - if (Utilities.isEmpty(systemName)) - { + if (Utilities.isEmpty(deviceName)) { throw new BadPayloadException("Name of the device is blank", HttpStatus.SC_BAD_REQUEST, origin); } - if (Utilities.isEmpty(macAddress)) - { + if (Utilities.isEmpty(macAddress)) { throw new BadPayloadException("MAC Address of the device is blank", HttpStatus.SC_BAD_REQUEST, origin); } - final Matcher matcher = macAddressPattern.matcher(macAddress); - if (matcher.matches()) - { + final Matcher matcher = MAC_ADDRESS_PATTERN.matcher(macAddress); + if (!matcher.matches()) { throw new BadPayloadException("Unrecognized format of MAC Address", HttpStatus.SC_BAD_REQUEST, origin); } } @@ -675,11 +656,14 @@ private void checkDeviceRegistryMergeRequest(final long id, final DeviceRegistry if (Utilities.notEmpty(device.getDeviceName())) { needChange = true; - } else if (Utilities.notEmpty(device.getAddress())) { + } + else if (Utilities.notEmpty(device.getAddress())) { needChange = true; - } else if (Utilities.notEmpty(device.getMacAddress())) { + } + else if (Utilities.notEmpty(device.getMacAddress())) { needChange = true; - } else if (Utilities.notEmpty(device.getAuthenticationInfo())) { + } + else if (Utilities.notEmpty(device.getAuthenticationInfo())) { needChange = true; } } @@ -692,7 +676,7 @@ private void checkDeviceRegistryMergeRequest(final long id, final DeviceRegistry needChange = true; } - if (request.getVersion() <= 0) { + if (request.getVersion() != null && request.getVersion() > 0) { needChange = true; } diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java index 1d3018b8c..30401265e 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java @@ -1,6 +1,10 @@ package eu.arrowhead.core.deviceregistry.database.service; -import eu.arrowhead.common.*; +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.CoreUtilities; +import eu.arrowhead.common.SSLProperties; +import eu.arrowhead.common.Utilities; import eu.arrowhead.common.database.entity.Device; import eu.arrowhead.common.database.entity.DeviceRegistry; import eu.arrowhead.common.database.entity.System; @@ -10,9 +14,15 @@ import eu.arrowhead.common.dto.internal.DTOConverter; import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; import eu.arrowhead.common.dto.internal.DeviceRegistryListResponseDTO; -import eu.arrowhead.common.dto.shared.*; +import eu.arrowhead.common.dto.shared.DeviceQueryFormDTO; +import eu.arrowhead.common.dto.shared.DeviceQueryResultDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.DeviceRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.exception.InvalidParameterException; +import eu.arrowhead.core.deviceregistry.DeviceRegistryController; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -25,11 +35,16 @@ import java.time.ZonedDateTime; import java.time.format.DateTimeParseException; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.regex.Matcher; @Service -public class DeviceRegistryDBService -{ +public class DeviceRegistryDBService { //================================================================================================= // members @@ -55,8 +70,7 @@ public class DeviceRegistryDBService public DeviceRegistryDBService(final DeviceRegistryRepository deviceRegistryRepository, final SystemRepository systemRepository, final DeviceRepository deviceRepository, - final SSLProperties sslProperties) - { + final SSLProperties sslProperties) { this.deviceRegistryRepository = deviceRegistryRepository; this.systemRepository = systemRepository; this.deviceRepository = deviceRepository; @@ -69,77 +83,58 @@ public DeviceRegistryDBService(final DeviceRegistryRepository deviceRegistryRepo //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public void removeSystemById(final long id) - { + public void removeSystemById(final long id) { logger.debug("removeSystemById started..."); - try - { - if (!systemRepository.existsById(id)) - { + try { + if (!systemRepository.existsById(id)) { throw new InvalidParameterException(COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE); } systemRepository.deleteById(id); systemRepository.flush(); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - public DeviceResponseDTO getDeviceById(long deviceId) - { + public DeviceResponseDTO getDeviceById(long deviceId) { logger.debug("getDeviceById started..."); - try - { + try { final Optional deviceOptional = deviceRepository.findById(deviceId); - if (deviceOptional.isEmpty()) - { + if (deviceOptional.isEmpty()) { throw new InvalidParameterException("Device with id " + deviceId + " not found."); } return DTOConverter.convertDeviceToDeviceResponseDTO(deviceOptional.get()); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) - { + public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) { logger.debug("getDeviceList started..."); final String validatedSortField = Utilities.isEmpty(sortField) ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); - if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) - { + if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) { throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); } - try - { + try { final Page devices = deviceRepository.findAll(PageRequest.of(pageParams.getValidatedPage(), pageParams.getValidatedSize(), pageParams.getValidatedDirection(), validatedSortField)); return DTOConverter.convertDeviceEntryListToDeviceListResponseDTO(devices); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -147,21 +142,18 @@ public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageP //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public DeviceResponseDTO createDeviceDto(final String name, final String address, final String macAddress, final String authenticationInfo) - { + public DeviceResponseDTO createDeviceDto(final String name, final String address, final String macAddress, final String authenticationInfo) { return DTOConverter.convertDeviceToDeviceResponseDTO(createDevice(name, address, macAddress, authenticationInfo)); } //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public DeviceResponseDTO updateDeviceByIdResponse(final long id, final String name, final String address, final String macAddress, - final String authenticationInfo) - { + final String authenticationInfo) { logger.debug("updateDeviceByIdResponse started..."); - try - { + try { final long validatedId = validateId(id); final Device newDevice = validateNonNullDeviceParameters(name, address, macAddress, authenticationInfo); @@ -175,13 +167,9 @@ public DeviceResponseDTO updateDeviceByIdResponse(final long id, final String na device.setAuthenticationInfo(newDevice.getAuthenticationInfo()); return DTOConverter.convertDeviceToDeviceResponseDTO(deviceRepository.saveAndFlush(device)); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -189,26 +177,19 @@ public DeviceResponseDTO updateDeviceByIdResponse(final long id, final String na //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public void removeDeviceById(final long id) - { + public void removeDeviceById(final long id) { logger.debug("removeDeviceById started..."); - try - { - if (!deviceRepository.existsById(id)) - { + try { + if (!deviceRepository.existsById(id)) { throw new InvalidParameterException(COULD_NOT_DELETE_DEVICE_ERROR_MESSAGE); } deviceRepository.deleteById(id); deviceRepository.flush(); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -216,23 +197,17 @@ public void removeDeviceById(final long id) //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public DeviceResponseDTO mergeDevice(final long deviceId, final DeviceRequestDTO request) - { + public DeviceResponseDTO mergeDevice(final long deviceId, final DeviceRequestDTO request) { logger.debug("mergeDevice started..."); - try - { + try { final Optional deviceOptional = deviceRepository.findById(deviceId); final Device device = deviceOptional.orElseThrow(() -> new InvalidParameterException("Device with id " + deviceId + " not found.")); return DTOConverter.convertDeviceToDeviceResponseDTO(mergeDevice(request, device)); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -240,27 +215,22 @@ public DeviceResponseDTO mergeDevice(final long deviceId, final DeviceRequestDTO //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public DeviceRegistryListResponseDTO getDeviceRegistryEntries(final CoreUtilities.ValidatedPageParams params, final String sortField) - { + public DeviceRegistryListResponseDTO getDeviceRegistryEntries(final CoreUtilities.ValidatedPageParams params, final String sortField) { logger.debug("getDeviceRegistryEntries started..."); final String validatedSortField = sortField == null ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); - if (!DeviceRegistry.SORTABLE_FIELDS_BY.contains(validatedSortField)) - { + if (!DeviceRegistry.SORTABLE_FIELDS_BY.contains(validatedSortField)) { throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); } - try - { + try { final PageRequest pageRequest = PageRequest.of(params.getValidatedPage(), params.getValidatedSize(), params.getValidatedDirection(), validatedSortField); final Page deviceRegistryPage = deviceRegistryRepository.findAll(pageRequest); return DTOConverter.convertDeviceRegistryListToDeviceRegistryListResponseDTO(deviceRegistryPage); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -270,18 +240,15 @@ public DeviceRegistryListResponseDTO getDeviceRegistryEntries(final CoreUtilitie @Transactional(rollbackFor = ArrowheadException.class) public DeviceRegistryListResponseDTO getDeviceRegistryEntriesByDeviceName(final String deviceName, final CoreUtilities.ValidatedPageParams params, - final String sortField) - { + final String sortField) { logger.debug("getDeviceRegistryEntriesByDeviceName started..."); final String validatedSortField = sortField == null ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); - if (!DeviceRegistry.SORTABLE_FIELDS_BY.contains(validatedSortField)) - { + if (!DeviceRegistry.SORTABLE_FIELDS_BY.contains(validatedSortField)) { throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); } - try - { + try { final List devices = deviceRepository.findByDeviceName(Utilities.lowerCaseTrim(deviceName)); final PageRequest pageRequest = PageRequest.of(params.getValidatedPage(), @@ -290,9 +257,7 @@ public DeviceRegistryListResponseDTO getDeviceRegistryEntriesByDeviceName(final validatedSortField); final Page deviceRegistryPage = deviceRegistryRepository.findAllByDeviceIsIn(devices, pageRequest); return DTOConverter.convertDeviceRegistryListToDeviceRegistryListResponseDTO(deviceRegistryPage); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -300,8 +265,7 @@ public DeviceRegistryListResponseDTO getDeviceRegistryEntriesByDeviceName(final //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public DeviceRegistryResponseDTO getDeviceRegistryById(final long id) - { + public DeviceRegistryResponseDTO getDeviceRegistryById(final long id) { logger.debug("getDeviceRegistryById started..."); return DTOConverter.convertDeviceRegistryToDeviceRegistryResponseDTO(getDeviceRegistryEntryById(id)); @@ -309,26 +273,19 @@ public DeviceRegistryResponseDTO getDeviceRegistryById(final long id) //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public void removeDeviceRegistryEntryById(final long id) - { + public void removeDeviceRegistryEntryById(final long id) { logger.debug("removeDeviceRegistryEntryById started..."); - try - { - if (!deviceRegistryRepository.existsById(id)) - { + try { + if (!deviceRegistryRepository.existsById(id)) { throw new InvalidParameterException("Device Registry entry with id '" + id + "' does not exists"); } deviceRegistryRepository.deleteById(id); deviceRegistryRepository.flush(); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -337,13 +294,11 @@ public void removeDeviceRegistryEntryById(final long id) //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public DeviceRegistryResponseDTO registerDeviceRegistry(final DeviceRegistryRequestDTO request) - { + public DeviceRegistryResponseDTO registerDeviceRegistry(final DeviceRegistryRequestDTO request) { logger.debug("registerDeviceRegistry started..."); checkDeviceRegistryRequest(request); - try - { + try { final Device deviceDb = findOrCreateDevice(request.getDevice()); final ZonedDateTime endOfValidity = getZonedDateTime(request); @@ -352,19 +307,13 @@ public DeviceRegistryResponseDTO registerDeviceRegistry(final DeviceRegistryRequ final DeviceRegistry drEntry = createDeviceRegistry(deviceDb, endOfValidity, metadataStr, version); return DTOConverter.convertDeviceRegistryToDeviceRegistryResponseDTO(drEntry); - } - catch (final DateTimeParseException ex) - { + } catch (final DateTimeParseException ex) { logger.debug(ex.getMessage(), ex); throw new InvalidParameterException( "End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -372,15 +321,13 @@ public DeviceRegistryResponseDTO registerDeviceRegistry(final DeviceRegistryRequ //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public DeviceRegistryResponseDTO updateDeviceRegistryById(final long id, final DeviceRegistryRequestDTO request) - { + public DeviceRegistryResponseDTO updateDeviceRegistryById(final long id, final DeviceRegistryRequestDTO request) { logger.debug("updateDeviceRegistryById started..."); Assert.isTrue(0 < id, "id is not greater than zero"); checkDeviceRegistryRequest(request); - try - { + try { final DeviceRegistry drEntry; final DeviceRegistry updateDrEntry; @@ -395,19 +342,13 @@ public DeviceRegistryResponseDTO updateDeviceRegistryById(final long id, final D updateDrEntry = updateDeviceRegistry(drEntry, deviceDb, endOfValidity, metadataStr, version); return DTOConverter.convertDeviceRegistryToDeviceRegistryResponseDTO(updateDrEntry); - } - catch (final DateTimeParseException ex) - { + } catch (final DateTimeParseException ex) { logger.debug(ex.getMessage(), ex); throw new InvalidParameterException( "End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -416,14 +357,12 @@ public DeviceRegistryResponseDTO updateDeviceRegistryById(final long id, final D //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public DeviceRegistryResponseDTO mergeDeviceRegistryById(final long id, final DeviceRegistryRequestDTO request) - { + public DeviceRegistryResponseDTO mergeDeviceRegistryById(final long id, final DeviceRegistryRequestDTO request) { logger.debug("mergeDeviceRegistryById started..."); Assert.notNull(request, "request is null."); Assert.isTrue(0 < id, "id is not greater than zero"); - try - { + try { final DeviceRegistry drEntry; final DeviceRegistry updateDrEntry; @@ -445,19 +384,13 @@ public DeviceRegistryResponseDTO mergeDeviceRegistryById(final long id, final De updateDrEntry = updateDeviceRegistry(drEntry, deviceDb, endOfValidity, validatedMetadataStr, validatedVersion); return DTOConverter.convertDeviceRegistryToDeviceRegistryResponseDTO(updateDrEntry); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final DateTimeParseException ex) - { + } catch (final DateTimeParseException ex) { logger.debug(ex.getMessage(), ex); throw new InvalidParameterException( "End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -465,16 +398,14 @@ public DeviceRegistryResponseDTO mergeDeviceRegistryById(final long id, final De //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public DeviceResponseDTO getDeviceDtoByNameAndMacAddress(final String deviceName, final String macAddress) - { + public DeviceResponseDTO getDeviceDtoByNameAndMacAddress(final String deviceName, final String macAddress) { final Device device = getDeviceByNameAndMacAddress(deviceName, macAddress); return DTOConverter.convertDeviceToDeviceResponseDTO(device); } //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public void removeDeviceRegistryByNameAndMacAddress(final String deviceName, final String macAddress) - { + public void removeDeviceRegistryByNameAndMacAddress(final String deviceName, final String macAddress) { logger.debug("removeDeviceRegistryByNameAndMacAddress is started..."); final Device device = getDeviceByNameAndMacAddress(deviceName, macAddress); @@ -491,68 +422,57 @@ public void removeDeviceRegistryByNameAndMacAddress(final String deviceName, fin //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public DeviceQueryResultDTO queryRegistry(final DeviceQueryFormDTO form) - { + public DeviceQueryResultDTO queryRegistry(final DeviceQueryFormDTO form) { logger.debug("queryRegistry is started..."); Assert.notNull(form, "Form is null."); - try - { + try { final List devices; final List registryList; final int unfilteredHits; - if (Utilities.isEmpty(form.getDeviceNameRequirements())) - { + if (Utilities.isEmpty(form.getDeviceNameRequirements())) { throw new InvalidParameterException("Device Name must not be null"); } final String deviceName = Utilities.lowerCaseTrim(form.getDeviceNameRequirements()); - if (Utilities.notEmpty(form.getMacAddressRequirement())) - { + if (Utilities.notEmpty(form.getMacAddressRequirement())) { // exact match or no match final String macAddress = Utilities.lowerCaseTrim(form.getMacAddressRequirement()); final Optional optionalDevice = deviceRepository.findByDeviceNameAndMacAddress(deviceName, macAddress); - if (optionalDevice.isPresent()) - { + if (optionalDevice.isPresent()) { devices = new ArrayList<>(); devices.add(optionalDevice.get()); } - else - { - return DTOConverter.convertDeviceRegistryListToDeviceQueryResultDTO(Collections.emptyList()); + else { + return DTOConverter.convertDeviceRegistryListToDeviceQueryResultDTO(List.of()); } } - else - { + else { devices = deviceRepository.findByDeviceName(deviceName); - if (devices.isEmpty()) - { + if (devices.isEmpty()) { // no service definition found logger.debug("Device not found: {}", deviceName); - return DTOConverter.convertDeviceRegistryListToDeviceQueryResultDTO(Collections.emptyList()); + return DTOConverter.convertDeviceRegistryListToDeviceQueryResultDTO(List.of()); } } registryList = deviceRegistryRepository.findAllByDeviceIsIn(devices); unfilteredHits = registryList.size(); - if (Utilities.notEmpty(form.getAddressRequirement())) - { - final String address = Utilities.lowerCaseTrim(form.getMacAddressRequirement()); + if (Utilities.notEmpty(form.getAddressRequirement())) { + final String address = Utilities.lowerCaseTrim(form.getAddressRequirement()); devices.removeIf(e -> !e.getAddress().startsWith(address)); } // filter on version - if (Objects.nonNull(form.getVersionRequirement())) - { + if (Objects.nonNull(form.getVersionRequirement())) { registryList.removeIf(e -> Objects.equals(form.getVersionRequirement(), e.getVersion())); } - else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(form.getMaxVersionRequirement())) - { + else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(form.getMaxVersionRequirement())) { final int minVersion = form.getMinVersionRequirement() == null ? 1 : form.getMinVersionRequirement(); final int maxVersion = form.getMaxVersionRequirement() == null ? Integer.MAX_VALUE : form.getMaxVersionRequirement(); @@ -560,14 +480,12 @@ else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(for } // filter on metadata - if (form.getMetadataRequirements() != null && !form.getMetadataRequirements().isEmpty()) - { + if (form.getMetadataRequirements() != null && !form.getMetadataRequirements().isEmpty()) { final Map requiredMetadata = normalizeMetadata(form.getMetadataRequirements()); registryList.removeIf(e -> { final Map metadata = Utilities.text2Map(e.getMetadata()); - if (Objects.isNull(metadata)) - { + if (Objects.isNull(metadata)) { // we have requirements but no metadata -> remove return true; } @@ -578,13 +496,9 @@ else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(for logger.debug("Potential system providers after filtering: {}", registryList.size()); return DTOConverter.convertListOfDeviceRegistryEntriesToDeviceQueryResultDTO(registryList, unfilteredHits); - } - catch (final IllegalStateException e) - { + } catch (final IllegalStateException e) { throw new InvalidParameterException("Invalid keys in the metadata requirements (whitespace only differences)"); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -592,14 +506,10 @@ else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(for //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public List getSystemByName(final String name) - { - try - { + public List getSystemByName(final String name) { + try { return systemRepository.findBySystemName(Utilities.lowerCaseTrim(name)); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -607,18 +517,14 @@ public List getSystemByName(final String name) //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) - { + public System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) { logger.debug("createSystem started..."); final System system = validateNonNullSystemParameters(systemName, address, port, authenticationInfo); - try - { + try { return systemRepository.saveAndFlush(system); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -627,19 +533,16 @@ public System createSystem(final String systemName, final String address, final //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- - private Device getDeviceByNameAndMacAddress(final String deviceName, final String macAddress) - { + private Device getDeviceByNameAndMacAddress(final String deviceName, final String macAddress) { final Optional optionalDevice = deviceRepository.findByDeviceNameAndMacAddress(deviceName, macAddress); return optionalDevice.orElseThrow(() -> new InvalidParameterException( "Device entry with name '" + deviceName + "' and MAC address '" + macAddress + "' does not exists")); } //------------------------------------------------------------------------------------------------- - private Map normalizeMetadata(final Map metadata) throws IllegalStateException - { + private Map normalizeMetadata(final Map metadata) throws IllegalStateException { logger.debug("normalizeMetadata started..."); - if (metadata == null) - { + if (metadata == null) { return Map.of(); } @@ -647,8 +550,7 @@ private Map normalizeMetadata(final Map metadata metadata.forEach((k, v) -> { - if (Objects.nonNull(v)) - { + if (Objects.nonNull(v)) { map.put(k.trim(), v.trim()); } }); @@ -657,36 +559,44 @@ private Map normalizeMetadata(final Map metadata } //------------------------------------------------------------------------------------------------- - private void checkConstraintsOfDeviceTable(final String validatedDeviceName, final String validatedMacAddress) - { + private void checkConstraintsOfDeviceTable(final String validatedDeviceName, final String validatedMacAddress) { logger.debug("checkConstraintsOfDeviceTable started..."); - try - { + try { final Optional find = deviceRepository.findByDeviceNameAndMacAddress(validatedDeviceName, validatedMacAddress); - if (find.isPresent()) - { + if (find.isPresent()) { throw new InvalidParameterException( "Device with name: " + validatedDeviceName + ", MAC address: " + validatedMacAddress + " already exists."); } - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private Device validateNonNullDeviceParameters(final String deviceName, final String address, final String macAddress, final String authenticationInfo) - { + private Device validateNonNullDeviceParameters(final String deviceName, final String address, final String macAddress, final String authenticationInfo) { logger.debug("validateNonNullDeviceParameters started..."); - validateNonNullParameters(deviceName, macAddress); + if (Utilities.isEmpty(deviceName)) { + throw new InvalidParameterException("Name is null or empty"); + } + + if (Utilities.isEmpty(macAddress)) { + throw new InvalidParameterException("MAC address is null or empty"); + } + else { + final Matcher matcher = DeviceRegistryController.MAC_ADDRESS_PATTERN.matcher(address); + if (!matcher.matches()) { + throw new InvalidParameterException("Unrecognized format of MAC Address"); + } + } + + if (deviceName.contains(".")) { + throw new InvalidParameterException("Name can't contain dot (.)"); + } final String validatedDeviceName = Utilities.lowerCaseTrim(deviceName); final String validatedAddress = Utilities.lowerCaseTrim(address); @@ -698,33 +608,10 @@ private Device validateNonNullDeviceParameters(final String deviceName, final St } //------------------------------------------------------------------------------------------------- - private void validateNonNullParameters(final String name, final String macAddress) - { - logger.debug("validateNonNullParameters started..."); - - if (Utilities.isEmpty(name)) - { - throw new InvalidParameterException("Name is null or empty"); - } - - if (Utilities.isEmpty(macAddress)) - { - throw new InvalidParameterException("MAC Address is null or empty"); - } - - if (name.contains(".")) - { - throw new InvalidParameterException("Name can't contain dot (.)"); - } - } - - //------------------------------------------------------------------------------------------------- - private long validateId(final long id) - { + private long validateId(final long id) { logger.debug("validateId started..."); - if (id < 1) - { + if (id < 1) { throw new IllegalArgumentException("Id must be greater than zero"); } @@ -732,28 +619,21 @@ private long validateId(final long id) } //------------------------------------------------------------------------------------------------- - private DeviceRegistry getDeviceRegistryEntryById(final long id) - { + private DeviceRegistry getDeviceRegistryEntryById(final long id) { logger.debug("getDeviceRegistryEntryById started..."); - try - { + try { final Optional systemRegistry = deviceRegistryRepository.findById(id); return systemRegistry.orElseThrow(() -> new InvalidParameterException("System Registry with id of '" + id + "' not exists")); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private Device findOrCreateDevice(DeviceRequestDTO requestDeviceDto) - { + private Device findOrCreateDevice(DeviceRequestDTO requestDeviceDto) { return findOrCreateDevice(requestDeviceDto.getDeviceName(), requestDeviceDto.getAddress(), requestDeviceDto.getMacAddress(), @@ -761,44 +641,41 @@ private Device findOrCreateDevice(DeviceRequestDTO requestDeviceDto) } //------------------------------------------------------------------------------------------------- - private Device findOrCreateDevice(String deviceName, String address, String macAddress, String authenticationInfo) - { + private Device findOrCreateDevice(String deviceName, String address, String macAddress, String authenticationInfo) { final String validateName = Utilities.lowerCaseTrim(deviceName); final String validateAddress = Utilities.lowerCaseTrim(address); final String validatedMacAddress = Utilities.lowerCaseTrim(macAddress); - final String validatedAuthenticationInfo = Utilities.lowerCaseTrim(authenticationInfo); final Optional optProvider = deviceRepository.findByDeviceNameAndMacAddress(validateName, validatedMacAddress); Device provider; - if (optProvider.isPresent()) - { + if (optProvider.isPresent()) { provider = optProvider.get(); - if (!Objects.equals(validatedAuthenticationInfo, provider.getAuthenticationInfo()) || - !Objects.equals(validateAddress, provider.getAddress())) - { // authentication info or provider has changed - provider.setAuthenticationInfo(validatedAuthenticationInfo); + if (!Objects.equals(authenticationInfo, provider.getAuthenticationInfo()) || + !Objects.equals(validateAddress, provider.getAddress())) { // authentication info or provider has changed + provider.setAuthenticationInfo(authenticationInfo); provider.setAddress(validateAddress); provider = deviceRepository.saveAndFlush(provider); } } - else - { - provider = createDevice(validateName, validateAddress, validatedMacAddress, validatedAuthenticationInfo); + else { + provider = createDevice(validateName, validateAddress, validatedMacAddress, authenticationInfo); } return provider; } //------------------------------------------------------------------------------------------------- - private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) - { + private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) { logger.debug("validateNonNullSystemParameters started..."); - validateNonNullParameters(systemName, address); - - if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) - { + if (Utilities.isEmpty(systemName)) { + throw new InvalidParameterException("Name is null or empty"); + } + if (Utilities.isEmpty(address)) { + throw new InvalidParameterException("Address is null or empty"); + } + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); } @@ -811,41 +688,32 @@ private System validateNonNullSystemParameters(final String systemName, final St } //------------------------------------------------------------------------------------------------- - private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) - { + private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) { logger.debug("checkConstraintsOfSystemTable started..."); - try - { + try { final Optional find = systemRepository .findBySystemNameAndAddressAndPort(validatedSystemName.toLowerCase().trim(), validatedAddress.toLowerCase().trim(), validatedPort); - if (find.isPresent()) - { + if (find.isPresent()) { throw new InvalidParameterException( "System with name: " + validatedSystemName + ", address: " + validatedAddress + ", port: " + validatedPort + " already exists."); } - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private Device createDevice(final String name, final String address, final String macAddress, final String authenticationInfo) - { - final Device device = new Device(name, address, macAddress, authenticationInfo); - return deviceRepository.save(device); + private Device createDevice(final String name, final String address, final String macAddress, final String authenticationInfo) { + final Device device = validateNonNullDeviceParameters(name, address, macAddress, authenticationInfo); + return deviceRepository.saveAndFlush(device); } //------------------------------------------------------------------------------------------------- - private void checkDeviceRegistryRequest(final DeviceRegistryRequestDTO request) - { + private void checkDeviceRegistryRequest(final DeviceRegistryRequestDTO request) { logger.debug("checkDeviceRegistryRequest started..."); Assert.notNull(request, "Request is null."); @@ -855,35 +723,27 @@ private void checkDeviceRegistryRequest(final DeviceRegistryRequestDTO request) } //------------------------------------------------------------------------------------------------- - private void checkConstraintsOfDeviceRegistryTable(final Device deviceDb) - { + private void checkConstraintsOfDeviceRegistryTable(final Device deviceDb) { logger.debug("checkConstraintOfDeviceRegistryTable started..."); - try - { + try { final Optional find = deviceRegistryRepository.findByDevice(deviceDb); - if (find.isPresent()) - { + if (find.isPresent()) { throw new InvalidParameterException("System Registry entry with provider: (" + deviceDb.getDeviceName() + ", " + deviceDb.getMacAddress() + ") already exists."); } - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private Device mergeDevice(final DeviceRequestDTO request, final Device device) - { + private Device mergeDevice(final DeviceRequestDTO request, final Device device) { final String name = Utilities.firstNotNullIfExists(request.getDeviceName(), device.getDeviceName()); final String address = Utilities.firstNotNullIfExists(request.getAddress(), device.getAddress()); final String macAddress = Utilities.firstNotNullIfExists(request.getDeviceName(), device.getDeviceName()); @@ -892,26 +752,21 @@ private Device mergeDevice(final DeviceRequestDTO request, final Device device) } //------------------------------------------------------------------------------------------------- - private DeviceRegistry createDeviceRegistry(final Device deviceDb, final ZonedDateTime endOfValidity, final String metadataStr, final int version) - { + private DeviceRegistry createDeviceRegistry(final Device deviceDb, final ZonedDateTime endOfValidity, final String metadataStr, final int version) { logger.debug("createDeviceRegistry started..."); checkConstraintsOfDeviceRegistryTable(deviceDb); - try - { + try { return deviceRegistryRepository.saveAndFlush(new DeviceRegistry(deviceDb, endOfValidity, metadataStr, version)); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private boolean checkDeviceRegistryIfUniqueValidationNeeded(final DeviceRegistry drEntry, final Device device) - { + private boolean checkDeviceRegistryIfUniqueValidationNeeded(final DeviceRegistry drEntry, final Device device) { logger.debug("checkDeviceRegistryIfUniqueValidationNeeded started..."); return drEntry.getDevice().getId() != device.getId(); @@ -920,14 +775,12 @@ private boolean checkDeviceRegistryIfUniqueValidationNeeded(final DeviceRegistry //------------------------------------------------------------------------------------------------- private DeviceRegistry updateDeviceRegistry(final DeviceRegistry drEntry, final Device device, - final ZonedDateTime endOfValidity, final String metadataStr, final int version) - { + final ZonedDateTime endOfValidity, final String metadataStr, final int version) { logger.debug("updateDeviceRegistry started..."); Assert.notNull(drEntry, "DeviceRegistry Entry is not specified."); Assert.notNull(device, "Device is not specified."); - if (checkDeviceRegistryIfUniqueValidationNeeded(drEntry, device)) - { + if (checkDeviceRegistryIfUniqueValidationNeeded(drEntry, device)) { checkConstraintsOfDeviceRegistryTable(device); } @@ -935,32 +788,26 @@ private DeviceRegistry updateDeviceRegistry(final DeviceRegistry drEntry, final } //------------------------------------------------------------------------------------------------- - private ZonedDateTime getZonedDateTime(DeviceRegistryRequestDTO request) - { + private ZonedDateTime getZonedDateTime(DeviceRegistryRequestDTO request) { return Utilities.isEmpty(request.getEndOfValidity()) ? null : Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()); } //------------------------------------------------------------------------------------------------- private DeviceRegistry setModifiedValuesOfDeviceRegistryEntryFields(final DeviceRegistry drEntry, final Device device, - final ZonedDateTime endOfValidity, final String metadataStr, final int version) - { + final ZonedDateTime endOfValidity, final String metadataStr, final int version) { logger.debug("setModifiedValuesOfDeviceRegistryEntryFields started..."); - try - { + try { drEntry.setDevice(device); drEntry.setEndOfValidity(endOfValidity); drEntry.setMetadata(metadataStr); drEntry.setVersion(version); return deviceRegistryRepository.saveAndFlush(drEntry); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } - } diff --git a/deviceregistry/src/main/resources/application.properties b/deviceregistry/src/main/resources/application.properties index 72f120e1c..a3896236e 100644 --- a/deviceregistry/src/main/resources/application.properties +++ b/deviceregistry/src/main/resources/application.properties @@ -11,13 +11,13 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect # use true only for debugging -spring.jpa.show-sql=false +spring.jpa.show-sql=false spring.jpa.properties.hibernate.format_sql=true spring.jpa.hibernate.ddl-auto=none -# Service Registry web-server parameters +# Device Registry web-server parameters server.address=0.0.0.0 -server.port=8443 +server.port=8439 domain.name=127.0.0.1 domain.port=8439 @@ -31,26 +31,6 @@ core_system_name=DEVICE_REGISTRY # Show all request/response in debug log log_all_request_and_response=false -# Service Registry has an optional feature to ping service providers in a fixed time interval, -# and remove service offerings where the service provider was not available -# use this feature (true/false) -ping_scheduled=false -# how much time the Service Registry should wait for the ping response (in milliseconds) -ping_timeout=5000 -# how frequently should the ping happen, in minutes -ping_interval=60 - -# Service Registry has an optional feature to automatically remove service offerings, where the endOfValidity -# timestamp field is in the past, meaning the offering expired -# use this feature (true/false) -ttl_scheduled=false -# how frequently the database should be checked for expired services, in minutes -ttl_interval=10 - -# Interface names has to follow this format --, where security can be SECURE or INSECURE and protocol and format must be a sequence of letters, numbers and underscore. -# A regexp checker will verify that. If this setting is set to true then the PROTOCOL and FORMAT must come from a predefined set. -use_strict_service_intf_name_verifier=false - ############################################ ### SECURE MODE ### ############################################ @@ -61,9 +41,9 @@ use_strict_service_intf_name_verifier=false server.ssl.enabled=true server.ssl.key-store-type=PKCS12 -server.ssl.key-store=classpath:certificates/onboarding.p12 +server.ssl.key-store=classpath:certificates/device_registry.p12 server.ssl.key-store-password=123456 -server.ssl.key-alias=onboarding +server.ssl.key-alias=device_registry server.ssl.key-password=123456 server.ssl.client-auth=need server.ssl.trust-store-type=PKCS12 diff --git a/deviceregistry/src/main/resources/certificates/sysop.crt b/deviceregistry/src/main/resources/certificates/sysop.crt deleted file mode 100644 index 56eae293d..000000000 --- a/deviceregistry/src/main/resources/certificates/sysop.crt +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDLzCCAhegAwIBAgIEXPYrATANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB10 -ZXN0Y2xvdWQyLmFpdGlhLmFycm93aGVhZC5ldTAeFw0xOTA2MDQwODI1MzdaFw0y -MDA2MDMwODI1MzdaMC4xLDAqBgNVBAMMI3N5c29wLnRlc3RjbG91ZDIuYWl0aWEu -YXJyb3doZWFkLmV1MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoCoC -WTjB+UIi8WC8+mynAwDpC74ddxCFRt1ugnTSaW2HGJY57mZRmft/APhy7C+HyXyz -j77K6TCkr9jXxAykrkGhybdJ3ITNulolZImH2Vz8WHbmcvcKotdOvVexNou72LKi -RMrboIxIRJPtTta7RbhmVyIrTVElAVDWFjZHP7K98AhoGa3ADp0xbh0qK1BpuCnP -Km64DbY52zwr58mSaeyL7MgE+dWwWHx9r4X/WI7/2qQIio8DTvx36PHGKurtwpxa -V0o+gQ+Q1YcD1mfSHp3xtYQAnZXRLIjaDd7LGWMG7j3HbqukkjThyKrUCKfrKXQF -ItBUJ58PJJq8sTxoLwIDAQABo1swWTAPBgNVHREECDAGhwR/AAABMCcGA1UdIwQg -MB6AFAQwTQgjkz3eZj0WWqfRyV4jppdPoQCCBFzZYhkwHQYDVR0OBBYEFAVG6MVZ -FFyHQXW6qlQWA4EfXWSIMA0GCSqGSIb3DQEBCwUAA4IBAQBUEExzkf2bH4fF/tyP -r7DxO94aqQOySGJq/25DzfZQOpuK5Ud3MPpXSlxYw+MB5rRDJu0NzGUX+ha4mG3T -dXxd3X2QaDFR0SYUD4J0hTtmYp9TzgCXnU+J7t6sku/LYFJrCl5m4o124ShZXBgR -Dj/gDVd4C6InTPhpIPHaD6D97wKyObbC3V1dGiVs5Z5/+wUJdUFUmnfAb1rbX0nV -0TTKluWTtRT4cjBeIFs7MZiThMx8bgSE4mZIC1ry4PikjAap/oEIQVxbBTbl+5q8 -xhPbPn+JhZwQp39a1oPMEQog0wQhtKvZrYx//H1o3mzRo1ZFzL+R/LCKKElMPMXx -UHKC ------END CERTIFICATE----- diff --git a/deviceregistry/src/main/resources/certificates/sysop.p12 b/deviceregistry/src/main/resources/certificates/sysop.p12 deleted file mode 100644 index 5cb50c7cf666210d8dfdd437622a9638ae9e93aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6109 zcmY+GRZtuNjE32T#oeJufdW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E6>^3D`bE7iZrlr}sDpq*;NKnp!DECJ&KtD)2(XvWx`c3B`4$>& z%SU6 zJiZnw{z5QmF6ojgOdnk2DErRkWWmM;=5n&z=zRk_Q0Q4XD;l#JhNqR%bxZjhxJPtI z36ou*Nq=O{QIq#UJN!|zEKFatv|CGXqgU7TyCI7)XVThHA{U+qE>~OeXF1Ay5T(Hcuye(&51q;po80Ev{&yd%Bwu3OB}&;< z$rQAN%=Tp`V@;3 zBqAJmRE9!pSJac5om9t3O)DqH)2w5ZjcQ%C>v~dVV*2tCta{oVw`3f@wx3hP1@~eb z>2Wz?ct@Dv+LNPG1$qW`;}2STe=FBTh<@q-Z0YC~`PLrtr>1tM?3y`?HPDi0_oUE1Ob&RZT6IOCdQ5;R4MLZ3&<85$&ZYlfyY1ebsoI%?wY=}u1qxXBAy7Rex|&xE0w z3P3rqpj>9qzZ6KdTB}kt#o$QTDx0v@JE!r6FscPrHQ!j{&yB)7H1@8ED5JXwivQvD zZAhU>sGDvUK(8(%u+d)w4;iAqXurr*|Lx_lC9)to=&@uF!2m8Q6uABFUTH3+XO_;s z8O5Smmmlutf_q)tBj6V)Rchj!7%(HJc$LXc{;B3+BS$qaV{JAzY%h+!(-T|jmU02M zN_|Vi(?`XgEhp#BgTwQDlkJ)72~J4O*Blv6TzGZJ}mya0$t`{Lp$Th6Rq_V5?K+PkH@oQeQ&tX`MS7HBcIx2N|=MbrrRx13N z0GHY&;#rnDd?LWc!+?}+hzVxFfmv1!trrDvM2nlTbXzE!EBloUPio*WtD5f~^w*zS zVWzW*uu-w0AcB}M;en(eI0XCyI!!Qz%$cR#V6!wiAb}cd`CBgnzLm~p4GwyhWsCa` SIE2BK - Service Registry + Device Registry diff --git a/onboarding/src/deb/control/config b/onboarding/src/deb/control/config index bee242d71..44fd37679 100644 --- a/onboarding/src/deb/control/config +++ b/onboarding/src/deb/control/config @@ -12,7 +12,7 @@ fi # Get installation type db_input high arrowhead-core-common/db_host || true -db_input high arrowhead-core-common/mysql_password_sr || true +db_input high arrowhead-core-common/mysql_password_onboarding || true # Run dialogs db_go || true diff --git a/onboarding/src/deb/control/postinst b/onboarding/src/deb/control/postinst index e30330ce5..8437b973e 100644 --- a/onboarding/src/deb/control/postinst +++ b/onboarding/src/deb/control/postinst @@ -26,42 +26,36 @@ case "$1" in configure) dos2unix -q /etc/systemd/system/${PKG_NAME}.service - . /usr/share/arrowhead/conf/ahconf.sh - - SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" + . /usr/share/arrowhead/conf/ahconf.sh + + SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" - db_get arrowhead-core-common/mysql_password_sr; system_passwd=$RET || true - db_unregister arrowhead-core-common/mysql_password_sr + db_get arrowhead-core-common/mysql_password_onboarding; system_passwd=$RET || true + db_unregister arrowhead-core-common/mysql_password_onboarding # Generate password (if required) if [ -z "${system_passwd}" ]; then system_passwd="$(openssl rand -base64 12)" fi - echo "Configuring MySQL database..." >&2 - ah_db_tables_and_user ${SYSTEM_NAME} ${SYSTEM_NAME}_privileges.sql ${system_passwd} + echo "Configuring MySQL database..." >&2 + ah_db_tables_and_user ${SYSTEM_NAME} ${SYSTEM_NAME}_privileges.sql ${system_passwd} - if [ ! -d "${SYSTEM_DIR}" ]; then - mkdir -p ${SYSTEM_DIR} - fi + if [ ! -d "${SYSTEM_DIR}" ]; then + mkdir -p ${SYSTEM_DIR} + fi domain_name=${AH_DOMAIN_NAME} if [ -z ${domain_name} ]; then domain_name=${OWN_IP} fi - ah_cert_signed_system ${SYSTEM_NAME} - - if [ ! -d "${AH_SYSTEMS_DIR}/sysop" ]; then - mkdir -p ${AH_SYSTEMS_DIR}/sysop - fi - - ah_cert_signed_system sysop + ah_cert_signed_system ${SYSTEM_NAME} # modify log config and application.properties ah_transform_log_file ${SYSTEM_DIR} - + db_get arrowhead-core-common/db_host; db_host=$RET || true mv ${SYSTEM_DIR}/application.properties ${SYSTEM_DIR}/application.properties.orig @@ -79,10 +73,10 @@ case "$1" in chown arrowhead:arrowhead ${SYSTEM_DIR}/application.properties chmod 640 ${SYSTEM_DIR}/application.properties - echo "Starting ${PKG_NAME}..." >&2 - systemctl daemon-reload + echo "Starting ${PKG_NAME}..." >&2 + systemctl daemon-reload systemctl enable ${PKG_NAME}.service - systemctl start ${PKG_NAME}.service + systemctl start ${PKG_NAME}.service ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/onboarding/src/deb/control/postrm b/onboarding/src/deb/control/postrm index ad190c0dd..e692870d7 100644 --- a/onboarding/src/deb/control/postrm +++ b/onboarding/src/deb/control/postrm @@ -31,14 +31,14 @@ case "$1" in rm -f \ /var/log/arrowhead/${SYSTEM_NAME}*.log \ - ${SYSTEM_DIR}/log4j2.xml \ + ${SYSTEM_DIR}/log4j2.xml \ ${SYSTEM_DIR}/application.properties \ - ${SYSTEM_DIR}/${SYSTEM_NAME}.p12 \ - ${AH_SYSTEMS_DIR}/sysop/sysop.p12 + ${SYSTEM_DIR}/${SYSTEM_NAME}.p12 rmdir ${SYSTEM_DIR} 2>/dev/null || true - rmdir ${AH_SYSTEMS_DIR}/sysop 2>/dev/null || true + rmdir ${AH_SYSTEMS_DIR}/sysop 2>/dev/null || true db_purge ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; diff --git a/onboarding/src/deb/control/prerm b/onboarding/src/deb/control/prerm index 1cc84becd..e9a9717a6 100644 --- a/onboarding/src/deb/control/prerm +++ b/onboarding/src/deb/control/prerm @@ -21,8 +21,8 @@ PKG_NAME="arrowhead-onboarding" case "$1" in remove) - systemctl stop ${PKG_NAME}.service - systemctl disable ${PKG_NAME}.service + systemctl stop ${PKG_NAME}.service + systemctl disable ${PKG_NAME}.service ;; upgrade|deconfigure) diff --git a/onboarding/src/main/resources/application.properties b/onboarding/src/main/resources/application.properties index 09bfa2c0d..12aa15118 100644 --- a/onboarding/src/main/resources/application.properties +++ b/onboarding/src/main/resources/application.properties @@ -6,7 +6,7 @@ # Change the server timezone if necessary spring.datasource.url=jdbc:mysql://127.0.0.1:3306/arrowhead?serverTimezone=Europe/Budapest spring.datasource.username=onboarding -spring.datasource.password=ZzNNpxrbZGVvfJ8 +spring.datasource.password=JKgh1as5f6oi7aV spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect @@ -15,9 +15,9 @@ spring.jpa.show-sql=false spring.jpa.properties.hibernate.format_sql=true spring.jpa.hibernate.ddl-auto=none -# Service Registry web-server parameters +# Onboarding Controller web-server parameters server.address=0.0.0.0 -server.port=8443 +server.port=8435 domain.name=127.0.0.1 domain.port=8435 @@ -31,26 +31,6 @@ core_system_name=ONBOARDING_CONTROLLER # Show all request/response in debug log log_all_request_and_response=false -# Service Registry has an optional feature to ping service providers in a fixed time interval, -# and remove service offerings where the service provider was not available -# use this feature (true/false) -ping_scheduled=false -# how much time the Service Registry should wait for the ping response (in milliseconds) -ping_timeout=5000 -# how frequently should the ping happen, in minutes -ping_interval=60 - -# Service Registry has an optional feature to automatically remove service offerings, where the endOfValidity -# timestamp field is in the past, meaning the offering expired -# use this feature (true/false) -ttl_scheduled=false -# how frequently the database should be checked for expired services, in minutes -ttl_interval=10 - -# Interface names has to follow this format --, where security can be SECURE or INSECURE and protocol and format must be a sequence of letters, numbers and underscore. -# A regexp checker will verify that. If this setting is set to true then the PROTOCOL and FORMAT must come from a predefined set. -use_strict_service_intf_name_verifier=false - ############################################ ### SECURE MODE ### ############################################ diff --git a/onboarding/src/main/resources/certificates/sysop.crt b/onboarding/src/main/resources/certificates/sysop.crt deleted file mode 100644 index 56eae293d..000000000 --- a/onboarding/src/main/resources/certificates/sysop.crt +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDLzCCAhegAwIBAgIEXPYrATANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB10 -ZXN0Y2xvdWQyLmFpdGlhLmFycm93aGVhZC5ldTAeFw0xOTA2MDQwODI1MzdaFw0y -MDA2MDMwODI1MzdaMC4xLDAqBgNVBAMMI3N5c29wLnRlc3RjbG91ZDIuYWl0aWEu -YXJyb3doZWFkLmV1MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoCoC -WTjB+UIi8WC8+mynAwDpC74ddxCFRt1ugnTSaW2HGJY57mZRmft/APhy7C+HyXyz -j77K6TCkr9jXxAykrkGhybdJ3ITNulolZImH2Vz8WHbmcvcKotdOvVexNou72LKi -RMrboIxIRJPtTta7RbhmVyIrTVElAVDWFjZHP7K98AhoGa3ADp0xbh0qK1BpuCnP -Km64DbY52zwr58mSaeyL7MgE+dWwWHx9r4X/WI7/2qQIio8DTvx36PHGKurtwpxa -V0o+gQ+Q1YcD1mfSHp3xtYQAnZXRLIjaDd7LGWMG7j3HbqukkjThyKrUCKfrKXQF -ItBUJ58PJJq8sTxoLwIDAQABo1swWTAPBgNVHREECDAGhwR/AAABMCcGA1UdIwQg -MB6AFAQwTQgjkz3eZj0WWqfRyV4jppdPoQCCBFzZYhkwHQYDVR0OBBYEFAVG6MVZ -FFyHQXW6qlQWA4EfXWSIMA0GCSqGSIb3DQEBCwUAA4IBAQBUEExzkf2bH4fF/tyP -r7DxO94aqQOySGJq/25DzfZQOpuK5Ud3MPpXSlxYw+MB5rRDJu0NzGUX+ha4mG3T -dXxd3X2QaDFR0SYUD4J0hTtmYp9TzgCXnU+J7t6sku/LYFJrCl5m4o124ShZXBgR -Dj/gDVd4C6InTPhpIPHaD6D97wKyObbC3V1dGiVs5Z5/+wUJdUFUmnfAb1rbX0nV -0TTKluWTtRT4cjBeIFs7MZiThMx8bgSE4mZIC1ry4PikjAap/oEIQVxbBTbl+5q8 -xhPbPn+JhZwQp39a1oPMEQog0wQhtKvZrYx//H1o3mzRo1ZFzL+R/LCKKElMPMXx -UHKC ------END CERTIFICATE----- diff --git a/onboarding/src/main/resources/certificates/sysop.p12 b/onboarding/src/main/resources/certificates/sysop.p12 deleted file mode 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1696f460..304932f1b 100644 --- a/scripts/create_empty_arrowhead_db.sql +++ b/scripts/create_empty_arrowhead_db.sql @@ -17,11 +17,16 @@ CREATE USER IF NOT EXISTS 'system_registry'@'localhost' IDENTIFIED BY 'Kh12Hhgax CREATE USER IF NOT EXISTS 'system_registry'@'%' IDENTIFIED BY 'Kh12Hhgaxzo7haf'; source system_registry_privileges.sql --- Deviec Registry +-- Device Registry CREATE USER IF NOT EXISTS 'device_registry'@'localhost' IDENTIFIED BY 'iooHU87hNGUalht'; CREATE USER IF NOT EXISTS 'device_registry'@'%' IDENTIFIED BY 'iooHU87hNGUalht'; source device_registry_privileges.sql +-- Onboarding controller +CREATE USER IF NOT EXISTS 'onboarding'@'localhost' IDENTIFIED BY 'JKgh1as5f6oi7aV'; +CREATE USER IF NOT EXISTS 'onboarding'@'%' IDENTIFIED BY 'JKgh1as5f6oi7aV'; +source onboarding_privileges.sql + -- Authorization CREATE USER IF NOT EXISTS 'authorization'@'localhost' IDENTIFIED BY 'hqZFUkuHxhekio3'; CREATE USER IF NOT EXISTS 'authorization'@'%' IDENTIFIED BY 'hqZFUkuHxhekio3'; diff --git a/scripts/onboarding_controller_privileges.sql b/scripts/onboarding_controller_privileges.sql index 4f20d66ba..919153f77 100644 --- a/scripts/onboarding_controller_privileges.sql +++ b/scripts/onboarding_controller_privileges.sql @@ -1,2 +1,8 @@ USE `arrowhead`; -## intentionally empty \ No newline at end of file +REVOKE ALL, GRANT OPTION FROM 'onboarding'@'localhost'; + +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'onboarding'@'localhost'; +REVOKE ALL, GRANT OPTION FROM 'onboarding'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'onboarding'@'%'; + +FLUSH PRIVILEGES; \ No newline at end of file diff --git a/systemregistry/src/deb/control/config b/systemregistry/src/deb/control/config index bee242d71..dafa23d7a 100644 --- a/systemregistry/src/deb/control/config +++ b/systemregistry/src/deb/control/config @@ -12,7 +12,7 @@ fi # Get installation type db_input high arrowhead-core-common/db_host || true -db_input high arrowhead-core-common/mysql_password_sr || true +db_input high arrowhead-core-common/mysql_password_sysr || true # Run dialogs db_go || true diff --git a/systemregistry/src/deb/control/postinst b/systemregistry/src/deb/control/postinst index 53b1e3334..c2ed57b68 100644 --- a/systemregistry/src/deb/control/postinst +++ b/systemregistry/src/deb/control/postinst @@ -26,37 +26,31 @@ case "$1" in configure) dos2unix -q /etc/systemd/system/${PKG_NAME}.service - . /usr/share/arrowhead/conf/ahconf.sh - - SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" + . /usr/share/arrowhead/conf/ahconf.sh + + SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" - db_get arrowhead-core-common/mysql_password_sr; system_passwd=$RET || true - db_unregister arrowhead-core-common/mysql_password_sr + db_get arrowhead-core-common/mysql_password_sysr; system_passwd=$RET || true + db_unregister arrowhead-core-common/mysql_password_sysr # Generate password (if required) if [ -z "${system_passwd}" ]; then system_passwd="$(openssl rand -base64 12)" fi - echo "Configuring MySQL database..." >&2 - ah_db_tables_and_user ${SYSTEM_NAME} ${SYSTEM_NAME}_privileges.sql ${system_passwd} + echo "Configuring MySQL database..." >&2 + ah_db_tables_and_user ${SYSTEM_NAME} ${SYSTEM_NAME}_privileges.sql ${system_passwd} - if [ ! -d "${SYSTEM_DIR}" ]; then - mkdir -p ${SYSTEM_DIR} - fi + if [ ! -d "${SYSTEM_DIR}" ]; then + mkdir -p ${SYSTEM_DIR} + fi domain_name=${AH_DOMAIN_NAME} if [ -z ${domain_name} ]; then domain_name=${OWN_IP} fi - ah_cert_signed_system ${SYSTEM_NAME} - - if [ ! -d "${AH_SYSTEMS_DIR}/sysop" ]; then - mkdir -p ${AH_SYSTEMS_DIR}/sysop - fi - - ah_cert_signed_system sysop + ah_cert_signed_system ${SYSTEM_NAME} # modify log config and application.properties @@ -79,10 +73,10 @@ case "$1" in chown arrowhead:arrowhead ${SYSTEM_DIR}/application.properties chmod 640 ${SYSTEM_DIR}/application.properties - echo "Starting ${PKG_NAME}..." >&2 - systemctl daemon-reload + echo "Starting ${PKG_NAME}..." >&2 + systemctl daemon-reload systemctl enable ${PKG_NAME}.service - systemctl start ${PKG_NAME}.service + systemctl start ${PKG_NAME}.service ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/systemregistry/src/deb/control/postrm b/systemregistry/src/deb/control/postrm index a9e24370e..d314adc04 100644 --- a/systemregistry/src/deb/control/postrm +++ b/systemregistry/src/deb/control/postrm @@ -30,15 +30,15 @@ case "$1" in SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" rm -f \ - /var/log/arrowhead/${SYSTEM_NAME}*.log \ - ${SYSTEM_DIR}/log4j2.xml \ - ${SYSTEM_DIR}/application.properties \ - ${SYSTEM_DIR}/${SYSTEM_NAME}.p12 \ - ${AH_SYSTEMS_DIR}/sysop/sysop.p12 - rmdir ${SYSTEM_DIR} 2>/dev/null || true - rmdir ${AH_SYSTEMS_DIR}/sysop 2>/dev/null || true + /var/log/arrowhead/${SYSTEM_NAME}*.log \ + ${SYSTEM_DIR}/log4j2.xml \ + ${SYSTEM_DIR}/application.properties \ + ${SYSTEM_DIR}/${SYSTEM_NAME}.p12 + rmdir ${SYSTEM_DIR} 2>/dev/null || true + rmdir ${AH_SYSTEMS_DIR}/sysop 2>/dev/null || true db_purge ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java index 9ded3fab9..2c959b7ab 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java @@ -160,7 +160,6 @@ public System updateSystem(final long systemId, final String systemName, final S } final String validatedAddress = validateParamString(address); - try { final Optional systemOptional = systemRepository.findById(validatedSystemId); @@ -1085,7 +1084,6 @@ private System findOrCreateSystem(final String name, final String address, final final String validatedName = Utilities.lowerCaseTrim(name); final String validatedAddress = Utilities.lowerCaseTrim(address); - final String validatedAuthenticationInfo = Utilities.lowerCaseTrim(authenticationInfo); final Optional optSystem = systemRepository.findBySystemNameAndAddressAndPort(validatedName, validatedAddress, port); System provider; @@ -1093,17 +1091,17 @@ private System findOrCreateSystem(final String name, final String address, final if (optSystem.isPresent()) { provider = optSystem.get(); - if (!Objects.equals(validatedAuthenticationInfo, provider.getAuthenticationInfo()) || + if (!Objects.equals(authenticationInfo, provider.getAuthenticationInfo()) || !Objects.equals(validatedAddress, provider.getAddress())) { // authentication info or system has changed - provider.setAuthenticationInfo(validatedAuthenticationInfo); + provider.setAuthenticationInfo(authenticationInfo); provider.setAddress(validatedAddress); provider = systemRepository.saveAndFlush(provider); } } else { - provider = createSystem(validatedName, validatedAddress, port, validatedAuthenticationInfo); + provider = createSystem(validatedName, validatedAddress, port, authenticationInfo); } return provider; } @@ -1124,7 +1122,6 @@ private Device findOrCreateDevice(String deviceName, String address, String macA final String validateName = Utilities.lowerCaseTrim(deviceName); final String validateAddress = Utilities.lowerCaseTrim(address); final String validatedMacAddress = Utilities.lowerCaseTrim(macAddress); - final String validatedAuthenticationInfo = Utilities.lowerCaseTrim(authenticationInfo); final Optional optProvider = deviceRepository.findByDeviceNameAndMacAddress(validateName, validatedMacAddress); Device provider; @@ -1132,17 +1129,17 @@ private Device findOrCreateDevice(String deviceName, String address, String macA if (optProvider.isPresent()) { provider = optProvider.get(); - if (!Objects.equals(validatedAuthenticationInfo, provider.getAuthenticationInfo()) || + if (!Objects.equals(authenticationInfo, provider.getAuthenticationInfo()) || !Objects.equals(validateAddress, provider.getAddress())) { // authentication info or provider has changed - provider.setAuthenticationInfo(validatedAuthenticationInfo); + provider.setAuthenticationInfo(authenticationInfo); provider.setAddress(validateAddress); provider = deviceRepository.saveAndFlush(provider); } } else { - provider = createDevice(validateName, validateAddress, validatedMacAddress, validatedAuthenticationInfo); + provider = createDevice(validateName, validateAddress, validatedMacAddress, authenticationInfo); } return provider; } @@ -1151,7 +1148,7 @@ private Device findOrCreateDevice(String deviceName, String address, String macA private Device createDevice(final String name, final String address, final String macAddress, final String authenticationInfo) { final Device device = new Device(name, address, macAddress, authenticationInfo); - return deviceRepository.save(device); + return deviceRepository.saveAndFlush(device); } //------------------------------------------------------------------------------------------------- diff --git a/systemregistry/src/main/resources/application.properties b/systemregistry/src/main/resources/application.properties index cb017f79c..d6dbbd769 100644 --- a/systemregistry/src/main/resources/application.properties +++ b/systemregistry/src/main/resources/application.properties @@ -15,9 +15,9 @@ spring.jpa.show-sql=false spring.jpa.properties.hibernate.format_sql=true spring.jpa.hibernate.ddl-auto=none -# Service Registry web-server parameters +# System Registry web-server parameters server.address=0.0.0.0 -server.port=8443 +server.port=8437 domain.name=127.0.0.1 domain.port=8437 @@ -31,26 +31,15 @@ core_system_name=SYSTEM_REGISTRY # Show all request/response in debug log log_all_request_and_response=false -# Service Registry has an optional feature to ping service providers in a fixed time interval, +# System Registry has an optional feature to ping service providers in a fixed time interval, # and remove service offerings where the service provider was not available # use this feature (true/false) ping_scheduled=false -# how much time the Service Registry should wait for the ping response (in milliseconds) +# how much time the System Registry should wait for the ping response (in milliseconds) ping_timeout=5000 # how frequently should the ping happen, in minutes ping_interval=60 -# Service Registry has an optional feature to automatically remove service offerings, where the endOfValidity -# timestamp field is in the past, meaning the offering expired -# use this feature (true/false) -ttl_scheduled=false -# how frequently the database should be checked for expired services, in minutes -ttl_interval=10 - -# Interface names has to follow this format --, where security can be SECURE or INSECURE and protocol and format must be a sequence of letters, numbers and underscore. -# A regexp checker will verify that. If this setting is set to true then the PROTOCOL and FORMAT must come from a predefined set. -use_strict_service_intf_name_verifier=false - ############################################ ### SECURE MODE ### ############################################ diff --git a/systemregistry/src/main/resources/certificates/sysop.crt b/systemregistry/src/main/resources/certificates/sysop.crt deleted file mode 100644 index 56eae293d..000000000 --- a/systemregistry/src/main/resources/certificates/sysop.crt +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDLzCCAhegAwIBAgIEXPYrATANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB10 -ZXN0Y2xvdWQyLmFpdGlhLmFycm93aGVhZC5ldTAeFw0xOTA2MDQwODI1MzdaFw0y -MDA2MDMwODI1MzdaMC4xLDAqBgNVBAMMI3N5c29wLnRlc3RjbG91ZDIuYWl0aWEu -YXJyb3doZWFkLmV1MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoCoC -WTjB+UIi8WC8+mynAwDpC74ddxCFRt1ugnTSaW2HGJY57mZRmft/APhy7C+HyXyz -j77K6TCkr9jXxAykrkGhybdJ3ITNulolZImH2Vz8WHbmcvcKotdOvVexNou72LKi -RMrboIxIRJPtTta7RbhmVyIrTVElAVDWFjZHP7K98AhoGa3ADp0xbh0qK1BpuCnP -Km64DbY52zwr58mSaeyL7MgE+dWwWHx9r4X/WI7/2qQIio8DTvx36PHGKurtwpxa -V0o+gQ+Q1YcD1mfSHp3xtYQAnZXRLIjaDd7LGWMG7j3HbqukkjThyKrUCKfrKXQF -ItBUJ58PJJq8sTxoLwIDAQABo1swWTAPBgNVHREECDAGhwR/AAABMCcGA1UdIwQg -MB6AFAQwTQgjkz3eZj0WWqfRyV4jppdPoQCCBFzZYhkwHQYDVR0OBBYEFAVG6MVZ -FFyHQXW6qlQWA4EfXWSIMA0GCSqGSIb3DQEBCwUAA4IBAQBUEExzkf2bH4fF/tyP -r7DxO94aqQOySGJq/25DzfZQOpuK5Ud3MPpXSlxYw+MB5rRDJu0NzGUX+ha4mG3T -dXxd3X2QaDFR0SYUD4J0hTtmYp9TzgCXnU+J7t6sku/LYFJrCl5m4o124ShZXBgR -Dj/gDVd4C6InTPhpIPHaD6D97wKyObbC3V1dGiVs5Z5/+wUJdUFUmnfAb1rbX0nV -0TTKluWTtRT4cjBeIFs7MZiThMx8bgSE4mZIC1ry4PikjAap/oEIQVxbBTbl+5q8 -xhPbPn+JhZwQp39a1oPMEQog0wQhtKvZrYx//H1o3mzRo1ZFzL+R/LCKKElMPMXx -UHKC ------END CERTIFICATE----- diff --git a/systemregistry/src/main/resources/certificates/sysop.p12 b/systemregistry/src/main/resources/certificates/sysop.p12 deleted file mode 100644 index 5cb50c7cf666210d8dfdd437622a9638ae9e93aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6109 zcmY+GRZtuNjE32T#oeJufdWN}ySuZvySrQQ#oc9bmqPKP#ocvrC|aaA6p9tN-p$F} zLnbr-pX4DAU&0njv<3vgvxO3+BBC%x%0=E|0FVGhp+sQ_p+v#|WPi3$kj?+IK)MK_ zAkBZW>c3DzMEmb9bW{MaC=}tDEfnFNjR6t$f8>9|-yz`dcF~IsbIq@@U4vNX`lbs^ z>2r2~@Nk2w2%!jL?^y}Bze_N-cP5Vb%?XVYZwG@yo_S~Vj*dT~1J_WmEajOZgjI|d zhIvV67tdB^0*gSD#pW|UUuCIX+qavFhvRIi82z;t1^bIK&}hUk-B6xcKb>>}Y4on5 zB%=J5}CrfvBOqoM7Qgo^8p2I9jtl<@YdCE_6L6C=00&#T?&=ym6x>J7)(N~&E)Xf>b!h*W)R9x1A_Nrr^USdn^KhsuGC9&+{*0jPb~c(!lkP zKh&AV)U;I$^7QSk2eU=KJKl${_eu~nx=o8us0?FCbvNAVmbMJL1KA&O(RY~W;g;8Q zE<#vFkA$BL=G>>^#`}f* zck7nU`ug51t7=JKT4Lbbl$<{$z1{U5nCX+cD-CHSSu-6U`^H33=0rI$kB z)V3~GIW#LRXxSmkRqyvn1D}M+kUzJ2nr^2rJCmnUl?6EmYg&oj-5P(VU$)yoPtqaS zZxwRMXdM(bOg0DaKM7L|-!6=<(3sW+5G$_gT#V}|6kQ7SPVopSBQS^`ZS2IvbG{j1 zw)e-LO4Dnv*TUY?s&bKF8z)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MbrrRx13N z0GHY&;#rnDd?LWc!+?}+hzVxFfmv1!trrDvM2nlTbXzE!EBloUPio*WtD5f~^w*zS zVWzW*uu-w0AcB}M;en(eI0XCyI!!Qz%$cR#V6!wiAb}cd`CBgnzLm~p4GwyhWsCa` SIE2BK - Service Registry + System Registry From 303a2be43056263a5747e3c15e474b2ee3d16c7d Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Tue, 28 Jan 2020 01:29:36 +0100 Subject: [PATCH 041/301] fixed typo --- .../eu/arrowhead/core/eventhandler/EventHandlerController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/EventHandlerController.java b/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/EventHandlerController.java index 1fe8084a0..9cc679155 100644 --- a/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/EventHandlerController.java +++ b/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/EventHandlerController.java @@ -141,7 +141,8 @@ public String echoService() { final ValidatedPageParams validParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.EVENT_HANDLER_URI + EVENT_HANDLER_MGMT_URI); final SubscriptionListResponseDTO subscriptionsResponse = eventHandlerDBService.getSubscriptionsResponse(validParameters.getValidatedPage(), validParameters.getValidatedSize(), - validParameters.getValidatedDirection(), sortField); + validParameters.getValidatedDirection(), + sortField); logger.debug("Subscriptions with page: {} and item_per page: {} retrieved successfully", page, size); return subscriptionsResponse; From 0de10a6e558cff06e3a41202d24ebddeae02e309 Mon Sep 17 00:00:00 2001 From: mzsilak Date: Tue, 28 Jan 2020 10:50:09 +0100 Subject: [PATCH 042/301] implemented review changes --- .../service/DeviceRegistryDBService.java | 81 +-- ...itional-spring-configuration-metadata.json | 30 - ...itional-spring-configuration-metadata.json | 30 - .../service/ServiceRegistryDBService.java | 14 +- .../SystemRegistryController.java | 4 +- .../service/SystemRegistryDBService.java | 668 ++++++------------ ...itional-spring-configuration-metadata.json | 15 - 7 files changed, 278 insertions(+), 564 deletions(-) diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java index 30401265e..7e89def36 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java @@ -132,7 +132,7 @@ public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageP try { final Page devices = deviceRepository.findAll(PageRequest.of(pageParams.getValidatedPage(), pageParams.getValidatedSize(), - pageParams.getValidatedDirection(), validatedSortField)); + pageParams.getValidatedDirection(), validatedSortField)); return DTOConverter.convertDeviceEntryListToDeviceListResponseDTO(devices); } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); @@ -225,9 +225,9 @@ public DeviceRegistryListResponseDTO getDeviceRegistryEntries(final CoreUtilitie try { final PageRequest pageRequest = PageRequest.of(params.getValidatedPage(), - params.getValidatedSize(), - params.getValidatedDirection(), - validatedSortField); + params.getValidatedSize(), + params.getValidatedDirection(), + validatedSortField); final Page deviceRegistryPage = deviceRegistryRepository.findAll(pageRequest); return DTOConverter.convertDeviceRegistryListToDeviceRegistryListResponseDTO(deviceRegistryPage); } catch (final Exception ex) { @@ -252,9 +252,9 @@ public DeviceRegistryListResponseDTO getDeviceRegistryEntriesByDeviceName(final final List devices = deviceRepository.findByDeviceName(Utilities.lowerCaseTrim(deviceName)); final PageRequest pageRequest = PageRequest.of(params.getValidatedPage(), - params.getValidatedSize(), - params.getValidatedDirection(), - validatedSortField); + params.getValidatedSize(), + params.getValidatedDirection(), + validatedSortField); final Page deviceRegistryPage = deviceRegistryRepository.findAllByDeviceIsIn(devices, pageRequest); return DTOConverter.convertDeviceRegistryListToDeviceRegistryListResponseDTO(deviceRegistryPage); } catch (final Exception ex) { @@ -278,7 +278,7 @@ public void removeDeviceRegistryEntryById(final long id) { try { if (!deviceRegistryRepository.existsById(id)) { - throw new InvalidParameterException("Device Registry entry with id '" + id + "' does not exists"); + throw new InvalidParameterException("Device Registry entry with id '" + id + "' does not exist"); } deviceRegistryRepository.deleteById(id); @@ -332,7 +332,7 @@ public DeviceRegistryResponseDTO updateDeviceRegistryById(final long id, final D final DeviceRegistry updateDrEntry; final Optional drEntryOptional = deviceRegistryRepository.findById(id); - drEntry = drEntryOptional.orElseThrow(() -> new InvalidParameterException("Device Registry entry with id '" + id + "' not exists")); + drEntry = drEntryOptional.orElseThrow(() -> new InvalidParameterException("Device Registry entry with id '" + id + "' does not exist")); final Device deviceDb = findOrCreateDevice(request.getDevice()); @@ -367,7 +367,7 @@ public DeviceRegistryResponseDTO mergeDeviceRegistryById(final long id, final De final DeviceRegistry updateDrEntry; final Optional drEntryOptional = deviceRegistryRepository.findById(id); - drEntry = drEntryOptional.orElseThrow(() -> new InvalidParameterException("System Registry entry with id '" + id + "' not exists")); + drEntry = drEntryOptional.orElseThrow(() -> new InvalidParameterException("System Registry entry with id '" + id + "' does not exist")); final Device deviceDb = mergeDevice(request.getDevice(), drEntry.getDevice()); @@ -413,7 +413,7 @@ public void removeDeviceRegistryByNameAndMacAddress(final String deviceName, fin final DeviceRegistry deviceRegistry = optionalDeviceRegistry.orElseThrow( () -> new InvalidParameterException( "Device Registry entry for System with name '" + deviceName + - "' and MAC address '" + macAddress + "' does not exists")); + "' and MAC address '" + macAddress + "' does not exist")); deviceRegistryRepository.delete(deviceRegistry); deviceRegistryRepository.flush(); @@ -445,12 +445,10 @@ public DeviceQueryResultDTO queryRegistry(final DeviceQueryFormDTO form) { if (optionalDevice.isPresent()) { devices = new ArrayList<>(); devices.add(optionalDevice.get()); - } - else { + } else { return DTOConverter.convertDeviceRegistryListToDeviceQueryResultDTO(List.of()); } - } - else { + } else { devices = deviceRepository.findByDeviceName(deviceName); if (devices.isEmpty()) { @@ -471,8 +469,7 @@ public DeviceQueryResultDTO queryRegistry(final DeviceQueryFormDTO form) { // filter on version if (Objects.nonNull(form.getVersionRequirement())) { registryList.removeIf(e -> Objects.equals(form.getVersionRequirement(), e.getVersion())); - } - else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(form.getMaxVersionRequirement())) { + } else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(form.getMaxVersionRequirement())) { final int minVersion = form.getMinVersionRequirement() == null ? 1 : form.getMinVersionRequirement(); final int maxVersion = form.getMaxVersionRequirement() == null ? Integer.MAX_VALUE : form.getMaxVersionRequirement(); @@ -483,15 +480,15 @@ else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(for if (form.getMetadataRequirements() != null && !form.getMetadataRequirements().isEmpty()) { final Map requiredMetadata = normalizeMetadata(form.getMetadataRequirements()); registryList.removeIf(e -> - { - final Map metadata = Utilities.text2Map(e.getMetadata()); - if (Objects.isNull(metadata)) { - // we have requirements but no metadata -> remove - return true; - } - - return !metadata.entrySet().containsAll(requiredMetadata.entrySet()); - }); + { + final Map metadata = Utilities.text2Map(e.getMetadata()); + if (Objects.isNull(metadata)) { + // we have requirements but no metadata -> remove + return true; + } + + return !metadata.entrySet().containsAll(requiredMetadata.entrySet()); + }); } logger.debug("Potential system providers after filtering: {}", registryList.size()); @@ -536,7 +533,7 @@ public System createSystem(final String systemName, final String address, final private Device getDeviceByNameAndMacAddress(final String deviceName, final String macAddress) { final Optional optionalDevice = deviceRepository.findByDeviceNameAndMacAddress(deviceName, macAddress); return optionalDevice.orElseThrow(() -> new InvalidParameterException( - "Device entry with name '" + deviceName + "' and MAC address '" + macAddress + "' does not exists")); + "Device entry with name '" + deviceName + "' and MAC address '" + macAddress + "' does not exist")); } //------------------------------------------------------------------------------------------------- @@ -549,11 +546,11 @@ private Map normalizeMetadata(final Map metadata final Map map = new HashMap<>(); metadata.forEach((k, v) -> - { - if (Objects.nonNull(v)) { - map.put(k.trim(), v.trim()); - } - }); + { + if (Objects.nonNull(v)) { + map.put(k.trim(), v.trim()); + } + }); return map; } @@ -586,8 +583,7 @@ private Device validateNonNullDeviceParameters(final String deviceName, final St if (Utilities.isEmpty(macAddress)) { throw new InvalidParameterException("MAC address is null or empty"); - } - else { + } else { final Matcher matcher = DeviceRegistryController.MAC_ADDRESS_PATTERN.matcher(address); if (!matcher.matches()) { throw new InvalidParameterException("Unrecognized format of MAC Address"); @@ -623,7 +619,7 @@ private DeviceRegistry getDeviceRegistryEntryById(final long id) { logger.debug("getDeviceRegistryEntryById started..."); try { final Optional systemRegistry = deviceRegistryRepository.findById(id); - return systemRegistry.orElseThrow(() -> new InvalidParameterException("System Registry with id of '" + id + "' not exists")); + return systemRegistry.orElseThrow(() -> new InvalidParameterException("System Registry with id of '" + id + "' does not exist")); } catch (final InvalidParameterException ex) { throw ex; } catch (final Exception ex) { @@ -635,9 +631,9 @@ private DeviceRegistry getDeviceRegistryEntryById(final long id) { //------------------------------------------------------------------------------------------------- private Device findOrCreateDevice(DeviceRequestDTO requestDeviceDto) { return findOrCreateDevice(requestDeviceDto.getDeviceName(), - requestDeviceDto.getAddress(), - requestDeviceDto.getMacAddress(), - requestDeviceDto.getAuthenticationInfo()); + requestDeviceDto.getAddress(), + requestDeviceDto.getMacAddress(), + requestDeviceDto.getAuthenticationInfo()); } //------------------------------------------------------------------------------------------------- @@ -658,8 +654,7 @@ private Device findOrCreateDevice(String deviceName, String address, String macA provider.setAddress(validateAddress); provider = deviceRepository.saveAndFlush(provider); } - } - else { + } else { provider = createDevice(validateName, validateAddress, validatedMacAddress, authenticationInfo); } return provider; @@ -730,9 +725,9 @@ private void checkConstraintsOfDeviceRegistryTable(final Device deviceDb) { final Optional find = deviceRegistryRepository.findByDevice(deviceDb); if (find.isPresent()) { throw new InvalidParameterException("System Registry entry with provider: (" + - deviceDb.getDeviceName() + ", " + - deviceDb.getMacAddress() + - ") already exists."); + deviceDb.getDeviceName() + ", " + + deviceDb.getMacAddress() + + ") already exists."); } } catch (final InvalidParameterException ex) { throw ex; diff --git a/deviceregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/deviceregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 8ccdfc698..16e979ed4 100644 --- a/deviceregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/deviceregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -1,29 +1,4 @@ {"properties": [ - { - "name": "ping_scheduled", - "type": "java.lang.Boolean", - "description": "A description for 'ping_scheduled'" - }, - { - "name": "ping_timeout", - "type": "java.lang.Long", - "description": "A description for 'ping_timeout'" - }, - { - "name": "ping_interval", - "type": "java.lang.Long", - "description": "A description for 'ping_interval'" - }, - { - "name": "ttl_scheduled", - "type": "java.lang.Boolean", - "description": "A description for 'ttl_scheduled'" - }, - { - "name": "ttl_interval", - "type": "java.lang.Long", - "description": "A description for 'ttl_interval'" - }, { "name": "disable.hostname.verifier", "type": "java.lang.Boolean", @@ -34,11 +9,6 @@ "type": "java.lang.Boolean", "description": "A description for 'log_all_request_and_response'" }, - { - "name": "use_strict_service_intf_name_verifier", - "type": "java.lang.Boolean", - "description": "A description for 'use_strict_service_intf_name_verifier'" - }, { "name": "core_system_name", "type": "java.lang.String", diff --git a/onboarding/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/onboarding/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 8ccdfc698..16e979ed4 100644 --- a/onboarding/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/onboarding/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -1,29 +1,4 @@ {"properties": [ - { - "name": "ping_scheduled", - "type": "java.lang.Boolean", - "description": "A description for 'ping_scheduled'" - }, - { - "name": "ping_timeout", - "type": "java.lang.Long", - "description": "A description for 'ping_timeout'" - }, - { - "name": "ping_interval", - "type": "java.lang.Long", - "description": "A description for 'ping_interval'" - }, - { - "name": "ttl_scheduled", - "type": "java.lang.Boolean", - "description": "A description for 'ttl_scheduled'" - }, - { - "name": "ttl_interval", - "type": "java.lang.Long", - "description": "A description for 'ttl_interval'" - }, { "name": "disable.hostname.verifier", "type": "java.lang.Boolean", @@ -34,11 +9,6 @@ "type": "java.lang.Boolean", "description": "A description for 'log_all_request_and_response'" }, - { - "name": "use_strict_service_intf_name_verifier", - "type": "java.lang.Boolean", - "description": "A description for 'use_strict_service_intf_name_verifier'" - }, { "name": "core_system_name", "type": "java.lang.String", diff --git a/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/database/service/ServiceRegistryDBService.java b/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/database/service/ServiceRegistryDBService.java index 4788ef99f..b64e0a58b 100644 --- a/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/database/service/ServiceRegistryDBService.java +++ b/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/database/service/ServiceRegistryDBService.java @@ -290,7 +290,7 @@ public ServiceDefinition getServiceDefinitionById(final long id) { if (find.isPresent()) { return find.get(); } else { - throw new InvalidParameterException("Service definition with id of '" + id + "' not exists"); + throw new InvalidParameterException("Service definition with id of '" + id + "' does not exist"); } } catch (final InvalidParameterException ex) { throw ex; @@ -388,7 +388,7 @@ public ServiceDefinition updateServiceDefinitionById(final long id, final String serviceDefinitionEntry.setServiceDefinition(validatedServiceDefinition); return serviceDefinitionRepository.saveAndFlush(serviceDefinitionEntry); } else { - throw new InvalidParameterException("Service definition with id of '" + id + "' not exists"); + throw new InvalidParameterException("Service definition with id of '" + id + "' does not exist"); } } catch (final InvalidParameterException ex) { throw ex; @@ -415,7 +415,7 @@ public void removeServiceDefinitionById(final long id) { try { if (!serviceDefinitionRepository.existsById(id)) { - throw new InvalidParameterException("Service Definition with id '" + id + "' not exists"); + throw new InvalidParameterException("Service Definition with id '" + id + "' does not exist"); } serviceDefinitionRepository.deleteById(id); @@ -437,7 +437,7 @@ public ServiceRegistry getServiceRegistryEntryById(final long id) { if (find.isPresent()) { return find.get(); } else { - throw new InvalidParameterException("Service Registry with id of '" + id + "' not exists"); + throw new InvalidParameterException("Service Registry with id of '" + id + "' does not exist"); } } catch (final InvalidParameterException ex) { throw ex; @@ -589,7 +589,7 @@ public ServiceRegistryResponseDTO updateServiceByIdResponse(final long id, final if (srEntryOptional.isPresent()) { srEntry = srEntryOptional.get(); } else { - throw new InvalidParameterException("Service Registry entry with id '" + id + "' not exists"); + throw new InvalidParameterException("Service Registry entry with id '" + id + "' does not exist"); } final String validatedServiceDefinition = request.getServiceDefinition().toLowerCase().trim(); @@ -630,7 +630,7 @@ public ServiceRegistryResponseDTO mergeServiceByIdResponse(final long id, final if (srEntryOptional.isPresent()) { srEntry = srEntryOptional.get(); } else { - throw new InvalidParameterException("Service Registry entry with id '" + id + "' not exists"); + throw new InvalidParameterException("Service Registry entry with id '" + id + "' does not exist"); } final String validatedServiceDefinition = !Utilities.isEmpty(request.getServiceDefinition()) ? request.getServiceDefinition().toLowerCase().trim() : @@ -858,7 +858,7 @@ public void removeServiceRegistryEntryById(final long id) { try { if (!serviceRegistryRepository.existsById(id)) { - throw new InvalidParameterException("Service Registry entry with id '" + id + "' does not exists"); + throw new InvalidParameterException("Service Registry entry with id '" + id + "' does not exist"); } serviceRegistryRepository.deleteById(id); diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java index 2e7a8c9b4..c9aac42e6 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java @@ -119,7 +119,7 @@ public class SystemRegistryController { private static final String DEVICE_MAC_ADDRESS_NULL_ERROR_MESSAGE = " Device MAC address must have value "; private static final String SYSTEM_REGISTRY_MGMT_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/{" + PATH_VARIABLE_ID + "}"; - private static final String PATH_VARIABLE_SYSTEM_NAME = "systenName"; + private static final String PATH_VARIABLE_SYSTEM_NAME = "systemName"; private static final String SYSTEM_REGISTRY_MGMT_BY_SYSTEM_NAME_URI = CoreCommonConstants.MGMT_URI + "/systemname" + "/{" + PATH_VARIABLE_SYSTEM_NAME + "}"; private static final String GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE = "System Registry entries returned"; private static final String GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE = "Could not retrieve system registry entries"; @@ -885,7 +885,7 @@ private void checkSystemRegistryMergeRequest(final long id, final SystemRegistry needChange = true; } - if (request.getVersion() <= 0) { + if (request.getVersion() != null && request.getVersion() > 0) { needChange = true; } diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java index 2c959b7ab..eeddbf4b1 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java @@ -1,6 +1,10 @@ package eu.arrowhead.core.systemregistry.database.service; -import eu.arrowhead.common.*; +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.CoreUtilities; +import eu.arrowhead.common.SSLProperties; +import eu.arrowhead.common.Utilities; import eu.arrowhead.common.database.entity.Device; import eu.arrowhead.common.database.entity.System; import eu.arrowhead.common.database.entity.SystemRegistry; @@ -11,7 +15,14 @@ import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; import eu.arrowhead.common.dto.internal.SystemListResponseDTO; import eu.arrowhead.common.dto.internal.SystemRegistryListResponseDTO; -import eu.arrowhead.common.dto.shared.*; +import eu.arrowhead.common.dto.shared.DeviceRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceResponseDTO; +import eu.arrowhead.common.dto.shared.SystemQueryFormDTO; +import eu.arrowhead.common.dto.shared.SystemQueryResultDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryRequestDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.exception.InvalidParameterException; import org.apache.logging.log4j.LogManager; @@ -30,11 +41,15 @@ import java.net.Socket; import java.time.ZonedDateTime; import java.time.format.DateTimeParseException; -import java.util.*; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; @Service -public class SystemRegistryDBService -{ +public class SystemRegistryDBService { //================================================================================================= // members @@ -60,8 +75,7 @@ public class SystemRegistryDBService public SystemRegistryDBService(final SystemRegistryRepository systemRegistryRepository, final SystemRepository systemRepository, final DeviceRepository deviceRepository, - final SSLProperties sslProperties) - { + final SSLProperties sslProperties) { this.systemRegistryRepository = systemRegistryRepository; this.systemRepository = systemRepository; this.deviceRepository = deviceRepository; @@ -73,26 +87,19 @@ public SystemRegistryDBService(final SystemRegistryRepository systemRegistryRepo // methods //------------------------------------------------------------------------------------------------- - public SystemResponseDTO getSystemById(final long systemId) - { + public SystemResponseDTO getSystemById(final long systemId) { logger.debug("getSystemById started..."); - try - { + try { final Optional systemOption = systemRepository.findById(systemId); - if (systemOption.isEmpty()) - { + if (systemOption.isEmpty()) { throw new InvalidParameterException("System with id " + systemId + " not found."); } return DTOConverter.convertSystemToSystemResponseDTO(systemOption.get()); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -100,8 +107,7 @@ public SystemResponseDTO getSystemById(final long systemId) //------------------------------------------------------------------------------------------------- - public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) - { + public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) { logger.debug("getSystemEntries started..."); final int validatedPage = pageParams.getValidatedPage(); @@ -109,18 +115,14 @@ public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageP final Sort.Direction validatedDirection = pageParams.getValidatedDirection(); final String validatedSortField = Utilities.isEmpty(sortField) ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); - if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) - { + if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) { throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); } - try - { + try { return DTOConverter.convertSystemEntryListToSystemListResponseDTO( systemRepository.findAll(PageRequest.of(validatedPage, validatedSize, validatedDirection, validatedSortField))); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -128,8 +130,7 @@ public SystemListResponseDTO getSystemEntries(final CoreUtilities.ValidatedPageP //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemResponseDTO createSystemDto(final String systemName, final String address, final int port, final String authenticationInfo) - { + public SystemResponseDTO createSystemDto(final String systemName, final String address, final int port, final String authenticationInfo) { logger.debug("createSystemResponse started..."); return DTOConverter.convertSystemToSystemResponseDTO(createSystem(systemName, address, port, authenticationInfo)); @@ -138,8 +139,7 @@ public SystemResponseDTO createSystemDto(final String systemName, final String a //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public SystemResponseDTO updateSystemDto(final long systemId, final String systemName, final String address, final int port, - final String authenticationInfo) - { + final String authenticationInfo) { logger.debug("updateSystemResponse started..."); return DTOConverter.convertSystemToSystemResponseDTO(updateSystem(systemId, systemName, address, port, authenticationInfo)); @@ -147,31 +147,26 @@ public SystemResponseDTO updateSystemDto(final long systemId, final String syste //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public System updateSystem(final long systemId, final String systemName, final String address, final int port, final String authenticationInfo) - { + public System updateSystem(final long systemId, final String systemName, final String address, final int port, final String authenticationInfo) { logger.debug("updateSystem started..."); final long validatedSystemId = validateId(systemId); final int validatedPort = validateSystemPort(port); final String validatedSystemName = validateParamString(systemName); - if (validatedSystemName.contains(".")) - { + if (validatedSystemName.contains(".")) { throw new InvalidParameterException("System name can't contain dot (.)"); } final String validatedAddress = validateParamString(address); - try - { + try { final Optional systemOptional = systemRepository.findById(validatedSystemId); - if (systemOptional.isEmpty()) - { + if (systemOptional.isEmpty()) { throw new InvalidParameterException("No system with id : " + validatedSystemId); } final System system = systemOptional.get(); - if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) - { + if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) { checkConstraintsOfSystemTable(validatedSystemName, validatedAddress, validatedPort); } @@ -181,13 +176,9 @@ public System updateSystem(final long systemId, final String systemName, final S system.setAuthenticationInfo(authenticationInfo); return systemRepository.saveAndFlush(system); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -195,26 +186,19 @@ public System updateSystem(final long systemId, final String systemName, final S //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public void removeSystemById(final long id) - { + public void removeSystemById(final long id) { logger.debug("removeSystemById started..."); - try - { - if (!systemRepository.existsById(id)) - { + try { + if (!systemRepository.existsById(id)) { throw new InvalidParameterException(COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE); } systemRepository.deleteById(id); systemRepository.flush(); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -223,8 +207,7 @@ public void removeSystemById(final long id) //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public SystemResponseDTO mergeSystemResponse(final long systemId, final String systemName, final String address, final Integer port, - final String authenticationInfo) - { + final String authenticationInfo) { logger.debug("mergeSystemResponse started..."); return DTOConverter.convertSystemToSystemResponseDTO(mergeSystem(systemId, systemName, address, port, authenticationInfo)); @@ -232,64 +215,51 @@ public SystemResponseDTO mergeSystemResponse(final long systemId, final String s //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public System mergeSystem(final long systemId, final String systemName, final String address, final Integer port, final String authenticationInfo) - { + public System mergeSystem(final long systemId, final String systemName, final String address, final Integer port, final String authenticationInfo) { logger.debug("mergeSystem started..."); final long validatedSystemId = validateId(systemId); final Integer validatedPort = validateAllowNullSystemPort(port); final String validatedSystemName = validateAllowNullParamString(systemName); - if (validatedSystemName != null && validatedSystemName.contains(".")) - { + if (validatedSystemName != null && validatedSystemName.contains(".")) { throw new InvalidParameterException("System name can't contain dot (.)"); } final String validatedAddress = validateAllowNullParamString(address); - try - { + try { final Optional systemOptional = systemRepository.findById(validatedSystemId); - if (systemOptional.isEmpty()) - { + if (systemOptional.isEmpty()) { throw new InvalidParameterException("No system with id : " + validatedSystemId); } final System system = systemOptional.get(); - if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) - { + if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) { checkConstraintsOfSystemTable(validatedSystemName != null ? validatedSystemName : system.getSystemName(), - validatedAddress != null ? validatedAddress : system.getAddress(), - validatedPort != null ? validatedPort : system.getPort()); + validatedAddress != null ? validatedAddress : system.getAddress(), + validatedPort != null ? validatedPort : system.getPort()); } - if (Utilities.notEmpty(validatedSystemName)) - { + if (Utilities.notEmpty(validatedSystemName)) { system.setSystemName(validatedSystemName); } - if (Utilities.notEmpty(validatedAddress)) - { + if (Utilities.notEmpty(validatedAddress)) { system.setAddress(validatedAddress); } - if (validatedPort != null) - { + if (validatedPort != null) { system.setPort(validatedPort); } - if (Utilities.notEmpty(authenticationInfo)) - { + if (Utilities.notEmpty(authenticationInfo)) { system.setAuthenticationInfo(authenticationInfo); } return systemRepository.saveAndFlush(system); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -297,51 +267,39 @@ public System mergeSystem(final long systemId, final String systemName, final St //------------------------------------------------------------------------------------------------- - public DeviceResponseDTO getDeviceById(long deviceId) - { + public DeviceResponseDTO getDeviceById(long deviceId) { logger.debug("getDeviceById started..."); - try - { + try { final Optional deviceOptional = deviceRepository.findById(deviceId); - if (deviceOptional.isEmpty()) - { + if (deviceOptional.isEmpty()) { throw new InvalidParameterException("Device with id " + deviceId + " not found."); } return DTOConverter.convertDeviceToDeviceResponseDTO(deviceOptional.get()); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) - { + public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) { logger.debug("getDeviceList started..."); final String validatedSortField = Utilities.isEmpty(sortField) ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); - if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) - { + if (!System.SORTABLE_FIELDS_BY.contains(validatedSortField)) { throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); } - try - { + try { final Page devices = deviceRepository.findAll(PageRequest.of(pageParams.getValidatedPage(), pageParams.getValidatedSize(), - pageParams.getValidatedDirection(), validatedSortField)); + pageParams.getValidatedDirection(), validatedSortField)); return DTOConverter.convertDeviceEntryListToDeviceListResponseDTO(devices); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -349,21 +307,18 @@ public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageP //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public DeviceResponseDTO createDeviceDto(final String name, final String address, final String macAddress, final String authenticationInfo) - { + public DeviceResponseDTO createDeviceDto(final String name, final String address, final String macAddress, final String authenticationInfo) { return DTOConverter.convertDeviceToDeviceResponseDTO(createDevice(name, address, macAddress, authenticationInfo)); } //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public DeviceResponseDTO updateDeviceByIdResponse(final long id, final String name, final String address, final String macAddress, - final String authenticationInfo) - { + final String authenticationInfo) { logger.debug("updateDeviceByIdResponse started..."); - try - { + try { final long validatedId = validateId(id); final Device newDevice = validateNonNullDeviceParameters(name, address, macAddress, authenticationInfo); @@ -377,13 +332,9 @@ public DeviceResponseDTO updateDeviceByIdResponse(final long id, final String na device.setAuthenticationInfo(newDevice.getAuthenticationInfo()); return DTOConverter.convertDeviceToDeviceResponseDTO(deviceRepository.saveAndFlush(device)); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -391,26 +342,19 @@ public DeviceResponseDTO updateDeviceByIdResponse(final long id, final String na //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public void removeDeviceById(final long id) - { + public void removeDeviceById(final long id) { logger.debug("removeDeviceById started..."); - try - { - if (!deviceRepository.existsById(id)) - { + try { + if (!deviceRepository.existsById(id)) { throw new InvalidParameterException(COULD_NOT_DELETE_DEVICE_ERROR_MESSAGE); } deviceRepository.deleteById(id); deviceRepository.flush(); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -418,27 +362,22 @@ public void removeDeviceById(final long id) //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemRegistryListResponseDTO getSystemRegistryEntries(final CoreUtilities.ValidatedPageParams params, final String sortField) - { + public SystemRegistryListResponseDTO getSystemRegistryEntries(final CoreUtilities.ValidatedPageParams params, final String sortField) { logger.debug("getSystemRegistryEntries started..."); final String validatedSortField = sortField == null ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); - if (!SystemRegistry.SORTABLE_FIELDS_BY.contains(validatedSortField)) - { + if (!SystemRegistry.SORTABLE_FIELDS_BY.contains(validatedSortField)) { throw new InvalidParameterException("Sortable field with reference '" + validatedSortField + "' is not available"); } - try - { + try { final PageRequest pageRequest = PageRequest.of(params.getValidatedPage(), - params.getValidatedSize(), - params.getValidatedDirection(), - validatedSortField); + params.getValidatedSize(), + params.getValidatedDirection(), + validatedSortField); final Page systemRegistryPage = systemRegistryRepository.findAll(pageRequest); return DTOConverter.convertSystemRegistryListToSystemRegistryListResponseDTO(systemRegistryPage); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -446,8 +385,7 @@ public SystemRegistryListResponseDTO getSystemRegistryEntries(final CoreUtilitie //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemRegistryResponseDTO getSystemRegistryById(final long id) - { + public SystemRegistryResponseDTO getSystemRegistryById(final long id) { logger.debug("getSystemRegistryById started..."); return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(getSystemRegistryEntryById(id)); @@ -455,26 +393,19 @@ public SystemRegistryResponseDTO getSystemRegistryById(final long id) //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public void removeSystemRegistryEntryById(final long id) - { + public void removeSystemRegistryEntryById(final long id) { logger.debug("removeSystemRegistryEntryById started..."); - try - { - if (!systemRegistryRepository.existsById(id)) - { - throw new InvalidParameterException("System Registry entry with id '" + id + "' does not exists"); + try { + if (!systemRegistryRepository.existsById(id)) { + throw new InvalidParameterException("System Registry entry with id '" + id + "' does not exist"); } systemRegistryRepository.deleteById(id); systemRegistryRepository.flush(); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -483,13 +414,11 @@ public void removeSystemRegistryEntryById(final long id) //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemRegistryResponseDTO registerSystemRegistry(final SystemRegistryRequestDTO request) - { + public SystemRegistryResponseDTO registerSystemRegistry(final SystemRegistryRequestDTO request) { logger.debug("registerSystemRegistry started..."); checkSystemRegistryRequest(request); - try - { + try { final System systemDb = findOrCreateSystem(request.getSystem()); final Device deviceDb = findOrCreateDevice(request.getProvider()); @@ -499,19 +428,13 @@ public SystemRegistryResponseDTO registerSystemRegistry(final SystemRegistryRequ final SystemRegistry srEntry = createSystemRegistry(systemDb, deviceDb, endOfValidity, metadataStr, version); return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(srEntry); - } - catch (final DateTimeParseException ex) - { + } catch (final DateTimeParseException ex) { logger.debug(ex.getMessage(), ex); throw new InvalidParameterException( "End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -519,20 +442,18 @@ public SystemRegistryResponseDTO registerSystemRegistry(final SystemRegistryRequ //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemRegistryResponseDTO updateSystemRegistryById(final long id, final SystemRegistryRequestDTO request) - { + public SystemRegistryResponseDTO updateSystemRegistryById(final long id, final SystemRegistryRequestDTO request) { logger.debug("updateSystemRegistryById started..."); Assert.isTrue(0 < id, "id is not greater than zero"); checkSystemRegistryRequest(request); - try - { + try { final SystemRegistry srEntry; final SystemRegistry updateSrEntry; final Optional srEntryOptional = systemRegistryRepository.findById(id); - srEntry = srEntryOptional.orElseThrow(() -> new InvalidParameterException("System Registry entry with id '" + id + "' not exists")); + srEntry = srEntryOptional.orElseThrow(() -> new InvalidParameterException("System Registry entry with id '" + id + "' does not exist")); final System systemDb = findOrCreateSystem(request.getSystem()); final Device deviceDb = findOrCreateDevice(request.getProvider()); @@ -543,19 +464,13 @@ public SystemRegistryResponseDTO updateSystemRegistryById(final long id, final S updateSrEntry = updateSystemRegistry(srEntry, systemDb, deviceDb, endOfValidity, metadataStr, version); return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(updateSrEntry); - } - catch (final DateTimeParseException ex) - { + } catch (final DateTimeParseException ex) { logger.debug(ex.getMessage(), ex); throw new InvalidParameterException( "End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -564,20 +479,18 @@ public SystemRegistryResponseDTO updateSystemRegistryById(final long id, final S //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemRegistryResponseDTO mergeSystemRegistryById(final long id, final SystemRegistryRequestDTO request) - { + public SystemRegistryResponseDTO mergeSystemRegistryById(final long id, final SystemRegistryRequestDTO request) { logger.debug("mergeSystemRegistryById started..."); Assert.notNull(request, "request is null."); Assert.isTrue(0 < id, "id is not greater than zero"); - try - { + try { final SystemRegistry srEntry; final SystemRegistry updateSrEntry; final Optional srEntryOptional = systemRegistryRepository.findById(id); - srEntry = srEntryOptional.orElseThrow(() -> new InvalidParameterException("System Registry entry with id '" + id + "' not exists")); + srEntry = srEntryOptional.orElseThrow(() -> new InvalidParameterException("System Registry entry with id '" + id + "' does not exist")); final System systemDb = mergeSystem(request.getSystem(), srEntry.getSystem()); final Device deviceDb = mergeDevice(request.getProvider(), srEntry.getDevice()); @@ -595,19 +508,13 @@ public SystemRegistryResponseDTO mergeSystemRegistryById(final long id, final Sy updateSrEntry = updateSystemRegistry(srEntry, systemDb, deviceDb, endOfValidity, validatedMetadataStr, validatedVersion); return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(updateSrEntry); - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final DateTimeParseException ex) - { + } catch (final DateTimeParseException ex) { logger.debug(ex.getMessage(), ex); throw new InvalidParameterException( "End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", ex); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -616,18 +523,16 @@ public SystemRegistryResponseDTO mergeSystemRegistryById(final long id, final Sy //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public SystemRegistryListResponseDTO getSystemRegistryEntriesBySystemName(final String systemName, final CoreUtilities.ValidatedPageParams pageParameters, - final String sortField) - { + final String sortField) { logger.debug("getSystemRegistryEntriesBySystemName is started..."); - if (!System.SORTABLE_FIELDS_BY.contains(sortField)) - { + if (!System.SORTABLE_FIELDS_BY.contains(sortField)) { throw new InvalidParameterException("Sortable field with reference '" + sortField + "' is not available"); } final List systemList = systemRepository.findBySystemName(systemName); final PageRequest pageRequest = PageRequest.of(pageParameters.getValidatedPage(), pageParameters.getValidatedSize(), - pageParameters.getValidatedDirection(), sortField); + pageParameters.getValidatedDirection(), sortField); final Page systemRegistries = systemRegistryRepository.findAllBySystemIsIn(systemList, pageRequest); return DTOConverter.convertSystemRegistryListToSystemRegistryListResponseDTO(systemRegistries); @@ -636,15 +541,14 @@ public SystemRegistryListResponseDTO getSystemRegistryEntriesBySystemName(final //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public void removeSystemRegistryByNameAndAddressAndPort(final String systemName, final String address, final int port) - { + public void removeSystemRegistryByNameAndAddressAndPort(final String systemName, final String address, final int port) { logger.debug("removeSystemRegistryByNameAndAddressAndPort is started..."); final System system = getSystemByNameAndAddressAndPort(systemName, address, port); final Optional optionalSystemRegistry = systemRegistryRepository.findBySystem(system); final SystemRegistry systemRegistry = optionalSystemRegistry.orElseThrow( () -> new InvalidParameterException( - "System Registry entry for System with name '" + systemName + "', address '" + address + "' and port '" + port + "' does not exists")); + "System Registry entry for System with name '" + systemName + "', address '" + address + "' and port '" + port + "' does not exist")); systemRegistryRepository.delete(systemRegistry); systemRegistryRepository.flush(); @@ -653,46 +557,38 @@ public void removeSystemRegistryByNameAndAddressAndPort(final String systemName, //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemQueryResultDTO queryRegistry(final SystemQueryFormDTO form) - { + public SystemQueryResultDTO queryRegistry(final SystemQueryFormDTO form) { logger.debug("queryRegistry is started..."); Assert.notNull(form, "Form is null."); - try - { + try { final List systems; final List devices; final List registryList; final int unfilteredHits; - if (Utilities.notEmpty(form.getSystemNameRequirements())) - { + if (Utilities.notEmpty(form.getSystemNameRequirements())) { final String systemName = Utilities.lowerCaseTrim(form.getSystemNameRequirements()); systems = systemRepository.findBySystemName(systemName); - if (systems.isEmpty()) - { - // no service definition found + if (systems.isEmpty()) { + // no system found logger.debug("System not found: {}", systemName); return DTOConverter.convertSystemRegistryListToSystemQueryResultDTO(Collections.emptyList()); } - } - else - { + } else { throw new InvalidParameterException("System Name must not be null"); } registryList = systemRegistryRepository.findAllBySystemIsIn(systems); unfilteredHits = registryList.size(); - if (Utilities.notEmpty(form.getDeviceNameRequirements())) - { + if (Utilities.notEmpty(form.getDeviceNameRequirements())) { final String deviceName = Utilities.lowerCaseTrim(form.getDeviceNameRequirements()); devices = deviceRepository.findByDeviceName(deviceName); - if (devices.isEmpty()) - { - // no service definition found + if (devices.isEmpty()) { + // no device found logger.debug("Device not found: {}", deviceName); return DTOConverter.convertSystemRegistryListToSystemQueryResultDTO(Collections.emptyList()); } @@ -701,12 +597,9 @@ public SystemQueryResultDTO queryRegistry(final SystemQueryFormDTO form) } // filter on version - if (Objects.nonNull(form.getVersionRequirement())) - { + if (Objects.nonNull(form.getVersionRequirement())) { registryList.removeIf(e -> Objects.equals(form.getVersionRequirement(), e.getVersion())); - } - else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(form.getMaxVersionRequirement())) - { + } else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(form.getMaxVersionRequirement())) { final int minVersion = form.getMinVersionRequirement() == null ? 1 : form.getMinVersionRequirement(); final int maxVersion = form.getMaxVersionRequirement() == null ? Integer.MAX_VALUE : form.getMaxVersionRequirement(); @@ -714,37 +607,30 @@ else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(for } // filter on metadata - if (form.getMetadataRequirements() != null && !form.getMetadataRequirements().isEmpty()) - { + if (form.getMetadataRequirements() != null && !form.getMetadataRequirements().isEmpty()) { final Map requiredMetadata = normalizeMetadata(form.getMetadataRequirements()); registryList.removeIf(e -> - { - final Map metadata = Utilities.text2Map(e.getMetadata()); - if (Objects.isNull(metadata)) - { - // we have requirements but no metadata -> remove - return true; - } - - return !metadata.entrySet().containsAll(requiredMetadata.entrySet()); - }); + { + final Map metadata = Utilities.text2Map(e.getMetadata()); + if (Objects.isNull(metadata)) { + // we have requirements but no metadata -> remove + return true; + } + + return !metadata.entrySet().containsAll(requiredMetadata.entrySet()); + }); } // filter on ping - if (form.getPingProviders()) - { + if (form.getPingProviders()) { filterOnPing(registryList, pingTimeout); } logger.debug("Potential system providers after filtering: {}", registryList.size()); return DTOConverter.convertListOfSystemRegistryEntriesToSystemQueryResultDTO(registryList, unfilteredHits); - } - catch (final IllegalStateException e) - { + } catch (final IllegalStateException e) { throw new InvalidParameterException("Invalid keys in the metadata requirements (whitespace only differences)"); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -752,16 +638,14 @@ else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(for //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public SystemResponseDTO getSystemDtoByNameAndAddressAndPort(final String systemName, final String address, final int port) - { + public SystemResponseDTO getSystemDtoByNameAndAddressAndPort(final String systemName, final String address, final int port) { final System system = getSystemByNameAndAddressAndPort(systemName, address, port); return DTOConverter.convertSystemToSystemResponseDTO(system); } //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public List getSystemByName(final String name) - { + public List getSystemByName(final String name) { try { return systemRepository.findBySystemName(Utilities.lowerCaseTrim(name)); } catch (final Exception ex) { @@ -772,18 +656,14 @@ public List getSystemByName(final String name) //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) - public System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) - { + public System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) { logger.debug("createSystem started..."); final System system = validateNonNullSystemParameters(systemName, address, port, authenticationInfo); - try - { + try { return systemRepository.saveAndFlush(system); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -792,41 +672,35 @@ public System createSystem(final String systemName, final String address, final //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- - private System getSystemByNameAndAddressAndPort(final String systemName, final String address, final int port) - { + private System getSystemByNameAndAddressAndPort(final String systemName, final String address, final int port) { final Optional optionalSystem = systemRepository.findBySystemNameAndAddressAndPort(systemName, address, port); return optionalSystem.orElseThrow(() -> new InvalidParameterException( - "System entry with name '" + systemName + "', address '" + address + "' and port '" + port + "' does not exists")); + "System entry with name '" + systemName + "', address '" + address + "' and port '" + port + "' does not exist")); } //------------------------------------------------------------------------------------------------- @SuppressWarnings("squid:S1126") private boolean checkSystemIfUniqueValidationNeeded(final System system, final String validatedSystemName, final String validatedAddress, - final Integer validatedPort) - { + final Integer validatedPort) { logger.debug("checkSystemIfUniqueValidationNeeded started..."); final String actualSystemName = system.getSystemName(); final String actualAddress = system.getAddress(); final int actualPort = system.getPort(); - if (validatedSystemName != null && !actualSystemName.equalsIgnoreCase(validatedSystemName)) - { + if (validatedSystemName != null && !actualSystemName.equalsIgnoreCase(validatedSystemName)) { return true; - } - else if (validatedAddress != null && !actualAddress.equalsIgnoreCase(validatedAddress)) - { + } else if (validatedAddress != null && !actualAddress.equalsIgnoreCase(validatedAddress)) { return true; + } else { + return validatedPort != null && actualPort != validatedPort; } - else { return validatedPort != null && actualPort != validatedPort; } } //------------------------------------------------------------------------------------------------- // This method may CHANGE the content of providedServices - private void filterOnPing(final List systems, final int timeout) - { - if (systems == null || systems.isEmpty() || timeout <= 0) - { + private void filterOnPing(final List systems, final int timeout) { + if (systems == null || systems.isEmpty() || timeout <= 0) { return; } @@ -834,102 +708,79 @@ private void filterOnPing(final List systems, final int timeout) } //------------------------------------------------------------------------------------------------- - private boolean pingService(final String address, final int port, final int timeout) - { + private boolean pingService(final String address, final int port, final int timeout) { final InetSocketAddress host = new InetSocketAddress(address, port); - try (final Socket socket = new Socket()) - { + try (final Socket socket = new Socket()) { socket.connect(host, timeout); return true; - } - catch (final IOException ex) - { + } catch (final IOException ex) { return false; } } //------------------------------------------------------------------------------------------------- - private Map normalizeMetadata(final Map metadata) throws IllegalStateException - { + private Map normalizeMetadata(final Map metadata) throws IllegalStateException { logger.debug("normalizeMetadata started..."); - if (metadata == null) - { + if (metadata == null) { return Map.of(); } final Map map = new HashMap<>(); metadata.forEach((k, v) -> - { - if (Objects.nonNull(v)) - { - map.put(k.trim(), v.trim()); - } - }); + { + if (Objects.nonNull(v)) { + map.put(k.trim(), v.trim()); + } + }); return map; } //------------------------------------------------------------------------------------------------- - private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) - { + private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) { logger.debug("checkConstraintsOfSystemTable started..."); - try - { + try { final Optional find = systemRepository .findBySystemNameAndAddressAndPort(validatedSystemName.toLowerCase().trim(), validatedAddress.toLowerCase().trim(), validatedPort); - if (find.isPresent()) - { + if (find.isPresent()) { throw new InvalidParameterException( "System with name: " + validatedSystemName + ", address: " + validatedAddress + ", port: " + validatedPort + " already exists."); } - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private void checkConstraintsOfDeviceTable(final String validatedDeviceName, final String validatedMacAddress) - { + private void checkConstraintsOfDeviceTable(final String validatedDeviceName, final String validatedMacAddress) { logger.debug("checkConstraintsOfDeviceTable started..."); - try - { + try { final Optional find = deviceRepository.findByDeviceNameAndMacAddress(validatedDeviceName, validatedMacAddress); - if (find.isPresent()) - { + if (find.isPresent()) { throw new InvalidParameterException( "Device with name: " + validatedDeviceName + ", MAC address: " + validatedMacAddress + " already exists."); } - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) - { + private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) { logger.debug("validateNonNullSystemParameters started..."); validateNonNullParameters(systemName, address); - if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) - { + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); } @@ -942,14 +793,12 @@ private System validateNonNullSystemParameters(final String systemName, final St } //------------------------------------------------------------------------------------------------- - private Device validateNonNullDeviceParameters(final String deviceName, final String address, final String macAddress, final String authenticationInfo) - { + private Device validateNonNullDeviceParameters(final String deviceName, final String address, final String macAddress, final String authenticationInfo) { logger.debug("validateNonNullDeviceParameters started..."); validateNonNullParameters(deviceName, address); - if (Utilities.isEmpty(macAddress)) - { + if (Utilities.isEmpty(macAddress)) { throw new InvalidParameterException("MAC address is null or empty"); } @@ -963,33 +812,27 @@ private Device validateNonNullDeviceParameters(final String deviceName, final St } //------------------------------------------------------------------------------------------------- - private void validateNonNullParameters(final String name, final String address) - { + private void validateNonNullParameters(final String name, final String address) { logger.debug("validateNonNullParameters started..."); - if (Utilities.isEmpty(name)) - { + if (Utilities.isEmpty(name)) { throw new InvalidParameterException("Name is null or empty"); } - if (Utilities.isEmpty(address)) - { + if (Utilities.isEmpty(address)) { throw new InvalidParameterException("Address is null or empty"); } - if (name.contains(".")) - { + if (name.contains(".")) { throw new InvalidParameterException("Name can't contain dot (.)"); } } //------------------------------------------------------------------------------------------------- - private String validateParamString(final String param) - { + private String validateParamString(final String param) { logger.debug("validateSystemParamString started..."); - if (Utilities.isEmpty(param)) - { + if (Utilities.isEmpty(param)) { throw new InvalidParameterException("parameter null or empty"); } @@ -997,12 +840,10 @@ private String validateParamString(final String param) } //------------------------------------------------------------------------------------------------- - private int validateSystemPort(final int port) - { + private int validateSystemPort(final int port) { logger.debug("validateSystemPort started..."); - if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) - { + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); } @@ -1010,12 +851,10 @@ private int validateSystemPort(final int port) } //------------------------------------------------------------------------------------------------- - private long validateId(final long id) - { + private long validateId(final long id) { logger.debug("validateId started..."); - if (id < 1) - { + if (id < 1) { throw new IllegalArgumentException("Id must be greater than zero"); } @@ -1023,12 +862,10 @@ private long validateId(final long id) } //------------------------------------------------------------------------------------------------- - private Integer validateAllowNullSystemPort(final Integer port) - { + private Integer validateAllowNullSystemPort(final Integer port) { logger.debug("validateAllowNullSystemPort started..."); - if (port != null && (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX)) - { + if (port != null && (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX)) { throw new IllegalArgumentException(PORT_RANGE_ERROR_MESSAGE); } @@ -1036,12 +873,10 @@ private Integer validateAllowNullSystemPort(final Integer port) } //------------------------------------------------------------------------------------------------- - private String validateAllowNullParamString(final String param) - { + private String validateAllowNullParamString(final String param) { logger.debug("validateAllowNullParamString started..."); - if (Utilities.isEmpty(param)) - { + if (Utilities.isEmpty(param)) { return null; } @@ -1050,37 +885,29 @@ private String validateAllowNullParamString(final String param) //------------------------------------------------------------------------------------------------- - private SystemRegistry getSystemRegistryEntryById(final long id) - { + private SystemRegistry getSystemRegistryEntryById(final long id) { logger.debug("getSystemRegistryEntryById started..."); - try - { + try { final Optional systemRegistry = systemRegistryRepository.findById(id); - return systemRegistry.orElseThrow(() -> new InvalidParameterException("System Registry with id of '" + id + "' not exists")); - } - catch (final InvalidParameterException ex) - { + return systemRegistry.orElseThrow(() -> new InvalidParameterException("System Registry with id of '" + id + "' does not exist")); + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private System findOrCreateSystem(SystemRequestDTO requestSystemDto) - { + private System findOrCreateSystem(SystemRequestDTO requestSystemDto) { return findOrCreateSystem(requestSystemDto.getSystemName(), - requestSystemDto.getAddress(), - requestSystemDto.getPort(), - requestSystemDto.getAuthenticationInfo()); + requestSystemDto.getAddress(), + requestSystemDto.getPort(), + requestSystemDto.getAuthenticationInfo()); } //------------------------------------------------------------------------------------------------- - private System findOrCreateSystem(final String name, final String address, final int port, final String authenticationInfo) - { + private System findOrCreateSystem(final String name, final String address, final int port, final String authenticationInfo) { final String validatedName = Utilities.lowerCaseTrim(name); final String validatedAddress = Utilities.lowerCaseTrim(address); @@ -1088,36 +915,30 @@ private System findOrCreateSystem(final String name, final String address, final final Optional optSystem = systemRepository.findBySystemNameAndAddressAndPort(validatedName, validatedAddress, port); System provider; - if (optSystem.isPresent()) - { + if (optSystem.isPresent()) { provider = optSystem.get(); if (!Objects.equals(authenticationInfo, provider.getAuthenticationInfo()) || - !Objects.equals(validatedAddress, provider.getAddress())) - { // authentication info or system has changed + !Objects.equals(validatedAddress, provider.getAddress())) { // authentication info or system has changed provider.setAuthenticationInfo(authenticationInfo); provider.setAddress(validatedAddress); provider = systemRepository.saveAndFlush(provider); } - } - else - { + } else { provider = createSystem(validatedName, validatedAddress, port, authenticationInfo); } return provider; } //------------------------------------------------------------------------------------------------- - private Device findOrCreateDevice(DeviceRequestDTO requestDeviceDto) - { + private Device findOrCreateDevice(DeviceRequestDTO requestDeviceDto) { return findOrCreateDevice(requestDeviceDto.getDeviceName(), - requestDeviceDto.getAddress(), - requestDeviceDto.getMacAddress(), - requestDeviceDto.getAuthenticationInfo()); + requestDeviceDto.getAddress(), + requestDeviceDto.getMacAddress(), + requestDeviceDto.getAuthenticationInfo()); } //------------------------------------------------------------------------------------------------- - private Device findOrCreateDevice(String deviceName, String address, String macAddress, String authenticationInfo) - { + private Device findOrCreateDevice(String deviceName, String address, String macAddress, String authenticationInfo) { final String validateName = Utilities.lowerCaseTrim(deviceName); final String validateAddress = Utilities.lowerCaseTrim(address); @@ -1126,34 +947,28 @@ private Device findOrCreateDevice(String deviceName, String address, String macA final Optional optProvider = deviceRepository.findByDeviceNameAndMacAddress(validateName, validatedMacAddress); Device provider; - if (optProvider.isPresent()) - { + if (optProvider.isPresent()) { provider = optProvider.get(); if (!Objects.equals(authenticationInfo, provider.getAuthenticationInfo()) || - !Objects.equals(validateAddress, provider.getAddress())) - { // authentication info or provider has changed + !Objects.equals(validateAddress, provider.getAddress())) { // authentication info or provider has changed provider.setAuthenticationInfo(authenticationInfo); provider.setAddress(validateAddress); provider = deviceRepository.saveAndFlush(provider); } - } - else - { + } else { provider = createDevice(validateName, validateAddress, validatedMacAddress, authenticationInfo); } return provider; } //------------------------------------------------------------------------------------------------- - private Device createDevice(final String name, final String address, final String macAddress, final String authenticationInfo) - { + private Device createDevice(final String name, final String address, final String macAddress, final String authenticationInfo) { final Device device = new Device(name, address, macAddress, authenticationInfo); return deviceRepository.saveAndFlush(device); } //------------------------------------------------------------------------------------------------- - private void checkSystemRegistryRequest(final SystemRegistryRequestDTO request) - { + private void checkSystemRegistryRequest(final SystemRegistryRequestDTO request) { logger.debug("checkSystemRegistryRequest started..."); Assert.notNull(request, "Request is null."); @@ -1169,33 +984,25 @@ private void checkSystemRegistryRequest(final SystemRegistryRequestDTO request) } //------------------------------------------------------------------------------------------------- - private void checkConstraintsOfSystemRegistryTable(final System systemDb, final Device deviceDb) - { + private void checkConstraintsOfSystemRegistryTable(final System systemDb, final Device deviceDb) { logger.debug("checkConstraintOfSystemRegistryTable started..."); - try - { + try { final Optional find = systemRegistryRepository.findBySystemAndDevice(systemDb, deviceDb); - if (find.isPresent()) - { + if (find.isPresent()) { throw new InvalidParameterException("System Registry entry with provider: (" + deviceDb.getDeviceName() + ", " + deviceDb.getMacAddress() + - ") and system : " + systemDb.getSystemName() + " already exists."); + ") and system : " + systemDb.getSystemName() + " already exists."); } - } - catch (final InvalidParameterException ex) - { + } catch (final InvalidParameterException ex) { throw ex; - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private Device mergeDevice(final DeviceRequestDTO request, final Device device) - { + private Device mergeDevice(final DeviceRequestDTO request, final Device device) { final String name = Utilities.firstNotNullIfExists(request.getDeviceName(), device.getDeviceName()); final String address = Utilities.firstNotNullIfExists(request.getAddress(), device.getAddress()); final String macAddress = Utilities.firstNotNullIfExists(request.getDeviceName(), device.getDeviceName()); @@ -1204,8 +1011,7 @@ private Device mergeDevice(final DeviceRequestDTO request, final Device device) } //------------------------------------------------------------------------------------------------- - private System mergeSystem(final SystemRequestDTO request, final System system) - { + private System mergeSystem(final SystemRequestDTO request, final System system) { final String name = Utilities.firstNotNullIfExists(request.getSystemName(), system.getSystemName()); final String address = Utilities.firstNotNullIfExists(request.getAddress(), system.getAddress()); final int port = request.getPort() > 0 ? request.getPort() : system.getPort(); @@ -1215,26 +1021,21 @@ private System mergeSystem(final SystemRequestDTO request, final System system) //------------------------------------------------------------------------------------------------- private SystemRegistry createSystemRegistry(final System systemDb, final Device deviceDb, final ZonedDateTime endOfValidity, final String metadataStr, - final int version) - { + final int version) { logger.debug("createSystemRegistry started..."); checkConstraintsOfSystemRegistryTable(systemDb, deviceDb); - try - { + try { return systemRegistryRepository.saveAndFlush(new SystemRegistry(systemDb, deviceDb, endOfValidity, metadataStr, version)); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } //------------------------------------------------------------------------------------------------- - private boolean checkSystemRegistryIfUniqueValidationNeeded(final SystemRegistry srEntry, final System system, final Device device) - { + private boolean checkSystemRegistryIfUniqueValidationNeeded(final SystemRegistry srEntry, final System system, final Device device) { logger.debug("checkSystemRegistryIfUniqueValidationNeeded started..."); return srEntry.getSystem().getId() != system.getId() || srEntry.getDevice().getId() != device.getId(); @@ -1243,15 +1044,13 @@ private boolean checkSystemRegistryIfUniqueValidationNeeded(final SystemRegistry //------------------------------------------------------------------------------------------------- private SystemRegistry updateSystemRegistry(final SystemRegistry srEntry, final System system, final Device device, - final ZonedDateTime endOfValidity, final String metadataStr, final int version) - { + final ZonedDateTime endOfValidity, final String metadataStr, final int version) { logger.debug("updateSystemRegistry started..."); Assert.notNull(srEntry, "SystemRegistry Entry is not specified."); Assert.notNull(system, "System is not specified."); Assert.notNull(device, "Device is not specified."); - if (checkSystemRegistryIfUniqueValidationNeeded(srEntry, system, device)) - { + if (checkSystemRegistryIfUniqueValidationNeeded(srEntry, system, device)) { checkConstraintsOfSystemRegistryTable(system, device); } @@ -1259,20 +1058,17 @@ private SystemRegistry updateSystemRegistry(final SystemRegistry srEntry, final } //------------------------------------------------------------------------------------------------- - private ZonedDateTime getZonedDateTime(SystemRegistryRequestDTO request) - { + private ZonedDateTime getZonedDateTime(SystemRegistryRequestDTO request) { return Utilities.isEmpty(request.getEndOfValidity()) ? null : Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()); } //------------------------------------------------------------------------------------------------- private SystemRegistry setModifiedValuesOfSystemRegistryEntryFields(final SystemRegistry srEntry, final System system, final Device device, - final ZonedDateTime endOfValidity, final String metadataStr, final int version) - { + final ZonedDateTime endOfValidity, final String metadataStr, final int version) { logger.debug("setModifiedValuesOfSystemRegistryEntryFields started..."); - try - { + try { srEntry.setSystem(system); srEntry.setDevice(device); srEntry.setEndOfValidity(endOfValidity); @@ -1280,9 +1076,7 @@ private SystemRegistry setModifiedValuesOfSystemRegistryEntryFields(final System srEntry.setVersion(version); return systemRegistryRepository.saveAndFlush(srEntry); - } - catch (final Exception ex) - { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } diff --git a/systemregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/systemregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 8ccdfc698..f88420b7a 100644 --- a/systemregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/systemregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -14,16 +14,6 @@ "type": "java.lang.Long", "description": "A description for 'ping_interval'" }, - { - "name": "ttl_scheduled", - "type": "java.lang.Boolean", - "description": "A description for 'ttl_scheduled'" - }, - { - "name": "ttl_interval", - "type": "java.lang.Long", - "description": "A description for 'ttl_interval'" - }, { "name": "disable.hostname.verifier", "type": "java.lang.Boolean", @@ -34,11 +24,6 @@ "type": "java.lang.Boolean", "description": "A description for 'log_all_request_and_response'" }, - { - "name": "use_strict_service_intf_name_verifier", - "type": "java.lang.Boolean", - "description": "A description for 'use_strict_service_intf_name_verifier'" - }, { "name": "core_system_name", "type": "java.lang.String", From 26a2940cbc1c647b046e523bfdc8d2f18f6401a1 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 28 Jan 2020 10:54:54 +0100 Subject: [PATCH 043/301] rename column with reserved name accessable and add select privileges --- scripts/create_arrowhead_tables.sql | 10 +++++----- scripts/qos_monitor_privileges.sql | 8 ++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/scripts/create_arrowhead_tables.sql b/scripts/create_arrowhead_tables.sql index bc55cb185..b1fb3fb36 100644 --- a/scripts/create_arrowhead_tables.sql +++ b/scripts/create_arrowhead_tables.sql @@ -349,11 +349,11 @@ CREATE TABLE IF NOT EXISTS `qos_intra_measurement` ( CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement` ( `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, `measurement_id` bigint(20) NOT NULL, - `accessible` int(1) NOT NULL DEFAULT 0, - `last_access_at` timestamp, - `min_response_time` int(11), - `max_response_time` int(11), - `mean_response_time` int(11), + `available` int(1) NOT NULL DEFAULT 0, + `last_access_at` timestamp DEFAULT NULL, + `min_response_time` int(11) DEFAULT NULL, + `max_response_time` int(11) DEFAULT NULL, + `mean_response_time` int(11) NULL DEFAULT NULL, `sent` bigint(20) NOT NULL DEFAULT 0, `received` bigint(20) NOT NULL DEFAULT 0, `count_started_at` timestamp, diff --git a/scripts/qos_monitor_privileges.sql b/scripts/qos_monitor_privileges.sql index 1e3eed89b..1b122ac5d 100644 --- a/scripts/qos_monitor_privileges.sql +++ b/scripts/qos_monitor_privileges.sql @@ -1,11 +1,15 @@ USE `arrowhead`; REVOKE ALL, GRANT OPTION FROM 'qos_monitor'@'localhost'; - +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_measurement` TO 'qos_monitor'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_ping_measurement` TO 'qos_monitor'@'localhost'; +GRANT SELECT ON `arrowhead`.`system_` TO 'qos_monitor'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'qos_monitor'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'qos_monitor'@'%'; - +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_measurement` TO 'qos_monitor'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_ping_measurement` TO 'qos_monitor'@'%'; +GRANT SELECT ON `arrowhead`.`system_` TO 'qos_monitor'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'qos_monitor'@'%'; FLUSH PRIVILEGES; \ No newline at end of file From 2be6530d9c0a85121cc77f1e1ef80ab6c6fd22d6 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 28 Jan 2020 10:56:47 +0100 Subject: [PATCH 044/301] updated column name with resereved word accessible --- .../entity/QoSIntraPingMeasurement.java | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java index dc55a2a2f..42246502b 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java @@ -29,34 +29,34 @@ public class QoSIntraPingMeasurement { @JoinColumn(name = "measurementId", referencedColumnName = "id", nullable = false, unique = true) private QoSIntraMeasurement measurement; - @Column(nullable = false) - private boolean accessible = false; + @Column(name = "available", nullable = false) + private boolean available = false; - @Column(nullable = true) + @Column(name = "last_access_at", nullable = true) private ZonedDateTime lastAccessAt; - @Column(nullable = true) - private int minResponseTime; + @Column(name = "min_response_time", nullable = true) + private Integer minResponseTime; - @Column(nullable = true) - private int maxResponseTime; + @Column(name = "max_response_time", nullable = true) + private Integer maxResponseTime; - @Column(nullable = true) - private int meanResponseTime; + @Column(name = "mean_response_time", nullable = true) + private Integer meanResponseTime; - @Column(nullable = false) + @Column(name = "sent", nullable = false) private long sent; - @Column(nullable = false) + @Column(name = "received", nullable = false) private long received; - @Column(nullable = true) + @Column(name = "count_started_at", nullable = true) private ZonedDateTime countStartedAt; - @Column(nullable = false) + @Column(name = "sent_all", nullable = false) private long sentAll; - @Column(nullable = false) + @Column(name = "received_all", nullable = false) private long receivedAll; @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") @@ -87,11 +87,11 @@ public void onUpdate() { //------------------------------------------------------------------------------------------------- public long getId() { return id; } public QoSIntraMeasurement getMeasurement() { return measurement; } - public boolean isAccessible() { return accessible; } + public boolean isAvailable() { return available; } public ZonedDateTime getLastAccessAt() { return lastAccessAt; } - public int getMinResponseTime() { return minResponseTime; } - public int getMaxResponseTime() { return maxResponseTime; } - public int getMeanResponseTime() { return meanResponseTime; } + public Integer getMinResponseTime() { return minResponseTime; } + public Integer getMaxResponseTime() { return maxResponseTime; } + public Integer getMeanResponseTime() { return meanResponseTime; } public long getSent() { return sent; } public long getReceived() { return received; } public ZonedDateTime getCountStartedAt() { return countStartedAt; } @@ -103,11 +103,11 @@ public void onUpdate() { //------------------------------------------------------------------------------------------------- public void setId(final long id) { this.id = id; } public void setMeasurement(final QoSIntraMeasurement measurement) { this.measurement = measurement; } - public void setAccessible(final boolean accessible) { this.accessible = accessible; } + public void setAvailable(final boolean available) { this.available = available; } public void setLastAccessAt(final ZonedDateTime lastAccessAt) { this.lastAccessAt = lastAccessAt; } - public void setMinResponseTime(final int minResponseTime) { this.minResponseTime = minResponseTime; } - public void setMaxResponseTime(final int maxResponseTime) { this.maxResponseTime = maxResponseTime; } - public void setMeanResponseTime(final int meanResponseTime) { this.meanResponseTime = meanResponseTime; } + public void setMinResponseTime(final Integer minResponseTime) { this.minResponseTime = minResponseTime; } + public void setMaxResponseTime(final Integer maxResponseTime) { this.maxResponseTime = maxResponseTime; } + public void setMeanResponseTime(final Integer meanResponseTime) { this.meanResponseTime = meanResponseTime; } public void setSent(final long sent) { this.sent = sent; } public void setReceived(final long received) { this.received = received; } public void setCountStartedAt(final ZonedDateTime countStartedAt) { this.countStartedAt = countStartedAt; } From 8e466ea48e45ad2d6ab6619c5cafb3c60c7a02f8 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 28 Jan 2020 10:57:38 +0100 Subject: [PATCH 045/301] further implementation of PingTask --- .../core/qos/quartz/task/PingTask.java | 297 +++++++++++++++--- .../core/qos/quartz/task/PingTaskConfig.java | 2 +- .../src/main/resources/application.properties | 2 +- 3 files changed, 260 insertions(+), 41 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 070763da1..df10bf389 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -2,8 +2,10 @@ import java.time.ZonedDateTime; import java.util.ArrayList; +import java.util.Comparator; import java.util.List; import java.util.Map; +import java.util.NoSuchElementException; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @@ -23,6 +25,7 @@ import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.util.UriComponents; import eu.arrowhead.common.CommonConstants; @@ -33,6 +36,7 @@ import eu.arrowhead.common.database.entity.System; import eu.arrowhead.common.database.repository.QoSIntraMeasurementPingRepository; import eu.arrowhead.common.database.repository.QoSIntraMeasurementRepository; +import eu.arrowhead.common.database.repository.SystemRepository; import eu.arrowhead.common.dto.internal.ServiceRegistryListResponseDTO; import eu.arrowhead.common.dto.shared.QoSMeasurementType; import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; @@ -48,7 +52,7 @@ public class PingTask implements Job { //================================================================================================= // members private static final String NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE = " is null or blank."; - private static final int TIMES_TO_REPEAT = 10; + private static final int TIMES_TO_REPEAT = 2; private static final int REST_BETWEEN_PINGS_MILLSEC = 1000; protected Logger logger = LogManager.getLogger(PingTask.class); @@ -59,6 +63,9 @@ public class PingTask implements Job { @Autowired private QoSIntraMeasurementPingRepository qoSIntraMeasurementPingRepository; + @Autowired + private SystemRepository systemRepository; + @Autowired private HttpService httpService; @@ -73,7 +80,7 @@ public class PingTask implements Job { public void execute(final JobExecutionContext context) throws JobExecutionException { logger.debug("STARTED: ping task"); - Set systems = getSystemsToMessure(); + final Set systems = getSystemsToMessure(); for (final SystemResponseDTO systemResponseDTO : systems) { pingSystem(systemResponseDTO); @@ -83,6 +90,84 @@ public void execute(final JobExecutionContext context) throws JobExecutionExcept logger.debug("Finished: ping task"); } + //------------------------------------------------------------------------------------------------- + @Transactional (rollbackFor = ArrowheadException.class) + public QoSIntraMeasurement createMeasurement(final System system,final QoSMeasurementType ping,final ZonedDateTime aroundNow) { + logger.debug("createMeasurement started..."); + + final QoSIntraMeasurement measurement = new QoSIntraMeasurement(system, QoSMeasurementType.PING, aroundNow); + measurement.setSystem(system); + measurement.setMeasurementType(QoSMeasurementType.PING); + + qoSIntraMeasurementRepository.saveAndFlush(measurement); + //qoSIntraMeasurementRepository.refresh(measurement); + + return measurement; + } + + //------------------------------------------------------------------------------------------------- + @Transactional (rollbackFor = ArrowheadException.class) + private QoSIntraPingMeasurement createPingMeasurement(final QoSIntraMeasurement measurementParam, + final List responseList, final ZonedDateTime aroundNow) { + logger.debug("pingSystem started..."); + + final boolean available = calculateAvailable(responseList); + final int maxResponseTime = calculateMaxResponseTime(responseList); + final int minResponseTime = calculateMinResponseTime(responseList); + final int meanResponseTime = calculateMeanResponseTime(responseList); + final ZonedDateTime countStartedAt = aroundNow; + + long sent = 0; + long sentAll = 0; + long received = 0; + long receivedAll = 0; + + final int sentInThisPing = getSentInThisPing(responseList); + final int receivedInThisPing = getReceivedInThisPing(responseList); + + final QoSIntraMeasurement measurement ; + final Optional meOptional = qoSIntraMeasurementRepository.findById(measurementParam.getId()); + if (meOptional.isPresent()) { + measurement = meOptional.get(); + }else { + throw new ArrowheadException("Could not find measurment in DB"); + } + + final QoSIntraPingMeasurement pingMeasurement = new QoSIntraPingMeasurement(); + + sent = pingMeasurement.getSent(); + sentAll = pingMeasurement.getSentAll(); + received = pingMeasurement.getReceived(); + receivedAll = pingMeasurement.getReceivedAll(); + + pingMeasurement.setMeasurement(measurement); + pingMeasurement.setAvailable(available); + pingMeasurement.setMaxResponseTime(maxResponseTime); + pingMeasurement.setMinResponseTime(minResponseTime); + pingMeasurement.setMeanResponseTime(meanResponseTime); + pingMeasurement.setCountStartedAt(countStartedAt); + pingMeasurement.setLastAccessAt(ZonedDateTime.now());//calculateLastAccessAt(responseList, pingMeasurement, aroundNow)); + pingMeasurement.setSent(sent + sentInThisPing); + pingMeasurement.setSentAll(sentAll + sentInThisPing); + pingMeasurement.setReceived(received + receivedInThisPing); + pingMeasurement.setReceivedAll(receivedAll + getReceivedInThisPing(responseList)); + + qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); + //qoSIntraMeasurementPingRepository.refresh(pingMeasurement); + + return pingMeasurement; + } + + //------------------------------------------------------------------------------------------------- + @Transactional (rollbackFor = ArrowheadException.class) + public void updateMeasurement(ZonedDateTime aroundNow,final QoSIntraMeasurement measurement) { + + measurement.setLastMeasurementAt(aroundNow); + //qoSIntraMeasurementRepository.refresh(measurement); + qoSIntraMeasurementRepository.saveAndFlush(measurement); + + } + //================================================================================================= // assistant methods @@ -97,55 +182,90 @@ private Set getSystemsToMessure() { } //------------------------------------------------------------------------------------------------- - private void pingSystem(final SystemResponseDTO systemResponseDTO ) { + public void pingSystem(final SystemResponseDTO systemResponseDTO ) { logger.debug("pingSystem started..."); + final ZonedDateTime aroundNow = ZonedDateTime.now(); + if (systemResponseDTO == null || Utilities.isEmpty(systemResponseDTO.getAddress())) { throw new InvalidParameterException("System.address" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE); } - final System system = new System(); - system.setSystemName(systemResponseDTO.getSystemName()); - system.setAddress(systemResponseDTO.getAddress()); - system.setPort(systemResponseDTO.getPort()); + final Optional systemOptional = systemRepository.findBySystemNameAndAddressAndPort( + systemResponseDTO.getSystemName(), + systemResponseDTO.getAddress(), + systemResponseDTO.getPort()); + final System system; + if (systemOptional.isPresent()) { + + system = systemOptional.get(); + }else { + throw new ArrowheadException("Requested system is not in DB"); + } final String address = systemResponseDTO.getAddress(); final List responseList = getPingResponseList(address); - // TODO continue implementation - //final boolean accesible = calculateAccessible(responseList); - //final int maxResponseTime = calculateMaxResponseTime(responseList); - //final int minResponseTime = calculateMinResponseTime(responseList); - //final int meanResponseTime = calculateMeanResponseTime(responseList); - // - // - //final Optional qoSIntraMeasurementOptional = qoSIntraMeasurementRepository.findBySystemAndMeasurementType(system, QoSMeasurementType.PING); - //if (qoSIntraMeasurementOptional.isEmpty()) { - // - // final QoSIntraMeasurement measurement = new QoSIntraMeasurement(system, QoSMeasurementType.PING, ZonedDateTime.now()); - // qoSIntraMeasurementRepository.saveAndFlush(measurement); - // - // final Optional pingMeasurementOptional = qoSIntraMeasurementPingRepository.findByMeasurement(measurement); - // if (pingMeasurementOptional.isEmpty()) { - // final QoSIntraPingMeasurement pingMeasurement = new QoSIntraPingMeasurement(); - // pingMeasurement.setMeasurement(measurement); - // - // pingMeasurement.setAccessible(accessible); - // pingMeasurement.setMaxResponseTime(maxResponseTime); - // pingMeasurement.setMinResponseTime(minResponseTime); - // pingMeasurement.setMeanResponseTime(meanResponseTime); - // pingMeasurement.setCountStartedAt(countStartedAt); - // pingMeasurement.setLastAccessAt(lastAccessAt); - // pingMeasurement.setSent(sent); - // pingMeasurement.setSentAll(sentAll); - // pingMeasurement.setReceived(received); - // pingMeasurement.setReceivedAll(receivedAll); - // pingMeasurement.setUpdatedAt(updatedAt); - // - // } - //} + final boolean available = calculateAvailable(responseList); + final int maxResponseTime = calculateMaxResponseTime(responseList); + final int minResponseTime = calculateMinResponseTime(responseList); + final int meanResponseTime = calculateMeanResponseTime(responseList); + final ZonedDateTime countStartedAt = aroundNow; + + final int sentInThisPing = getSentInThisPing(responseList); + final int receivedInThisPing = getReceivedInThisPing(responseList); + + final QoSIntraMeasurement measurement; + final Optional qoSIntraMeasurementOptional = qoSIntraMeasurementRepository.findBySystemAndMeasurementType(system, QoSMeasurementType.PING); + if (qoSIntraMeasurementOptional.isEmpty()) { + measurement = createMeasurement(system, QoSMeasurementType.PING, aroundNow); + }else { + measurement = qoSIntraMeasurementOptional.get(); + } + + final QoSIntraPingMeasurement pingMeasurement; + final Optional pingMeasurementOptional = qoSIntraMeasurementPingRepository.findByMeasurement(measurement); + if (pingMeasurementOptional.isEmpty()) { + + pingMeasurement = createPingMeasurement(measurement, responseList, aroundNow); + + pingMeasurement.setMeasurement(measurement); + pingMeasurement.setAvailable(available); + pingMeasurement.setMaxResponseTime(maxResponseTime); + pingMeasurement.setMinResponseTime(minResponseTime); + pingMeasurement.setMeanResponseTime(meanResponseTime); + pingMeasurement.setCountStartedAt(countStartedAt); + pingMeasurement.setLastAccessAt(calculateLastAccessAt(responseList, pingMeasurement, aroundNow)); + pingMeasurement.setSent(pingMeasurement.getSent() + sentInThisPing); + pingMeasurement.setSentAll(pingMeasurement.getSentAll() + sentInThisPing); + pingMeasurement.setReceived(pingMeasurement.getReceived() + receivedInThisPing); + pingMeasurement.setReceivedAll(pingMeasurement.getReceivedAll() + getReceivedInThisPing(responseList)); + + qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); + //qoSIntraMeasurementPingRepository.refresh(pingMeasurement); + + }else { + pingMeasurement = pingMeasurementOptional.get(); + + pingMeasurement.setMeasurement(measurement); + pingMeasurement.setAvailable(available); + pingMeasurement.setMaxResponseTime(maxResponseTime); + pingMeasurement.setMinResponseTime(minResponseTime); + pingMeasurement.setMeanResponseTime(meanResponseTime); + pingMeasurement.setCountStartedAt(countStartedAt); + pingMeasurement.setLastAccessAt(calculateLastAccessAt(responseList, pingMeasurement, aroundNow)); + pingMeasurement.setSent(pingMeasurement.getSent() + sentInThisPing); + pingMeasurement.setSentAll(pingMeasurement.getSentAll() + sentInThisPing); + pingMeasurement.setReceived(pingMeasurement.getReceived() + receivedInThisPing); + pingMeasurement.setReceivedAll(pingMeasurement.getReceivedAll() + getReceivedInThisPing(responseList)); + + qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); + //qoSIntraMeasurementPingRepository.refresh(pingMeasurement); + } + + updateMeasurement(aroundNow, measurement); } //------------------------------------------------------------------------------------------------- @@ -202,4 +322,103 @@ private List getPingResponseList(final String address) { return responseList; } + + //------------------------------------------------------------------------------------------------- + private int getReceivedInThisPing(final List responseList) { + logger.debug("getReceivedInThisPing started..."); + + int countReceived = 0; + for (final IcmpPingResponse icmpPingResponse : responseList) { + + if (icmpPingResponse.getSuccessFlag()) { + + ++ countReceived; + } + } + return countReceived; + } + + //------------------------------------------------------------------------------------------------- + private int getSentInThisPing(final List responseList) { + logger.debug("getSentInThisPing started..."); + + return responseList.size(); + } + + //------------------------------------------------------------------------------------------------- + private ZonedDateTime calculateLastAccessAt(final List responseList, final QoSIntraPingMeasurement pingMeasurement, final ZonedDateTime aroundNow) { + logger.debug("calculateLastAccessAt started..."); + + ZonedDateTime accessedAt = null; + for (final IcmpPingResponse icmpPingResponse : responseList) { + + if (icmpPingResponse.getSuccessFlag()) { + accessedAt = aroundNow; + break; + } + } + + if (accessedAt == null) { + if (pingMeasurement.getLastAccessAt() == null) { + accessedAt = null; + }else { + accessedAt = pingMeasurement.getLastAccessAt(); + } + } + + return accessedAt; + } + + //------------------------------------------------------------------------------------------------- + private int calculateMeanResponseTime(final List responseList) { + logger.debug("calculateMeanResponseTime started..."); + + final double mean = responseList. + stream(). + mapToLong(IcmpPingResponse::getDuration). + average(). + getAsDouble(); + + return (int) Math.round(mean); + } + + //------------------------------------------------------------------------------------------------- + private int calculateMinResponseTime(final List responseList) { + logger.debug("calculateMinResponseTime started..."); + + final IcmpPingResponse responseWithMinDuration = responseList. + stream(). + min(Comparator.comparing(IcmpPingResponse::getDuration)). + orElseThrow(NoSuchElementException::new); + + return (int)responseWithMinDuration.getDuration(); + } + + //------------------------------------------------------------------------------------------------- + private int calculateMaxResponseTime(final List responseList) { + logger.debug("calculateMaxResponseTime started..."); + + final IcmpPingResponse responseWithMaxDuration = responseList. + stream(). + max(Comparator.comparing(IcmpPingResponse::getDuration)). + orElseThrow(NoSuchElementException::new); + + return (int) responseWithMaxDuration.getDuration(); + } + + //------------------------------------------------------------------------------------------------- + private boolean calculateAvailable(final List responseList) { + logger.debug("calculateAvailable started..."); + + for (final IcmpPingResponse icmpPingResponse : responseList) { + + if (icmpPingResponse.getSuccessFlag()) { + + return true; + } + } + + return false; + } + } \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java index 7f2942e2c..a7ede9f5b 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java @@ -33,7 +33,7 @@ public class PingTaskConfig { @Value(CoreCommonConstants.$PING_TTL_INTERVAL_WD) private int ttlInterval; - private static final int SCHEDULER_DELAY = 7; + private static final int SCHEDULER_DELAY = 1; private static final String NAME_OF_TRIGGER = "Intra_Cloud_Ping_Task_Trigger"; private static final String NAME_OF_TASK = "Intra_Cloud_Ping_Task_Detail"; diff --git a/qos-monitor/src/main/resources/application.properties b/qos-monitor/src/main/resources/application.properties index c5a6932e0..0065258ed 100644 --- a/qos-monitor/src/main/resources/application.properties +++ b/qos-monitor/src/main/resources/application.properties @@ -11,7 +11,7 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect # use true only for debugging -spring.jpa.show-sql=false +spring.jpa.show-sql=false spring.jpa.properties.hibernate.format_sql=true spring.jpa.hibernate.ddl-auto=none From 4b552aed157dbbece8cbc96a4f950a4abd696a8f Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 28 Jan 2020 11:03:55 +0100 Subject: [PATCH 046/301] renamed DB column accessible to available --- .../entity/QoSIntraPingMeasurement.java | 20 +++++++------- scripts/create_arrowhead_tables.sql | 27 ++++--------------- scripts/qos_monitor_privileges.sql | 8 ++++-- 3 files changed, 21 insertions(+), 34 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java index dc55a2a2f..b7994b7d4 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java @@ -17,24 +17,24 @@ @Entity @Table(name = "qos_intra_ping_measurement") public class QoSIntraPingMeasurement { - + //================================================================================================= // members - + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; - + @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "measurementId", referencedColumnName = "id", nullable = false, unique = true) private QoSIntraMeasurement measurement; - + @Column(nullable = false) - private boolean accessible = false; - + private boolean available = false; + @Column(nullable = true) private ZonedDateTime lastAccessAt; - + @Column(nullable = true) private int minResponseTime; @@ -70,7 +70,7 @@ public class QoSIntraPingMeasurement { //------------------------------------------------------------------------------------------------- public QoSIntraPingMeasurement() {} - + //------------------------------------------------------------------------------------------------- @PrePersist public void onCreate() { @@ -87,7 +87,7 @@ public void onUpdate() { //------------------------------------------------------------------------------------------------- public long getId() { return id; } public QoSIntraMeasurement getMeasurement() { return measurement; } - public boolean isAccessible() { return accessible; } + public boolean isAvailable() { return available; } public ZonedDateTime getLastAccessAt() { return lastAccessAt; } public int getMinResponseTime() { return minResponseTime; } public int getMaxResponseTime() { return maxResponseTime; } @@ -103,7 +103,7 @@ public void onUpdate() { //------------------------------------------------------------------------------------------------- public void setId(final long id) { this.id = id; } public void setMeasurement(final QoSIntraMeasurement measurement) { this.measurement = measurement; } - public void setAccessible(final boolean accessible) { this.accessible = accessible; } + public void setAccessible(final boolean available) { this.available = available; } public void setLastAccessAt(final ZonedDateTime lastAccessAt) { this.lastAccessAt = lastAccessAt; } public void setMinResponseTime(final int minResponseTime) { this.minResponseTime = minResponseTime; } public void setMaxResponseTime(final int maxResponseTime) { this.maxResponseTime = maxResponseTime; } diff --git a/scripts/create_arrowhead_tables.sql b/scripts/create_arrowhead_tables.sql index 3cd1c8190..27480690a 100644 --- a/scripts/create_arrowhead_tables.sql +++ b/scripts/create_arrowhead_tables.sql @@ -349,11 +349,11 @@ CREATE TABLE IF NOT EXISTS `qos_intra_measurement` ( CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement` ( `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, `measurement_id` bigint(20) NOT NULL, - `accessible` int(1) NOT NULL DEFAULT 0, - `last_access_at` timestamp, - `min_response_time` int(11), - `max_response_time` int(11), - `mean_response_time` int(11), + `available` int(1) NOT NULL DEFAULT 0, + `last_access_at` timestamp DEFAULT NULL, + `min_response_time` int(11) DEFAULT NULL, + `max_response_time` int(11) DEFAULT NULL, + `mean_response_time` int(11) NULL DEFAULT NULL, `sent` bigint(20) NOT NULL DEFAULT 0, `received` bigint(20) NOT NULL DEFAULT 0, `count_started_at` timestamp, @@ -365,20 +365,3 @@ CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement` ( UNIQUE KEY `unique_measurement` (`measurement_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- QoS Manager - -CREATE TABLE IF NOT EXISTS `qos_reservation` ( - `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, - `reserved_service_id` bigint(20) NOT NULL, - `consumer_cloud_id` bigint(20), - `consumer_system_name` varchar(255) NOT NULL, - `consumer_address` varchar(255) NOT NULL, - `consumer_port` int(11) NOT NULL, - `reserved_to` timestamp NOT NULL, - `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - CONSTRAINT `fk_reserved_service` FOREIGN KEY (`reserved_service_id`) REFERENCES `service_registry` (`id`) ON DELETE CASCADE, - CONSTRAINT `fk_consumer_cloud` FOREIGN KEY (`consumer_cloud_id`) REFERENCES `cloud` (`id`) ON DELETE CASCADE, - UNIQUE KEY `unique_reserved_service` (`reserved_service_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/scripts/qos_monitor_privileges.sql b/scripts/qos_monitor_privileges.sql index 1e3eed89b..1b122ac5d 100644 --- a/scripts/qos_monitor_privileges.sql +++ b/scripts/qos_monitor_privileges.sql @@ -1,11 +1,15 @@ USE `arrowhead`; REVOKE ALL, GRANT OPTION FROM 'qos_monitor'@'localhost'; - +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_measurement` TO 'qos_monitor'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_ping_measurement` TO 'qos_monitor'@'localhost'; +GRANT SELECT ON `arrowhead`.`system_` TO 'qos_monitor'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'qos_monitor'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'qos_monitor'@'%'; - +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_measurement` TO 'qos_monitor'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_ping_measurement` TO 'qos_monitor'@'%'; +GRANT SELECT ON `arrowhead`.`system_` TO 'qos_monitor'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'qos_monitor'@'%'; FLUSH PRIVILEGES; \ No newline at end of file From ec4c021dd83c20bc9796b865b1fb9f7485585d91 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Tue, 28 Jan 2020 12:13:41 +0100 Subject: [PATCH 047/301] fixing errors --- .../entity/QoSIntraPingMeasurement.java | 18 +++++++++--------- .../src/main/resources/swagger/swagger-ui.html | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java index dc55a2a2f..a5069b6a2 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java @@ -36,13 +36,13 @@ public class QoSIntraPingMeasurement { private ZonedDateTime lastAccessAt; @Column(nullable = true) - private int minResponseTime; + private Integer minResponseTime; @Column(nullable = true) - private int maxResponseTime; + private Integer maxResponseTime; @Column(nullable = true) - private int meanResponseTime; + private Integer meanResponseTime; @Column(nullable = false) private long sent; @@ -89,9 +89,9 @@ public void onUpdate() { public QoSIntraMeasurement getMeasurement() { return measurement; } public boolean isAccessible() { return accessible; } public ZonedDateTime getLastAccessAt() { return lastAccessAt; } - public int getMinResponseTime() { return minResponseTime; } - public int getMaxResponseTime() { return maxResponseTime; } - public int getMeanResponseTime() { return meanResponseTime; } + public Integer getMinResponseTime() { return minResponseTime; } + public Integer getMaxResponseTime() { return maxResponseTime; } + public Integer getMeanResponseTime() { return meanResponseTime; } public long getSent() { return sent; } public long getReceived() { return received; } public ZonedDateTime getCountStartedAt() { return countStartedAt; } @@ -105,9 +105,9 @@ public void onUpdate() { public void setMeasurement(final QoSIntraMeasurement measurement) { this.measurement = measurement; } public void setAccessible(final boolean accessible) { this.accessible = accessible; } public void setLastAccessAt(final ZonedDateTime lastAccessAt) { this.lastAccessAt = lastAccessAt; } - public void setMinResponseTime(final int minResponseTime) { this.minResponseTime = minResponseTime; } - public void setMaxResponseTime(final int maxResponseTime) { this.maxResponseTime = maxResponseTime; } - public void setMeanResponseTime(final int meanResponseTime) { this.meanResponseTime = meanResponseTime; } + public void setMinResponseTime(final Integer minResponseTime) { this.minResponseTime = minResponseTime; } + public void setMaxResponseTime(final Integer maxResponseTime) { this.maxResponseTime = maxResponseTime; } + public void setMeanResponseTime(final Integer meanResponseTime) { this.meanResponseTime = meanResponseTime; } public void setSent(final long sent) { this.sent = sent; } public void setReceived(final long received) { this.received = received; } public void setCountStartedAt(final ZonedDateTime countStartedAt) { this.countStartedAt = countStartedAt; } diff --git a/qos-monitor/src/main/resources/swagger/swagger-ui.html b/qos-monitor/src/main/resources/swagger/swagger-ui.html index b338d2f47..5f1488c02 100644 --- a/qos-monitor/src/main/resources/swagger/swagger-ui.html +++ b/qos-monitor/src/main/resources/swagger/swagger-ui.html @@ -3,7 +3,7 @@ - Service Registry + QoS Monitor From 1daaac65f5157bc63536b2da639c87ad64254e67 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Tue, 28 Jan 2020 15:30:58 +0100 Subject: [PATCH 048/301] QoS reservation releaser Quartz task implementation --- .../arrowhead/common/CoreCommonConstants.java | 5 +- .../eu/arrowhead/common/CoreDefaults.java | 2 + .../repository/QoSReservationRepository.java | 6 ++ .../shared/OrchestrationFormRequestDTO.java | 6 +- .../service/QoSReservationDBService.java | 46 +++++++++++ .../qos/quartz/task/ReservationCheckTask.java | 38 +++++++++ .../task/ReservationCheckTaskConfig.java | 77 +++++++++++++++++++ ...itional-spring-configuration-metadata.json | 5 ++ .../src/main/resources/application.properties | 3 + 9 files changed, 185 insertions(+), 3 deletions(-) create mode 100644 orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java create mode 100644 orchestrator/src/main/java/eu/arrowhead/core/qos/quartz/task/ReservationCheckTask.java create mode 100644 orchestrator/src/main/java/eu/arrowhead/core/qos/quartz/task/ReservationCheckTaskConfig.java diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java index 3b8c884e0..c567f3664 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java @@ -95,7 +95,7 @@ public class CoreCommonConstants { public static final String $SERVICE_REGISTRY_TTL_INTERVAL_WD = "${" + SERVICE_REGISTRY_TTL_INTERVAL + ":" + CoreDefaults.DEFAULT_SERVICE_REGISTRY_TTL_INTERVAL_MINUTES + "}"; public static final String AUTHORIZATION_IS_EVENTHANDLER_PRESENT = "eventhandler_is_present"; - public static final String $AUTHORIZATION_IS_EVENTHANDLER_PRESENT_WD = "${" + AUTHORIZATION_IS_EVENTHANDLER_PRESENT + ":" +CoreDefaults.DEFAULT_AUTHORIZATION_IS_EVENTHANDLER_PRESENT + "}"; + public static final String $AUTHORIZATION_IS_EVENTHANDLER_PRESENT_WD = "${" + AUTHORIZATION_IS_EVENTHANDLER_PRESENT + ":" + CoreDefaults.DEFAULT_AUTHORIZATION_IS_EVENTHANDLER_PRESENT + "}"; public static final String ORCHESTRATOR_IS_GATEKEEPER_PRESENT = "gatekeeper_is_present"; public static final String $ORCHESTRATOR_IS_GATEKEEPER_PRESENT_WD = "${" + ORCHESTRATOR_IS_GATEKEEPER_PRESENT + ":" + CoreDefaults.DEFAULT_ORCHESTRATOR_IS_GATEKEEPER_PRESENT + "}"; @@ -116,6 +116,9 @@ public class CoreCommonConstants { public static final int TOP_PRIORITY = 1; + public static final String QOS_RESERVATION_CHECK_INTERVAL = "qos_reservation_check_interval"; // in minutes + public static final String $QOS_RESERVATION_CHECK_INTERVAL_WS = "${" + QOS_RESERVATION_CHECK_INTERVAL + ":" + CoreDefaults.DEFAULT_QOS_RESERVATION_CHECK_INTERVAL + "}"; + public static final String NO_GATEKEEPER_RELAY_REQUEST_HANDLER_WORKERS = "no_gatekeeper_relay_request_handler_workers"; public static final String $NO_GATEKEEPER_RELAY_REQUEST_HANDLER_WORKERS_WD = "${" + NO_GATEKEEPER_RELAY_REQUEST_HANDLER_WORKERS + ":" + CoreDefaults.DEFAULT_NO_GATEKEEPER_RELAY_REQUEST_HANDLER_WORKERS + "}"; diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java b/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java index 994cae06f..b253ba0ee 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java @@ -51,6 +51,8 @@ public class CoreDefaults { public static final boolean DEFAULT_CLOUD_PING_TTL_SCHEDULED = false; public static final int DEFAULT_CLOUD_PING_TTL_INTERVAL_MINUTES = 10; + public static final int DEFAULT_QOS_RESERVATION_CHECK_INTERVAL = 60; // in seconds + //================================================================================================= // assistant methods diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSReservationRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSReservationRepository.java index 26d5598a4..9da2a7f22 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSReservationRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSReservationRepository.java @@ -1,5 +1,8 @@ package eu.arrowhead.common.database.repository; +import java.time.ZonedDateTime; +import java.util.List; + import org.springframework.stereotype.Repository; import eu.arrowhead.common.database.entity.QoSReservation; @@ -9,4 +12,7 @@ public interface QoSReservationRepository extends RefreshableRepository findAllByReservedToLessThanEqual(final ZonedDateTime threshold); } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OrchestrationFormRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OrchestrationFormRequestDTO.java index 484ca714a..c6be5a4fa 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OrchestrationFormRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OrchestrationFormRequestDTO.java @@ -15,9 +15,11 @@ public class OrchestrationFormRequestDTO implements Serializable { - public static final String QOS_REQUIREMENT_MINIMUM_RESPONSE_TIME = "qosMinRespTime"; // in milliseconds + public static final String QOS_REQUIREMENT_MAXIMUM_RESPONSE_TIME_THRESHOLD = "qosMaxRespTimeThreshold"; // in milliseconds, it means the maximum value of the maximum response time + public static final String QOS_REQUIREMENT_AVERAGE_RESPONSE_TIME_THRESHOLD = "qosAvgRespTime"; // in milliseconds, it means the maximum value of the average (mean) response time + public static final String QOS_REQUIREMENT_JITTER_THRESHOLD = "qosJitterThreshold"; // in milliseconds, it mean the maximum acceptable jitter public static final String QOS_REQUIREMENT_MAXIMUM_RECENT_PACKET_LOSS = "qosMaxRecentPacketLoss"; // in percent, for example 20% is 20 - public static final String QOS_REQUIREMENT_MAXIMUM_PACKET_LOSS = "qosMaxPacketLost"; // in percent + public static final String QOS_REQUIREMENT_MAXIMUM_PACKET_LOSS = "qosMaxPacketLost"; // in percent public static final String QOS_COMMAND_EXCLUSIVITY = "qosExclusivity"; // in seconds diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java new file mode 100644 index 000000000..7af0ac6dc --- /dev/null +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java @@ -0,0 +1,46 @@ +package eu.arrowhead.core.qos.database.service; + +import java.time.ZonedDateTime; +import java.util.List; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.database.entity.QoSReservation; +import eu.arrowhead.common.database.repository.QoSReservationRepository; +import eu.arrowhead.common.exception.ArrowheadException; + +@Service +public class QoSReservationDBService { + + //================================================================================================= + // members + + protected final Logger logger = LogManager.getLogger(QoSReservationDBService.class); + + @Autowired + private QoSReservationRepository qosReservationRepository; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public int releaseObsoleteReservations() { + try { + final ZonedDateTime now = ZonedDateTime.now(); + final List obsoletes = qosReservationRepository.findAllByReservedToLessThanEqual(now); + qosReservationRepository.deleteAll(obsoletes); + qosReservationRepository.flush(); + + return obsoletes.size(); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } +} \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/quartz/task/ReservationCheckTask.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/quartz/task/ReservationCheckTask.java new file mode 100644 index 000000000..51c6e2c87 --- /dev/null +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/quartz/task/ReservationCheckTask.java @@ -0,0 +1,38 @@ +package eu.arrowhead.core.qos.quartz.task; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.quartz.DisallowConcurrentExecution; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import eu.arrowhead.core.qos.database.service.QoSReservationDBService; + +@Component +@DisallowConcurrentExecution +public class ReservationCheckTask implements Job { + + //================================================================================================= + // members + + protected final Logger logger = LogManager.getLogger(ReservationCheckTask.class); + + @Autowired + private QoSReservationDBService qosReservationDBService; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Override + public void execute(final JobExecutionContext context) throws JobExecutionException { + logger.debug("STARTED: Services reservation check task"); + + final int removeCount = qosReservationDBService.releaseObsoleteReservations(); + + logger.debug("FINISHED: Services reservation check task. Number of removed reservation entry: {}", removeCount); + } +} \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/quartz/task/ReservationCheckTaskConfig.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/quartz/task/ReservationCheckTaskConfig.java new file mode 100644 index 000000000..4af418a51 --- /dev/null +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/quartz/task/ReservationCheckTaskConfig.java @@ -0,0 +1,77 @@ +package eu.arrowhead.core.qos.quartz.task; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.quartz.SimpleTrigger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.quartz.JobDetailFactoryBean; +import org.springframework.scheduling.quartz.SchedulerFactoryBean; +import org.springframework.scheduling.quartz.SimpleTriggerFactoryBean; + +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.quartz.AutoWiringSpringBeanQuartzTaskFactory; + +@Configuration +public class ReservationCheckTaskConfig { + + //================================================================================================= + // members + + protected final Logger logger = LogManager.getLogger(ReservationCheckTaskConfig.class); + + @Autowired + private ApplicationContext applicationContext; //NOSONAR + + @Value(CoreCommonConstants.$QOS_RESERVATION_CHECK_INTERVAL_WS) + private int interval; + + private static final int SCHEDULER_DELAY = 19; + + private static final String NAME_OF_TRIGGER = "Services_Reservation_Check_Task_Trigger"; + private static final String NAME_OF_TASK = "Services_Reservation_Check_Task_Detail"; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Bean + public SchedulerFactoryBean servicesReservationCheckScheduler() { + final AutoWiringSpringBeanQuartzTaskFactory jobFactory = new AutoWiringSpringBeanQuartzTaskFactory(); + jobFactory.setApplicationContext(applicationContext); + final SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean(); + schedulerFactory.setJobFactory(jobFactory); + schedulerFactory.setJobDetails(servicesReservationCheckTaskDetail().getObject()); + schedulerFactory.setTriggers(servicesReservationCheckTaskTrigger().getObject()); + schedulerFactory.setStartupDelay(SCHEDULER_DELAY); + logger.info("Services reservation task adjusted with interval: {} seconds", interval); + + return schedulerFactory; + } + + //------------------------------------------------------------------------------------------------- + @Bean + public SimpleTriggerFactoryBean servicesReservationCheckTaskTrigger() { + final SimpleTriggerFactoryBean trigger = new SimpleTriggerFactoryBean(); + trigger.setJobDetail(servicesReservationCheckTaskDetail().getObject()); + trigger.setRepeatInterval(interval * CoreCommonConstants.CONVERSION_MILLISECOND_TO_SECOND); + trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY); + trigger.setName(NAME_OF_TRIGGER); + + return trigger; + } + + //------------------------------------------------------------------------------------------------- + @Bean + public JobDetailFactoryBean servicesReservationCheckTaskDetail() { + final JobDetailFactoryBean jobDetailFactory = new JobDetailFactoryBean(); + jobDetailFactory.setJobClass(ReservationCheckTask.class); + jobDetailFactory.setName(NAME_OF_TASK); + jobDetailFactory.setDurability(true); + + return jobDetailFactory; + } +} \ No newline at end of file diff --git a/orchestrator/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/orchestrator/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 9b58d1302..02ef2b997 100644 --- a/orchestrator/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/orchestrator/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -48,5 +48,10 @@ "name": "enable_qos", "type": "java.lang.Boolean", "description": "A description for 'enable_qos'" + }, + { + "name": "qos_reservation_check_interval", + "type": "java.lang.Integer", + "description": "A description for 'qos_reservation_check_interval'" } ]} \ No newline at end of file diff --git a/orchestrator/src/main/resources/application.properties b/orchestrator/src/main/resources/application.properties index 69dfb4c13..bc3c596b4 100644 --- a/orchestrator/src/main/resources/application.properties +++ b/orchestrator/src/main/resources/application.properties @@ -41,6 +41,9 @@ gatekeeper_is_present=true #If true, orchestrator will use QoS verification and reservation (if clients using this feature) enable_qos=true +#How frequently the database should be checked for expired reservations, in seconds +qos_reservation_check_interval=120 + # Interface names has to follow this format --, where security can be SECURE or INSECURE and protocol and format must be a sequence of letters, numbers and underscore. # A regexp checker will verify that. If this setting is set to true then the PROTOCOL and FORMAT must come from a predefined set. use_strict_service_intf_name_verifier=false From 05e7abf750e137f9117dd9a53ebc94efc8dc2a50 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 28 Jan 2020 16:11:03 +0100 Subject: [PATCH 049/301] updated column names --- .../entity/QoSIntraPingMeasurement.java | 30 +++++++++++++++---- scripts/create_arrowhead_tables.sql | 6 +++- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java index 60af74b8d..3b2336d6f 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java @@ -41,9 +41,21 @@ public class QoSIntraPingMeasurement { @Column(name = "max_response_time", nullable = true) private Integer maxResponseTime; - @Column(name = "mean_response_time", nullable = true) - private Integer meanResponseTime; - + @Column(name = "mean_response_time_with_timeout", nullable = true) + private Integer meanResponseTimeWithTimeout; + + @Column(name = "mean_response_time_without_timeout", nullable = true) + private Integer meanResponseTimeWithoutTimeout; + + @Column(name = "jitter_with_timeout", nullable = true) + private Integer jitterWithTimeout; + + @Column(name = "jitter_without_timeout", nullable = true) + private Integer jitterWithoutTimeout; + + @Column(name = "lost_per_measurement_percent", nullable = false) + private Integer lostPerMeasurementPercent; + @Column(name = "sent", nullable = false) private long sent; @@ -91,7 +103,11 @@ public void onUpdate() { public ZonedDateTime getLastAccessAt() { return lastAccessAt; } public Integer getMinResponseTime() { return minResponseTime; } public Integer getMaxResponseTime() { return maxResponseTime; } - public Integer getMeanResponseTime() { return meanResponseTime; } + public Integer getMeanResponseTimeWithTimeout() { return meanResponseTimeWithTimeout; } + public Integer getMeanResponseTimeWithoutTimeout() { return meanResponseTimeWithoutTimeout; } + public Integer getJitterWithTimeout() {return jitterWithTimeout;} + public Integer getJitterWithoutTimeout() { return jitterWithoutTimeout; } + public Integer getLostPerMeasurementPercent() { return lostPerMeasurementPercent; } public long getSent() { return sent; } public long getReceived() { return received; } public ZonedDateTime getCountStartedAt() { return countStartedAt; } @@ -107,7 +123,11 @@ public void onUpdate() { public void setLastAccessAt(final ZonedDateTime lastAccessAt) { this.lastAccessAt = lastAccessAt; } public void setMinResponseTime(final Integer minResponseTime) { this.minResponseTime = minResponseTime; } public void setMaxResponseTime(final Integer maxResponseTime) { this.maxResponseTime = maxResponseTime; } - public void setMeanResponseTime(final Integer meanResponseTime) { this.meanResponseTime = meanResponseTime; } + public void setMeanResponseTimeWithoutTimeout(final Integer meanResponseTimeWithoutTimeout) { this.meanResponseTimeWithoutTimeout = meanResponseTimeWithoutTimeout; } + public void setMeanResponseTimeWithTimeout(final Integer meanResponseTimeWithTimeout) { this.meanResponseTimeWithTimeout = meanResponseTimeWithTimeout; } + public void setJitterWithTimeout(Integer jitterWithTimeout) { this.jitterWithTimeout = jitterWithTimeout; } + public void setJitterWithoutTimeout(Integer jitterWithoutTimeout) { this.jitterWithoutTimeout = jitterWithoutTimeout; } + public void setLostPerMeasurementPercent(Integer lostPerMeasurementPercent) { this.lostPerMeasurementPercent = lostPerMeasurementPercent; } public void setSent(final long sent) { this.sent = sent; } public void setReceived(final long received) { this.received = received; } public void setCountStartedAt(final ZonedDateTime countStartedAt) { this.countStartedAt = countStartedAt; } diff --git a/scripts/create_arrowhead_tables.sql b/scripts/create_arrowhead_tables.sql index 27480690a..c99fa9aab 100644 --- a/scripts/create_arrowhead_tables.sql +++ b/scripts/create_arrowhead_tables.sql @@ -353,7 +353,11 @@ CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement` ( `last_access_at` timestamp DEFAULT NULL, `min_response_time` int(11) DEFAULT NULL, `max_response_time` int(11) DEFAULT NULL, - `mean_response_time` int(11) NULL DEFAULT NULL, + `mean_response_time_with_timeout` int(11) NULL DEFAULT NULL, + `mean_response_time_without_timeout` int(11) NULL DEFAULT NULL, + `jitter_with_timeout` int(11) NULL DEFAULT NULL, + `jitter_without_timeout` int(11) NULL DEFAULT NULL, + `lost_per_measurement_percent` int(3) NOT NULL DEFAULT 0, `sent` bigint(20) NOT NULL DEFAULT 0, `received` bigint(20) NOT NULL DEFAULT 0, `count_started_at` timestamp, From f3bb61196e800ba5fa9f68ebcb05ca851bdea094 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 28 Jan 2020 16:11:58 +0100 Subject: [PATCH 050/301] updated field names --- .../core/qos/quartz/task/PingTask.java | 231 ++++++++++++------ 1 file changed, 156 insertions(+), 75 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index df10bf389..a0c95ee1c 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -2,10 +2,8 @@ import java.time.ZonedDateTime; import java.util.ArrayList; -import java.util.Comparator; import java.util.List; import java.util.Map; -import java.util.NoSuchElementException; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @@ -52,23 +50,24 @@ public class PingTask implements Job { //================================================================================================= // members private static final String NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE = " is null or blank."; - private static final int TIMES_TO_REPEAT = 2; + private static final int TIMES_TO_REPEAT = 35; + private static final int PING_TIME_OUT = 5000; private static final int REST_BETWEEN_PINGS_MILLSEC = 1000; protected Logger logger = LogManager.getLogger(PingTask.class); - + @Autowired private QoSIntraMeasurementRepository qoSIntraMeasurementRepository; - + @Autowired private QoSIntraMeasurementPingRepository qoSIntraMeasurementPingRepository; - + @Autowired private SystemRepository systemRepository; - + @Autowired private HttpService httpService; - + @Resource(name = CommonConstants.ARROWHEAD_CONTEXT) private Map arrowheadContext; @@ -111,19 +110,25 @@ private QoSIntraPingMeasurement createPingMeasurement(final QoSIntraMeasurement final List responseList, final ZonedDateTime aroundNow) { logger.debug("pingSystem started..."); - final boolean available = calculateAvailable(responseList); - final int maxResponseTime = calculateMaxResponseTime(responseList); - final int minResponseTime = calculateMinResponseTime(responseList); - final int meanResponseTime = calculateMeanResponseTime(responseList); - final ZonedDateTime countStartedAt = aroundNow; - - long sent = 0; - long sentAll = 0; - long received = 0; - long receivedAll = 0; + final boolean available = calculateAvailable(responseList); + final int maxResponseTime = calculateMaxResponseTime(responseList); + final int minResponseTime = calculateMinResponseTime(responseList); + final int meanResponseTimeWithTimeout = calculateMeanResponseTimeWithTimeout(responseList); + final int meanResponseTimeWithOutTimeout = calculateMeanResponseTimeWithoutTimeout(responseList); + final int jitterWithTimeout = calculateJitterWithTimeout(responseList); + final int jitterWithoutTimeout = calculateJitterWithoutTimeout(responseList); + + final ZonedDateTime countStartedAt = aroundNow; - final int sentInThisPing = getSentInThisPing(responseList); - final int receivedInThisPing = getReceivedInThisPing(responseList); + long sent = 0; + long sentAll = 0; + long received = 0; + long receivedAll = 0; + + final int sentInThisPing = getSentInThisPing(responseList); + final int receivedInThisPing = getReceivedInThisPing(responseList); + + final int lostPerMeasurementPercent = (int) (receivedInThisPing == 0 ? 1 : ((double)receivedInThisPing / (double)sentInThisPing) * 100); final QoSIntraMeasurement measurement ; final Optional meOptional = qoSIntraMeasurementRepository.findById(measurementParam.getId()); @@ -144,16 +149,19 @@ private QoSIntraPingMeasurement createPingMeasurement(final QoSIntraMeasurement pingMeasurement.setAvailable(available); pingMeasurement.setMaxResponseTime(maxResponseTime); pingMeasurement.setMinResponseTime(minResponseTime); - pingMeasurement.setMeanResponseTime(meanResponseTime); + pingMeasurement.setMeanResponseTimeWithoutTimeout(meanResponseTimeWithOutTimeout); + pingMeasurement.setMeanResponseTimeWithTimeout(meanResponseTimeWithTimeout); + pingMeasurement.setJitterWithoutTimeout(jitterWithoutTimeout); + pingMeasurement.setJitterWithTimeout(jitterWithTimeout); + pingMeasurement.setLostPerMeasurementPercent(lostPerMeasurementPercent); pingMeasurement.setCountStartedAt(countStartedAt); - pingMeasurement.setLastAccessAt(ZonedDateTime.now());//calculateLastAccessAt(responseList, pingMeasurement, aroundNow)); + pingMeasurement.setLastAccessAt(calculateLastAccessAt(responseList, pingMeasurement, aroundNow)); pingMeasurement.setSent(sent + sentInThisPing); pingMeasurement.setSentAll(sentAll + sentInThisPing); pingMeasurement.setReceived(received + receivedInThisPing); pingMeasurement.setReceivedAll(receivedAll + getReceivedInThisPing(responseList)); qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); - //qoSIntraMeasurementPingRepository.refresh(pingMeasurement); return pingMeasurement; } @@ -163,7 +171,6 @@ private QoSIntraPingMeasurement createPingMeasurement(final QoSIntraMeasurement public void updateMeasurement(ZonedDateTime aroundNow,final QoSIntraMeasurement measurement) { measurement.setLastMeasurementAt(aroundNow); - //qoSIntraMeasurementRepository.refresh(measurement); qoSIntraMeasurementRepository.saveAndFlush(measurement); } @@ -207,52 +214,47 @@ public void pingSystem(final SystemResponseDTO systemResponseDTO ) { final List responseList = getPingResponseList(address); - final boolean available = calculateAvailable(responseList); - final int maxResponseTime = calculateMaxResponseTime(responseList); - final int minResponseTime = calculateMinResponseTime(responseList); - final int meanResponseTime = calculateMeanResponseTime(responseList); - final ZonedDateTime countStartedAt = aroundNow; + final boolean available = calculateAvailable(responseList); + final int maxResponseTime = calculateMaxResponseTime(responseList); + final int minResponseTime = calculateMinResponseTime(responseList); + final int meanResponseTimeWithTimeout = calculateMeanResponseTimeWithTimeout(responseList); + final int meanResponseTimeWithOutTimeout = calculateMeanResponseTimeWithoutTimeout(responseList); + final int jitterWithTimeout = calculateJitterWithTimeout(responseList); + final int jitterWithoutTimeout = calculateJitterWithoutTimeout(responseList); - final int sentInThisPing = getSentInThisPing(responseList); - final int receivedInThisPing = getReceivedInThisPing(responseList); + final ZonedDateTime countStartedAt = aroundNow; - final QoSIntraMeasurement measurement; - final Optional qoSIntraMeasurementOptional = qoSIntraMeasurementRepository.findBySystemAndMeasurementType(system, QoSMeasurementType.PING); - if (qoSIntraMeasurementOptional.isEmpty()) { + final int sentInThisPing = getSentInThisPing(responseList); + final int receivedInThisPing = getReceivedInThisPing(responseList); + final int lostPerMeasurementPercent = (int) (receivedInThisPing == 0 ? 1 : 100 - ((double)receivedInThisPing / (double)sentInThisPing) * 100); + + final QoSIntraMeasurement measurement; + final Optional qoSIntraMeasurementOptional = qoSIntraMeasurementRepository.findBySystemAndMeasurementType(system, QoSMeasurementType.PING); + if (qoSIntraMeasurementOptional.isEmpty()) { measurement = createMeasurement(system, QoSMeasurementType.PING, aroundNow); - }else { + }else { measurement = qoSIntraMeasurementOptional.get(); } - final QoSIntraPingMeasurement pingMeasurement; - final Optional pingMeasurementOptional = qoSIntraMeasurementPingRepository.findByMeasurement(measurement); - if (pingMeasurementOptional.isEmpty()) { + final QoSIntraPingMeasurement pingMeasurement; + final Optional pingMeasurementOptional = qoSIntraMeasurementPingRepository.findByMeasurement(measurement); + if (pingMeasurementOptional.isEmpty()) { pingMeasurement = createPingMeasurement(measurement, responseList, aroundNow); + qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); - pingMeasurement.setMeasurement(measurement); - pingMeasurement.setAvailable(available); - pingMeasurement.setMaxResponseTime(maxResponseTime); - pingMeasurement.setMinResponseTime(minResponseTime); - pingMeasurement.setMeanResponseTime(meanResponseTime); - pingMeasurement.setCountStartedAt(countStartedAt); - pingMeasurement.setLastAccessAt(calculateLastAccessAt(responseList, pingMeasurement, aroundNow)); - pingMeasurement.setSent(pingMeasurement.getSent() + sentInThisPing); - pingMeasurement.setSentAll(pingMeasurement.getSentAll() + sentInThisPing); - pingMeasurement.setReceived(pingMeasurement.getReceived() + receivedInThisPing); - pingMeasurement.setReceivedAll(pingMeasurement.getReceivedAll() + getReceivedInThisPing(responseList)); - - qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); - //qoSIntraMeasurementPingRepository.refresh(pingMeasurement); - - }else { + }else { pingMeasurement = pingMeasurementOptional.get(); pingMeasurement.setMeasurement(measurement); pingMeasurement.setAvailable(available); pingMeasurement.setMaxResponseTime(maxResponseTime); pingMeasurement.setMinResponseTime(minResponseTime); - pingMeasurement.setMeanResponseTime(meanResponseTime); + pingMeasurement.setMeanResponseTimeWithoutTimeout(meanResponseTimeWithOutTimeout); + pingMeasurement.setMeanResponseTimeWithTimeout(meanResponseTimeWithTimeout); + pingMeasurement.setJitterWithoutTimeout(jitterWithoutTimeout); + pingMeasurement.setJitterWithTimeout(jitterWithTimeout); + pingMeasurement.setLostPerMeasurementPercent(lostPerMeasurementPercent); pingMeasurement.setCountStartedAt(countStartedAt); pingMeasurement.setLastAccessAt(calculateLastAccessAt(responseList, pingMeasurement, aroundNow)); pingMeasurement.setSent(pingMeasurement.getSent() + sentInThisPing); @@ -261,7 +263,6 @@ public void pingSystem(final SystemResponseDTO systemResponseDTO ) { pingMeasurement.setReceivedAll(pingMeasurement.getReceivedAll() + getReceivedInThisPing(responseList)); qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); - //qoSIntraMeasurementPingRepository.refresh(pingMeasurement); } @@ -326,7 +327,7 @@ private List getPingResponseList(final String address) { //------------------------------------------------------------------------------------------------- private int getReceivedInThisPing(final List responseList) { logger.debug("getReceivedInThisPing started..."); - + int countReceived = 0; for (final IcmpPingResponse icmpPingResponse : responseList) { @@ -370,15 +371,39 @@ private ZonedDateTime calculateLastAccessAt(final List respons } //------------------------------------------------------------------------------------------------- - private int calculateMeanResponseTime(final List responseList) { + private int calculateMeanResponseTimeWithoutTimeout(final List responseList) { logger.debug("calculateMeanResponseTime started..."); - final double mean = responseList. - stream(). - mapToLong(IcmpPingResponse::getDuration). - average(). - getAsDouble(); + final double mean; + long sum = 0; + int count = 0; + for (final IcmpPingResponse icmpPingResponse : responseList) { + if (icmpPingResponse.getSuccessFlag()) { + sum += icmpPingResponse.getDuration(); + ++count; + } + } + mean = (double)sum / (double)count; + return (int) Math.round(mean); + } + + //------------------------------------------------------------------------------------------------- + private int calculateMeanResponseTimeWithTimeout(final List responseList) { + logger.debug("calculateMeanResponseTime started..."); + + final double mean; + long sum = 0; + for (final IcmpPingResponse icmpPingResponse : responseList) { + + if (!icmpPingResponse.getSuccessFlag()) { + sum += PING_TIME_OUT; + }else { + sum += icmpPingResponse.getDuration(); + } + } + + mean = (double)sum / (double)responseList.size(); return (int) Math.round(mean); } @@ -386,30 +411,40 @@ private int calculateMeanResponseTime(final List responseList) private int calculateMinResponseTime(final List responseList) { logger.debug("calculateMinResponseTime started..."); - final IcmpPingResponse responseWithMinDuration = responseList. - stream(). - min(Comparator.comparing(IcmpPingResponse::getDuration)). - orElseThrow(NoSuchElementException::new); + int min = PING_TIME_OUT; + for (final IcmpPingResponse icmpPingResponse : responseList) { + + if (icmpPingResponse.getSuccessFlag()) { + if(icmpPingResponse.getDuration() < min) { + min = (int) icmpPingResponse.getDuration(); + } + } + } - return (int)responseWithMinDuration.getDuration(); + return min; } //------------------------------------------------------------------------------------------------- private int calculateMaxResponseTime(final List responseList) { logger.debug("calculateMaxResponseTime started..."); - final IcmpPingResponse responseWithMaxDuration = responseList. - stream(). - max(Comparator.comparing(IcmpPingResponse::getDuration)). - orElseThrow(NoSuchElementException::new); - - return (int) responseWithMaxDuration.getDuration(); + int max = 0; + for (final IcmpPingResponse icmpPingResponse : responseList) { + + if (icmpPingResponse.getSuccessFlag()) { + if(icmpPingResponse.getDuration() > max) { + max = (int) icmpPingResponse.getDuration(); + } + } + } + + return max; } //------------------------------------------------------------------------------------------------- private boolean calculateAvailable(final List responseList) { logger.debug("calculateAvailable started..."); - + for (final IcmpPingResponse icmpPingResponse : responseList) { if (icmpPingResponse.getSuccessFlag()) { @@ -421,4 +456,50 @@ private boolean calculateAvailable(final List responseList) { return false; } + //------------------------------------------------------------------------------------------------- + private int calculateJitterWithTimeout(final List responseList) { + logger.debug("calculateJitterWithTimeout started..."); + + final int meanResponseTimeWithTimeout = calculateMeanResponseTimeWithTimeout(responseList); + int sumOfDiffs = 0; + for (final IcmpPingResponse icmpPingResponse : responseList) { + + final int duration; + if (!icmpPingResponse.getSuccessFlag()) { + duration = PING_TIME_OUT + 1; + }else { + duration = (int) icmpPingResponse.getDuration(); + } + sumOfDiffs += Math.pow( (duration - meanResponseTimeWithTimeout), 2); + + } + + final int jitter = (int) Math.sqrt(sumOfDiffs / responseList.size()); + + return jitter; + } + + //------------------------------------------------------------------------------------------------- + private int calculateJitterWithoutTimeout(final List responseList) { + logger.debug("calculateJitterWithoutTimeout started..."); + + final int meanResponseTimeWithTimeout = calculateMeanResponseTimeWithoutTimeout(responseList); + int sumOfDiffs = 0; + int count = 0; + for (final IcmpPingResponse icmpPingResponse : responseList) { + + final int duration; + if (icmpPingResponse.getSuccessFlag()) { + duration = (int) icmpPingResponse.getDuration(); + sumOfDiffs += Math.pow( (duration - meanResponseTimeWithTimeout), 2); + + ++ count; + } + + } + + final int jitter = (int) Math.sqrt(sumOfDiffs / count); + + return jitter; + } } \ No newline at end of file From 51c65a2a0e42e3cddf3f0f11c4bf7ad736098a24 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 28 Jan 2020 16:15:41 +0100 Subject: [PATCH 051/301] updated column names --- .../entity/QoSIntraPingMeasurement.java | 66 ++++++++++++------- scripts/create_arrowhead_tables.sql | 6 +- 2 files changed, 48 insertions(+), 24 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java index b7994b7d4..47c581a58 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java @@ -28,35 +28,47 @@ public class QoSIntraPingMeasurement { @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "measurementId", referencedColumnName = "id", nullable = false, unique = true) private QoSIntraMeasurement measurement; - - @Column(nullable = false) + + @Column(name = "available", nullable = false) private boolean available = false; - - @Column(nullable = true) + + @Column(name = "last_access_at", nullable = true) private ZonedDateTime lastAccessAt; + + @Column(name = "min_response_time", nullable = true) + private Integer minResponseTime; - @Column(nullable = true) - private int minResponseTime; + @Column(name = "max_response_time", nullable = true) + private Integer maxResponseTime; - @Column(nullable = true) - private int maxResponseTime; + @Column(name = "mean_response_time_with_timeout", nullable = true) + private Integer meanResponseTimeWithTimeout; - @Column(nullable = true) - private int meanResponseTime; - - @Column(nullable = false) + @Column(name = "mean_response_time_without_timeout", nullable = true) + private Integer meanResponseTimeWithoutTimeout; + + @Column(name = "jitter_with_timeout", nullable = true) + private Integer jitterWithTimeout; + + @Column(name = "jitter_without_timeout", nullable = true) + private Integer jitterWithoutTimeout; + + @Column(name = "lost_per_measurement_percent", nullable = false) + private Integer lostPerMeasurementPercent; + + @Column(name = "sent", nullable = false) private long sent; - @Column(nullable = false) + @Column(name = "received", nullable = false) private long received; - @Column(nullable = true) + @Column(name = "count_started_at", nullable = true) private ZonedDateTime countStartedAt; - @Column(nullable = false) + @Column(name = "sent_all", nullable = false) private long sentAll; - @Column(nullable = false) + @Column(name = "received_all", nullable = false) private long receivedAll; @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") @@ -89,9 +101,13 @@ public void onUpdate() { public QoSIntraMeasurement getMeasurement() { return measurement; } public boolean isAvailable() { return available; } public ZonedDateTime getLastAccessAt() { return lastAccessAt; } - public int getMinResponseTime() { return minResponseTime; } - public int getMaxResponseTime() { return maxResponseTime; } - public int getMeanResponseTime() { return meanResponseTime; } + public Integer getMinResponseTime() { return minResponseTime; } + public Integer getMaxResponseTime() { return maxResponseTime; } + public Integer getMeanResponseTimeWithTimeout() { return meanResponseTimeWithTimeout; } + public Integer getMeanResponseTimeWithoutTimeout() { return meanResponseTimeWithoutTimeout; } + public Integer getJitterWithTimeout() {return jitterWithTimeout;} + public Integer getJitterWithoutTimeout() { return jitterWithoutTimeout; } + public Integer getLostPerMeasurementPercent() { return lostPerMeasurementPercent; } public long getSent() { return sent; } public long getReceived() { return received; } public ZonedDateTime getCountStartedAt() { return countStartedAt; } @@ -103,11 +119,15 @@ public void onUpdate() { //------------------------------------------------------------------------------------------------- public void setId(final long id) { this.id = id; } public void setMeasurement(final QoSIntraMeasurement measurement) { this.measurement = measurement; } - public void setAccessible(final boolean available) { this.available = available; } + public void setAvailable(final boolean available) { this.available = available; } public void setLastAccessAt(final ZonedDateTime lastAccessAt) { this.lastAccessAt = lastAccessAt; } - public void setMinResponseTime(final int minResponseTime) { this.minResponseTime = minResponseTime; } - public void setMaxResponseTime(final int maxResponseTime) { this.maxResponseTime = maxResponseTime; } - public void setMeanResponseTime(final int meanResponseTime) { this.meanResponseTime = meanResponseTime; } + public void setMinResponseTime(final Integer minResponseTime) { this.minResponseTime = minResponseTime; } + public void setMaxResponseTime(final Integer maxResponseTime) { this.maxResponseTime = maxResponseTime; } + public void setMeanResponseTimeWithoutTimeout(final Integer meanResponseTimeWithoutTimeout) { this.meanResponseTimeWithoutTimeout = meanResponseTimeWithoutTimeout; } + public void setMeanResponseTimeWithTimeout(final Integer meanResponseTimeWithTimeout) { this.meanResponseTimeWithTimeout = meanResponseTimeWithTimeout; } + public void setJitterWithTimeout(Integer jitterWithTimeout) { this.jitterWithTimeout = jitterWithTimeout; } + public void setJitterWithoutTimeout(Integer jitterWithoutTimeout) { this.jitterWithoutTimeout = jitterWithoutTimeout; } + public void setLostPerMeasurementPercent(Integer lostPerMeasurementPercent) { this.lostPerMeasurementPercent = lostPerMeasurementPercent; } public void setSent(final long sent) { this.sent = sent; } public void setReceived(final long received) { this.received = received; } public void setCountStartedAt(final ZonedDateTime countStartedAt) { this.countStartedAt = countStartedAt; } diff --git a/scripts/create_arrowhead_tables.sql b/scripts/create_arrowhead_tables.sql index 27480690a..c99fa9aab 100644 --- a/scripts/create_arrowhead_tables.sql +++ b/scripts/create_arrowhead_tables.sql @@ -353,7 +353,11 @@ CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement` ( `last_access_at` timestamp DEFAULT NULL, `min_response_time` int(11) DEFAULT NULL, `max_response_time` int(11) DEFAULT NULL, - `mean_response_time` int(11) NULL DEFAULT NULL, + `mean_response_time_with_timeout` int(11) NULL DEFAULT NULL, + `mean_response_time_without_timeout` int(11) NULL DEFAULT NULL, + `jitter_with_timeout` int(11) NULL DEFAULT NULL, + `jitter_without_timeout` int(11) NULL DEFAULT NULL, + `lost_per_measurement_percent` int(3) NOT NULL DEFAULT 0, `sent` bigint(20) NOT NULL DEFAULT 0, `received` bigint(20) NOT NULL DEFAULT 0, `count_started_at` timestamp, From 7f2acffd214f01639f86e493b10037cba2e9ae7f Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 28 Jan 2020 17:13:49 +0100 Subject: [PATCH 052/301] modified method modifiers to private --- .../core/qos/quartz/task/PingTask.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index a0c95ee1c..246a9ab63 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -89,9 +89,22 @@ public void execute(final JobExecutionContext context) throws JobExecutionExcept logger.debug("Finished: ping task"); } + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private Set getSystemsToMessure() { + logger.debug("getSystemToMessure started..."); + + final ServiceRegistryListResponseDTO serviceRegistryListResponseDTO = queryServiceRegistryAll(); + final Set systemList = serviceRegistryListResponseDTO.getData().stream().map(ServiceRegistryResponseDTO::getProvider).collect(Collectors.toSet()); + + return systemList; + } + //------------------------------------------------------------------------------------------------- @Transactional (rollbackFor = ArrowheadException.class) - public QoSIntraMeasurement createMeasurement(final System system,final QoSMeasurementType ping,final ZonedDateTime aroundNow) { + private QoSIntraMeasurement createMeasurement(final System system,final QoSMeasurementType ping,final ZonedDateTime aroundNow) { logger.debug("createMeasurement started..."); final QoSIntraMeasurement measurement = new QoSIntraMeasurement(system, QoSMeasurementType.PING, aroundNow); @@ -105,10 +118,10 @@ public QoSIntraMeasurement createMeasurement(final System system,final QoSMeasur } //------------------------------------------------------------------------------------------------- - @Transactional (rollbackFor = ArrowheadException.class) + @Transactional (rollbackFor = ArrowheadException.class) private QoSIntraPingMeasurement createPingMeasurement(final QoSIntraMeasurement measurementParam, final List responseList, final ZonedDateTime aroundNow) { - logger.debug("pingSystem started..."); + logger.debug("createPingMeasurement started..."); final boolean available = calculateAvailable(responseList); final int maxResponseTime = calculateMaxResponseTime(responseList); @@ -168,28 +181,15 @@ private QoSIntraPingMeasurement createPingMeasurement(final QoSIntraMeasurement //------------------------------------------------------------------------------------------------- @Transactional (rollbackFor = ArrowheadException.class) - public void updateMeasurement(ZonedDateTime aroundNow,final QoSIntraMeasurement measurement) { + private void updateMeasurement(ZonedDateTime aroundNow,final QoSIntraMeasurement measurement) { measurement.setLastMeasurementAt(aroundNow); qoSIntraMeasurementRepository.saveAndFlush(measurement); } - //================================================================================================= - // assistant methods - - //------------------------------------------------------------------------------------------------- - private Set getSystemsToMessure() { - logger.debug("getSystemToMessure started..."); - - final ServiceRegistryListResponseDTO serviceRegistryListResponseDTO = queryServiceRegistryAll(); - final Set systemList = serviceRegistryListResponseDTO.getData().stream().map(ServiceRegistryResponseDTO::getProvider).collect(Collectors.toSet()); - - return systemList; - } - //------------------------------------------------------------------------------------------------- - public void pingSystem(final SystemResponseDTO systemResponseDTO ) { + private void pingSystem(final SystemResponseDTO systemResponseDTO ) { logger.debug("pingSystem started..."); final ZonedDateTime aroundNow = ZonedDateTime.now(); From 626e58b665e7f224ba3cf8ed845d6712075da289 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 28 Jan 2020 17:14:51 +0100 Subject: [PATCH 053/301] implemented reset count --- .../qos/quartz/task/CountRestarterTask.java | 30 ++++++++++++++++++- .../quartz/task/CountRestarterTaskConfig.java | 2 +- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java index d4e0674b4..d87bf440a 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java @@ -1,12 +1,21 @@ package eu.arrowhead.core.qos.quartz.task; +import java.time.ZonedDateTime; +import java.util.List; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.quartz.DisallowConcurrentExecution; import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; +import eu.arrowhead.common.database.repository.QoSIntraMeasurementPingRepository; +import eu.arrowhead.common.exception.ArrowheadException; @Component @DisallowConcurrentExecution @@ -17,6 +26,9 @@ public class CountRestarterTask implements Job { protected Logger logger = LogManager.getLogger(CountRestarterTask.class); + @Autowired + private QoSIntraMeasurementPingRepository qoSIntraMeasurementPingRepository; + //================================================================================================= // methods @@ -24,10 +36,26 @@ public class CountRestarterTask implements Job { @Override public void execute(final JobExecutionContext context) throws JobExecutionException { logger.debug("STARTED: count restarter task"); - + + updateCountStartedAt(); + logger.debug("Finished: count restarter task"); } + @Transactional (rollbackFor = ArrowheadException.class) + public void updateCountStartedAt() { + logger.debug("updateCountStartedAt started..."); + + final List measurementList = qoSIntraMeasurementPingRepository.findAll(); + for (final QoSIntraPingMeasurement qoSIntraPingMeasurement : measurementList) { + qoSIntraPingMeasurement.setSent(0); + qoSIntraPingMeasurement.setReceived(0); + qoSIntraPingMeasurement.setCountStartedAt(ZonedDateTime.now()); + + qoSIntraMeasurementPingRepository.saveAndFlush(qoSIntraPingMeasurement); + + } + } //================================================================================================= // assistant methods diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java index 2f4c36b7a..7b7deaf99 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java @@ -35,7 +35,7 @@ public class CountRestarterTaskConfig { private static final String CRONE_EXPRESSION_MIDNIGHT_EVERY_DAY= "0 0 0 ? * * *"; private static final String NAME_OF_TRIGGER = "Counter_Restart_Task_Trigger"; - private static final String NAME_OF_TASK = "Counter_Restart_Task_Detail"; + private static final String NAME_OF_TASK = "Counter_Restart_Task_Detail"; //================================================================================================= // methods From 69fd0fa67547b837fca6c072e389861a4ab34cdc Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 29 Jan 2020 08:53:25 +0100 Subject: [PATCH 054/301] changed spaces to tabs --- .../core/qos/QoSMonitorController.java | 28 +++++---- .../core/qos/quartz/task/CloudPingTask.java | 2 +- .../qos/quartz/task/CloudPingTaskConfig.java | 62 +++++++++---------- .../quartz/task/CountRestarterTaskConfig.java | 42 ++++++------- .../core/qos/quartz/task/PingTask.java | 6 +- .../core/qos/quartz/task/PingTaskConfig.java | 12 ++-- 6 files changed, 77 insertions(+), 75 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java index b4c584c38..27a030ad0 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java @@ -28,20 +28,22 @@ public class QoSMonitorController { //================================================================================================= // members - private final Logger logger = LogManager.getLogger(QoSMonitorController.class); + private final Logger logger = LogManager.getLogger(QoSMonitorController.class); - //================================================================================================= + //================================================================================================= // methods - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return an echo message with the purpose of testing the core service availability", response = String.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = CoreCommonConstants.SWAGGER_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = CommonConstants.ECHO_URI) - public String echoService() { - return "Got it!"; - } + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return an echo message with the purpose of testing the core service availability", response = String.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = CoreCommonConstants.SWAGGER_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CommonConstants.ECHO_URI) + public String echoService() { + logger.debug("echoService started..."); + + return "Got it!"; + } } \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTask.java index b460a0f28..5d7594f2d 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTask.java @@ -19,7 +19,7 @@ public class CloudPingTask implements Job { //================================================================================================= // methods - + //------------------------------------------------------------------------------------------------- @Override public void execute(final JobExecutionContext context) throws JobExecutionException { diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTaskConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTaskConfig.java index 519a7df5f..52e61f7ab 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTaskConfig.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTaskConfig.java @@ -23,21 +23,21 @@ public class CloudPingTaskConfig { // members protected Logger logger = LogManager.getLogger(CloudPingTaskConfig.class); - + @Autowired - private ApplicationContext applicationContext; //NOSONAR - + private ApplicationContext applicationContext; //NOSONAR + @Value(CoreCommonConstants.$CLOUD_PING_TTL_SCHEDULED_WD) private boolean ttlScheduled; - + @Value(CoreCommonConstants.$CLOUD_PING_TTL_INTERVAL_WD) private int ttlInterval; - + private static final int SCHEDULER_DELAY = 5; - + private static final String NAME_OF_TRIGGER = "Cloud_Ping_Task_Trigger"; - private static final String NAME_OF_TASK = "Cloud_Ping_Task_Detail"; - + private static final String NAME_OF_TASK = "Cloud_Ping_Task_Detail"; + //================================================================================================= // methods @@ -48,39 +48,39 @@ public SchedulerFactoryBean cloudPingSheduler() { jobFactory.setApplicationContext(applicationContext); final SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean(); - if (ttlScheduled) { + if (ttlScheduled) { schedulerFactory.setJobFactory(jobFactory); - schedulerFactory.setJobDetails(cloudPingTaskDetails().getObject()); - schedulerFactory.setTriggers(cloudPingTaskTrigger().getObject()); - schedulerFactory.setStartupDelay(SCHEDULER_DELAY); - logger.info("Cloud ping task adjusted with ttl interval: {} minutes", ttlInterval); + schedulerFactory.setJobDetails(cloudPingTaskDetails().getObject()); + schedulerFactory.setTriggers(cloudPingTaskTrigger().getObject()); + schedulerFactory.setStartupDelay(SCHEDULER_DELAY); + logger.info("Cloud ping task adjusted with ttl interval: {} minutes", ttlInterval); } else { logger.info("Cloud ping task is not adjusted"); } - - return schedulerFactory; - } - + + return schedulerFactory; + } + //------------------------------------------------------------------------------------------------- @Bean - public SimpleTriggerFactoryBean cloudPingTaskTrigger() { + public SimpleTriggerFactoryBean cloudPingTaskTrigger() { final SimpleTriggerFactoryBean trigger = new SimpleTriggerFactoryBean(); trigger.setJobDetail(cloudPingTaskDetails().getObject()); - trigger.setRepeatInterval(ttlInterval * CommonConstants.CONVERSION_MILLISECOND_TO_MINUTE); - trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY); - trigger.setName(NAME_OF_TRIGGER); - - return trigger; - } - + trigger.setRepeatInterval(ttlInterval * CommonConstants.CONVERSION_MILLISECOND_TO_MINUTE); + trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY); + trigger.setName(NAME_OF_TRIGGER); + + return trigger; + } + //------------------------------------------------------------------------------------------------- @Bean - public JobDetailFactoryBean cloudPingTaskDetails() { + public JobDetailFactoryBean cloudPingTaskDetails() { final JobDetailFactoryBean jobDetailFactory = new JobDetailFactoryBean(); jobDetailFactory.setJobClass(PingTask.class); - jobDetailFactory.setName(NAME_OF_TASK); - jobDetailFactory.setDurability(true); - - return jobDetailFactory; - } + jobDetailFactory.setName(NAME_OF_TASK); + jobDetailFactory.setDurability(true); + + return jobDetailFactory; + } } \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java index 7b7deaf99..5f1a63e11 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java @@ -21,9 +21,9 @@ public class CountRestarterTaskConfig { // members protected Logger logger = LogManager.getLogger(CountRestarterTaskConfig.class); - + @Autowired - private ApplicationContext applicationContext; //NOSONAR + private ApplicationContext applicationContext; //NOSONAR @Value(CoreCommonConstants.$PING_TTL_SCHEDULED_WD) private boolean ttlScheduled; @@ -49,37 +49,37 @@ public SchedulerFactoryBean counterRestarterTaskSheduler() { final SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean(); if (ttlScheduled) { schedulerFactory.setJobFactory(jobFactory); - schedulerFactory.setJobDetails(counterRestartTaskDetails().getObject()); - schedulerFactory.setTriggers(counterRestartTaskTrigger().getObject()); - schedulerFactory.setStartupDelay(SCHEDULER_DELAY); - logger.info("Pin task adjusted with ttl interval: {} minutes", ttlInterval); + schedulerFactory.setJobDetails(counterRestartTaskDetails().getObject()); + schedulerFactory.setTriggers(counterRestartTaskTrigger().getObject()); + schedulerFactory.setStartupDelay(SCHEDULER_DELAY); + logger.info("Pin task adjusted with ttl interval: {} minutes", ttlInterval); } else { logger.info("Ping task is not adjusted"); } - - return schedulerFactory; - } + + return schedulerFactory; + } //------------------------------------------------------------------------------------------------- @Bean - public CronTriggerFactoryBean counterRestartTaskTrigger() { + public CronTriggerFactoryBean counterRestartTaskTrigger() { CronTriggerFactoryBean trigger = new CronTriggerFactoryBean(); trigger.setJobDetail(counterRestartTaskDetails().getObject()); trigger.setCronExpression(CRONE_EXPRESSION_MIDNIGHT_EVERY_DAY); - trigger.setName(NAME_OF_TRIGGER); - - return trigger; - } - + trigger.setName(NAME_OF_TRIGGER); + + return trigger; + } + //------------------------------------------------------------------------------------------------- @Bean - public JobDetailFactoryBean counterRestartTaskDetails() { + public JobDetailFactoryBean counterRestartTaskDetails() { final JobDetailFactoryBean jobDetailFactory = new JobDetailFactoryBean(); jobDetailFactory.setJobClass(CountRestarterTask.class); - jobDetailFactory.setName(NAME_OF_TASK); - jobDetailFactory.setDurability(true); - - return jobDetailFactory; - } + jobDetailFactory.setName(NAME_OF_TASK); + jobDetailFactory.setDurability(true); + + return jobDetailFactory; + } } \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 246a9ab63..ca4da7128 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -111,10 +111,10 @@ private QoSIntraMeasurement createMeasurement(final System system,final QoSMeasu measurement.setSystem(system); measurement.setMeasurementType(QoSMeasurementType.PING); - qoSIntraMeasurementRepository.saveAndFlush(measurement); - //qoSIntraMeasurementRepository.refresh(measurement); + qoSIntraMeasurementRepository.saveAndFlush(measurement); + //qoSIntraMeasurementRepository.refresh(measurement); - return measurement; + return measurement; } //------------------------------------------------------------------------------------------------- diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java index a7ede9f5b..80b1330d4 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java @@ -23,21 +23,21 @@ public class PingTaskConfig { // members protected Logger logger = LogManager.getLogger(PingTaskConfig.class); - + @Autowired private ApplicationContext applicationContext; //NOSONAR - + @Value(CoreCommonConstants.$PING_TTL_SCHEDULED_WD) private boolean ttlScheduled; - + @Value(CoreCommonConstants.$PING_TTL_INTERVAL_WD) private int ttlInterval; - + private static final int SCHEDULER_DELAY = 1; - + private static final String NAME_OF_TRIGGER = "Intra_Cloud_Ping_Task_Trigger"; private static final String NAME_OF_TASK = "Intra_Cloud_Ping_Task_Detail"; - + //================================================================================================= // methods From fa4037e85bd047c0280b4bac0643c7ce32d69a8f Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 29 Jan 2020 08:59:15 +0100 Subject: [PATCH 055/301] removed unnecessary comment --- .../main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java | 1 - 1 file changed, 1 deletion(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index ca4da7128..1b1d3db30 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -112,7 +112,6 @@ private QoSIntraMeasurement createMeasurement(final System system,final QoSMeasu measurement.setMeasurementType(QoSMeasurementType.PING); qoSIntraMeasurementRepository.saveAndFlush(measurement); - //qoSIntraMeasurementRepository.refresh(measurement); return measurement; } From 5efed2498ab9eb7e9bda0104ae3e35a8cf0349ca Mon Sep 17 00:00:00 2001 From: rbocsi Date: Wed, 29 Jan 2020 14:22:41 +0100 Subject: [PATCH 056/301] QoSManager skeleton prerequisities to redesigning orchestration process for working with QosManager --- .../arrowhead/common/CoreCommonConstants.java | 3 ++ .../eu/arrowhead/common/CoreDefaults.java | 2 + .../OrchestratorApplicationInitListener.java | 12 +++++ .../DefaultIntraCloudProviderMatchmaker.java | 20 ++++----- ...ntraCloudProviderMatchmakingAlgorithm.java | 4 +- .../RandomIntraCloudProviderMatchmaker.java | 20 ++++----- .../service/OrchestratorDriver.java | 13 ++++++ .../service/OrchestratorService.java | 41 ++++++++++++----- .../core/qos/manager/QoSManager.java | 5 +++ .../qos/manager/impl/DummyQoSManager.java | 7 +++ .../core/qos/manager/impl/QoSManagerImpl.java | 7 +++ ...faultIntraCloudProviderMatchmakerTest.java | 40 ++++++++--------- ...andomIntraCloudProviderMatchmakerTest.java | 44 +++++++++---------- .../service/OrchestratorServiceTest.java | 13 ++++-- 14 files changed, 152 insertions(+), 79 deletions(-) create mode 100644 orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java create mode 100644 orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java create mode 100644 orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java index c567f3664..4f90e6e88 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java @@ -116,6 +116,9 @@ public class CoreCommonConstants { public static final int TOP_PRIORITY = 1; + public static final String QOS_MANAGER = "qosManager"; + public static final String QOS_ENABLED = "enable_qos"; + public static final String $QOS_ENABLED_WD = "${" + QOS_ENABLED + ":" + CoreDefaults.DEFAULT_QOS_ENABLED + "}"; public static final String QOS_RESERVATION_CHECK_INTERVAL = "qos_reservation_check_interval"; // in minutes public static final String $QOS_RESERVATION_CHECK_INTERVAL_WS = "${" + QOS_RESERVATION_CHECK_INTERVAL + ":" + CoreDefaults.DEFAULT_QOS_RESERVATION_CHECK_INTERVAL + "}"; diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java b/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java index b253ba0ee..17fc47442 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java @@ -13,6 +13,7 @@ public class CoreDefaults { public static final boolean DEFAULT_USE_STRICT_SERVICE_INTF_NAME_VERIFIER = false; public static final int DEFAULT_URI_CRAWLER_INTERVAL = 30; public static final int DEFAULT_AUTH_TOKEN_TTL_IN_MINUTES = -1; // never expires + public static final int DEFAULT_AUTH_TOKEN_TTL_IN_MINUTES_WITH_QOS_ENABLED = 60; // when QoS enabled, we want to make sure that tokens expires eventually public static final boolean DEFAULT_SERVICE_REGISTRY_PING_SCHEDULED = false; public static final int DEFAULT_SERVICE_REGISTRY_PING_INTERVAL_MINUTES = 60; @@ -51,6 +52,7 @@ public class CoreDefaults { public static final boolean DEFAULT_CLOUD_PING_TTL_SCHEDULED = false; public static final int DEFAULT_CLOUD_PING_TTL_INTERVAL_MINUTES = 10; + public static final boolean DEFAULT_QOS_ENABLED = false; public static final int DEFAULT_QOS_RESERVATION_CHECK_INTERVAL = 60; // in seconds //================================================================================================= diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/OrchestratorApplicationInitListener.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/OrchestratorApplicationInitListener.java index ef13b43b3..1e1f7cdea 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/OrchestratorApplicationInitListener.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/OrchestratorApplicationInitListener.java @@ -21,6 +21,9 @@ import eu.arrowhead.core.orchestrator.matchmaking.InterCloudProviderMatchmakingAlgorithm; import eu.arrowhead.core.orchestrator.matchmaking.IntraCloudProviderMatchmakingAlgorithm; import eu.arrowhead.core.orchestrator.matchmaking.RandomIntraCloudProviderMatchmaker; +import eu.arrowhead.core.qos.manager.QoSManager; +import eu.arrowhead.core.qos.manager.impl.DummyQoSManager; +import eu.arrowhead.core.qos.manager.impl.QoSManagerImpl; @Component public class OrchestratorApplicationInitListener extends ApplicationInitListener { @@ -31,6 +34,9 @@ public class OrchestratorApplicationInitListener extends ApplicationInitListener @Value(CoreCommonConstants.$ORCHESTRATOR_IS_GATEKEEPER_PRESENT_WD) private boolean gatekeeperIsPresent; + @Value(CoreCommonConstants.$QOS_ENABLED_WD) + private boolean qosEnabled; + //================================================================================================= // methods @@ -51,6 +57,12 @@ public InterCloudProviderMatchmakingAlgorithm getInterCloudProviderMatchmaker() public CloudMatchmakingAlgorithm getCloudMatchmaker() { return new DefaultCloudMatchmaker(); } + + //------------------------------------------------------------------------------------------------- + @Bean(CoreCommonConstants.QOS_MANAGER) + public QoSManager getQoSManager() { + return qosEnabled ? new QoSManagerImpl() : new DummyQoSManager(); + } //================================================================================================= // assistant methods diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/matchmaking/DefaultIntraCloudProviderMatchmaker.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/matchmaking/DefaultIntraCloudProviderMatchmaker.java index e29a27ec1..8dd338485 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/matchmaking/DefaultIntraCloudProviderMatchmaker.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/matchmaking/DefaultIntraCloudProviderMatchmaker.java @@ -7,8 +7,8 @@ import org.springframework.util.Assert; import eu.arrowhead.common.dto.internal.DTOUtilities; +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; import eu.arrowhead.common.dto.shared.PreferredProviderDataDTO; -import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; public class DefaultIntraCloudProviderMatchmaker implements IntraCloudProviderMatchmakingAlgorithm { @@ -25,28 +25,28 @@ public class DefaultIntraCloudProviderMatchmaker implements IntraCloudProviderMa * This algorithm returns the first (preferred) provider. */ @Override - public ServiceRegistryResponseDTO doMatchmaking(final List srList, final IntraCloudProviderMatchmakingParameters params) { + public OrchestrationResultDTO doMatchmaking(final List orList, final IntraCloudProviderMatchmakingParameters params) { logger.debug("DefaultIntraCloudProviderMatchmaker.doMatchmaking started..."); - Assert.isTrue(srList != null && !srList.isEmpty(), "srList is null or empty."); + Assert.isTrue(orList != null && !orList.isEmpty(), "orList is null or empty."); Assert.notNull(params, "params is null"); if (params.getPreferredLocalProviders().isEmpty()) { - logger.debug("No preferred provider is specified, the first one in the SR list is selected."); - return srList.get(0); + logger.debug("No preferred provider is specified, the first one in the list is selected."); + return orList.get(0); } - for (final ServiceRegistryResponseDTO srResult : srList) { + for (final OrchestrationResultDTO orResult : orList) { for (final PreferredProviderDataDTO provider : params.getPreferredLocalProviders()) { - if (DTOUtilities.equalsSystemInResponseAndRequest(srResult.getProvider(), provider.getProviderSystem())) { - logger.debug("The first preferred provider found in SR is selected."); - return srResult; + if (DTOUtilities.equalsSystemInResponseAndRequest(orResult.getProvider(), provider.getProviderSystem())) { + logger.debug("The first preferred provider found in the list is selected."); + return orResult; } } } logger.debug("no match was found between preferred providers, the first one is selected."); - return srList.get(0); + return orList.get(0); } } \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/matchmaking/IntraCloudProviderMatchmakingAlgorithm.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/matchmaking/IntraCloudProviderMatchmakingAlgorithm.java index 01117dfda..ac5d27f7b 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/matchmaking/IntraCloudProviderMatchmakingAlgorithm.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/matchmaking/IntraCloudProviderMatchmakingAlgorithm.java @@ -2,7 +2,7 @@ import java.util.List; -import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; public interface IntraCloudProviderMatchmakingAlgorithm { @@ -10,5 +10,5 @@ public interface IntraCloudProviderMatchmakingAlgorithm { // methods //------------------------------------------------------------------------------------------------- - public ServiceRegistryResponseDTO doMatchmaking(final List srList, final IntraCloudProviderMatchmakingParameters params); + public OrchestrationResultDTO doMatchmaking(final List orList, final IntraCloudProviderMatchmakingParameters params); } \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/matchmaking/RandomIntraCloudProviderMatchmaker.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/matchmaking/RandomIntraCloudProviderMatchmaker.java index 6eeb6fc20..f885976da 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/matchmaking/RandomIntraCloudProviderMatchmaker.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/matchmaking/RandomIntraCloudProviderMatchmaker.java @@ -8,8 +8,8 @@ import org.springframework.util.Assert; import eu.arrowhead.common.dto.internal.DTOUtilities; +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; import eu.arrowhead.common.dto.shared.PreferredProviderDataDTO; -import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; public class RandomIntraCloudProviderMatchmaker implements IntraCloudProviderMatchmakingAlgorithm { @@ -28,10 +28,10 @@ public class RandomIntraCloudProviderMatchmaker implements IntraCloudProviderMat * This algorithm returns the first (preferred) provider. */ @Override - public ServiceRegistryResponseDTO doMatchmaking(final List srList, final IntraCloudProviderMatchmakingParameters params) { + public OrchestrationResultDTO doMatchmaking(final List orList, final IntraCloudProviderMatchmakingParameters params) { logger.debug("RandomIntraCloudProviderMatchmaker.doMatchmaking started..."); - Assert.isTrue(srList != null && !srList.isEmpty(), "srList is null or empty."); + Assert.isTrue(orList != null && !orList.isEmpty(), "orList is null or empty."); Assert.notNull(params, "params is null"); if (rng == null) { @@ -39,21 +39,21 @@ public ServiceRegistryResponseDTO doMatchmaking(final List orList = compileOrchestrationResponse(queryData, request); + + // Generate the authorization tokens if it is requested based on the service security (modifies the orList) + orList = orchestratorDriver.generateAuthTokens(request, orList); + + return new OrchestrationResponseDTO(orList); } //------------------------------------------------------------------------------------------------- @@ -167,7 +172,12 @@ public OrchestrationResponseDTO topPriorityEntriesOrchestrationProcess(final Orc return new OrchestrationResponseDTO(); // empty response } - return compileOrchestrationResponse(crossCheckedEntryList, orchestrationFormRequestDTO); + List orList = compileOrchestrationResponse(crossCheckedEntryList, orchestrationFormRequestDTO); + + // Generate the authorization tokens if it is requested based on the service security (modifies the orList) + orList = orchestratorDriver.generateAuthTokens(orchestrationFormRequestDTO, orList); + + return new OrchestrationResponseDTO(orList); } //------------------------------------------------------------------------------------------------- @@ -258,19 +268,25 @@ public OrchestrationResponseDTO dynamicOrchestration(final OrchestrationFormRequ } } + List orList = compileOrchestrationResponse(queryData, request); + // If matchmaking is requested, we pick out 1 ServiceRegistryEntry entity from the list. if (flags.get(Flag.MATCHMAKING)) { final IntraCloudProviderMatchmakingParameters params = new IntraCloudProviderMatchmakingParameters(localProviders); // set additional parameters here if you use a different matchmaking algorithm - final ServiceRegistryResponseDTO selected = intraCloudProviderMatchmaker.doMatchmaking(queryData, params); - queryData.clear(); - queryData.add(selected); + final OrchestrationResultDTO selected = intraCloudProviderMatchmaker.doMatchmaking(orList, params); + orList.clear(); + orList.add(selected); } // all the filtering is done logger.debug("dynamicOrchestration finished with {} service providers.", queryData.size()); - return compileOrchestrationResponse(queryData, request); + + // Generate the authorization tokens if it is requested based on the service security (modifies the orList) + orList = orchestratorDriver.generateAuthTokens(request, orList); + + return new OrchestrationResponseDTO(orList); } //------------------------------------------------------------------------------------------------- @@ -397,7 +413,7 @@ private List removeNonPreferred(final List srList, final OrchestrationFormRequestDTO request) { + private List compileOrchestrationResponse(final List srList, final OrchestrationFormRequestDTO request) { logger.debug("compileOrchestrationResponse started..."); List orList = new ArrayList<>(srList.size()); @@ -412,12 +428,9 @@ private OrchestrationResponseDTO compileOrchestrationResponse(final List orList = compileOrchestrationResponse(List.of(serviceRegistryResponseDTO), request); + // Generate the authorization tokens if it is requested based on the service security (modifies the orList) + orList = orchestratorDriver.generateAuthTokens(request, orList); + + return new OrchestrationResponseDTO(orList); } } diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java new file mode 100644 index 000000000..dec08d45a --- /dev/null +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java @@ -0,0 +1,5 @@ +package eu.arrowhead.core.qos.manager; + +public interface QoSManager { + +} diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java new file mode 100644 index 000000000..5ad196c8b --- /dev/null +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java @@ -0,0 +1,7 @@ +package eu.arrowhead.core.qos.manager.impl; + +import eu.arrowhead.core.qos.manager.QoSManager; + +public class DummyQoSManager implements QoSManager { + +} \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java new file mode 100644 index 000000000..a765a0067 --- /dev/null +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java @@ -0,0 +1,7 @@ +package eu.arrowhead.core.qos.manager.impl; + +import eu.arrowhead.core.qos.manager.QoSManager; + +public class QoSManagerImpl implements QoSManager { + +} \ No newline at end of file diff --git a/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/matchmaking/DefaultIntraCloudProviderMatchmakerTest.java b/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/matchmaking/DefaultIntraCloudProviderMatchmakerTest.java index 55e9f145a..7b867430f 100644 --- a/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/matchmaking/DefaultIntraCloudProviderMatchmakerTest.java +++ b/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/matchmaking/DefaultIntraCloudProviderMatchmakerTest.java @@ -7,8 +7,8 @@ import org.junit.runner.RunWith; import org.springframework.test.context.junit4.SpringRunner; +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; import eu.arrowhead.common.dto.shared.PreferredProviderDataDTO; -import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; import eu.arrowhead.common.dto.shared.SystemRequestDTO; import eu.arrowhead.common.dto.shared.SystemResponseDTO; @@ -38,20 +38,20 @@ public void doMatchmakingSRListEmpty() { //------------------------------------------------------------------------------------------------- @Test(expected = IllegalArgumentException.class) public void doMatchmakingParamsNull() { - algorithm.doMatchmaking(List.of(new ServiceRegistryResponseDTO()), null); + algorithm.doMatchmaking(List.of(new OrchestrationResultDTO()), null); } //------------------------------------------------------------------------------------------------- @Test public void doMatchmakingNoPreferred() { - final ServiceRegistryResponseDTO dto1 = new ServiceRegistryResponseDTO(); - dto1.setId(1); - final ServiceRegistryResponseDTO dto2 = new ServiceRegistryResponseDTO(); - dto2.setId(2); + final OrchestrationResultDTO dto1 = new OrchestrationResultDTO(); + dto1.setVersion(1); + final OrchestrationResultDTO dto2 = new OrchestrationResultDTO(); + dto2.setVersion(2); - final ServiceRegistryResponseDTO selected = algorithm.doMatchmaking(List.of(dto1, dto2), new IntraCloudProviderMatchmakingParameters(List.of())); + final OrchestrationResultDTO selected = algorithm.doMatchmaking(List.of(dto1, dto2), new IntraCloudProviderMatchmakingParameters(List.of())); - Assert.assertEquals(1, selected.getId()); + Assert.assertEquals(1, selected.getVersion().intValue()); } //------------------------------------------------------------------------------------------------- @@ -59,11 +59,11 @@ public void doMatchmakingNoPreferred() { public void doMatchmakingNoPreferredMatch() { final SystemResponseDTO system1 = new SystemResponseDTO(1, "system1", "localhost", 1234, null, null, null); final SystemResponseDTO system2 = new SystemResponseDTO(1, "system2", "localhost", 4567, null, null, null); - final ServiceRegistryResponseDTO dto1 = new ServiceRegistryResponseDTO(); - dto1.setId(1); + final OrchestrationResultDTO dto1 = new OrchestrationResultDTO(); + dto1.setVersion(1); dto1.setProvider(system1); - final ServiceRegistryResponseDTO dto2 = new ServiceRegistryResponseDTO(); - dto2.setId(2); + final OrchestrationResultDTO dto2 = new OrchestrationResultDTO(); + dto2.setVersion(2); dto2.setProvider(system2); final SystemRequestDTO reqSystem = new SystemRequestDTO(); @@ -73,9 +73,9 @@ public void doMatchmakingNoPreferredMatch() { final PreferredProviderDataDTO ppDTO = new PreferredProviderDataDTO(); ppDTO.setProviderSystem(reqSystem); - final ServiceRegistryResponseDTO selected = algorithm.doMatchmaking(List.of(dto1, dto2), new IntraCloudProviderMatchmakingParameters(List.of(ppDTO))); + final OrchestrationResultDTO selected = algorithm.doMatchmaking(List.of(dto1, dto2), new IntraCloudProviderMatchmakingParameters(List.of(ppDTO))); - Assert.assertEquals(1, selected.getId()); + Assert.assertEquals(1, selected.getVersion().intValue()); } //------------------------------------------------------------------------------------------------- @@ -83,11 +83,11 @@ public void doMatchmakingNoPreferredMatch() { public void doMatchmakingPreferredMatch() { final SystemResponseDTO system1 = new SystemResponseDTO(1, "system1", "localhost", 1234, null, null, null); final SystemResponseDTO system2 = new SystemResponseDTO(1, "system2", "localhost", 4567, null, null, null); - final ServiceRegistryResponseDTO dto1 = new ServiceRegistryResponseDTO(); - dto1.setId(1); + final OrchestrationResultDTO dto1 = new OrchestrationResultDTO(); + dto1.setVersion(1); dto1.setProvider(system1); - final ServiceRegistryResponseDTO dto2 = new ServiceRegistryResponseDTO(); - dto2.setId(2); + final OrchestrationResultDTO dto2 = new OrchestrationResultDTO(); + dto2.setVersion(2); dto2.setProvider(system2); final SystemRequestDTO reqSystem = new SystemRequestDTO(); @@ -97,8 +97,8 @@ public void doMatchmakingPreferredMatch() { final PreferredProviderDataDTO ppDTO = new PreferredProviderDataDTO(); ppDTO.setProviderSystem(reqSystem); - final ServiceRegistryResponseDTO selected = algorithm.doMatchmaking(List.of(dto1, dto2), new IntraCloudProviderMatchmakingParameters(List.of(ppDTO))); + final OrchestrationResultDTO selected = algorithm.doMatchmaking(List.of(dto1, dto2), new IntraCloudProviderMatchmakingParameters(List.of(ppDTO))); - Assert.assertEquals(2, selected.getId()); + Assert.assertEquals(2, selected.getVersion().intValue()); } } \ No newline at end of file diff --git a/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/matchmaking/RandomIntraCloudProviderMatchmakerTest.java b/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/matchmaking/RandomIntraCloudProviderMatchmakerTest.java index aab9378bd..a22de1c5a 100644 --- a/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/matchmaking/RandomIntraCloudProviderMatchmakerTest.java +++ b/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/matchmaking/RandomIntraCloudProviderMatchmakerTest.java @@ -8,8 +8,8 @@ import org.junit.runner.RunWith; import org.springframework.test.context.junit4.SpringRunner; +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; import eu.arrowhead.common.dto.shared.PreferredProviderDataDTO; -import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; import eu.arrowhead.common.dto.shared.SystemRequestDTO; import eu.arrowhead.common.dto.shared.SystemResponseDTO; @@ -40,16 +40,16 @@ public void doMatchmakingSRListEmpty() { //------------------------------------------------------------------------------------------------- @Test(expected = IllegalArgumentException.class) public void doMatchmakingParamsNull() { - algorithm.doMatchmaking(List.of(new ServiceRegistryResponseDTO()), null); + algorithm.doMatchmaking(List.of(new OrchestrationResultDTO()), null); } //------------------------------------------------------------------------------------------------- @Test public void doMatchmakingNoPreferred() { - final ServiceRegistryResponseDTO dto1 = new ServiceRegistryResponseDTO(); - dto1.setId(1); - final ServiceRegistryResponseDTO dto2 = new ServiceRegistryResponseDTO(); - dto2.setId(2); + final OrchestrationResultDTO dto1 = new OrchestrationResultDTO(); + dto1.setVersion(1); + final OrchestrationResultDTO dto2 = new OrchestrationResultDTO(); + dto2.setVersion(2); final long seed = System.currentTimeMillis(); IntraCloudProviderMatchmakingParameters params = new IntraCloudProviderMatchmakingParameters(List.of()); @@ -57,10 +57,10 @@ public void doMatchmakingNoPreferred() { rng.setSeed(seed); algorithm = new RandomIntraCloudProviderMatchmaker(); // to make sure the same seed is set - final List srList = List.of(dto1, dto2); - final ServiceRegistryResponseDTO selected = algorithm.doMatchmaking(srList, params); + final List orList = List.of(dto1, dto2); + final OrchestrationResultDTO selected = algorithm.doMatchmaking(orList, params); - Assert.assertEquals(srList.get(rng.nextInt(2)).getId(), selected.getId()); + Assert.assertEquals(orList.get(rng.nextInt(2)).getVersion().intValue(), selected.getVersion().intValue()); } //------------------------------------------------------------------------------------------------- @@ -68,11 +68,11 @@ public void doMatchmakingNoPreferred() { public void doMatchmakingNoPreferredMatch() { final SystemResponseDTO system1 = new SystemResponseDTO(1, "system1", "localhost", 1234, null, null, null); final SystemResponseDTO system2 = new SystemResponseDTO(1, "system2", "localhost", 4567, null, null, null); - final ServiceRegistryResponseDTO dto1 = new ServiceRegistryResponseDTO(); - dto1.setId(1); + final OrchestrationResultDTO dto1 = new OrchestrationResultDTO(); + dto1.setVersion(1); dto1.setProvider(system1); - final ServiceRegistryResponseDTO dto2 = new ServiceRegistryResponseDTO(); - dto2.setId(2); + final OrchestrationResultDTO dto2 = new OrchestrationResultDTO(); + dto2.setVersion(2); dto2.setProvider(system2); final SystemRequestDTO reqSystem = new SystemRequestDTO(); @@ -88,10 +88,10 @@ public void doMatchmakingNoPreferredMatch() { rng.setSeed(seed); algorithm = new RandomIntraCloudProviderMatchmaker(); // to make sure the same seed is set - final List srList = List.of(dto1, dto2); - final ServiceRegistryResponseDTO selected = algorithm.doMatchmaking(srList, params); + final List orList = List.of(dto1, dto2); + final OrchestrationResultDTO selected = algorithm.doMatchmaking(orList, params); - Assert.assertEquals(srList.get(rng.nextInt(2)).getId(), selected.getId()); + Assert.assertEquals(orList.get(rng.nextInt(2)).getVersion().intValue(), selected.getVersion().intValue()); } //------------------------------------------------------------------------------------------------- @@ -99,11 +99,11 @@ public void doMatchmakingNoPreferredMatch() { public void doMatchmakingPreferredMatch() { final SystemResponseDTO system1 = new SystemResponseDTO(1, "system1", "localhost", 1234, null, null, null); final SystemResponseDTO system2 = new SystemResponseDTO(1, "system2", "localhost", 4567, null, null, null); - final ServiceRegistryResponseDTO dto1 = new ServiceRegistryResponseDTO(); - dto1.setId(1); + final OrchestrationResultDTO dto1 = new OrchestrationResultDTO(); + dto1.setVersion(1); dto1.setProvider(system1); - final ServiceRegistryResponseDTO dto2 = new ServiceRegistryResponseDTO(); - dto2.setId(2); + final OrchestrationResultDTO dto2 = new OrchestrationResultDTO(); + dto2.setVersion(2); dto2.setProvider(system2); final SystemRequestDTO reqSystem = new SystemRequestDTO(); @@ -113,8 +113,8 @@ public void doMatchmakingPreferredMatch() { final PreferredProviderDataDTO ppDTO = new PreferredProviderDataDTO(); ppDTO.setProviderSystem(reqSystem); - final ServiceRegistryResponseDTO selected = algorithm.doMatchmaking(List.of(dto1, dto2), new IntraCloudProviderMatchmakingParameters(List.of(ppDTO))); + final OrchestrationResultDTO selected = algorithm.doMatchmaking(List.of(dto1, dto2), new IntraCloudProviderMatchmakingParameters(List.of(ppDTO))); - Assert.assertEquals(2, selected.getId()); + Assert.assertEquals(2, selected.getVersion().intValue()); } } \ No newline at end of file diff --git a/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/service/OrchestratorServiceTest.java b/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/service/OrchestratorServiceTest.java index d4b4a56c2..2947a5ce4 100644 --- a/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/service/OrchestratorServiceTest.java +++ b/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/service/OrchestratorServiceTest.java @@ -637,19 +637,26 @@ public void testDynamicOrchestrationOneResultWithMatchmaking() { requestedService(serviceForm). flag(Flag.MATCHMAKING, true). build(); + final ServiceDefinitionResponseDTO serviceDefinitionResponseDTO = new ServiceDefinitionResponseDTO(3, "service", null, null); + final ServiceInterfaceResponseDTO serviceInterfaceResponseDTO = new ServiceInterfaceResponseDTO(4, "HTTP-SECURE-JSON", null, null); final ServiceRegistryResponseDTO srEntry = new ServiceRegistryResponseDTO(); srEntry.setProvider(new SystemResponseDTO(1, "a", "b", 3, null, null, null)); + srEntry.setServiceDefinition(serviceDefinitionResponseDTO); + srEntry.setInterfaces(List.of(serviceInterfaceResponseDTO)); final ServiceRegistryResponseDTO srEntry2 = new ServiceRegistryResponseDTO(); srEntry2.setProvider(new SystemResponseDTO(2, "d", "e", 6, null, null, null)); - srEntry2.setServiceDefinition(new ServiceDefinitionResponseDTO(3, "service", null, null)); - srEntry2.setInterfaces(List.of(new ServiceInterfaceResponseDTO(4, "HTTP-SECURE-JSON", null, null))); + srEntry2.setServiceDefinition(serviceDefinitionResponseDTO); + srEntry2.setInterfaces(List.of(serviceInterfaceResponseDTO)); final ServiceQueryResultDTO srResult = new ServiceQueryResultDTO(); srResult.getServiceQueryData().add(srEntry); srResult.getServiceQueryData().add(srEntry2); + final OrchestrationResultDTO convertedSrEntry2 = new OrchestrationResultDTO(srEntry2.getProvider(), srEntry2.getServiceDefinition(), srEntry2.getServiceUri(), + srEntry2.getSecure(), srEntry2.getMetadata(), srEntry2.getInterfaces(), srEntry2.getVersion()); + when(orchestratorDriver.queryServiceRegistry(any(ServiceQueryFormDTO.class), anyBoolean(), anyBoolean())).thenReturn(srResult); when(orchestratorDriver.queryAuthorization(any(SystemRequestDTO.class), any())).thenReturn(srResult.getServiceQueryData()); - when(intraCloudProviderMatchmaker.doMatchmaking(any(), any(IntraCloudProviderMatchmakingParameters.class))).thenReturn(srEntry2); + when(intraCloudProviderMatchmaker.doMatchmaking(any(), any(IntraCloudProviderMatchmakingParameters.class))).thenReturn(convertedSrEntry2); when(orchestratorDriver.generateAuthTokens(any(OrchestrationFormRequestDTO.class), any())).thenCallRealMethod(); final OrchestrationResponseDTO result = testingObject.dynamicOrchestration(request); From 9b7aa718ffbd86c5e2425a969c844db7649c3e15 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Thu, 30 Jan 2020 13:52:33 +0100 Subject: [PATCH 057/301] modifying token generation to handle custom duration redesigned orchestration processes (not finished yet) some QoSManager implementation code --- .../AuthorizationController.java | 9 +-- .../token/TokenGenerationService.java | 18 +++--- .../AuthorizationControllerTokenTest.java | 4 +- .../token/TokenGenerationServiceTest.java | 45 +++++++------- .../eu/arrowhead/common/CommonConstants.java | 1 + .../repository/QoSReservationRepository.java | 1 + .../internal/TokenGenerationProviderDTO.java | 8 ++- .../internal/TokenGenerationRequestDTO.java | 9 +-- .../shared/OrchestrationFormRequestDTO.java | 4 ++ .../service/OrchestratorDriver.java | 17 +++++- .../service/OrchestratorService.java | 49 +++++++++++++-- .../service/QoSReservationDBService.java | 13 ++++ .../core/qos/manager/QoSManager.java | 16 ++++- .../qos/manager/impl/DummyQoSManager.java | 13 ++++ .../core/qos/manager/impl/QoSManagerImpl.java | 61 +++++++++++++++++++ .../service/OrchestratorServiceTest.java | 9 +++ qos-monitor/.project | 6 +- 17 files changed, 223 insertions(+), 60 deletions(-) diff --git a/authorization/src/main/java/eu/arrowhead/core/authorization/AuthorizationController.java b/authorization/src/main/java/eu/arrowhead/core/authorization/AuthorizationController.java index f38c0adec..63c15435d 100644 --- a/authorization/src/main/java/eu/arrowhead/core/authorization/AuthorizationController.java +++ b/authorization/src/main/java/eu/arrowhead/core/authorization/AuthorizationController.java @@ -597,10 +597,6 @@ public void removeAuthorizationInterCloudById(@PathVariable(value = PATH_VARIABL logger.debug("New token generation request received"); checkTokenGenerationRequest(request); - if (request.getDuration() != null && request.getDuration().intValue() <= 0) { - request.setDuration(null); - } - final TokenGenerationResponseDTO response = tokenGenerationService.generateTokensResponse(request); logger.debug("{} token(s) are generated for {}", calculateNumberOfTokens(response.getTokenData()), request.getConsumer().getSystemName()); @@ -669,6 +665,11 @@ private void checkTokenGenerationProviderDTO(final TokenGenerationProviderDTO pr throw new BadPayloadException("Specified interface name is not valid: " + intf, HttpStatus.SC_BAD_REQUEST, origin); } } + + if (provider.getTokenDuration() <= 0) { + provider.setTokenDuration(-1); + } + } //------------------------------------------------------------------------------------------------- diff --git a/authorization/src/main/java/eu/arrowhead/core/authorization/token/TokenGenerationService.java b/authorization/src/main/java/eu/arrowhead/core/authorization/token/TokenGenerationService.java index 86da3e05c..ac4215250 100644 --- a/authorization/src/main/java/eu/arrowhead/core/authorization/token/TokenGenerationService.java +++ b/authorization/src/main/java/eu/arrowhead/core/authorization/token/TokenGenerationService.java @@ -78,21 +78,17 @@ public Map> generateTokens(final TokenGenera final Map publicKeys = getProviderPublicKeys(request.getProviders()); final Map> result = new HashMap<>(publicKeys.size()); final String consumerInfo = generateConsumerInfo(request.getConsumer(), request.getConsumerCloud()); - final Map signedJWTs = new HashMap<>(); for (final TokenGenerationProviderDTO provider : request.getProviders()) { final SystemRequestDTO providerSystem = provider.getProvider(); if (publicKeys.containsKey(providerSystem)) { for (final String intf : provider.getServiceInterfaces()) { - String signedJWT = signedJWTs.get(intf); - if (signedJWT == null) { - try { - signedJWT = generateSignedJWT(consumerInfo, request.getService(), intf, request.getDuration()); - signedJWTs.put(intf, signedJWT); - } catch (final JoseException ex) { - logger.error("Problem occured when trying to sign JWT token", ex); - throw new ArrowheadException("Token generation failed"); // if there is a problem here, all calling cause the same problem - } + String signedJWT; + try { + signedJWT = generateSignedJWT(consumerInfo, request.getService(), intf, provider.getTokenDuration() < 0 ? null: provider.getTokenDuration()); + } catch (final JoseException ex) { + logger.error("Problem occured when trying to sign JWT token", ex); + throw new ArrowheadException("Token generation failed"); // if there is a problem here, all calling cause the same problem } try { @@ -284,7 +280,7 @@ private JwtClaims generateTokenPayload(final String consumerInfo, final String s claims.setIssuedAtToNow(); claims.setNotBeforeMinutesInThePast(1); if (duration != null) { - claims.setExpirationTimeMinutesInTheFuture(duration.floatValue()); + claims.setExpirationTimeMinutesInTheFuture(duration.floatValue() / CommonConstants.CONVERSION_SECOND_TO_MINUTE); } claims.setStringClaim(CommonConstants.JWT_CLAIM_CONSUMER_ID, consumerInfo); claims.setStringClaim(CommonConstants.JWT_CLAIM_SERVICE_ID, service.toLowerCase()); diff --git a/authorization/src/test/java/eu/arrowhead/core/authorization/AuthorizationControllerTokenTest.java b/authorization/src/test/java/eu/arrowhead/core/authorization/AuthorizationControllerTokenTest.java index 2b0593fec..33a528f24 100644 --- a/authorization/src/test/java/eu/arrowhead/core/authorization/AuthorizationControllerTokenTest.java +++ b/authorization/src/test/java/eu/arrowhead/core/authorization/AuthorizationControllerTokenTest.java @@ -529,8 +529,8 @@ private TokenGenerationRequestDTO getRequest() { provider.setPort(18765); provider.setAuthenticationInfo("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1aaeuv1I4bF5dxMIvUvLMxjRn309kdJewIIH08DfL17/LSssD70ZaLz0yxNfbPPQpFK8LMK+HQHDiGZH5yp4qJDuEgfmUrqWibnBIBc/K3Ob45lQy0zdFVtFsVJYBFVymQwgxJT6th0hI3RGLbCJMzbmpDzT7g0IDsN+64tMyi08ZCPrqk99uzYgioSSWNb9bhG2Z9646b3oiY5utQWRhP/2z/t6vVJHtRYeyaXPl6Z2M/5KnjpSvpSeZQhNrw+Is1DEE5DHiEjfQFWrLwDOqPKDrvmFyIlJ7P7OCMax6dIlSB7GEQSSP+j4eIxDWgjm+Pv/c02UVDc0x3xX/UGtNwIDAQAB"); - final TokenGenerationProviderDTO providerDTO = new TokenGenerationProviderDTO(provider, List.of("HTTP-SECURE-JSON")); + final TokenGenerationProviderDTO providerDTO = new TokenGenerationProviderDTO(provider, 6000, List.of("HTTP-SECURE-JSON")); - return new TokenGenerationRequestDTO(consumer, consumerCloud, List.of(providerDTO), "aservice", null); + return new TokenGenerationRequestDTO(consumer, consumerCloud, List.of(providerDTO), "aservice"); } } \ No newline at end of file diff --git a/authorization/src/test/java/eu/arrowhead/core/authorization/token/TokenGenerationServiceTest.java b/authorization/src/test/java/eu/arrowhead/core/authorization/token/TokenGenerationServiceTest.java index 948994922..2f910d121 100644 --- a/authorization/src/test/java/eu/arrowhead/core/authorization/token/TokenGenerationServiceTest.java +++ b/authorization/src/test/java/eu/arrowhead/core/authorization/token/TokenGenerationServiceTest.java @@ -91,7 +91,7 @@ public void testGenerateTokenNullConsumer() { @Test(expected = InvalidParameterException.class) public void testGenerateTokenConsumerNameNull() { final SystemRequestDTO consumer = new SystemRequestDTO(); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(new TokenGenerationProviderDTO()), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(new TokenGenerationProviderDTO()), "testService"); tokenGenerationService.generateTokens(request); } @@ -100,7 +100,7 @@ public void testGenerateTokenConsumerNameNull() { public void testGenerateTokenConsumerNameEmpty() { final SystemRequestDTO consumer = new SystemRequestDTO(); consumer.setSystemName(" "); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(new TokenGenerationProviderDTO()), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(new TokenGenerationProviderDTO()), "testService"); tokenGenerationService.generateTokens(request); } @@ -109,7 +109,7 @@ public void testGenerateTokenConsumerNameEmpty() { public void testGenerateTokenConsumerCloudOperatorNull() { final SystemRequestDTO consumer = new SystemRequestDTO(); consumer.setSystemName("consumer"); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, new CloudRequestDTO(), List.of(new TokenGenerationProviderDTO()), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, new CloudRequestDTO(), List.of(new TokenGenerationProviderDTO()), "testService"); tokenGenerationService.generateTokens(request); } @@ -120,7 +120,7 @@ public void testGenerateTokenConsumerCloudOperatorEmpty() { consumer.setSystemName("consumer"); final CloudRequestDTO consumerCloud = new CloudRequestDTO(); consumerCloud.setOperator(" "); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, consumerCloud, List.of(new TokenGenerationProviderDTO()), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, consumerCloud, List.of(new TokenGenerationProviderDTO()), "testService"); tokenGenerationService.generateTokens(request); } @@ -131,7 +131,7 @@ public void testGenerateTokenConsumerCloudNameNull() { consumer.setSystemName("consumer"); final CloudRequestDTO consumerCloud = new CloudRequestDTO(); consumerCloud.setOperator("aitia"); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, consumerCloud, List.of(new TokenGenerationProviderDTO()), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, consumerCloud, List.of(new TokenGenerationProviderDTO()), "testService"); tokenGenerationService.generateTokens(request); } @@ -143,7 +143,7 @@ public void testGenerateTokenConsumerCloudNameEmpty() { final CloudRequestDTO consumerCloud = new CloudRequestDTO(); consumerCloud.setOperator("aitia"); consumerCloud.setName(" "); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, consumerCloud, List.of(new TokenGenerationProviderDTO()), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, consumerCloud, List.of(new TokenGenerationProviderDTO()), "testService"); tokenGenerationService.generateTokens(request); } @@ -152,7 +152,7 @@ public void testGenerateTokenConsumerCloudNameEmpty() { public void testGenerateTokenProvidersListNull() { final SystemRequestDTO consumer = new SystemRequestDTO(); consumer.setSystemName("consumer"); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(new TokenGenerationProviderDTO()), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(new TokenGenerationProviderDTO()), "testService"); request.setProviders(null); tokenGenerationService.generateTokens(request); } @@ -162,7 +162,7 @@ public void testGenerateTokenProvidersListNull() { public void testGenerateTokenProvidersListEmpty() { final SystemRequestDTO consumer = new SystemRequestDTO(); consumer.setSystemName("consumer"); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(new TokenGenerationProviderDTO()), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(new TokenGenerationProviderDTO()), "testService"); request.setProviders(List.of()); tokenGenerationService.generateTokens(request); } @@ -172,7 +172,7 @@ public void testGenerateTokenProvidersListEmpty() { public void testGenerateTokenProviderNull() { final SystemRequestDTO consumer = new SystemRequestDTO(); consumer.setSystemName("consumer"); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(new TokenGenerationProviderDTO()), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(new TokenGenerationProviderDTO()), "testService"); tokenGenerationService.generateTokens(request); } @@ -183,7 +183,7 @@ public void testGenerateTokenProviderNameNull() { consumer.setSystemName("consumer"); final TokenGenerationProviderDTO providerDTO = new TokenGenerationProviderDTO(); providerDTO.setProvider(new SystemRequestDTO()); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService"); tokenGenerationService.generateTokens(request); } @@ -196,7 +196,7 @@ public void testGenerateTokenProviderNameEmpty() { provider.setSystemName(" "); final TokenGenerationProviderDTO providerDTO = new TokenGenerationProviderDTO(); providerDTO.setProvider(provider); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService"); tokenGenerationService.generateTokens(request); } @@ -209,7 +209,7 @@ public void testGenerateTokenServiceInterfacesNull() { provider.setSystemName("provider"); final TokenGenerationProviderDTO providerDTO = new TokenGenerationProviderDTO(); providerDTO.setProvider(provider); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService"); tokenGenerationService.generateTokens(request); } @@ -223,7 +223,7 @@ public void testGenerateTokenServiceInterfacesEmpty() { final TokenGenerationProviderDTO providerDTO = new TokenGenerationProviderDTO(); providerDTO.setProvider(provider); providerDTO.setServiceInterfaces(List.of()); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService"); tokenGenerationService.generateTokens(request); } @@ -237,7 +237,7 @@ public void testGenerateTokenServiceInterfaceInvalid() { final TokenGenerationProviderDTO providerDTO = new TokenGenerationProviderDTO(); providerDTO.setProvider(provider); providerDTO.setServiceInterfaces(List.of("INVALID")); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService"); tokenGenerationService.generateTokens(request); } @@ -251,7 +251,7 @@ public void testGenerateTokenServiceNull() { final TokenGenerationProviderDTO providerDTO = new TokenGenerationProviderDTO(); providerDTO.setProvider(provider); providerDTO.setServiceInterfaces(List.of("HTTP-SECURE-JSON")); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService"); request.setService(null); tokenGenerationService.generateTokens(request); } @@ -266,7 +266,7 @@ public void testGenerateTokenServiceEmpty() { final TokenGenerationProviderDTO providerDTO = new TokenGenerationProviderDTO(); providerDTO.setProvider(provider); providerDTO.setServiceInterfaces(List.of("HTTP-SECURE-JSON")); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService"); request.setService(" \t"); tokenGenerationService.generateTokens(request); } @@ -281,7 +281,7 @@ public void testGenerateTokenProviderHasNoKey() { final TokenGenerationProviderDTO providerDTO = new TokenGenerationProviderDTO(); providerDTO.setProvider(provider); providerDTO.setServiceInterfaces(List.of("HTTP-SECURE-JSON")); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService"); tokenGenerationService.generateTokens(request); } @@ -296,7 +296,7 @@ public void testGenerateTokenProviderHasNotValidKey() { final TokenGenerationProviderDTO providerDTO = new TokenGenerationProviderDTO(); providerDTO.setProvider(provider); providerDTO.setServiceInterfaces(List.of("HTTP-SECURE-JSON")); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService"); tokenGenerationService.generateTokens(request); } @@ -313,7 +313,7 @@ public void testGenerateTokenProviderInitOwnCloudFromCertificateNoCommonName() { final TokenGenerationProviderDTO providerDTO = new TokenGenerationProviderDTO(); providerDTO.setProvider(provider); providerDTO.setServiceInterfaces(List.of("HTTP-SECURE-JSON")); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, null, List.of(providerDTO), "testService"); tokenGenerationService.generateTokens(request); } @@ -331,7 +331,7 @@ public void testGenerateTokenProviderNoServerPrivateKey() { final TokenGenerationProviderDTO providerDTO = new TokenGenerationProviderDTO(); providerDTO.setProvider(provider); providerDTO.setServiceInterfaces(List.of("HTTP-SECURE-JSON")); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, cloud, List.of(providerDTO), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, cloud, List.of(providerDTO), "testService"); tokenGenerationService.generateTokens(request); } @@ -351,7 +351,7 @@ public void testGenerateTokenProviderErrorWhileSigning() throws Exception { final TokenGenerationProviderDTO providerDTO = new TokenGenerationProviderDTO(); providerDTO.setProvider(provider); providerDTO.setServiceInterfaces(List.of("HTTP-SECURE-JSON")); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, cloud, List.of(providerDTO), "testService", null); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, cloud, List.of(providerDTO), "testService"); tokenGenerationService.generateTokens(request); } @@ -375,7 +375,8 @@ public void testTokenGenerationOk() throws Exception { final TokenGenerationProviderDTO providerDTO = new TokenGenerationProviderDTO(); providerDTO.setProvider(provider); providerDTO.setServiceInterfaces(List.of("HTTP-SECURE-JSON")); - final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, cloud, List.of(providerDTO), "testservice", 10); + providerDTO.setTokenDuration(600); + final TokenGenerationRequestDTO request = new TokenGenerationRequestDTO(consumer, cloud, List.of(providerDTO), "testservice"); final Map> result = tokenGenerationService.generateTokens(request); Assert.assertTrue(!result.isEmpty()); Assert.assertTrue(result.containsKey(provider)); diff --git a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java index 184a935cf..a0a5f5300 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java @@ -167,6 +167,7 @@ public class CommonConstants { public static final long CONVERSION_MILLISECOND_TO_SECOND = 1000; public static final long CONVERSION_MILLISECOND_TO_MINUTE = 60000; + public static final long CONVERSION_SECOND_TO_MINUTE = 60; public static final String SORT_ORDER_ASCENDING = "ASC"; public static final String SORT_ORDER_DESCENDING = "DESC"; diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSReservationRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSReservationRepository.java index 9da2a7f22..db969d3c8 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSReservationRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSReservationRepository.java @@ -15,4 +15,5 @@ public interface QoSReservationRepository extends RefreshableRepository findAllByReservedToLessThanEqual(final ZonedDateTime threshold); + public List findAllByConsumerSystemNameNotOrConsumerAddressNotOrConsumerPortNot(final String consumerSystemName, final String consumerAddress, final int consumerPort); } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/TokenGenerationProviderDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/TokenGenerationProviderDTO.java index a9551c44e..92e5796da 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/TokenGenerationProviderDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/TokenGenerationProviderDTO.java @@ -13,10 +13,11 @@ public class TokenGenerationProviderDTO implements Serializable { //================================================================================================= // members - private static final long serialVersionUID = 5119997814495760531L; + private static final long serialVersionUID = -8058322682102502369L; private SystemRequestDTO provider; private List serviceInterfaces = new ArrayList<>(); + private int tokenDuration = -1; // in seconds //================================================================================================= // methods @@ -25,19 +26,22 @@ public class TokenGenerationProviderDTO implements Serializable { public TokenGenerationProviderDTO() {} //------------------------------------------------------------------------------------------------- - public TokenGenerationProviderDTO(final SystemRequestDTO provider, final List serviceInterfaces) { + public TokenGenerationProviderDTO(final SystemRequestDTO provider, final int tokenDuration, final List serviceInterfaces) { Assert.notNull(provider, "Provider is null."); Assert.isTrue(serviceInterfaces != null && !serviceInterfaces.isEmpty(), "Interface list is null or empty."); this.provider = provider; + this.tokenDuration = tokenDuration; this.serviceInterfaces = serviceInterfaces; } //------------------------------------------------------------------------------------------------- public SystemRequestDTO getProvider() { return provider; } + public int getTokenDuration() { return tokenDuration; } public List getServiceInterfaces() { return serviceInterfaces; } //------------------------------------------------------------------------------------------------- public void setProvider(final SystemRequestDTO provider) { this.provider = provider; } + public void setTokenDuration(final int tokenDuration) { this.tokenDuration = tokenDuration; } public void setServiceInterfaces(final List serviceInterfaces) { this.serviceInterfaces = serviceInterfaces; } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/TokenGenerationRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/TokenGenerationRequestDTO.java index 0001419f2..f6d20d69a 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/TokenGenerationRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/TokenGenerationRequestDTO.java @@ -15,13 +15,12 @@ public class TokenGenerationRequestDTO implements Serializable { //================================================================================================= // members - private static final long serialVersionUID = 1323986110293510298L; + private static final long serialVersionUID = -662827797790310767L; private SystemRequestDTO consumer; private CloudRequestDTO consumerCloud; private List providers = new ArrayList<>(); private String service; - private Integer duration; // in minutes //================================================================================================= // methods @@ -30,8 +29,7 @@ public class TokenGenerationRequestDTO implements Serializable { public TokenGenerationRequestDTO() {} //------------------------------------------------------------------------------------------------- - public TokenGenerationRequestDTO(final SystemRequestDTO consumer, final CloudRequestDTO consumerCloud, final List providers, final String service, - final Integer duration) { + public TokenGenerationRequestDTO(final SystemRequestDTO consumer, final CloudRequestDTO consumerCloud, final List providers, final String service) { Assert.notNull(consumer, "Consumer is null."); Assert.isTrue(providers != null && !providers.isEmpty(), "Provider list is null or empty."); Assert.isTrue(!Utilities.isEmpty(service), "Service is null or blank."); @@ -40,7 +38,6 @@ public TokenGenerationRequestDTO(final SystemRequestDTO consumer, final CloudReq this.consumerCloud = consumerCloud; this.providers = providers; this.service = service; - this.duration = duration; } //------------------------------------------------------------------------------------------------- @@ -48,12 +45,10 @@ public TokenGenerationRequestDTO(final SystemRequestDTO consumer, final CloudReq public CloudRequestDTO getConsumerCloud() { return consumerCloud; } public List getProviders() { return providers; } public String getService() { return service; } - public Integer getDuration() { return duration; } //------------------------------------------------------------------------------------------------- public void setConsumer(final SystemRequestDTO consumer) { this.consumer = consumer; } public void setConsumerCloud(final CloudRequestDTO consumerCloud) { this.consumerCloud = consumerCloud; } public void setProviders(final List providers) { this.providers = providers; } public void setService(final String service) { this.service = service; } - public void setDuration(final Integer duration) { this.duration = duration; } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OrchestrationFormRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OrchestrationFormRequestDTO.java index c6be5a4fa..98509fdf8 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OrchestrationFormRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OrchestrationFormRequestDTO.java @@ -100,6 +100,10 @@ public OrchestrationFormRequestDTO validateCrossParameterConstraints() { throw new BadPayloadException("There is no valid preferred provider, but \"" + Flag.ONLY_PREFERRED + "\" is set to true"); } } + + if (orchestrationFlags.get(Flag.ENABLE_QOS) && commands.containsKey(QOS_COMMAND_EXCLUSIVITY) && !orchestrationFlags.get(Flag.MATCHMAKING)) { + throw new BadPayloadException("Exclusive service orchestration is only possible when \"" + Flag.MATCHMAKING + "\" is set to true"); + } return this; } diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java index ea675fe98..17b916072 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java @@ -59,6 +59,8 @@ public class OrchestratorDriver { private static final String GATEKEEPER_INIT_GSD_URI_KEY = CoreSystemService.GATEKEEPER_GLOBAL_SERVICE_DISCOVERY.getServiceDefinition() + CoreCommonConstants.URI_SUFFIX; private static final String GATEKEEPER_INIT_ICN_URI_KEY = CoreSystemService.GATEKEEPER_INTER_CLOUD_NEGOTIATION.getServiceDefinition() + CoreCommonConstants.URI_SUFFIX; + private static final String KEY_CALCULATED_SERVICE_TIME_FRAME = "QoSCalculatedServiceTimeFrame"; + private static final Logger logger = LogManager.getLogger(OrchestratorDriver.class); @Autowired @@ -137,8 +139,7 @@ public List generateAuthTokens(final OrchestrationFormRe final UriComponents tokenGenerationUri = getAuthTokenGenerationUri(); for (final TokenGenHelper helper : tokenGenHelperList) { - final TokenGenerationRequestDTO payload = new TokenGenerationRequestDTO(request.getRequesterSystem(), request.getRequesterCloud(), helper.getProviders(), helper.getService(), - tokenDuration > 0 ? tokenDuration : null); + final TokenGenerationRequestDTO payload = new TokenGenerationRequestDTO(request.getRequesterSystem(), request.getRequesterCloud(), helper.getProviders(), helper.getService()); final ResponseEntity response = httpService.sendRequest(tokenGenerationUri, HttpMethod.POST, TokenGenerationResponseDTO.class, payload); final TokenGenerationResponseDTO tokenGenerationResult = response.getBody(); @@ -328,7 +329,17 @@ private List convertOrchestrationResultListToTokenGenHelperList( private TokenGenerationProviderDTO createTokenGenerationProvider(final OrchestrationResultDTO result) { logger.debug("createTokenGenerationProvider started..."); - return new TokenGenerationProviderDTO(DTOConverter.convertSystemResponseDTOToSystemRequestDTO(result.getProvider()), + int tokenDuration = this.tokenDuration; + if (result.getMetadata() != null && result.getMetadata().containsKey(KEY_CALCULATED_SERVICE_TIME_FRAME)) { + try { + tokenDuration = Integer.parseInt(result.getMetadata().get(KEY_CALCULATED_SERVICE_TIME_FRAME)); + } catch (final NumberFormatException ex) { + logger.debug(ex.getMessage()); + logger.trace("Stacktracke:", ex); + } + } + + return new TokenGenerationProviderDTO(DTOConverter.convertSystemResponseDTOToSystemRequestDTO(result.getProvider()), tokenDuration, convertServiceInterfaceListToServiceInterfaceNameList(result.getInterfaces())); } diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java index 56cf9e481..8cd2db234 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java @@ -54,6 +54,7 @@ import eu.arrowhead.core.orchestrator.matchmaking.InterCloudProviderMatchmakingParameters; import eu.arrowhead.core.orchestrator.matchmaking.IntraCloudProviderMatchmakingAlgorithm; import eu.arrowhead.core.orchestrator.matchmaking.IntraCloudProviderMatchmakingParameters; +import eu.arrowhead.core.qos.manager.QoSManager; @Service public class OrchestratorService { @@ -85,9 +86,15 @@ public class OrchestratorService { @Resource(name = CoreCommonConstants.CLOUD_MATCHMAKER) private CloudMatchmakingAlgorithm cloudMatchmaker; + @Resource(name = CoreCommonConstants.QOS_MANAGER) + private QoSManager qosManager; + @Value(CoreCommonConstants.$ORCHESTRATOR_IS_GATEKEEPER_PRESENT_WD) private boolean gateKeeperIsPresent; + @Value(CoreCommonConstants.$QOS_ENABLED_WD) + private boolean qosEnabled; + //================================================================================================= // methods @@ -117,14 +124,18 @@ public OrchestrationResponseDTO externalServiceRequest(final OrchestrationFormRe logger.debug("externalServiceRequest finished with {} service providers.", queryData.size()); List orList = compileOrchestrationResponse(queryData, request); + orList = qosManager.filterReservedProviders(orList, request); // to reduce the number of results before token generation // Generate the authorization tokens if it is requested based on the service security (modifies the orList) orList = orchestratorDriver.generateAuthTokens(request, orList); + + orList = qosManager.filterReservedProviders(orList, request); // token generation can be slow, so we have to check for new reservations return new OrchestrationResponseDTO(orList); } //------------------------------------------------------------------------------------------------- + //TODO: handle qos (inter) public OrchestrationResponseDTO triggerInterCloud(final OrchestrationFormRequestDTO request) { logger.debug("triggerInterCloud started ..."); @@ -173,10 +184,13 @@ public OrchestrationResponseDTO topPriorityEntriesOrchestrationProcess(final Orc } List orList = compileOrchestrationResponse(crossCheckedEntryList, orchestrationFormRequestDTO); - + orList = qosManager.filterReservedProviders(orList, orchestrationFormRequestDTO); // to reduce the number of results before token generation + // Generate the authorization tokens if it is requested based on the service security (modifies the orList) orList = orchestratorDriver.generateAuthTokens(orchestrationFormRequestDTO, orList); - + + orList = qosManager.filterReservedProviders(orList, orchestrationFormRequestDTO); // token generation can be slow, so we have to check for new reservations + return new OrchestrationResponseDTO(orList); } @@ -269,12 +283,36 @@ public OrchestrationResponseDTO dynamicOrchestration(final OrchestrationFormRequ } List orList = compileOrchestrationResponse(queryData, request); + orList = qosManager.filterReservedProviders(orList, request); + + final boolean needReservation = qosEnabled && flags.get(Flag.ENABLE_QOS) && request.getCommands().containsKey(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY); + + if (needReservation) { + //TODO: temporary locking (if caller wants exclusivity) + } + + if (flags.get(Flag.ENABLE_QOS)) { + //TODO: filter by QoS Requirements (removing temporary lock if needed) + } + + if (!needReservation) { + orList = qosManager.filterReservedProviders(orList, request); + } + + if (qosEnabled) { + // Generate the authorization tokens if it is requested based on the service security (modifies the orList) + orList = orchestratorDriver.generateAuthTokens(request, orList); + if (!needReservation) { + orList = qosManager.filterReservedProviders(orList, request); + } + } // If matchmaking is requested, we pick out 1 ServiceRegistryEntry entity from the list. if (flags.get(Flag.MATCHMAKING)) { final IntraCloudProviderMatchmakingParameters params = new IntraCloudProviderMatchmakingParameters(localProviders); // set additional parameters here if you use a different matchmaking algorithm final OrchestrationResultDTO selected = intraCloudProviderMatchmaker.doMatchmaking(orList, params); + //TODO: remove temporary locks and change lock on the selected orList.clear(); orList.add(selected); } @@ -282,9 +320,10 @@ public OrchestrationResponseDTO dynamicOrchestration(final OrchestrationFormRequ // all the filtering is done logger.debug("dynamicOrchestration finished with {} service providers.", queryData.size()); - - // Generate the authorization tokens if it is requested based on the service security (modifies the orList) - orList = orchestratorDriver.generateAuthTokens(request, orList); + if (!qosEnabled) { + // Generate the authorization tokens if it is requested based on the service security (modifies the orList) + orList = orchestratorDriver.generateAuthTokens(request, orList); + } return new OrchestrationResponseDTO(orList); } diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java index 7af0ac6dc..20051df54 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java @@ -8,8 +8,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.Assert; import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.Utilities; import eu.arrowhead.common.database.entity.QoSReservation; import eu.arrowhead.common.database.repository.QoSReservationRepository; import eu.arrowhead.common.exception.ArrowheadException; @@ -43,4 +45,15 @@ public int releaseObsoleteReservations() { throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } + + //------------------------------------------------------------------------------------------------- + public List getAllReservationsExceptMine(final String systemName, final String address, final int port) { + Assert.isTrue(!Utilities.isEmpty(systemName), "'systemName' is null or empty."); + Assert.isTrue(!Utilities.isEmpty(address), "'address' is null or empty."); + + final String validatedSystemName = systemName.trim().toLowerCase(); + final String validatedAddress = address.trim().toLowerCase(); + + return qosReservationRepository.findAllByConsumerSystemNameNotOrConsumerAddressNotOrConsumerPortNot(validatedSystemName, validatedAddress, port); + } } \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java index dec08d45a..0a35c8683 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java @@ -1,5 +1,19 @@ package eu.arrowhead.core.qos.manager; +import java.util.List; + +import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; + public interface QoSManager { -} + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + // verification-related + + //------------------------------------------------------------------------------------------------- + // reservation-related + public List filterReservedProviders(final List orList, final OrchestrationFormRequestDTO request); +} \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java index 5ad196c8b..a9699bc3e 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java @@ -1,7 +1,20 @@ package eu.arrowhead.core.qos.manager.impl; +import java.util.List; + +import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; import eu.arrowhead.core.qos.manager.QoSManager; public class DummyQoSManager implements QoSManager { + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Override + public List filterReservedProviders(final List orList, final OrchestrationFormRequestDTO request) { + return orList; + } } \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java index a765a0067..9cc89e637 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java @@ -1,7 +1,68 @@ package eu.arrowhead.core.qos.manager.impl; +import java.util.ArrayList; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.Assert; + +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.database.entity.QoSReservation; +import eu.arrowhead.common.database.entity.ServiceRegistry; +import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; +import eu.arrowhead.core.qos.database.service.QoSReservationDBService; import eu.arrowhead.core.qos.manager.QoSManager; public class QoSManagerImpl implements QoSManager { + + //================================================================================================= + // members + + @Autowired + private QoSReservationDBService qosReservationDBService; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Override + public List filterReservedProviders(final List orList, final OrchestrationFormRequestDTO request) { + Assert.notNull(orList, "'orList' is null."); + Assert.notNull(request, "'request' is null."); + final SystemRequestDTO requesterSystem = request.getRequesterSystem(); + Assert.notNull(requesterSystem, "Requester system is null."); + Assert.isTrue(!Utilities.isEmpty(requesterSystem.getSystemName()), "Requester system's name is null."); + Assert.isTrue(!Utilities.isEmpty(requesterSystem.getAddress()), "Requester system's address is null."); + + if (orList.isEmpty()) { + return orList; + } + + final List reservations = qosReservationDBService.getAllReservationsExceptMine(requesterSystem.getSystemName(), requesterSystem.getAddress(), requesterSystem.getPort()); + final List result = new ArrayList<>(); + for (final OrchestrationResultDTO dto : orList) { + if (!isReserved(dto, reservations)) { + result.add(dto); + } + } + + return result; + } + + //================================================================================================= + // methods + //------------------------------------------------------------------------------------------------- + private boolean isReserved(final OrchestrationResultDTO dto, final List reservations) { + for (final QoSReservation reservation : reservations) { + final ServiceRegistry reservedService = reservation.getReservedService(); + if (reservedService.getSystem().getId() == dto.getProvider().getId() && reservedService.getServiceDefinition().getId() == dto.getService().getId()) { + return true; + } + } + + return false; + } } \ No newline at end of file diff --git a/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/service/OrchestratorServiceTest.java b/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/service/OrchestratorServiceTest.java index 2947a5ce4..30d7a5d46 100644 --- a/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/service/OrchestratorServiceTest.java +++ b/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/service/OrchestratorServiceTest.java @@ -10,6 +10,7 @@ import java.util.Map; import org.junit.Assert; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; @@ -17,6 +18,7 @@ import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.util.ReflectionTestUtils; +import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.database.entity.OrchestratorStore; import eu.arrowhead.common.database.entity.ServiceDefinition; import eu.arrowhead.common.database.entity.ServiceInterface; @@ -54,6 +56,7 @@ import eu.arrowhead.core.orchestrator.matchmaking.InterCloudProviderMatchmakingParameters; import eu.arrowhead.core.orchestrator.matchmaking.IntraCloudProviderMatchmakingAlgorithm; import eu.arrowhead.core.orchestrator.matchmaking.IntraCloudProviderMatchmakingParameters; +import eu.arrowhead.core.qos.manager.impl.DummyQoSManager; @RunWith(SpringRunner.class) public class OrchestratorServiceTest { @@ -82,6 +85,12 @@ public class OrchestratorServiceTest { //================================================================================================= // methods + //------------------------------------------------------------------------------------------------- + @Before + public void setUp() { + ReflectionTestUtils.setField(testingObject, CoreCommonConstants.QOS_MANAGER, new DummyQoSManager()); + } + //------------------------------------------------------------------------------------------------- @Test(expected = InvalidParameterException.class) public void testExternalServiceRequestRequestNull() { diff --git a/qos-monitor/.project b/qos-monitor/.project index b018914ab..d18b9d5b3 100644 --- a/qos-monitor/.project +++ b/qos-monitor/.project @@ -16,17 +16,17 @@ - org.eclipse.m2e.core.maven2Builder + org.springframework.ide.eclipse.core.springbuilder - org.springframework.ide.eclipse.core.springbuilder + org.springframework.ide.eclipse.boot.validation.springbootbuilder - org.springframework.ide.eclipse.boot.validation.springbootbuilder + org.eclipse.m2e.core.maven2Builder From c137b9a4c40756eeee980607874fdc790270b437 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Thu, 30 Jan 2020 15:02:48 +0100 Subject: [PATCH 058/301] further orchestration process modifications --- .../core/orchestrator/service/OrchestratorService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java index 8cd2db234..4b1edde8d 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java @@ -215,7 +215,11 @@ public OrchestrationResponseDTO orchestrationFromStore(final OrchestrationFormRe final List authorizedLocalServiceRegistryEntries = getAuthorizedServiceRegistryEntries(entryList, orchestrationFormRequestDTO); - return getHighestPriorityCurrentlyWorkingStoreEntryFromEntryList(orchestrationFormRequestDTO, entryList, authorizedLocalServiceRegistryEntries); + final OrchestrationResponseDTO result = getHighestPriorityCurrentlyWorkingStoreEntryFromEntryList(orchestrationFormRequestDTO, entryList, authorizedLocalServiceRegistryEntries); + + final List orList = qosManager.filterReservedProviders(result.getResponse(), orchestrationFormRequestDTO); + + return new OrchestrationResponseDTO(orList); } //------------------------------------------------------------------------------------------------- From 50b9618322fa98d83d7c3f612bf6e8bc119d7513 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Thu, 30 Jan 2020 17:12:06 +0100 Subject: [PATCH 059/301] redesigned qos_reservation table new qos manager method --- .../arrowhead/common/CoreCommonConstants.java | 4 +- .../database/entity/QoSReservation.java | 30 ++++------- .../service/OrchestratorService.java | 16 +++--- .../service/QoSReservationDBService.java | 19 ++++++- .../core/qos/manager/QoSManager.java | 5 +- .../qos/manager/impl/DummyQoSManager.java | 10 +++- .../core/qos/manager/impl/QoSManagerImpl.java | 50 +++++++++++++++---- .../task/ReservationCheckTaskConfig.java | 2 +- scripts/create_arrowhead_tables.sql | 8 +-- 9 files changed, 93 insertions(+), 51 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java index 204e80812..24188205f 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java @@ -120,9 +120,9 @@ public class CoreCommonConstants { public static final String QOS_ENABLED = "enable_qos"; public static final String $QOS_ENABLED_WD = "${" + QOS_ENABLED + ":" + CoreDefaults.DEFAULT_QOS_ENABLED + "}"; public static final String QOS_RESERVATION_CHECK_INTERVAL = "qos_reservation_check_interval"; // in seconds - public static final String $QOS_RESERVATION_CHECK_INTERVAL_WS = "${" + QOS_RESERVATION_CHECK_INTERVAL + ":" + CoreDefaults.DEFAULT_QOS_RESERVATION_CHECK_INTERVAL + "}"; + public static final String $QOS_RESERVATION_CHECK_INTERVAL_WD = "${" + QOS_RESERVATION_CHECK_INTERVAL + ":" + CoreDefaults.DEFAULT_QOS_RESERVATION_CHECK_INTERVAL + "}"; public static final String QOS_RESERVATION_TEMP_LOCK_DURATION = "qos_reservation_temp_lock_duration"; // in seconds - public static final String $QOS_RESERVATION_TEMP_LOCK_DURATION = "${" + QOS_RESERVATION_TEMP_LOCK_DURATION + ":" + CoreDefaults.DEFAULT_QOS_TEMPORARY_LOCK_DURATION + "}"; + public static final String $QOS_RESERVATION_TEMP_LOCK_DURATION_WD = "${" + QOS_RESERVATION_TEMP_LOCK_DURATION + ":" + CoreDefaults.DEFAULT_QOS_TEMPORARY_LOCK_DURATION + "}"; public static final String NO_GATEKEEPER_RELAY_REQUEST_HANDLER_WORKERS = "no_gatekeeper_relay_request_handler_workers"; public static final String $NO_GATEKEEPER_RELAY_REQUEST_HANDLER_WORKERS_WD = "${" + NO_GATEKEEPER_RELAY_REQUEST_HANDLER_WORKERS + ":" + diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSReservation.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSReservation.java index bfc24c604..4c2df2ea8 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSReservation.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSReservation.java @@ -4,19 +4,16 @@ import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToOne; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; import javax.persistence.Table; +import javax.persistence.UniqueConstraint; @Entity -@Table(name = "qos_reservation") +@Table(name = "qos_reservation", uniqueConstraints = @UniqueConstraint(columnNames = { "reservedProviderId", "reservedServiceId" }) ) public class QoSReservation { //================================================================================================= @@ -26,13 +23,8 @@ public class QoSReservation { @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; - @OneToOne(fetch = FetchType.EAGER) - @JoinColumn(name = "reservedServiceId", referencedColumnName = "id", nullable = false, unique = true) - private ServiceRegistry reservedService; - - @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = "consumerCloudId", referencedColumnName = "id", nullable = true) - private Cloud consumerCloud; + private long reservedProviderId; + private long reservedServiceId; private String consumerSystemName; private String consumerAddress; @@ -55,10 +47,10 @@ public class QoSReservation { public QoSReservation() {} //------------------------------------------------------------------------------------------------- - public QoSReservation(final ServiceRegistry reservedService, final Cloud consumerCloud, final String consumerSystemName, final String consumerAddress, final int consumerPort, + public QoSReservation(final long reservedProviderId, final long reservedServiceId, final String consumerSystemName, final String consumerAddress, final int consumerPort, final ZonedDateTime reservedTo, final boolean temporaryLock) { - this.reservedService = reservedService; - this.consumerCloud = consumerCloud; + this.reservedProviderId = reservedProviderId; + this.reservedServiceId = reservedServiceId; this.consumerSystemName = consumerSystemName; this.consumerAddress = consumerAddress; this.consumerPort = consumerPort; @@ -81,8 +73,8 @@ public void onUpdate() { //------------------------------------------------------------------------------------------------- public long getId() { return id; } - public ServiceRegistry getReservedService() { return reservedService; } - public Cloud getConsumerCloud() { return consumerCloud; } + public long getReservedProviderId() { return reservedProviderId; } + public long getReservedServiceId() { return reservedServiceId; } public String getConsumerSystemName() { return consumerSystemName; } public String getConsumerAddress() { return consumerAddress; } public int getConsumerPort() { return consumerPort; } @@ -93,8 +85,8 @@ public void onUpdate() { //------------------------------------------------------------------------------------------------- public void setId(final long id) { this.id = id; } - public void setReservedService(final ServiceRegistry reservedService) { this.reservedService = reservedService; } - public void setConsumerCloud(final Cloud consumerCloud) { this.consumerCloud = consumerCloud; } + public void setReservedProviderId(final long reservedProviderId) { this.reservedProviderId = reservedProviderId; } + public void setReservedServiceId(final int reservedServiceId) { this.reservedServiceId = reservedServiceId; } public void setConsumerSystemName(final String consumerSystemName) { this.consumerSystemName = consumerSystemName; } public void setConsumerAddress(final String consumerAddress) { this.consumerAddress = consumerAddress; } public void setConsumerPort(final int consumerPort) { this.consumerPort = consumerPort; } diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java index 4b1edde8d..749ee9c80 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java @@ -124,12 +124,12 @@ public OrchestrationResponseDTO externalServiceRequest(final OrchestrationFormRe logger.debug("externalServiceRequest finished with {} service providers.", queryData.size()); List orList = compileOrchestrationResponse(queryData, request); - orList = qosManager.filterReservedProviders(orList, request); // to reduce the number of results before token generation + orList = qosManager.filterReservedProviders(orList, request.getRequesterSystem()); // to reduce the number of results before token generation // Generate the authorization tokens if it is requested based on the service security (modifies the orList) orList = orchestratorDriver.generateAuthTokens(request, orList); - orList = qosManager.filterReservedProviders(orList, request); // token generation can be slow, so we have to check for new reservations + orList = qosManager.filterReservedProviders(orList, request.getRequesterSystem()); // token generation can be slow, so we have to check for new reservations return new OrchestrationResponseDTO(orList); } @@ -184,12 +184,12 @@ public OrchestrationResponseDTO topPriorityEntriesOrchestrationProcess(final Orc } List orList = compileOrchestrationResponse(crossCheckedEntryList, orchestrationFormRequestDTO); - orList = qosManager.filterReservedProviders(orList, orchestrationFormRequestDTO); // to reduce the number of results before token generation + orList = qosManager.filterReservedProviders(orList, orchestrationFormRequestDTO.getRequesterSystem()); // to reduce the number of results before token generation // Generate the authorization tokens if it is requested based on the service security (modifies the orList) orList = orchestratorDriver.generateAuthTokens(orchestrationFormRequestDTO, orList); - orList = qosManager.filterReservedProviders(orList, orchestrationFormRequestDTO); // token generation can be slow, so we have to check for new reservations + orList = qosManager.filterReservedProviders(orList, orchestrationFormRequestDTO.getRequesterSystem()); // token generation can be slow, so we have to check for new reservations return new OrchestrationResponseDTO(orList); } @@ -217,7 +217,7 @@ public OrchestrationResponseDTO orchestrationFromStore(final OrchestrationFormRe final OrchestrationResponseDTO result = getHighestPriorityCurrentlyWorkingStoreEntryFromEntryList(orchestrationFormRequestDTO, entryList, authorizedLocalServiceRegistryEntries); - final List orList = qosManager.filterReservedProviders(result.getResponse(), orchestrationFormRequestDTO); + final List orList = qosManager.filterReservedProviders(result.getResponse(), orchestrationFormRequestDTO.getRequesterSystem()); return new OrchestrationResponseDTO(orList); } @@ -287,7 +287,7 @@ public OrchestrationResponseDTO dynamicOrchestration(final OrchestrationFormRequ } List orList = compileOrchestrationResponse(queryData, request); - orList = qosManager.filterReservedProviders(orList, request); + orList = qosManager.filterReservedProviders(orList, request.getRequesterSystem()); final boolean needReservation = qosEnabled && flags.get(Flag.ENABLE_QOS) && request.getCommands().containsKey(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY); @@ -300,14 +300,14 @@ public OrchestrationResponseDTO dynamicOrchestration(final OrchestrationFormRequ } if (!needReservation) { - orList = qosManager.filterReservedProviders(orList, request); + orList = qosManager.filterReservedProviders(orList, request.getRequesterSystem()); } if (qosEnabled) { // Generate the authorization tokens if it is requested based on the service security (modifies the orList) orList = orchestratorDriver.generateAuthTokens(request, orList); if (!needReservation) { - orList = qosManager.filterReservedProviders(orList, request); + orList = qosManager.filterReservedProviders(orList, request.getRequesterSystem()); } } diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java index 20051df54..977c8175e 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java @@ -6,6 +6,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; @@ -13,7 +14,9 @@ import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.Utilities; import eu.arrowhead.common.database.entity.QoSReservation; +import eu.arrowhead.common.database.entity.ServiceRegistry; import eu.arrowhead.common.database.repository.QoSReservationRepository; +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; import eu.arrowhead.common.exception.ArrowheadException; @Service @@ -21,12 +24,15 @@ public class QoSReservationDBService { //================================================================================================= // members + + @Value(CoreCommonConstants.$QOS_RESERVATION_TEMP_LOCK_DURATION_WD) + private int lockDuration; // in seconds - protected final Logger logger = LogManager.getLogger(QoSReservationDBService.class); + private final Logger logger = LogManager.getLogger(QoSReservationDBService.class); @Autowired private QoSReservationRepository qosReservationRepository; - + //================================================================================================= // methods @@ -56,4 +62,13 @@ public List getAllReservationsExceptMine(final String systemName return qosReservationRepository.findAllByConsumerSystemNameNotOrConsumerAddressNotOrConsumerPortNot(validatedSystemName, validatedAddress, port); } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public void applyTemporaryLock(final String systemName, final String address, final int port, final OrchestrationResultDTO dto) { + Assert.isTrue(!Utilities.isEmpty(systemName), "'systemName' is null or empty."); + Assert.isTrue(!Utilities.isEmpty(address), "'address' is null or empty."); + + //TODO: cont + } } \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java index 0a35c8683..65b6ba608 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java @@ -2,8 +2,8 @@ import java.util.List; -import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; public interface QoSManager { @@ -15,5 +15,6 @@ public interface QoSManager { //------------------------------------------------------------------------------------------------- // reservation-related - public List filterReservedProviders(final List orList, final OrchestrationFormRequestDTO request); + public List filterReservedProviders(final List orList, final SystemRequestDTO requester); + public List reserveProvidersTemporarily(final List orList, final SystemRequestDTO requester); // returns with the temp locked results } \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java index a9699bc3e..96e6295d1 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java @@ -2,8 +2,8 @@ import java.util.List; -import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; import eu.arrowhead.core.qos.manager.QoSManager; public class DummyQoSManager implements QoSManager { @@ -14,7 +14,13 @@ public class DummyQoSManager implements QoSManager { //------------------------------------------------------------------------------------------------- @Override - public List filterReservedProviders(final List orList, final OrchestrationFormRequestDTO request) { + public List filterReservedProviders(final List orList, final SystemRequestDTO requester) { + return orList; + } + + //------------------------------------------------------------------------------------------------- + @Override + public List reserveProvidersTemporarily(final List orList, final SystemRequestDTO requester) { return orList; } } \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java index 9cc89e637..9d2a6c492 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java @@ -3,15 +3,16 @@ import java.util.ArrayList; import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.Assert; import eu.arrowhead.common.Utilities; import eu.arrowhead.common.database.entity.QoSReservation; -import eu.arrowhead.common.database.entity.ServiceRegistry; -import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; import eu.arrowhead.common.dto.shared.SystemRequestDTO; +import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.core.qos.database.service.QoSReservationDBService; import eu.arrowhead.core.qos.manager.QoSManager; @@ -20,6 +21,8 @@ public class QoSManagerImpl implements QoSManager { //================================================================================================= // members + private static final Logger logger = LogManager.getLogger(QoSManagerImpl.class); + @Autowired private QoSReservationDBService qosReservationDBService; @@ -28,19 +31,18 @@ public class QoSManagerImpl implements QoSManager { //------------------------------------------------------------------------------------------------- @Override - public List filterReservedProviders(final List orList, final OrchestrationFormRequestDTO request) { + public List filterReservedProviders(final List orList, final SystemRequestDTO requester) { Assert.notNull(orList, "'orList' is null."); - Assert.notNull(request, "'request' is null."); - final SystemRequestDTO requesterSystem = request.getRequesterSystem(); - Assert.notNull(requesterSystem, "Requester system is null."); - Assert.isTrue(!Utilities.isEmpty(requesterSystem.getSystemName()), "Requester system's name is null."); - Assert.isTrue(!Utilities.isEmpty(requesterSystem.getAddress()), "Requester system's address is null."); + Assert.notNull(requester, "Requester system is null."); + Assert.isTrue(!Utilities.isEmpty(requester.getSystemName()), "Requester system's name is null or empty."); + Assert.isTrue(!Utilities.isEmpty(requester.getAddress()), "Requester system's address is null or empty."); + Assert.notNull(requester.getPort(), "Requester system's port is null."); if (orList.isEmpty()) { return orList; } - final List reservations = qosReservationDBService.getAllReservationsExceptMine(requesterSystem.getSystemName(), requesterSystem.getAddress(), requesterSystem.getPort()); + final List reservations = qosReservationDBService.getAllReservationsExceptMine(requester.getSystemName(), requester.getAddress(), requester.getPort()); final List result = new ArrayList<>(); for (final OrchestrationResultDTO dto : orList) { if (!isReserved(dto, reservations)) { @@ -51,14 +53,40 @@ public List filterReservedProviders(final List reserveProvidersTemporarily(List orList, SystemRequestDTO requester) { + Assert.notNull(orList, "'orList' is null."); + Assert.isTrue(!Utilities.isEmpty(requester.getSystemName()), "Requester system's name is null or empty."); + Assert.isTrue(!Utilities.isEmpty(requester.getAddress()), "Requester system's address is null or empty."); + Assert.notNull(requester.getPort(), "Requester system's port is null."); + + if (orList.isEmpty()) { + return orList; + } + + final List result = new ArrayList(orList.size()); + for (final OrchestrationResultDTO dto : orList) { + try { + // try to lock + qosReservationDBService.applyTemporaryLock(requester.getSystemName(), requester.getAddress(), requester.getPort(), dto); + result.add(dto); + } catch (final ArrowheadException ex) { + // should means locking is failed because somebody already reserved that service => logging and removing + logger.debug("{}/{} may be already locked by someone else", dto.getProvider().getSystemName(), dto.getService().getServiceDefinition()); + } + } + + return result; + } + //================================================================================================= // methods //------------------------------------------------------------------------------------------------- private boolean isReserved(final OrchestrationResultDTO dto, final List reservations) { for (final QoSReservation reservation : reservations) { - final ServiceRegistry reservedService = reservation.getReservedService(); - if (reservedService.getSystem().getId() == dto.getProvider().getId() && reservedService.getServiceDefinition().getId() == dto.getService().getId()) { + if (reservation.getReservedProviderId() == dto.getProvider().getId() && reservation.getReservedServiceId() == dto.getService().getId()) { return true; } } diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/quartz/task/ReservationCheckTaskConfig.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/quartz/task/ReservationCheckTaskConfig.java index 4af418a51..799abfdfe 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/quartz/task/ReservationCheckTaskConfig.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/quartz/task/ReservationCheckTaskConfig.java @@ -26,7 +26,7 @@ public class ReservationCheckTaskConfig { @Autowired private ApplicationContext applicationContext; //NOSONAR - @Value(CoreCommonConstants.$QOS_RESERVATION_CHECK_INTERVAL_WS) + @Value(CoreCommonConstants.$QOS_RESERVATION_CHECK_INTERVAL_WD) private int interval; private static final int SCHEDULER_DELAY = 19; diff --git a/scripts/create_arrowhead_tables.sql b/scripts/create_arrowhead_tables.sql index f4fe41eea..416d8fe22 100644 --- a/scripts/create_arrowhead_tables.sql +++ b/scripts/create_arrowhead_tables.sql @@ -374,8 +374,8 @@ CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement` ( CREATE TABLE IF NOT EXISTS `qos_reservation` ( `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, + `reserved_provider_id` bigint(20) NOT NULL, `reserved_service_id` bigint(20) NOT NULL, - `consumer_cloud_id` bigint(20), `consumer_system_name` varchar(255) NOT NULL, `consumer_address` varchar(255) NOT NULL, `consumer_port` int(11) NOT NULL, @@ -383,7 +383,7 @@ CREATE TABLE IF NOT EXISTS `qos_reservation` ( `temporary_lock` int(1) NOT NULL DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - CONSTRAINT `fk_reserved_service` FOREIGN KEY (`reserved_service_id`) REFERENCES `service_registry` (`id`) ON DELETE CASCADE, - CONSTRAINT `fk_consumer_cloud` FOREIGN KEY (`consumer_cloud_id`) REFERENCES `cloud` (`id`) ON DELETE CASCADE, - UNIQUE KEY `unique_reserved_service` (`reserved_service_id`) + CONSTRAINT `fk_reserved_provider` FOREIGN KEY (`reserved_provider_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE, + CONSTRAINT `fk_reserved_service` FOREIGN KEY (`reserved_service_id`) REFERENCES `service_definition` (`id`) ON DELETE CASCADE, + UNIQUE KEY `unique_reserved_provider_and_service` (`reserved_provider_id`, `reserved_service_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; From fe04df448f5256c25ec28924d50b05dbff2205e1 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 30 Jan 2020 17:33:31 +0100 Subject: [PATCH 060/301] converted spaces to tabs --- .../database/entity/QoSIntraPingMeasurement.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java index 3b2336d6f..2a9d345f7 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java @@ -28,13 +28,13 @@ public class QoSIntraPingMeasurement { @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "measurementId", referencedColumnName = "id", nullable = false, unique = true) private QoSIntraMeasurement measurement; - + @Column(name = "available", nullable = false) private boolean available = false; - + @Column(name = "last_access_at", nullable = true) private ZonedDateTime lastAccessAt; - + @Column(name = "min_response_time", nullable = true) private Integer minResponseTime; @@ -61,7 +61,7 @@ public class QoSIntraPingMeasurement { @Column(name = "received", nullable = false) private long received; - + @Column(name = "count_started_at", nullable = true) private ZonedDateTime countStartedAt; @@ -73,10 +73,10 @@ public class QoSIntraPingMeasurement { @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") private ZonedDateTime createdAt; - + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") private ZonedDateTime updatedAt; - + //================================================================================================= // methods @@ -89,7 +89,7 @@ public void onCreate() { this.createdAt = ZonedDateTime.now(); this.updatedAt = this.createdAt; } - + //------------------------------------------------------------------------------------------------- @PreUpdate public void onUpdate() { From 10d3c59aa142564093465b1492f2d5fa38a2199c Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 30 Jan 2020 17:35:50 +0100 Subject: [PATCH 061/301] added pingMeasurementLog and measurementLogDetails tables --- .../entity/QoSIntraPingMeasurementLog.java | 125 ++++++++++++++++++ .../QoSIntraPingMeasurementLogDetails.java | 113 ++++++++++++++++ ...raPingMeasurementLogDetailsRepository.java | 11 ++ .../QoSIntraPingMeasurementLogRepository.java | 15 +++ scripts/create_arrowhead_tables.sql | 39 ++++++ scripts/qos_monitor_privileges.sql | 4 + 6 files changed, 307 insertions(+) create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLog.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLogDetails.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraPingMeasurementLogDetailsRepository.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraPingMeasurementLogRepository.java diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLog.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLog.java new file mode 100644 index 000000000..5ecc1faa0 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLog.java @@ -0,0 +1,125 @@ +package eu.arrowhead.common.database.entity; + +import java.time.ZonedDateTime; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; +import javax.persistence.Table; + +import eu.arrowhead.common.CoreDefaults; +import eu.arrowhead.common.dto.shared.QoSMeasurementType; + +@Entity +@Table(name = "qos_intra_ping_measurement_log") +public class QoSIntraPingMeasurementLog { + + //================================================================================================= + // members + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private long id; + + @Column(nullable = false, columnDefinition = "varchar(" + CoreDefaults.VARCHAR_BASIC + ")") + @Enumerated(EnumType.STRING) + private QoSMeasurementType measurementType; + + @Column(name = "measured_system_address", nullable = false) + private String measuredSystemAddress; + + @Column(name = "available", nullable = false) + private boolean available = false; + + @Column(name = "min_response_time", nullable = true) + private Integer minResponseTime; + + @Column(name = "max_response_time", nullable = true) + private Integer maxResponseTime; + + @Column(name = "mean_response_time_with_timeout", nullable = true) + private Integer meanResponseTimeWithTimeout; + + @Column(name = "mean_response_time_without_timeout", nullable = true) + private Integer meanResponseTimeWithoutTimeout; + + @Column(name = "jitter_with_timeout", nullable = true) + private Integer jitterWithTimeout; + + @Column(name = "jitter_without_timeout", nullable = true) + private Integer jitterWithoutTimeout; + + @Column(name = "lost_per_measurement_percent", nullable = false) + private Integer lostPerMeasurementPercent; + + @Column(name = "sent", nullable = false) + private long sent; + + @Column(name = "received", nullable = false) + private long received; + + @Column(name = "measured_at",nullable = false) + private ZonedDateTime measuredAt; + + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") + private ZonedDateTime createdAt; + + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") + private ZonedDateTime updatedAt; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public QoSIntraPingMeasurementLog() {} + + //------------------------------------------------------------------------------------------------- + @PrePersist + public void onCreate() { + this.createdAt = ZonedDateTime.now(); + this.updatedAt = this.createdAt; + } + + //------------------------------------------------------------------------------------------------- + @PreUpdate + public void onUpdate() { + this.updatedAt = ZonedDateTime.now(); + } + + //------------------------------------------------------------------------------------------------- + public QoSMeasurementType getMeasurementType() { return measurementType; } + public String getMeasuredSystemAddress() { return measuredSystemAddress; } + public boolean isAvailable() { return available; } + public Integer getMinResponseTime() { return minResponseTime; } + public Integer getMaxResponseTime() { return maxResponseTime; } + public Integer getMeanResponseTimeWithTimeout() { return meanResponseTimeWithTimeout; } + public Integer getMeanResponseTimeWithoutTimeout() { return meanResponseTimeWithoutTimeout; } + public Integer getJitterWithTimeout() { return jitterWithTimeout; } + public Integer getJitterWithoutTimeout() { return jitterWithoutTimeout; } + public Integer getLostPerMeasurementPercent() { return lostPerMeasurementPercent; } + public long getSent() { return sent; } + public long getReceived() { return received; } + public ZonedDateTime getMeasuredAt() { return measuredAt; } + + //------------------------------------------------------------------------------------------------- + public void setMeasurementType(final QoSMeasurementType measurementType) { this.measurementType = measurementType; } + public void setMeasuredSystemAddress(final String measuredSystemAddress) { this.measuredSystemAddress = measuredSystemAddress; } + public void setAvailable(final boolean available) { this.available = available; } + public void setMinResponseTime(final Integer minResponseTime) { this.minResponseTime = minResponseTime; } + public void setMaxResponseTime(final Integer maxResponseTime) { this.maxResponseTime = maxResponseTime; } + public void setMeanResponseTimeWithTimeout(final Integer meanResponseTimeWithTimeout) { this.meanResponseTimeWithTimeout = meanResponseTimeWithTimeout; } + public void setMeanResponseTimeWithoutTimeout(final Integer meanResponseTimeWithoutTimeout) { this.meanResponseTimeWithoutTimeout = meanResponseTimeWithoutTimeout; } + public void setJitterWithTimeout(final Integer jitterWithTimeout) { this.jitterWithTimeout = jitterWithTimeout; } + public void setJitterWithoutTimeout(final Integer jitterWithoutTimeout) { this.jitterWithoutTimeout = jitterWithoutTimeout; } + public void setLostPerMeasurementPercent(final Integer lostPerMeasurementPercent) { this.lostPerMeasurementPercent = lostPerMeasurementPercent; } + public void setSent(final long sent) { this.sent = sent; } + public void setReceived(final long received) { this.received = received; } + public void setMeasuredAt(ZonedDateTime measuredAt) { this.measuredAt = measuredAt; } + +} diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLogDetails.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLogDetails.java new file mode 100644 index 000000000..034fb4b08 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLogDetails.java @@ -0,0 +1,113 @@ +package eu.arrowhead.common.database.entity; + +import java.time.ZonedDateTime; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; +import javax.persistence.Table; + +@Entity +@Table(name = "qos_intra_ping_measurement_log_details") +public class QoSIntraPingMeasurementLogDetails { + + //================================================================================================= + // members + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private long id; + + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "measurement_log_id", referencedColumnName = "id", nullable = false, unique = true) + private QoSIntraPingMeasurementLog measurementLog; + + @Column(name = "measured_system_address", nullable = false) + private String measuredSystemAddress; + + @Column(name = "success_flag", nullable = false) + private boolean successFlag = false; + + @Column(name = "timeout_flag", nullable = false) + private boolean timeoutFlag = false; + + @Column(name = "error_message", nullable = true) + private String errorMessage; + + @Column(name = "throwable", nullable = true) + private String throwable; + + @Column(name = "size_", nullable = true) + private Integer size; + + @Column(name = "rtt", nullable = true) + private Integer rtt; + + @Column(name = "ttl", nullable = true) + private Integer ttl; + + @Column(name = "duration", nullable = true) + private Integer duration; + + @Column(name = "measured_at", nullable = false) + private ZonedDateTime measuredAt; + + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") + private ZonedDateTime createdAt; + + @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") + private ZonedDateTime updatedAt; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public QoSIntraPingMeasurementLogDetails() {} + + //------------------------------------------------------------------------------------------------- + @PrePersist + public void onCreate() { + this.createdAt = ZonedDateTime.now(); + this.updatedAt = this.createdAt; + } + + //------------------------------------------------------------------------------------------------- + @PreUpdate + public void onUpdate() { + this.updatedAt = ZonedDateTime.now(); + } + + //------------------------------------------------------------------------------------------------- + public QoSIntraPingMeasurementLog getMeasurementLog() { return measurementLog; } + public String getMeasuredSystemAddress() { return measuredSystemAddress; } + public boolean isSuccessFlag() { return successFlag; } + public boolean isTimeoutFlag() { return timeoutFlag; } + public String getErrorMessage() { return errorMessage; } + public String getThrowable() { return throwable; } + public Integer getSize() { return size; } + public Integer getRtt() { return rtt; } + public Integer getTtl() { return ttl; } + public Integer getDuration() { return duration; } + public ZonedDateTime getMeasuredAt() { return measuredAt; } + + //------------------------------------------------------------------------------------------------- + public void setMeasurementLog(QoSIntraPingMeasurementLog measurementLog) { this.measurementLog = measurementLog; } + public void setMeasuredSystemAddress(String measuredSystemAddress) { this.measuredSystemAddress = measuredSystemAddress; } + public void setSuccessFlag(boolean successFlag) { this.successFlag = successFlag; } + public void setTimeoutFlag(boolean timeoutFlag) { this.timeoutFlag = timeoutFlag; } + public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } + public void setThrowable(String throwable) { this.throwable = throwable; } + public void setSize(Integer size) { this.size = size; } + public void setRtt(Integer rtt) { this.rtt = rtt; } + public void setTtl(Integer ttl) { this.ttl = ttl; } + public void setDuration(Integer duration) { this.duration = duration; } + public void setMeasuredAt(ZonedDateTime measuredAt) { this.measuredAt = measuredAt; } + +} diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraPingMeasurementLogDetailsRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraPingMeasurementLogDetailsRepository.java new file mode 100644 index 000000000..e72f6e59b --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraPingMeasurementLogDetailsRepository.java @@ -0,0 +1,11 @@ +package eu.arrowhead.common.database.repository; + +import org.springframework.stereotype.Repository; + +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurementLogDetails; + +@Repository +public interface QoSIntraPingMeasurementLogDetailsRepository extends RefreshableRepository { + //================================================================================================= + // methods +} diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraPingMeasurementLogRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraPingMeasurementLogRepository.java new file mode 100644 index 000000000..3d558459f --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraPingMeasurementLogRepository.java @@ -0,0 +1,15 @@ +package eu.arrowhead.common.database.repository; + +import java.time.ZonedDateTime; +import java.util.Optional; + +import org.springframework.stereotype.Repository; +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurementLog; + +@Repository +public interface QoSIntraPingMeasurementLogRepository extends RefreshableRepository { + + //================================================================================================= + // methods + Optional findByMeasuredAt(final ZonedDateTime aroundNow); +} diff --git a/scripts/create_arrowhead_tables.sql b/scripts/create_arrowhead_tables.sql index c99fa9aab..e77dad2e7 100644 --- a/scripts/create_arrowhead_tables.sql +++ b/scripts/create_arrowhead_tables.sql @@ -369,3 +369,42 @@ CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement` ( UNIQUE KEY `unique_measurement` (`measurement_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement_log` ( + `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, + `measurement_type` varchar(255) NOT NULL, + `measured_system_address` varchar(255) NOT NULL, + `available` int(1) NOT NULL DEFAULT 0, + `min_response_time` int(11) DEFAULT NULL, + `max_response_time` int(11) DEFAULT NULL, + `mean_response_time_with_timeout` int(11) NULL DEFAULT NULL, + `mean_response_time_without_timeout` int(11) NULL DEFAULT NULL, + `jitter_with_timeout` int(11) NULL DEFAULT NULL, + `jitter_without_timeout` int(11) NULL DEFAULT NULL, + `lost_per_measurement_percent` int(3) NOT NULL DEFAULT 0, + `sent` bigint(20) NOT NULL DEFAULT 0, + `received` bigint(20) NOT NULL DEFAULT 0, + `measured_at` timestamp NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement_log_details` ( + `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, + `measurement_log_id` bigint(20) NOT NULL, + `measured_system_address` varchar(255) NOT NULL, + `success_flag` int(1) NOT NULL DEFAULT 0, + `timeout_flag` int(1) NOT NULL DEFAULT 0, + `error_message` varchar(255) NOT NULL, + `throwable` varchar(255), + `size_` int(11) NULL DEFAULT NULL, + `rtt` int(11) NULL DEFAULT NULL, + `ttl` int(3) NULL DEFAULT NULL, + `duration` int(5) NULL DEFAULT NULL, + `measured_at` timestamp NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + CONSTRAINT `fk_measurement_log` FOREIGN KEY (`measurement_log_id`) REFERENCES `qos_intra_ping_measurement_log` (`id`) ON DELETE CASCADE + +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/scripts/qos_monitor_privileges.sql b/scripts/qos_monitor_privileges.sql index 1b122ac5d..74422bb57 100644 --- a/scripts/qos_monitor_privileges.sql +++ b/scripts/qos_monitor_privileges.sql @@ -5,11 +5,15 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_measurement` TO 'qos_monitor'@'lo GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_ping_measurement` TO 'qos_monitor'@'localhost'; GRANT SELECT ON `arrowhead`.`system_` TO 'qos_monitor'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'qos_monitor'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_ping_measurement_log` TO 'qos_monitor'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_ping_measurement_log_details` TO 'qos_monitor'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'qos_monitor'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_measurement` TO 'qos_monitor'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_ping_measurement` TO 'qos_monitor'@'%'; GRANT SELECT ON `arrowhead`.`system_` TO 'qos_monitor'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'qos_monitor'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_ping_measurement_log` TO 'qos_monitor'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_ping_measurement_log_details` TO 'qos_monitor'@'%'; FLUSH PRIVILEGES; \ No newline at end of file From 0d649edd53b2de14e522ccfdde402ae8b117b3ca Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 30 Jan 2020 17:36:52 +0100 Subject: [PATCH 062/301] added ping measurement logging --- .../core/qos/quartz/task/PingTask.java | 114 +++++++++++++++++- 1 file changed, 112 insertions(+), 2 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 1b1d3db30..066ab3f30 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -31,9 +31,13 @@ import eu.arrowhead.common.Utilities; import eu.arrowhead.common.database.entity.QoSIntraMeasurement; import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurementLog; +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurementLogDetails; import eu.arrowhead.common.database.entity.System; import eu.arrowhead.common.database.repository.QoSIntraMeasurementPingRepository; import eu.arrowhead.common.database.repository.QoSIntraMeasurementRepository; +import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogDetailsRepository; +import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogRepository; import eu.arrowhead.common.database.repository.SystemRepository; import eu.arrowhead.common.dto.internal.ServiceRegistryListResponseDTO; import eu.arrowhead.common.dto.shared.QoSMeasurementType; @@ -54,6 +58,9 @@ public class PingTask implements Job { private static final int PING_TIME_OUT = 5000; private static final int REST_BETWEEN_PINGS_MILLSEC = 1000; + private static final boolean LOG_MEASUREMENT = true; + private static final boolean LOG_MEASUREMENT_DETAILS = true; + protected Logger logger = LogManager.getLogger(PingTask.class); @Autowired @@ -62,6 +69,12 @@ public class PingTask implements Job { @Autowired private QoSIntraMeasurementPingRepository qoSIntraMeasurementPingRepository; + @Autowired + private QoSIntraPingMeasurementLogRepository qoSIntraPingMeasurementLogRepository; + + @Autowired + private QoSIntraPingMeasurementLogDetailsRepository qoSIntraPingMeasurementLogDetailsRepository; + @Autowired private SystemRepository systemRepository; @@ -217,7 +230,7 @@ private void pingSystem(final SystemResponseDTO systemResponseDTO ) { final int maxResponseTime = calculateMaxResponseTime(responseList); final int minResponseTime = calculateMinResponseTime(responseList); final int meanResponseTimeWithTimeout = calculateMeanResponseTimeWithTimeout(responseList); - final int meanResponseTimeWithOutTimeout = calculateMeanResponseTimeWithoutTimeout(responseList); + final int meanResponseTimeWithoutTimeout = calculateMeanResponseTimeWithoutTimeout(responseList); final int jitterWithTimeout = calculateJitterWithTimeout(responseList); final int jitterWithoutTimeout = calculateJitterWithoutTimeout(responseList); @@ -242,6 +255,54 @@ private void pingSystem(final SystemResponseDTO systemResponseDTO ) { pingMeasurement = createPingMeasurement(measurement, responseList, aroundNow); qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); + if(LOG_MEASUREMENT) { + + final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); + measurementLog.setMeasurementType(QoSMeasurementType.PING); + measurementLog.setMeasuredSystemAddress(address); + measurementLog.setAvailable(available); + measurementLog.setMinResponseTime(minResponseTime); + measurementLog.setMaxResponseTime(maxResponseTime); + measurementLog.setMeanResponseTimeWithoutTimeout(meanResponseTimeWithoutTimeout); + measurementLog.setMeanResponseTimeWithTimeout(meanResponseTimeWithTimeout); + measurementLog.setJitterWithoutTimeout(jitterWithoutTimeout); + measurementLog.setJitterWithTimeout(jitterWithTimeout); + measurementLog.setLostPerMeasurementPercent(lostPerMeasurementPercent); + measurementLog.setSent(sentInThisPing); + measurementLog.setReceived(receivedInThisPing); + measurementLog.setMeasuredAt(aroundNow); + + final QoSIntraPingMeasurementLog measurementLogSaved = qoSIntraPingMeasurementLogRepository.saveAndFlush(measurementLog); + + if(LOG_MEASUREMENT_DETAILS) { + + final List measurementLogDetailsList = new ArrayList<>(responseList.size()); + + for (final IcmpPingResponse icmpPingResponse : responseList) { + + final QoSIntraPingMeasurementLogDetails measurementLogDetails = new QoSIntraPingMeasurementLogDetails(); + measurementLogDetails.setMeasurementLog(measurementLogSaved); + measurementLogDetails.setMeasuredSystemAddress(address); + measurementLogDetails.setSuccessFlag(icmpPingResponse.getSuccessFlag()); + measurementLogDetails.setTimeoutFlag(icmpPingResponse.getTimeoutFlag()); + measurementLogDetails.setErrorMessage(icmpPingResponse.getErrorMessage()); + measurementLogDetails.setThrowable(icmpPingResponse.getThrowable() == null ? null : icmpPingResponse.getThrowable().toString()); + measurementLogDetails.setSize(icmpPingResponse.getSize()); + measurementLogDetails.setTtl(icmpPingResponse.getTtl()); + measurementLogDetails.setRtt(icmpPingResponse.getRtt()); + measurementLogDetails.setDuration((int) icmpPingResponse.getDuration()); + measurementLogDetails.setMeasuredAt(aroundNow); + + measurementLogDetailsList.add(measurementLogDetails); + } + + qoSIntraPingMeasurementLogDetailsRepository.saveAll(measurementLogDetailsList); + qoSIntraPingMeasurementLogDetailsRepository.flush(); + + } + + } + }else { pingMeasurement = pingMeasurementOptional.get(); @@ -249,7 +310,7 @@ private void pingSystem(final SystemResponseDTO systemResponseDTO ) { pingMeasurement.setAvailable(available); pingMeasurement.setMaxResponseTime(maxResponseTime); pingMeasurement.setMinResponseTime(minResponseTime); - pingMeasurement.setMeanResponseTimeWithoutTimeout(meanResponseTimeWithOutTimeout); + pingMeasurement.setMeanResponseTimeWithoutTimeout(meanResponseTimeWithoutTimeout); pingMeasurement.setMeanResponseTimeWithTimeout(meanResponseTimeWithTimeout); pingMeasurement.setJitterWithoutTimeout(jitterWithoutTimeout); pingMeasurement.setJitterWithTimeout(jitterWithTimeout); @@ -263,9 +324,58 @@ private void pingSystem(final SystemResponseDTO systemResponseDTO ) { qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); + if(LOG_MEASUREMENT) { + + final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); + measurementLog.setMeasurementType(QoSMeasurementType.PING); + measurementLog.setMeasuredSystemAddress(address); + measurementLog.setAvailable(available); + measurementLog.setMinResponseTime(minResponseTime); + measurementLog.setMaxResponseTime(maxResponseTime); + measurementLog.setMeanResponseTimeWithoutTimeout(meanResponseTimeWithoutTimeout); + measurementLog.setMeanResponseTimeWithTimeout(meanResponseTimeWithTimeout); + measurementLog.setJitterWithoutTimeout(jitterWithoutTimeout); + measurementLog.setJitterWithTimeout(jitterWithTimeout); + measurementLog.setLostPerMeasurementPercent(lostPerMeasurementPercent); + measurementLog.setSent(sentInThisPing); + measurementLog.setReceived(receivedInThisPing); + measurementLog.setMeasuredAt(aroundNow); + + final QoSIntraPingMeasurementLog measurementLogSaved = qoSIntraPingMeasurementLogRepository.saveAndFlush(measurementLog); + + if(LOG_MEASUREMENT_DETAILS) { + + final List measurementLogDetailsList = new ArrayList<>(responseList.size()); + + for (final IcmpPingResponse icmpPingResponse : responseList) { + + final QoSIntraPingMeasurementLogDetails measurementLogDetails = new QoSIntraPingMeasurementLogDetails(); + measurementLogDetails.setMeasurementLog(measurementLogSaved); + measurementLogDetails.setMeasuredSystemAddress(address); + measurementLogDetails.setSuccessFlag(icmpPingResponse.getSuccessFlag()); + measurementLogDetails.setTimeoutFlag(icmpPingResponse.getTimeoutFlag()); + measurementLogDetails.setErrorMessage(icmpPingResponse.getErrorMessage()); + measurementLogDetails.setThrowable(icmpPingResponse.getThrowable() == null ? null : icmpPingResponse.getThrowable().toString()); + measurementLogDetails.setSize(icmpPingResponse.getSize()); + measurementLogDetails.setTtl(icmpPingResponse.getTtl()); + measurementLogDetails.setRtt(icmpPingResponse.getRtt()); + measurementLogDetails.setDuration((int) icmpPingResponse.getDuration()); + measurementLogDetails.setMeasuredAt(aroundNow); + + measurementLogDetailsList.add(measurementLogDetails); + } + + qoSIntraPingMeasurementLogDetailsRepository.saveAll(measurementLogDetailsList); + qoSIntraPingMeasurementLogDetailsRepository.flush(); + + } + + } } updateMeasurement(aroundNow, measurement); + + } //------------------------------------------------------------------------------------------------- From 179e1ba9cfee994974bd720e4168d1da38b5f47f Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 30 Jan 2020 17:44:23 +0100 Subject: [PATCH 063/301] added ping measurement log tables --- scripts/create_arrowhead_tables.sql | 39 +++++++++++++++++++++++++++++ scripts/qos_monitor_privileges.sql | 4 +++ 2 files changed, 43 insertions(+) diff --git a/scripts/create_arrowhead_tables.sql b/scripts/create_arrowhead_tables.sql index 416d8fe22..ccab29fa8 100644 --- a/scripts/create_arrowhead_tables.sql +++ b/scripts/create_arrowhead_tables.sql @@ -370,6 +370,45 @@ CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement_log` ( + `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, + `measurement_type` varchar(255) NOT NULL, + `measured_system_address` varchar(255) NOT NULL, + `available` int(1) NOT NULL DEFAULT 0, + `min_response_time` int(11) DEFAULT NULL, + `max_response_time` int(11) DEFAULT NULL, + `mean_response_time_with_timeout` int(11) NULL DEFAULT NULL, + `mean_response_time_without_timeout` int(11) NULL DEFAULT NULL, + `jitter_with_timeout` int(11) NULL DEFAULT NULL, + `jitter_without_timeout` int(11) NULL DEFAULT NULL, + `lost_per_measurement_percent` int(3) NOT NULL DEFAULT 0, + `sent` bigint(20) NOT NULL DEFAULT 0, + `received` bigint(20) NOT NULL DEFAULT 0, + `measured_at` timestamp NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement_log_details` ( + `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, + `measurement_log_id` bigint(20) NOT NULL, + `measured_system_address` varchar(255) NOT NULL, + `success_flag` int(1) NOT NULL DEFAULT 0, + `timeout_flag` int(1) NOT NULL DEFAULT 0, + `error_message` varchar(255) NOT NULL, + `throwable` varchar(255), + `size_` int(11) NULL DEFAULT NULL, + `rtt` int(11) NULL DEFAULT NULL, + `ttl` int(3) NULL DEFAULT NULL, + `duration` int(5) NULL DEFAULT NULL, + `measured_at` timestamp NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + CONSTRAINT `fk_measurement_log` FOREIGN KEY (`measurement_log_id`) REFERENCES `qos_intra_ping_measurement_log` (`id`) ON DELETE CASCADE + +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + -- QoS Manager CREATE TABLE IF NOT EXISTS `qos_reservation` ( diff --git a/scripts/qos_monitor_privileges.sql b/scripts/qos_monitor_privileges.sql index 1b122ac5d..74422bb57 100644 --- a/scripts/qos_monitor_privileges.sql +++ b/scripts/qos_monitor_privileges.sql @@ -5,11 +5,15 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_measurement` TO 'qos_monitor'@'lo GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_ping_measurement` TO 'qos_monitor'@'localhost'; GRANT SELECT ON `arrowhead`.`system_` TO 'qos_monitor'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'qos_monitor'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_ping_measurement_log` TO 'qos_monitor'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_ping_measurement_log_details` TO 'qos_monitor'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'qos_monitor'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_measurement` TO 'qos_monitor'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_ping_measurement` TO 'qos_monitor'@'%'; GRANT SELECT ON `arrowhead`.`system_` TO 'qos_monitor'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'qos_monitor'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_ping_measurement_log` TO 'qos_monitor'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`qos_intra_ping_measurement_log_details` TO 'qos_monitor'@'%'; FLUSH PRIVILEGES; \ No newline at end of file From 2875a22c32f5f0194b455b0d3bcecdf5f86d32cb Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 31 Jan 2020 10:47:55 +0100 Subject: [PATCH 064/301] refactored pingTask --- .../core/qos/quartz/task/PingTask.java | 207 +++++++++--------- 1 file changed, 100 insertions(+), 107 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 066ab3f30..d66f8ad5f 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -25,6 +25,7 @@ import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.util.UriComponents; +import org.springframework.util.Assert; import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; @@ -142,13 +143,13 @@ private QoSIntraPingMeasurement createPingMeasurement(final QoSIntraMeasurement final int meanResponseTimeWithOutTimeout = calculateMeanResponseTimeWithoutTimeout(responseList); final int jitterWithTimeout = calculateJitterWithTimeout(responseList); final int jitterWithoutTimeout = calculateJitterWithoutTimeout(responseList); - + final ZonedDateTime countStartedAt = aroundNow; - long sent = 0; - long sentAll = 0; - long received = 0; - long receivedAll = 0; + final long sent = 0; + final long sentAll = 0; + final long received = 0; + final long receivedAll = 0; final int sentInThisPing = getSentInThisPing(responseList); final int receivedInThisPing = getReceivedInThisPing(responseList); @@ -156,20 +157,15 @@ private QoSIntraPingMeasurement createPingMeasurement(final QoSIntraMeasurement final int lostPerMeasurementPercent = (int) (receivedInThisPing == 0 ? 1 : ((double)receivedInThisPing / (double)sentInThisPing) * 100); final QoSIntraMeasurement measurement ; - final Optional meOptional = qoSIntraMeasurementRepository.findById(measurementParam.getId()); - if (meOptional.isPresent()) { - measurement = meOptional.get(); + final Optional measurementOptional = qoSIntraMeasurementRepository.findById(measurementParam.getId()); + if (measurementOptional.isPresent()) { + measurement = measurementOptional.get(); }else { throw new ArrowheadException("Could not find measurment in DB"); } final QoSIntraPingMeasurement pingMeasurement = new QoSIntraPingMeasurement(); - sent = pingMeasurement.getSent(); - sentAll = pingMeasurement.getSentAll(); - received = pingMeasurement.getReceived(); - receivedAll = pingMeasurement.getReceivedAll(); - pingMeasurement.setMeasurement(measurement); pingMeasurement.setAvailable(available); pingMeasurement.setMaxResponseTime(maxResponseTime); @@ -193,7 +189,7 @@ private QoSIntraPingMeasurement createPingMeasurement(final QoSIntraMeasurement //------------------------------------------------------------------------------------------------- @Transactional (rollbackFor = ArrowheadException.class) - private void updateMeasurement(ZonedDateTime aroundNow,final QoSIntraMeasurement measurement) { + private void updateMeasurement(final ZonedDateTime aroundNow,final QoSIntraMeasurement measurement) { measurement.setLastMeasurementAt(aroundNow); qoSIntraMeasurementRepository.saveAndFlush(measurement); @@ -226,6 +222,19 @@ private void pingSystem(final SystemResponseDTO systemResponseDTO ) { final List responseList = getPingResponseList(address); + final QoSIntraMeasurement measurement = getMeasurement(system, aroundNow); + handelPingMeasurement(address, measurement, responseList, aroundNow); + + updateMeasurement(aroundNow, measurement); + + } + + //------------------------------------------------------------------------------------------------- + @Transactional (rollbackFor = ArrowheadException.class) + private void handelPingMeasurement(final String address, final QoSIntraMeasurement measurement, + final List responseList, final ZonedDateTime aroundNow) { + logger.debug("handelPingMeasurement started..."); + final boolean available = calculateAvailable(responseList); final int maxResponseTime = calculateMaxResponseTime(responseList); final int minResponseTime = calculateMinResponseTime(responseList); @@ -233,20 +242,13 @@ private void pingSystem(final SystemResponseDTO systemResponseDTO ) { final int meanResponseTimeWithoutTimeout = calculateMeanResponseTimeWithoutTimeout(responseList); final int jitterWithTimeout = calculateJitterWithTimeout(responseList); final int jitterWithoutTimeout = calculateJitterWithoutTimeout(responseList); - final ZonedDateTime countStartedAt = aroundNow; final int sentInThisPing = getSentInThisPing(responseList); final int receivedInThisPing = getReceivedInThisPing(responseList); - final int lostPerMeasurementPercent = (int) (receivedInThisPing == 0 ? 1 : 100 - ((double)receivedInThisPing / (double)sentInThisPing) * 100); - final QoSIntraMeasurement measurement; - final Optional qoSIntraMeasurementOptional = qoSIntraMeasurementRepository.findBySystemAndMeasurementType(system, QoSMeasurementType.PING); - if (qoSIntraMeasurementOptional.isEmpty()) { - measurement = createMeasurement(system, QoSMeasurementType.PING, aroundNow); - }else { - measurement = qoSIntraMeasurementOptional.get(); - } + Assert.isTrue(sentInThisPing > 0, "Sent in this Ping value must be greater than zero"); + final int lostPerMeasurementPercent = (int) (receivedInThisPing == 0 ? 100 : 100 - ( (double)receivedInThisPing / (double)sentInThisPing ) * 100); final QoSIntraPingMeasurement pingMeasurement; final Optional pingMeasurementOptional = qoSIntraMeasurementPingRepository.findByMeasurement(measurement); @@ -257,48 +259,11 @@ private void pingSystem(final SystemResponseDTO systemResponseDTO ) { if(LOG_MEASUREMENT) { - final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); - measurementLog.setMeasurementType(QoSMeasurementType.PING); - measurementLog.setMeasuredSystemAddress(address); - measurementLog.setAvailable(available); - measurementLog.setMinResponseTime(minResponseTime); - measurementLog.setMaxResponseTime(maxResponseTime); - measurementLog.setMeanResponseTimeWithoutTimeout(meanResponseTimeWithoutTimeout); - measurementLog.setMeanResponseTimeWithTimeout(meanResponseTimeWithTimeout); - measurementLog.setJitterWithoutTimeout(jitterWithoutTimeout); - measurementLog.setJitterWithTimeout(jitterWithTimeout); - measurementLog.setLostPerMeasurementPercent(lostPerMeasurementPercent); - measurementLog.setSent(sentInThisPing); - measurementLog.setReceived(receivedInThisPing); - measurementLog.setMeasuredAt(aroundNow); - - final QoSIntraPingMeasurementLog measurementLogSaved = qoSIntraPingMeasurementLogRepository.saveAndFlush(measurementLog); - - if(LOG_MEASUREMENT_DETAILS) { - - final List measurementLogDetailsList = new ArrayList<>(responseList.size()); - - for (final IcmpPingResponse icmpPingResponse : responseList) { - - final QoSIntraPingMeasurementLogDetails measurementLogDetails = new QoSIntraPingMeasurementLogDetails(); - measurementLogDetails.setMeasurementLog(measurementLogSaved); - measurementLogDetails.setMeasuredSystemAddress(address); - measurementLogDetails.setSuccessFlag(icmpPingResponse.getSuccessFlag()); - measurementLogDetails.setTimeoutFlag(icmpPingResponse.getTimeoutFlag()); - measurementLogDetails.setErrorMessage(icmpPingResponse.getErrorMessage()); - measurementLogDetails.setThrowable(icmpPingResponse.getThrowable() == null ? null : icmpPingResponse.getThrowable().toString()); - measurementLogDetails.setSize(icmpPingResponse.getSize()); - measurementLogDetails.setTtl(icmpPingResponse.getTtl()); - measurementLogDetails.setRtt(icmpPingResponse.getRtt()); - measurementLogDetails.setDuration((int) icmpPingResponse.getDuration()); - measurementLogDetails.setMeasuredAt(aroundNow); - - measurementLogDetailsList.add(measurementLogDetails); - } - - qoSIntraPingMeasurementLogDetailsRepository.saveAll(measurementLogDetailsList); - qoSIntraPingMeasurementLogDetailsRepository.flush(); + final QoSIntraPingMeasurementLog measurementLogSaved = logMeasurementToDB(address, pingMeasurement, aroundNow); + if(LOG_MEASUREMENT_DETAILS && measurementLogSaved != null) { + + logMeasurementDetailsToDB(address, measurementLogSaved, responseList, aroundNow); } } @@ -326,56 +291,84 @@ private void pingSystem(final SystemResponseDTO systemResponseDTO ) { if(LOG_MEASUREMENT) { - final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); - measurementLog.setMeasurementType(QoSMeasurementType.PING); - measurementLog.setMeasuredSystemAddress(address); - measurementLog.setAvailable(available); - measurementLog.setMinResponseTime(minResponseTime); - measurementLog.setMaxResponseTime(maxResponseTime); - measurementLog.setMeanResponseTimeWithoutTimeout(meanResponseTimeWithoutTimeout); - measurementLog.setMeanResponseTimeWithTimeout(meanResponseTimeWithTimeout); - measurementLog.setJitterWithoutTimeout(jitterWithoutTimeout); - measurementLog.setJitterWithTimeout(jitterWithTimeout); - measurementLog.setLostPerMeasurementPercent(lostPerMeasurementPercent); - measurementLog.setSent(sentInThisPing); - measurementLog.setReceived(receivedInThisPing); - measurementLog.setMeasuredAt(aroundNow); - - final QoSIntraPingMeasurementLog measurementLogSaved = qoSIntraPingMeasurementLogRepository.saveAndFlush(measurementLog); - - if(LOG_MEASUREMENT_DETAILS) { - - final List measurementLogDetailsList = new ArrayList<>(responseList.size()); - - for (final IcmpPingResponse icmpPingResponse : responseList) { - - final QoSIntraPingMeasurementLogDetails measurementLogDetails = new QoSIntraPingMeasurementLogDetails(); - measurementLogDetails.setMeasurementLog(measurementLogSaved); - measurementLogDetails.setMeasuredSystemAddress(address); - measurementLogDetails.setSuccessFlag(icmpPingResponse.getSuccessFlag()); - measurementLogDetails.setTimeoutFlag(icmpPingResponse.getTimeoutFlag()); - measurementLogDetails.setErrorMessage(icmpPingResponse.getErrorMessage()); - measurementLogDetails.setThrowable(icmpPingResponse.getThrowable() == null ? null : icmpPingResponse.getThrowable().toString()); - measurementLogDetails.setSize(icmpPingResponse.getSize()); - measurementLogDetails.setTtl(icmpPingResponse.getTtl()); - measurementLogDetails.setRtt(icmpPingResponse.getRtt()); - measurementLogDetails.setDuration((int) icmpPingResponse.getDuration()); - measurementLogDetails.setMeasuredAt(aroundNow); - - measurementLogDetailsList.add(measurementLogDetails); - } - - qoSIntraPingMeasurementLogDetailsRepository.saveAll(measurementLogDetailsList); - qoSIntraPingMeasurementLogDetailsRepository.flush(); + final QoSIntraPingMeasurementLog measurementLogSaved = logMeasurementToDB(address, pingMeasurement, aroundNow); - } + if(LOG_MEASUREMENT_DETAILS && measurementLogSaved != null) { + logMeasurementDetailsToDB(address, measurementLogSaved, responseList, aroundNow); + } } } + } - updateMeasurement(aroundNow, measurement); + //------------------------------------------------------------------------------------------------- + @Transactional (rollbackFor = ArrowheadException.class) + private QoSIntraMeasurement getMeasurement(final System system, final ZonedDateTime aroundNow) { + logger.debug("getMeasurement started..."); + + final QoSIntraMeasurement measurement; + final Optional qoSIntraMeasurementOptional = qoSIntraMeasurementRepository.findBySystemAndMeasurementType(system, QoSMeasurementType.PING); + if (qoSIntraMeasurementOptional.isEmpty()) { + measurement = createMeasurement(system, QoSMeasurementType.PING, aroundNow); + }else { + measurement = qoSIntraMeasurementOptional.get(); + } + return measurement; + } + //------------------------------------------------------------------------------------------------- + @Transactional (rollbackFor = ArrowheadException.class) + private void logMeasurementDetailsToDB(final String address, final QoSIntraPingMeasurementLog measurementLogSaved, + final List responseList, final ZonedDateTime aroundNow) { + logger.debug("logMeasurementDetailsToDB started..."); + + final List measurementLogDetailsList = new ArrayList<>(responseList.size()); + for (final IcmpPingResponse icmpPingResponse : responseList) { + + final QoSIntraPingMeasurementLogDetails measurementLogDetails = new QoSIntraPingMeasurementLogDetails(); + measurementLogDetails.setMeasurementLog(measurementLogSaved); + measurementLogDetails.setMeasuredSystemAddress(address); + measurementLogDetails.setSuccessFlag(icmpPingResponse.getSuccessFlag()); + measurementLogDetails.setTimeoutFlag(icmpPingResponse.getTimeoutFlag()); + measurementLogDetails.setErrorMessage(icmpPingResponse.getErrorMessage()); + measurementLogDetails.setThrowable(icmpPingResponse.getThrowable() == null ? null : icmpPingResponse.getThrowable().toString()); + measurementLogDetails.setSize(icmpPingResponse.getSize()); + measurementLogDetails.setTtl(icmpPingResponse.getTtl()); + measurementLogDetails.setRtt(icmpPingResponse.getRtt()); + measurementLogDetails.setDuration((int) icmpPingResponse.getDuration()); + measurementLogDetails.setMeasuredAt(aroundNow); + + measurementLogDetailsList.add(measurementLogDetails); + } + + qoSIntraPingMeasurementLogDetailsRepository.saveAll(measurementLogDetailsList); + qoSIntraPingMeasurementLogDetailsRepository.flush(); + } + + //------------------------------------------------------------------------------------------------- + @Transactional (rollbackFor = ArrowheadException.class) + private QoSIntraPingMeasurementLog logMeasurementToDB(final String address, final QoSIntraPingMeasurement pingMeasurement, final ZonedDateTime aroundNow) { + logger.debug("logMeasurementToDB started..."); + + final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); + measurementLog.setMeasurementType(QoSMeasurementType.PING); + measurementLog.setMeasuredSystemAddress(address); + measurementLog.setAvailable(pingMeasurement.isAvailable()); + measurementLog.setMinResponseTime(pingMeasurement.getMinResponseTime()); + measurementLog.setMaxResponseTime(pingMeasurement.getMaxResponseTime()); + measurementLog.setMeanResponseTimeWithoutTimeout(pingMeasurement.getMeanResponseTimeWithoutTimeout()); + measurementLog.setMeanResponseTimeWithTimeout(pingMeasurement.getMeanResponseTimeWithTimeout()); + measurementLog.setJitterWithoutTimeout(pingMeasurement.getJitterWithoutTimeout()); + measurementLog.setJitterWithTimeout(pingMeasurement.getJitterWithTimeout()); + measurementLog.setLostPerMeasurementPercent(pingMeasurement.getLostPerMeasurementPercent()); + measurementLog.setSent(pingMeasurement.getSent()); + measurementLog.setReceived(pingMeasurement.getReceived()); + measurementLog.setMeasuredAt(aroundNow); + + final QoSIntraPingMeasurementLog measurementLogSaved = qoSIntraPingMeasurementLogRepository.saveAndFlush(measurementLog); + + return measurementLogSaved; } //------------------------------------------------------------------------------------------------- From 58576d71dba0366adc10f5a12518870139c0f313 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Fri, 31 Jan 2020 10:56:36 +0100 Subject: [PATCH 065/301] QoS reservation handling --- .../arrowhead/common/CoreCommonConstants.java | 2 + .../eu/arrowhead/common/CoreDefaults.java | 1 + .../repository/QoSReservationRepository.java | 3 + .../service/OrchestratorDriver.java | 2 +- .../service/OrchestratorService.java | 6 +- .../service/QoSReservationDBService.java | 94 ++++++++++++++++++- .../core/qos/manager/QoSManager.java | 1 + .../qos/manager/impl/DummyQoSManager.java | 7 +- .../core/qos/manager/impl/QoSManagerImpl.java | 22 ++++- 9 files changed, 131 insertions(+), 7 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java index 24188205f..4b89817dd 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java @@ -123,6 +123,8 @@ public class CoreCommonConstants { public static final String $QOS_RESERVATION_CHECK_INTERVAL_WD = "${" + QOS_RESERVATION_CHECK_INTERVAL + ":" + CoreDefaults.DEFAULT_QOS_RESERVATION_CHECK_INTERVAL + "}"; public static final String QOS_RESERVATION_TEMP_LOCK_DURATION = "qos_reservation_temp_lock_duration"; // in seconds public static final String $QOS_RESERVATION_TEMP_LOCK_DURATION_WD = "${" + QOS_RESERVATION_TEMP_LOCK_DURATION + ":" + CoreDefaults.DEFAULT_QOS_TEMPORARY_LOCK_DURATION + "}"; + public static final String QOS_MAX_RESERVATION_DURATION = "qos_maximum_reservation_duration"; // in seconds + public static final String $QOS_MAX_RESERVATION_DURATION_WD = "${" + QOS_MAX_RESERVATION_DURATION + ":" + CoreDefaults.DEFAULT_QOS_MAX_RESERVATION_DURATION + "}"; public static final String NO_GATEKEEPER_RELAY_REQUEST_HANDLER_WORKERS = "no_gatekeeper_relay_request_handler_workers"; public static final String $NO_GATEKEEPER_RELAY_REQUEST_HANDLER_WORKERS_WD = "${" + NO_GATEKEEPER_RELAY_REQUEST_HANDLER_WORKERS + ":" + diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java b/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java index 629e14568..62e4b9c76 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java @@ -55,6 +55,7 @@ public class CoreDefaults { public static final boolean DEFAULT_QOS_ENABLED = false; public static final int DEFAULT_QOS_RESERVATION_CHECK_INTERVAL = 60; // in seconds public static final int DEFAULT_QOS_TEMPORARY_LOCK_DURATION = 60; // in seconds + public static final int DEFAULT_QOS_MAX_RESERVATION_DURATION = 3600; // in seconds //================================================================================================= // assistant methods diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSReservationRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSReservationRepository.java index db969d3c8..ad3ce72c3 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSReservationRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSReservationRepository.java @@ -2,6 +2,7 @@ import java.time.ZonedDateTime; import java.util.List; +import java.util.Optional; import org.springframework.stereotype.Repository; @@ -16,4 +17,6 @@ public interface QoSReservationRepository extends RefreshableRepository findAllByReservedToLessThanEqual(final ZonedDateTime threshold); public List findAllByConsumerSystemNameNotOrConsumerAddressNotOrConsumerPortNot(final String consumerSystemName, final String consumerAddress, final int consumerPort); + public Optional findByReservedProviderIdAndReservedServiceId(final long reservedProviderId, final long reservedServiceId); + public Optional findByReservedProviderIdAndReservedServiceIdAndTemporaryLockTrue(final long reservedProviderId, final long reservedServiceId); } \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java index 17b916072..0cc81138b 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java @@ -59,7 +59,7 @@ public class OrchestratorDriver { private static final String GATEKEEPER_INIT_GSD_URI_KEY = CoreSystemService.GATEKEEPER_GLOBAL_SERVICE_DISCOVERY.getServiceDefinition() + CoreCommonConstants.URI_SUFFIX; private static final String GATEKEEPER_INIT_ICN_URI_KEY = CoreSystemService.GATEKEEPER_INTER_CLOUD_NEGOTIATION.getServiceDefinition() + CoreCommonConstants.URI_SUFFIX; - private static final String KEY_CALCULATED_SERVICE_TIME_FRAME = "QoSCalculatedServiceTimeFrame"; + public static final String KEY_CALCULATED_SERVICE_TIME_FRAME = "QoSCalculatedServiceTimeFrame"; private static final Logger logger = LogManager.getLogger(OrchestratorDriver.class); diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java index 749ee9c80..161a3bc26 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java @@ -292,7 +292,7 @@ public OrchestrationResponseDTO dynamicOrchestration(final OrchestrationFormRequ final boolean needReservation = qosEnabled && flags.get(Flag.ENABLE_QOS) && request.getCommands().containsKey(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY); if (needReservation) { - //TODO: temporary locking (if caller wants exclusivity) + orList = qosManager.reserveProvidersTemporarily(orList, request.getRequesterSystem()); } if (flags.get(Flag.ENABLE_QOS)) { @@ -316,7 +316,9 @@ public OrchestrationResponseDTO dynamicOrchestration(final OrchestrationFormRequ final IntraCloudProviderMatchmakingParameters params = new IntraCloudProviderMatchmakingParameters(localProviders); // set additional parameters here if you use a different matchmaking algorithm final OrchestrationResultDTO selected = intraCloudProviderMatchmaker.doMatchmaking(orList, params); - //TODO: remove temporary locks and change lock on the selected + if (needReservation) { + qosManager.confirmReservation(selected, orList, request.getRequesterSystem()); + } orList.clear(); orList.add(selected); } diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java index 977c8175e..8f0a9f4c4 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java @@ -2,6 +2,7 @@ import java.time.ZonedDateTime; import java.util.List; +import java.util.Optional; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -14,10 +15,11 @@ import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.Utilities; import eu.arrowhead.common.database.entity.QoSReservation; -import eu.arrowhead.common.database.entity.ServiceRegistry; import eu.arrowhead.common.database.repository.QoSReservationRepository; import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.core.orchestrator.service.OrchestratorDriver; @Service public class QoSReservationDBService { @@ -28,6 +30,9 @@ public class QoSReservationDBService { @Value(CoreCommonConstants.$QOS_RESERVATION_TEMP_LOCK_DURATION_WD) private int lockDuration; // in seconds + @Value(CoreCommonConstants.$QOS_MAX_RESERVATION_DURATION_WD) + private int maxReservationDuration; // in seconds + private final Logger logger = LogManager.getLogger(QoSReservationDBService.class); @Autowired @@ -68,7 +73,92 @@ public List getAllReservationsExceptMine(final String systemName public void applyTemporaryLock(final String systemName, final String address, final int port, final OrchestrationResultDTO dto) { Assert.isTrue(!Utilities.isEmpty(systemName), "'systemName' is null or empty."); Assert.isTrue(!Utilities.isEmpty(address), "'address' is null or empty."); + Assert.notNull(dto, "'dto' is null."); + Assert.notNull(dto.getProvider(), "Provider is null."); + Assert.notNull(dto.getService(), "Service is null."); + + final ZonedDateTime reservedTo = ZonedDateTime.now().plusSeconds(lockDuration); + final QoSReservation reservation = new QoSReservation(dto.getProvider().getId(), dto.getService().getId(), systemName, address, port, reservedTo, true); + try { + qosReservationRepository.saveAndFlush(reservation); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public void removeTemporaryLock(final OrchestrationResultDTO dto) { + Assert.notNull(dto, "'dto' is null."); + Assert.notNull(dto.getProvider(), "Provider is null."); + Assert.notNull(dto.getService(), "Service is null."); + + final Optional optReservation = qosReservationRepository.findByReservedProviderIdAndReservedServiceIdAndTemporaryLockTrue(dto.getProvider().getId(), + dto.getService().getId()); + if (optReservation.isEmpty()) { // maybe temporary lock is expired and removed + // do nothing + } else { + final QoSReservation reservation = optReservation.get(); + try { + qosReservationRepository.delete(reservation); + qosReservationRepository.flush(); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public void extendReservation(final OrchestrationResultDTO reserved, final SystemRequestDTO requester) { + Assert.notNull(reserved, "'reserved' is null."); + Assert.notNull(reserved.getProvider(), "Provider is null."); + Assert.notNull(reserved.getService(), "Service is null."); + Assert.notNull(requester, "'requester' is null."); + Assert.isTrue(!Utilities.isEmpty(requester.getSystemName()), "Requester system's name is null or empty."); + Assert.isTrue(!Utilities.isEmpty(requester.getAddress()), "Requester system's address is null or empty."); + Assert.notNull(requester.getPort(), "Requester system's port is null."); - //TODO: cont + final Optional optReservation = qosReservationRepository.findByReservedProviderIdAndReservedServiceId(reserved.getProvider().getId(), reserved.getService().getId()); + QoSReservation reservation; + if (optReservation.isEmpty()) { // maybe temporary lock is expired and removed + reservation = new QoSReservation(reserved.getProvider().getId(), reserved.getService().getId(), requester.getSystemName(), requester.getAddress(), requester.getPort(), + null, false); + } else { + reservation = optReservation.get(); + } + + reservation.setTemporaryLock(false); + reservation.setReservedTo(getReservationTime(reserved)); + try { + qosReservationRepository.saveAndFlush(reservation); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private ZonedDateTime getReservationTime(final OrchestrationResultDTO dto) { + final ZonedDateTime time = ZonedDateTime.now(); + + int seconds = maxReservationDuration; + if (dto.getMetadata() != null && dto.getMetadata().containsKey(OrchestratorDriver.KEY_CALCULATED_SERVICE_TIME_FRAME)) { + try { + final String calculatedTimeFrameStr = dto.getMetadata().remove(OrchestratorDriver.KEY_CALCULATED_SERVICE_TIME_FRAME); + final int calculatedTimeFrame = Integer.parseInt(calculatedTimeFrameStr); + seconds = Math.min(maxReservationDuration, calculatedTimeFrame); + } catch (final NumberFormatException ex) { + logger.debug(ex.getMessage()); + logger.trace("Stacktracke:", ex); + } + } + + return time.plusSeconds(seconds); } } \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java index 65b6ba608..6767ebfa2 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java @@ -17,4 +17,5 @@ public interface QoSManager { // reservation-related public List filterReservedProviders(final List orList, final SystemRequestDTO requester); public List reserveProvidersTemporarily(final List orList, final SystemRequestDTO requester); // returns with the temp locked results + public void confirmReservation(final OrchestrationResultDTO selected, final List orList, final SystemRequestDTO requester); } \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java index 96e6295d1..2965c226d 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java @@ -11,7 +11,6 @@ public class DummyQoSManager implements QoSManager { //================================================================================================= // methods - //------------------------------------------------------------------------------------------------- @Override public List filterReservedProviders(final List orList, final SystemRequestDTO requester) { @@ -23,4 +22,10 @@ public List filterReservedProviders(final List reserveProvidersTemporarily(final List orList, final SystemRequestDTO requester) { return orList; } + + //------------------------------------------------------------------------------------------------- + @Override + public void confirmReservation(final OrchestrationResultDTO selected, final List orList, final SystemRequestDTO requester) { + // intentionally do nothing + } } \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java index 9d2a6c492..6e5029385 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java @@ -55,8 +55,9 @@ public List filterReservedProviders(final List reserveProvidersTemporarily(List orList, SystemRequestDTO requester) { + public List reserveProvidersTemporarily(List orList, final SystemRequestDTO requester) { Assert.notNull(orList, "'orList' is null."); + Assert.notNull(requester, "'requester' is null."); Assert.isTrue(!Utilities.isEmpty(requester.getSystemName()), "Requester system's name is null or empty."); Assert.isTrue(!Utilities.isEmpty(requester.getAddress()), "Requester system's address is null or empty."); Assert.notNull(requester.getPort(), "Requester system's port is null."); @@ -80,6 +81,25 @@ public List reserveProvidersTemporarily(List orList, final SystemRequestDTO requester) { + Assert.notNull(selected, "'selected' is null."); + Assert.notEmpty(orList, "'orList' is null or empty."); + Assert.notNull(requester, "'requester' is null."); + Assert.isTrue(!Utilities.isEmpty(requester.getSystemName()), "Requester system's name is null or empty."); + Assert.isTrue(!Utilities.isEmpty(requester.getAddress()), "Requester system's address is null or empty."); + Assert.notNull(requester.getPort(), "Requester system's port is null."); + + for (final OrchestrationResultDTO dto : orList) { + if (dto.getProvider().getId() == selected.getProvider().getId() && dto.getService().getId() == selected.getProvider().getId()) { + qosReservationDBService.extendReservation(selected, requester); + } else { + qosReservationDBService.removeTemporaryLock(dto); + } + } + } + //================================================================================================= // methods From a425d2bf81386fb203f5c318fbd07a6ae0bf3bce Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 31 Jan 2020 14:03:57 +0100 Subject: [PATCH 066/301] requested change: remove unnecessary cloumns --- .../common/database/entity/QoSIntraPingMeasurementLog.java | 6 ------ .../database/entity/QoSIntraPingMeasurementLogDetails.java | 5 ----- scripts/create_arrowhead_tables.sql | 2 -- 3 files changed, 13 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLog.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLog.java index 5ecc1faa0..aa7696ba3 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLog.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLog.java @@ -27,10 +27,6 @@ public class QoSIntraPingMeasurementLog { @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; - @Column(nullable = false, columnDefinition = "varchar(" + CoreDefaults.VARCHAR_BASIC + ")") - @Enumerated(EnumType.STRING) - private QoSMeasurementType measurementType; - @Column(name = "measured_system_address", nullable = false) private String measuredSystemAddress; @@ -93,7 +89,6 @@ public void onUpdate() { } //------------------------------------------------------------------------------------------------- - public QoSMeasurementType getMeasurementType() { return measurementType; } public String getMeasuredSystemAddress() { return measuredSystemAddress; } public boolean isAvailable() { return available; } public Integer getMinResponseTime() { return minResponseTime; } @@ -108,7 +103,6 @@ public void onUpdate() { public ZonedDateTime getMeasuredAt() { return measuredAt; } //------------------------------------------------------------------------------------------------- - public void setMeasurementType(final QoSMeasurementType measurementType) { this.measurementType = measurementType; } public void setMeasuredSystemAddress(final String measuredSystemAddress) { this.measuredSystemAddress = measuredSystemAddress; } public void setAvailable(final boolean available) { this.available = available; } public void setMinResponseTime(final Integer minResponseTime) { this.minResponseTime = minResponseTime; } diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLogDetails.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLogDetails.java index 034fb4b08..357f68cab 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLogDetails.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLogDetails.java @@ -29,9 +29,6 @@ public class QoSIntraPingMeasurementLogDetails { @JoinColumn(name = "measurement_log_id", referencedColumnName = "id", nullable = false, unique = true) private QoSIntraPingMeasurementLog measurementLog; - @Column(name = "measured_system_address", nullable = false) - private String measuredSystemAddress; - @Column(name = "success_flag", nullable = false) private boolean successFlag = false; @@ -86,7 +83,6 @@ public void onUpdate() { //------------------------------------------------------------------------------------------------- public QoSIntraPingMeasurementLog getMeasurementLog() { return measurementLog; } - public String getMeasuredSystemAddress() { return measuredSystemAddress; } public boolean isSuccessFlag() { return successFlag; } public boolean isTimeoutFlag() { return timeoutFlag; } public String getErrorMessage() { return errorMessage; } @@ -99,7 +95,6 @@ public void onUpdate() { //------------------------------------------------------------------------------------------------- public void setMeasurementLog(QoSIntraPingMeasurementLog measurementLog) { this.measurementLog = measurementLog; } - public void setMeasuredSystemAddress(String measuredSystemAddress) { this.measuredSystemAddress = measuredSystemAddress; } public void setSuccessFlag(boolean successFlag) { this.successFlag = successFlag; } public void setTimeoutFlag(boolean timeoutFlag) { this.timeoutFlag = timeoutFlag; } public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } diff --git a/scripts/create_arrowhead_tables.sql b/scripts/create_arrowhead_tables.sql index ccab29fa8..39b88aa18 100644 --- a/scripts/create_arrowhead_tables.sql +++ b/scripts/create_arrowhead_tables.sql @@ -372,7 +372,6 @@ CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement` ( CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement_log` ( `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, - `measurement_type` varchar(255) NOT NULL, `measured_system_address` varchar(255) NOT NULL, `available` int(1) NOT NULL DEFAULT 0, `min_response_time` int(11) DEFAULT NULL, @@ -393,7 +392,6 @@ CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement_log` ( CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement_log_details` ( `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, `measurement_log_id` bigint(20) NOT NULL, - `measured_system_address` varchar(255) NOT NULL, `success_flag` int(1) NOT NULL DEFAULT 0, `timeout_flag` int(1) NOT NULL DEFAULT 0, `error_message` varchar(255) NOT NULL, From 0c9232420d5caa9dc2dee96e08ed5de8a3e39ad3 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Fri, 31 Jan 2020 14:05:56 +0100 Subject: [PATCH 067/301] add log messages --- .../database/service/QoSReservationDBService.java | 12 ++++++++++++ .../core/qos/manager/impl/QoSManagerImpl.java | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java index 8f0a9f4c4..66d6464d2 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java @@ -44,6 +44,8 @@ public class QoSReservationDBService { //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public int releaseObsoleteReservations() { + logger.debug("releaseObsoleteReservations started ..."); + try { final ZonedDateTime now = ZonedDateTime.now(); final List obsoletes = qosReservationRepository.findAllByReservedToLessThanEqual(now); @@ -59,6 +61,8 @@ public int releaseObsoleteReservations() { //------------------------------------------------------------------------------------------------- public List getAllReservationsExceptMine(final String systemName, final String address, final int port) { + logger.debug("getAllReservationsExceptMine started ..."); + Assert.isTrue(!Utilities.isEmpty(systemName), "'systemName' is null or empty."); Assert.isTrue(!Utilities.isEmpty(address), "'address' is null or empty."); @@ -71,6 +75,8 @@ public List getAllReservationsExceptMine(final String systemName //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public void applyTemporaryLock(final String systemName, final String address, final int port, final OrchestrationResultDTO dto) { + logger.debug("applyTemporaryLock started ..."); + Assert.isTrue(!Utilities.isEmpty(systemName), "'systemName' is null or empty."); Assert.isTrue(!Utilities.isEmpty(address), "'address' is null or empty."); Assert.notNull(dto, "'dto' is null."); @@ -90,6 +96,8 @@ public void applyTemporaryLock(final String systemName, final String address, fi //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public void removeTemporaryLock(final OrchestrationResultDTO dto) { + logger.debug("removeTemporaryLock started ..."); + Assert.notNull(dto, "'dto' is null."); Assert.notNull(dto.getProvider(), "Provider is null."); Assert.notNull(dto.getService(), "Service is null."); @@ -113,6 +121,8 @@ public void removeTemporaryLock(final OrchestrationResultDTO dto) { //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public void extendReservation(final OrchestrationResultDTO reserved, final SystemRequestDTO requester) { + logger.debug("extendReservation started ..."); + Assert.notNull(reserved, "'reserved' is null."); Assert.notNull(reserved.getProvider(), "Provider is null."); Assert.notNull(reserved.getService(), "Service is null."); @@ -145,6 +155,8 @@ public void extendReservation(final OrchestrationResultDTO reserved, final Syste //------------------------------------------------------------------------------------------------- private ZonedDateTime getReservationTime(final OrchestrationResultDTO dto) { + logger.debug("getReservationTime started ..."); + final ZonedDateTime time = ZonedDateTime.now(); int seconds = maxReservationDuration; diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java index 6e5029385..7f04ad855 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java @@ -32,6 +32,8 @@ public class QoSManagerImpl implements QoSManager { //------------------------------------------------------------------------------------------------- @Override public List filterReservedProviders(final List orList, final SystemRequestDTO requester) { + logger.debug("filterReservedProviders started ..."); + Assert.notNull(orList, "'orList' is null."); Assert.notNull(requester, "Requester system is null."); Assert.isTrue(!Utilities.isEmpty(requester.getSystemName()), "Requester system's name is null or empty."); @@ -56,6 +58,8 @@ public List filterReservedProviders(final List reserveProvidersTemporarily(List orList, final SystemRequestDTO requester) { + logger.debug("reserveProvidersTemporarily started ..."); + Assert.notNull(orList, "'orList' is null."); Assert.notNull(requester, "'requester' is null."); Assert.isTrue(!Utilities.isEmpty(requester.getSystemName()), "Requester system's name is null or empty."); @@ -84,6 +88,8 @@ public List reserveProvidersTemporarily(List orList, final SystemRequestDTO requester) { + logger.debug("confirmReservation started ..."); + Assert.notNull(selected, "'selected' is null."); Assert.notEmpty(orList, "'orList' is null or empty."); Assert.notNull(requester, "'requester' is null."); @@ -105,6 +111,8 @@ public void confirmReservation(OrchestrationResultDTO selected, List reservations) { + logger.debug("isReserved started ..."); + for (final QoSReservation reservation : reservations) { if (reservation.getReservedProviderId() == dto.getProvider().getId() && reservation.getReservedServiceId() == dto.getService().getId()) { return true; From 8c6d3322584038222e48f0f12a6651a4783bb960 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 31 Jan 2020 14:10:24 +0100 Subject: [PATCH 068/301] removed unnecessary fields --- .../main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index d66f8ad5f..06229859e 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -328,7 +328,6 @@ private void logMeasurementDetailsToDB(final String address, final QoSIntraPingM final QoSIntraPingMeasurementLogDetails measurementLogDetails = new QoSIntraPingMeasurementLogDetails(); measurementLogDetails.setMeasurementLog(measurementLogSaved); - measurementLogDetails.setMeasuredSystemAddress(address); measurementLogDetails.setSuccessFlag(icmpPingResponse.getSuccessFlag()); measurementLogDetails.setTimeoutFlag(icmpPingResponse.getTimeoutFlag()); measurementLogDetails.setErrorMessage(icmpPingResponse.getErrorMessage()); @@ -352,7 +351,6 @@ private QoSIntraPingMeasurementLog logMeasurementToDB(final String address, fina logger.debug("logMeasurementToDB started..."); final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); - measurementLog.setMeasurementType(QoSMeasurementType.PING); measurementLog.setMeasuredSystemAddress(address); measurementLog.setAvailable(pingMeasurement.isAvailable()); measurementLog.setMinResponseTime(pingMeasurement.getMinResponseTime()); From b051085b160604e7e028d9e0c687cc3ebf4927cc Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 31 Jan 2020 14:12:03 +0100 Subject: [PATCH 069/301] requested change: rename parameters --- .../database/repository/QoSIntraMeasurementRepository.java | 2 +- .../repository/QoSIntraPingMeasurementLogRepository.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementRepository.java index ee9a39e53..a17d5b359 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraMeasurementRepository.java @@ -13,5 +13,5 @@ public interface QoSIntraMeasurementRepository extends RefreshableRepository findBySystemAndMeasurementType(final System systemToCheck,final QoSMeasurementType ping); + public Optional findBySystemAndMeasurementType(final System systemToCheck,final QoSMeasurementType type); } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraPingMeasurementLogRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraPingMeasurementLogRepository.java index 3d558459f..5b8702099 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraPingMeasurementLogRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/QoSIntraPingMeasurementLogRepository.java @@ -11,5 +11,5 @@ public interface QoSIntraPingMeasurementLogRepository extends RefreshableReposit //================================================================================================= // methods - Optional findByMeasuredAt(final ZonedDateTime aroundNow); + public Optional findByMeasuredAt(final ZonedDateTime timeStamp); } From 7f30e90c5f1a201cd82605fc9889203e55320b97 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Fri, 31 Jan 2020 14:39:20 +0100 Subject: [PATCH 070/301] QoS verifying process skeleton --- .../service/OrchestratorService.java | 2 +- .../core/qos/manager/QoSManager.java | 3 ++ .../core/qos/manager/QoSVerifier.java | 14 ++++++++ .../qos/manager/impl/DummyQoSManager.java | 7 ++++ .../core/qos/manager/impl/QoSManagerImpl.java | 33 +++++++++++++++++-- 5 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSVerifier.java diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java index 161a3bc26..ce2bd2cd3 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java @@ -296,7 +296,7 @@ public OrchestrationResponseDTO dynamicOrchestration(final OrchestrationFormRequ } if (flags.get(Flag.ENABLE_QOS)) { - //TODO: filter by QoS Requirements (removing temporary lock if needed) + orList = qosManager.verifyServices(orList, request); } if (!needReservation) { diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java index 6767ebfa2..051cf8b67 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSManager.java @@ -2,6 +2,7 @@ import java.util.List; +import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; import eu.arrowhead.common.dto.shared.SystemRequestDTO; @@ -12,10 +13,12 @@ public interface QoSManager { //------------------------------------------------------------------------------------------------- // verification-related + public List verifyServices(final List orList, final OrchestrationFormRequestDTO request); //------------------------------------------------------------------------------------------------- // reservation-related public List filterReservedProviders(final List orList, final SystemRequestDTO requester); public List reserveProvidersTemporarily(final List orList, final SystemRequestDTO requester); // returns with the temp locked results public void confirmReservation(final OrchestrationResultDTO selected, final List orList, final SystemRequestDTO requester); + } \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSVerifier.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSVerifier.java new file mode 100644 index 000000000..a5dedabc5 --- /dev/null +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSVerifier.java @@ -0,0 +1,14 @@ +package eu.arrowhead.core.qos.manager; + +import java.util.Map; + +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; + +public interface QoSVerifier { + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public boolean verify(final OrchestrationResultDTO result, final Map qosRequirements, final Map commands); +} \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java index 2965c226d..c326e734d 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManager.java @@ -2,6 +2,7 @@ import java.util.List; +import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; import eu.arrowhead.common.dto.shared.SystemRequestDTO; import eu.arrowhead.core.qos.manager.QoSManager; @@ -28,4 +29,10 @@ public List reserveProvidersTemporarily(final List orList, final SystemRequestDTO requester) { // intentionally do nothing } + + //------------------------------------------------------------------------------------------------- + @Override + public List verifyServices(final List orList, final OrchestrationFormRequestDTO request) { + return orList; + } } \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java index 7f04ad855..387bda203 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java @@ -10,11 +10,13 @@ import eu.arrowhead.common.Utilities; import eu.arrowhead.common.database.entity.QoSReservation; +import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; import eu.arrowhead.common.dto.shared.SystemRequestDTO; import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.core.qos.database.service.QoSReservationDBService; import eu.arrowhead.core.qos.manager.QoSManager; +import eu.arrowhead.core.qos.manager.QoSVerifier; public class QoSManagerImpl implements QoSManager { @@ -25,6 +27,8 @@ public class QoSManagerImpl implements QoSManager { @Autowired private QoSReservationDBService qosReservationDBService; + + private List verifiers = List.of(); // TODO: add verifier here //================================================================================================= // methods @@ -57,7 +61,7 @@ public List filterReservedProviders(final List reserveProvidersTemporarily(List orList, final SystemRequestDTO requester) { + public List reserveProvidersTemporarily(final List orList, final SystemRequestDTO requester) { logger.debug("reserveProvidersTemporarily started ..."); Assert.notNull(orList, "'orList' is null."); @@ -87,7 +91,7 @@ public List reserveProvidersTemporarily(List orList, final SystemRequestDTO requester) { + public void confirmReservation(final OrchestrationResultDTO selected, final List orList, final SystemRequestDTO requester) { logger.debug("confirmReservation started ..."); Assert.notNull(selected, "'selected' is null."); @@ -106,6 +110,31 @@ public void confirmReservation(OrchestrationResultDTO selected, List verifyServices(final List orList, final OrchestrationFormRequestDTO request) { + logger.debug("verifyServices started ..."); + + final List result = new ArrayList<>(); + for (final OrchestrationResultDTO dto : orList) { + final boolean needLockRelease = request.getCommands().containsKey(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY); + for (final QoSVerifier verifier : verifiers) { + final boolean verified = verifier.verify(dto, request.getQosRequirements(), request.getCommands()); + if (!verified) { + if (needLockRelease) { + qosReservationDBService.removeTemporaryLock(dto); + } + logger.debug("{} exclude result: {}/{}", verifier.getClass().getName(), dto.getProvider().getId(), dto.getService().getId()); + break; + } + } + + result.add(dto); + } + + return result; + } + //================================================================================================= // methods From 5d5bcfe46f03125e7a268276dc18c454d6fac69c Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 31 Jan 2020 14:56:52 +0100 Subject: [PATCH 071/301] requested change: remove unused fields --- .../arrowhead/common/CoreCommonConstants.java | 4 --- .../eu/arrowhead/common/CoreDefaults.java | 2 -- .../qos/quartz/task/CloudPingTaskConfig.java | 18 ++++------ .../quartz/task/CountRestarterTaskConfig.java | 34 ++++++++----------- .../core/qos/quartz/task/PingTaskConfig.java | 20 ++++------- .../src/main/resources/application.properties | 2 -- 6 files changed, 27 insertions(+), 53 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java index 14478666e..d87c602e4 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java @@ -155,13 +155,9 @@ public class CoreCommonConstants { public static final String $EVENT_HANDLER_MAX_EXPRESS_SUBSCRIBERS_WD = "${" + EVENT_HANDLER_MAX_EXPRESS_SUBSCRIBERS + ":" + CoreDefaults.DEFAULT_EVENT_HANDLER_MAX_EXPRESS_SUBSCRIBERS + "}"; public static final String EVENT_PUBLISHING_EXPRESS_EXECUTOR = "eventPublishingExpressExecutor"; - public static final String PING_TTL_SCHEDULED = "ping_ttl_scheduled"; - public static final String $PING_TTL_SCHEDULED_WD = "${" + PING_TTL_SCHEDULED + ":" + CoreDefaults.DEFAULT_PING_TTL_SCHEDULED + "}"; public static final String PING_TTL_INTERVAL = "ping_ttl_interval"; public static final String $PING_TTL_INTERVAL_WD = "${" + PING_TTL_INTERVAL + ":" + CoreDefaults.DEFAULT_PING_TTL_INTERVAL_MINUTES + "}"; - public static final String CLOUD_PING_TTL_SCHEDULED = "cloud_ping_ttl_scheduled"; - public static final String $CLOUD_PING_TTL_SCHEDULED_WD = "${" + CLOUD_PING_TTL_SCHEDULED + ":" + CoreDefaults.DEFAULT_CLOUD_PING_TTL_SCHEDULED + "}"; public static final String CLOUD_PING_TTL_INTERVAL = "cloud_ping_ttl_interval"; public static final String $CLOUD_PING_TTL_INTERVAL_WD = "${" + CLOUD_PING_TTL_INTERVAL + ":" + CoreDefaults.DEFAULT_CLOUD_PING_TTL_INTERVAL_MINUTES + "}"; diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java b/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java index 629e14568..19e615935 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java @@ -46,10 +46,8 @@ public class CoreDefaults { public static final long DEFAULT_TIME_STAMP_TOLERANCE_SECONDS = 120; public static final int DEFAULT_EVENT_HANDLER_MAX_EXPRESS_SUBSCRIBERS = 10; - public static final boolean DEFAULT_PING_TTL_SCHEDULED = false; public static final int DEFAULT_PING_TTL_INTERVAL_MINUTES = 10; - public static final boolean DEFAULT_CLOUD_PING_TTL_SCHEDULED = false; public static final int DEFAULT_CLOUD_PING_TTL_INTERVAL_MINUTES = 10; public static final boolean DEFAULT_QOS_ENABLED = false; diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTaskConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTaskConfig.java index 52e61f7ab..d9fd608a2 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTaskConfig.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTaskConfig.java @@ -27,9 +27,6 @@ public class CloudPingTaskConfig { @Autowired private ApplicationContext applicationContext; //NOSONAR - @Value(CoreCommonConstants.$CLOUD_PING_TTL_SCHEDULED_WD) - private boolean ttlScheduled; - @Value(CoreCommonConstants.$CLOUD_PING_TTL_INTERVAL_WD) private int ttlInterval; @@ -48,15 +45,12 @@ public SchedulerFactoryBean cloudPingSheduler() { jobFactory.setApplicationContext(applicationContext); final SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean(); - if (ttlScheduled) { - schedulerFactory.setJobFactory(jobFactory); - schedulerFactory.setJobDetails(cloudPingTaskDetails().getObject()); - schedulerFactory.setTriggers(cloudPingTaskTrigger().getObject()); - schedulerFactory.setStartupDelay(SCHEDULER_DELAY); - logger.info("Cloud ping task adjusted with ttl interval: {} minutes", ttlInterval); - } else { - logger.info("Cloud ping task is not adjusted"); - } + + schedulerFactory.setJobFactory(jobFactory); + schedulerFactory.setJobDetails(cloudPingTaskDetails().getObject()); + schedulerFactory.setTriggers(cloudPingTaskTrigger().getObject()); + schedulerFactory.setStartupDelay(SCHEDULER_DELAY); + logger.info("Cloud ping task adjusted with ttl interval: {} minutes", ttlInterval); return schedulerFactory; } diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java index 5f1a63e11..7106999d3 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java @@ -24,19 +24,15 @@ public class CountRestarterTaskConfig { @Autowired private ApplicationContext applicationContext; //NOSONAR - - @Value(CoreCommonConstants.$PING_TTL_SCHEDULED_WD) - private boolean ttlScheduled; - + @Value(CoreCommonConstants.$PING_TTL_INTERVAL_WD) private int ttlInterval; - + private static final int SCHEDULER_DELAY = 7; - private static final String CRONE_EXPRESSION_MIDNIGHT_EVERY_DAY= "0 0 0 ? * * *"; - + private static final String CRON_EXPRESSION_MIDNIGHT_EVERY_DAY= "0 0 0 ? * * *"; private static final String NAME_OF_TRIGGER = "Counter_Restart_Task_Trigger"; private static final String NAME_OF_TASK = "Counter_Restart_Task_Detail"; - + //================================================================================================= // methods @@ -45,17 +41,15 @@ public class CountRestarterTaskConfig { public SchedulerFactoryBean counterRestarterTaskSheduler() { final AutoWiringSpringBeanQuartzTaskFactory jobFactory = new AutoWiringSpringBeanQuartzTaskFactory(); jobFactory.setApplicationContext(applicationContext); - + final SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean(); - if (ttlScheduled) { - schedulerFactory.setJobFactory(jobFactory); - schedulerFactory.setJobDetails(counterRestartTaskDetails().getObject()); - schedulerFactory.setTriggers(counterRestartTaskTrigger().getObject()); - schedulerFactory.setStartupDelay(SCHEDULER_DELAY); - logger.info("Pin task adjusted with ttl interval: {} minutes", ttlInterval); - } else { - logger.info("Ping task is not adjusted"); - } + + schedulerFactory.setJobFactory(jobFactory); + schedulerFactory.setJobDetails(counterRestartTaskDetails().getObject()); + schedulerFactory.setTriggers(counterRestartTaskTrigger().getObject()); + schedulerFactory.setStartupDelay(SCHEDULER_DELAY); + + logger.info("CountRestarterTask task adjusted with ttl interval: {} minutes", ttlInterval); return schedulerFactory; } @@ -63,10 +57,10 @@ public SchedulerFactoryBean counterRestarterTaskSheduler() { //------------------------------------------------------------------------------------------------- @Bean public CronTriggerFactoryBean counterRestartTaskTrigger() { - + CronTriggerFactoryBean trigger = new CronTriggerFactoryBean(); trigger.setJobDetail(counterRestartTaskDetails().getObject()); - trigger.setCronExpression(CRONE_EXPRESSION_MIDNIGHT_EVERY_DAY); + trigger.setCronExpression(CRON_EXPRESSION_MIDNIGHT_EVERY_DAY); trigger.setName(NAME_OF_TRIGGER); return trigger; diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java index 80b1330d4..19d8f598f 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTaskConfig.java @@ -27,9 +27,6 @@ public class PingTaskConfig { @Autowired private ApplicationContext applicationContext; //NOSONAR - @Value(CoreCommonConstants.$PING_TTL_SCHEDULED_WD) - private boolean ttlScheduled; - @Value(CoreCommonConstants.$PING_TTL_INTERVAL_WD) private int ttlInterval; @@ -48,16 +45,13 @@ public SchedulerFactoryBean pingSheduler() { jobFactory.setApplicationContext(applicationContext); final SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean(); - if (ttlScheduled) { - schedulerFactory.setJobFactory(jobFactory); - schedulerFactory.setJobDetails(intraCloudPingTaskDetails().getObject()); - schedulerFactory.setTriggers(intraCloudPingTaskTrigger().getObject()); - schedulerFactory.setStartupDelay(SCHEDULER_DELAY); - logger.info("Pin task adjusted with ttl interval: {} minutes", ttlInterval); - } else { - logger.info("Ping task is not adjusted"); - } - + + schedulerFactory.setJobFactory(jobFactory); + schedulerFactory.setJobDetails(intraCloudPingTaskDetails().getObject()); + schedulerFactory.setTriggers(intraCloudPingTaskTrigger().getObject()); + schedulerFactory.setStartupDelay(SCHEDULER_DELAY); + logger.info("Ping task adjusted with ttl interval: {} minutes", ttlInterval); + return schedulerFactory; } diff --git a/qos-monitor/src/main/resources/application.properties b/qos-monitor/src/main/resources/application.properties index 0065258ed..134e30d05 100644 --- a/qos-monitor/src/main/resources/application.properties +++ b/qos-monitor/src/main/resources/application.properties @@ -39,10 +39,8 @@ sr_port=8443 gatekeeper_is_present=true # Monitor timings -cloud_ping_ttl_scheduled=true cloud_ping_ttl_interval=2 -ping_ttl_scheduled=true ping_ttl_interval=2 ############################################ From d7ddc9ee24e6e61ce9ab4422985650af2de2d2a2 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 31 Jan 2020 14:57:48 +0100 Subject: [PATCH 072/301] requested change: remove unused fields --- .../additional-spring-configuration-metadata.json | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 3251c0d4f..4a240f9ba 100644 --- a/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -39,21 +39,11 @@ "type": "java.lang.Boolean", "description": "A description for 'gatekeeper_is_present'" }, - { - "name": "cloud_ping_ttl_scheduled", - "type": "java.lang.String", - "description": "A description for 'cloud_ping_ttl_scheduled'" - }, { "name": "cloud_ping_ttl_interval", "type": "java.lang.String", "description": "A description for 'cloud_ping_ttl_interval'" }, - { - "name": "ping_ttl_scheduled", - "type": "java.lang.String", - "description": "A description for 'ping_ttl_scheduled'" - }, { "name": "ping_ttl_interval", "type": "java.lang.String", From 04e4d73b658c3ffde1a8e5658604d04fb76542f6 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 31 Jan 2020 15:00:04 +0100 Subject: [PATCH 073/301] requested change: move method to DBService --- .../database/service/QoSDatabaseService.java | 47 +++++++++++++++++-- .../qos/quartz/task/CountRestarterTask.java | 26 ++-------- 2 files changed, 47 insertions(+), 26 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java index 7468532f5..71bb75265 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java @@ -1,20 +1,61 @@ package eu.arrowhead.core.qos.database.service; +import java.time.ZonedDateTime; +import java.util.List; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; import eu.arrowhead.common.database.repository.QoSIntraMeasurementPingRepository; import eu.arrowhead.common.database.repository.QoSIntraMeasurementRepository; +import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogDetailsRepository; +import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogRepository; +import eu.arrowhead.common.database.repository.SystemRepository; +import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.core.qos.quartz.task.CountRestarterTask; @Service public class QoSDatabaseService { //================================================================================================= // members - + @Autowired private QoSIntraMeasurementRepository qosIntraMeasurementRepository; - + + @Autowired + private QoSIntraMeasurementPingRepository qoSIntraMeasurementPingRepository; + + @Autowired + private QoSIntraPingMeasurementLogRepository qoSIntraPingMeasurementLogRepository; + @Autowired - private QoSIntraMeasurementPingRepository qosIntraMeasurementPingRepository; + private QoSIntraPingMeasurementLogDetailsRepository qoSIntraPingMeasurementLogDetailsRepository; + + @Autowired + private SystemRepository systemRepository; + + protected Logger logger = LogManager.getLogger(QoSDatabaseService.class); + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Transactional (rollbackFor = ArrowheadException.class) + public void updateCountStartedAt() { + logger.debug("updateCountStartedAt started..."); + + final List measurementList = qoSIntraMeasurementPingRepository.findAll(); + for (final QoSIntraPingMeasurement qoSIntraPingMeasurement : measurementList) { + qoSIntraPingMeasurement.setSent(0); + qoSIntraPingMeasurement.setReceived(0); + qoSIntraPingMeasurement.setCountStartedAt(ZonedDateTime.now()); + } + qoSIntraMeasurementPingRepository.saveAll(measurementList); + qoSIntraMeasurementPingRepository.flush(); + + } } \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java index d87bf440a..f43da6b5a 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java @@ -1,8 +1,5 @@ package eu.arrowhead.core.qos.quartz.task; -import java.time.ZonedDateTime; -import java.util.List; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.quartz.DisallowConcurrentExecution; @@ -11,11 +8,8 @@ import org.quartz.JobExecutionException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; -import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; -import eu.arrowhead.common.database.repository.QoSIntraMeasurementPingRepository; -import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.core.qos.database.service.QoSDatabaseService; @Component @DisallowConcurrentExecution @@ -27,7 +21,7 @@ public class CountRestarterTask implements Job { protected Logger logger = LogManager.getLogger(CountRestarterTask.class); @Autowired - private QoSIntraMeasurementPingRepository qoSIntraMeasurementPingRepository; + private QoSDatabaseService qoSDatabaseService; //================================================================================================= // methods @@ -37,25 +31,11 @@ public class CountRestarterTask implements Job { public void execute(final JobExecutionContext context) throws JobExecutionException { logger.debug("STARTED: count restarter task"); - updateCountStartedAt(); + qoSDatabaseService.updateCountStartedAt(); logger.debug("Finished: count restarter task"); } - @Transactional (rollbackFor = ArrowheadException.class) - public void updateCountStartedAt() { - logger.debug("updateCountStartedAt started..."); - - final List measurementList = qoSIntraMeasurementPingRepository.findAll(); - for (final QoSIntraPingMeasurement qoSIntraPingMeasurement : measurementList) { - qoSIntraPingMeasurement.setSent(0); - qoSIntraPingMeasurement.setReceived(0); - qoSIntraPingMeasurement.setCountStartedAt(ZonedDateTime.now()); - - qoSIntraMeasurementPingRepository.saveAndFlush(qoSIntraPingMeasurement); - - } - } //================================================================================================= // assistant methods From 8d9bc80b234385b208ac4ab0fa6fa6f20cb69860 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 31 Jan 2020 17:08:53 +0100 Subject: [PATCH 074/301] temporal commit : started to implement calculations refactoring --- .../database/service/QoSDatabaseService.java | 73 +++++++-- .../dto/PingMeasurementCalculationsDTO.java | 70 +++++++++ .../core/qos/quartz/task/PingTask.java | 142 ++++++++++-------- 3 files changed, 210 insertions(+), 75 deletions(-) create mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/dto/PingMeasurementCalculationsDTO.java diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java index 71bb75265..25aefcb2a 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java @@ -2,6 +2,7 @@ import java.time.ZonedDateTime; import java.util.List; +import java.util.Optional; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -9,14 +10,18 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.database.entity.QoSIntraMeasurement; import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; +import eu.arrowhead.common.database.entity.System; import eu.arrowhead.common.database.repository.QoSIntraMeasurementPingRepository; import eu.arrowhead.common.database.repository.QoSIntraMeasurementRepository; import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogDetailsRepository; import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogRepository; import eu.arrowhead.common.database.repository.SystemRepository; +import eu.arrowhead.common.dto.shared.QoSMeasurementType; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; -import eu.arrowhead.core.qos.quartz.task.CountRestarterTask; @Service public class QoSDatabaseService { @@ -25,7 +30,7 @@ public class QoSDatabaseService { // members @Autowired - private QoSIntraMeasurementRepository qosIntraMeasurementRepository; + private QoSIntraMeasurementRepository qoSIntraMeasurementRepository; @Autowired private QoSIntraMeasurementPingRepository qoSIntraMeasurementPingRepository; @@ -48,14 +53,64 @@ public class QoSDatabaseService { public void updateCountStartedAt() { logger.debug("updateCountStartedAt started..."); - final List measurementList = qoSIntraMeasurementPingRepository.findAll(); - for (final QoSIntraPingMeasurement qoSIntraPingMeasurement : measurementList) { - qoSIntraPingMeasurement.setSent(0); - qoSIntraPingMeasurement.setReceived(0); - qoSIntraPingMeasurement.setCountStartedAt(ZonedDateTime.now()); + try { + final List measurementList = qoSIntraMeasurementPingRepository.findAll(); + for (final QoSIntraPingMeasurement qoSIntraPingMeasurement : measurementList) { + qoSIntraPingMeasurement.setSent(0); + qoSIntraPingMeasurement.setReceived(0); + qoSIntraPingMeasurement.setCountStartedAt(ZonedDateTime.now()); + } + qoSIntraMeasurementPingRepository.saveAll(measurementList); + qoSIntraMeasurementPingRepository.flush(); + } catch (Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } - qoSIntraMeasurementPingRepository.saveAll(measurementList); - qoSIntraMeasurementPingRepository.flush(); } + + //------------------------------------------------------------------------------------------------- + @Transactional (rollbackFor = ArrowheadException.class) + public QoSIntraMeasurement createMeasurement(final System system,final QoSMeasurementType ping,final ZonedDateTime aroundNow) { + logger.debug("createMeasurement started..."); + + final QoSIntraMeasurement measurement = new QoSIntraMeasurement(system, QoSMeasurementType.PING, aroundNow); + measurement.setSystem(system); + measurement.setMeasurementType(QoSMeasurementType.PING); + + try { + qoSIntraMeasurementRepository.saveAndFlush(measurement); + } catch (Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + return measurement; + } + + //------------------------------------------------------------------------------------------------- + @Transactional (rollbackFor = ArrowheadException.class) + public QoSIntraMeasurement getMeasurement(final SystemResponseDTO systemResponseDTO, final ZonedDateTime aroundNow) { + logger.debug("getMeasurement started..."); + + final Optional systemOptional = systemRepository.findBySystemNameAndAddressAndPort( + systemResponseDTO.getSystemName(), + systemResponseDTO.getAddress(), + systemResponseDTO.getPort()); + final System system; + if (systemOptional.isPresent()) { + + system = systemOptional.get(); + }else { + throw new ArrowheadException("Requested system is not in DB"); + } + + final QoSIntraMeasurement measurement; + final Optional qoSIntraMeasurementOptional = qoSIntraMeasurementRepository.findBySystemAndMeasurementType(system, QoSMeasurementType.PING); + if (qoSIntraMeasurementOptional.isEmpty()) { + measurement = createMeasurement(system, QoSMeasurementType.PING, aroundNow); + }else { + measurement = qoSIntraMeasurementOptional.get(); + } + return measurement; + } } \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/dto/PingMeasurementCalculationsDTO.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/dto/PingMeasurementCalculationsDTO.java new file mode 100644 index 000000000..89d387821 --- /dev/null +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/dto/PingMeasurementCalculationsDTO.java @@ -0,0 +1,70 @@ +package eu.arrowhead.core.qos.dto; + +import java.io.Serializable; + +public class PingMeasurementCalculationsDTO implements Serializable{ + + //================================================================================================= + // members + + private static final long serialVersionUID = -1645860899758857162L; + + private boolean available; + private int maxResponseTime; + private int minResponseTime; + private int meanResponseTimeWithTimeout; + private int meanResponseTimeWithOutTimeout; + private int jitterWithTimeout; + private int jitterWithoutTimeout; + private int sentInThisPing; + private int receivedInThisPing; + private int lostPerMeasurementPercent; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public PingMeasurementCalculationsDTO() {} + + //------------------------------------------------------------------------------------------------- + public PingMeasurementCalculationsDTO(final boolean available, final int maxResponseTime, final int minResponseTime, + final int meanResponseTimeWithTimeout, final int meanResponseTimeWithOutTimeout, final int jitterWithTimeout, + final int jitterWithoutTimeout, final int sentInThisPing, final int receivedInThisPing, final int lostPerMeasurementPercent) { + + this.available = available; + this.maxResponseTime = maxResponseTime; + this.minResponseTime = minResponseTime; + this.meanResponseTimeWithTimeout = meanResponseTimeWithTimeout; + this.meanResponseTimeWithOutTimeout = meanResponseTimeWithOutTimeout; + this.jitterWithTimeout = jitterWithTimeout; + this.jitterWithoutTimeout = jitterWithoutTimeout; + this.sentInThisPing = sentInThisPing; + this.receivedInThisPing = receivedInThisPing; + this.lostPerMeasurementPercent = lostPerMeasurementPercent; + } + + //------------------------------------------------------------------------------------------------- + public boolean isAvailable() { return available; } + public int getMaxResponseTime() { return maxResponseTime; } + public int getMinResponseTime() { return minResponseTime; } + public int getMeanResponseTimeWithTimeout() { return meanResponseTimeWithTimeout; } + public int getMeanResponseTimeWithOutTimeout() { return meanResponseTimeWithOutTimeout; } + public int getJitterWithTimeout() { return jitterWithTimeout; } + public int getJitterWithoutTimeout() { return jitterWithoutTimeout; } + public int getSentInThisPing() { return sentInThisPing; } + public int getReceivedInThisPing() { return receivedInThisPing; } + public int getLostPerMeasurementPercent() { return lostPerMeasurementPercent; } + + //------------------------------------------------------------------------------------------------- + public void setAvailable(final boolean available) { this.available = available; } + public void setMaxResponseTime(final int maxResponseTime) { this.maxResponseTime = maxResponseTime; } + public void setMinResponseTime(final int minResponseTime) { this.minResponseTime = minResponseTime; } + public void setMeanResponseTimeWithTimeout(final int meanResponseTimeWithTimeout) { this.meanResponseTimeWithTimeout = meanResponseTimeWithTimeout; } + public void setMeanResponseTimeWithOutTimeout(final int meanResponseTimeWithOutTimeout) { this.meanResponseTimeWithOutTimeout = meanResponseTimeWithOutTimeout; } + public void setJitterWithTimeout(final int jitterWithTimeout) { this.jitterWithTimeout = jitterWithTimeout; } + public void setJitterWithoutTimeout(final int jitterWithoutTimeout) { this.jitterWithoutTimeout = jitterWithoutTimeout; } + public void setSentInThisPing(final int sentInThisPing) { this.sentInThisPing = sentInThisPing; } + public void setReceivedInThisPing(final int receivedInThisPing) { this.receivedInThisPing = receivedInThisPing; } + public void setLostPerMeasurementPercent(final int lostPerMeasurementPercent) { this.lostPerMeasurementPercent = lostPerMeasurementPercent; } + +} diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 06229859e..6fe1fd64b 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -25,6 +25,9 @@ import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.util.UriComponents; + +import com.rabbitmq.client.impl.AMQImpl.Basic.Qos; + import org.springframework.util.Assert; import eu.arrowhead.common.CommonConstants; @@ -47,6 +50,8 @@ import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.exception.InvalidParameterException; import eu.arrowhead.common.http.HttpService; +import eu.arrowhead.core.qos.database.service.QoSDatabaseService; +import eu.arrowhead.core.qos.dto.PingMeasurementCalculationsDTO; @Component @DisallowConcurrentExecution @@ -65,19 +70,7 @@ public class PingTask implements Job { protected Logger logger = LogManager.getLogger(PingTask.class); @Autowired - private QoSIntraMeasurementRepository qoSIntraMeasurementRepository; - - @Autowired - private QoSIntraMeasurementPingRepository qoSIntraMeasurementPingRepository; - - @Autowired - private QoSIntraPingMeasurementLogRepository qoSIntraPingMeasurementLogRepository; - - @Autowired - private QoSIntraPingMeasurementLogDetailsRepository qoSIntraPingMeasurementLogDetailsRepository; - - @Autowired - private SystemRepository systemRepository; + private QoSDatabaseService qoSDatabaseService; @Autowired private HttpService httpService; @@ -93,7 +86,7 @@ public class PingTask implements Job { public void execute(final JobExecutionContext context) throws JobExecutionException { logger.debug("STARTED: ping task"); - final Set systems = getSystemsToMessure(); + final Set systems = getSystemsToMeasure(); for (final SystemResponseDTO systemResponseDTO : systems) { pingSystem(systemResponseDTO); @@ -107,7 +100,7 @@ public void execute(final JobExecutionContext context) throws JobExecutionExcept // assistant methods //------------------------------------------------------------------------------------------------- - private Set getSystemsToMessure() { + private Set getSystemsToMeasure() { logger.debug("getSystemToMessure started..."); final ServiceRegistryListResponseDTO serviceRegistryListResponseDTO = queryServiceRegistryAll(); @@ -117,25 +110,12 @@ private Set getSystemsToMessure() { } //------------------------------------------------------------------------------------------------- - @Transactional (rollbackFor = ArrowheadException.class) - private QoSIntraMeasurement createMeasurement(final System system,final QoSMeasurementType ping,final ZonedDateTime aroundNow) { - logger.debug("createMeasurement started..."); - - final QoSIntraMeasurement measurement = new QoSIntraMeasurement(system, QoSMeasurementType.PING, aroundNow); - measurement.setSystem(system); - measurement.setMeasurementType(QoSMeasurementType.PING); - - qoSIntraMeasurementRepository.saveAndFlush(measurement); - - return measurement; - } - - //------------------------------------------------------------------------------------------------- - @Transactional (rollbackFor = ArrowheadException.class) private QoSIntraPingMeasurement createPingMeasurement(final QoSIntraMeasurement measurementParam, final List responseList, final ZonedDateTime aroundNow) { logger.debug("createPingMeasurement started..."); + final PingMeasurementCalculationsDTO calculations = calculatePingMeasurementValues(responseList); + final boolean available = calculateAvailable(responseList); final int maxResponseTime = calculateMaxResponseTime(responseList); final int minResponseTime = calculateMinResponseTime(responseList); @@ -154,7 +134,7 @@ private QoSIntraPingMeasurement createPingMeasurement(final QoSIntraMeasurement final int sentInThisPing = getSentInThisPing(responseList); final int receivedInThisPing = getReceivedInThisPing(responseList); - final int lostPerMeasurementPercent = (int) (receivedInThisPing == 0 ? 1 : ((double)receivedInThisPing / (double)sentInThisPing) * 100); + final int lostPerMeasurementPercent = (int) (receivedInThisPing == 0 ? 0 : 100 - ((double)receivedInThisPing / (double)sentInThisPing) * 100); final QoSIntraMeasurement measurement ; final Optional measurementOptional = qoSIntraMeasurementRepository.findById(measurementParam.getId()); @@ -186,14 +166,72 @@ private QoSIntraPingMeasurement createPingMeasurement(final QoSIntraMeasurement return pingMeasurement; } - //------------------------------------------------------------------------------------------------- - @Transactional (rollbackFor = ArrowheadException.class) - private void updateMeasurement(final ZonedDateTime aroundNow,final QoSIntraMeasurement measurement) { + private PingMeasurementCalculationsDTO calculatePingMeasurementValues(List responseList) { + logger.debug("calculatePingMeasurementValues started..."); + + final int sentInThisPing = responseList.size(); + Assert.isTrue(sentInThisPing > 0, "Sent in this Ping value must be greater than zero"); + + boolean available = false; + int receivedInThisPing = 0; + long maxResponseTime = 0; + long minResponseTime = Integer.MAX_VALUE; + double sumOfDurationForMeanResponseTimeWithTimeout = 0; + double sumOfDurationForMeanResponseTimeWithoutTimeout = 0; + int meanResponseTimeWithoutTimeoutMembersCount = 0; + + for (final IcmpPingResponse icmpPingResponse : responseList) { - measurement.setLastMeasurementAt(aroundNow); - qoSIntraMeasurementRepository.saveAndFlush(measurement); + final boolean successFlag = icmpPingResponse.getSuccessFlag(); + + if (successFlag) { + available = true; + ++receivedInThisPing; + final long duration = icmpPingResponse.getDuration(); + if (duration > maxResponseTime) { + maxResponseTime = duration; + } + + if (duration < minResponseTime) { + minResponseTime = duration; + } + + sumOfDurationForMeanResponseTimeWithoutTimeout += duration; + ++meanResponseTimeWithoutTimeoutMembersCount; + + }else { + sumOfDurationForMeanResponseTimeWithTimeout += PING_TIME_OUT; + } + } + + int lostPerMeasurementPercent = (int) (receivedInThisPing == 0 ? 0 : 100 - ((double)receivedInThisPing / sentInThisPing) * 100); + + final double meanResponseTimeWithTimeout = sumOfDurationForMeanResponseTimeWithTimeout / responseList.size(); + final double meanResponseTimeWithoutTimeout = sumOfDurationForMeanResponseTimeWithoutTimeout / meanResponseTimeWithoutTimeoutMembersCount; + + double sumOfDiffsForJitterWithTimeout = 0; + double sumOfDiffsForJitterWithoutTimeout =0; + for (final IcmpPingResponse icmpPingResponse : responseList) { + + final boolean successFlag = icmpPingResponse.getSuccessFlag(); + final double duration; + if (successFlag) { + duration = icmpPingResponse.getDuration(); + sumOfDiffsForJitterWithoutTimeout += Math.pow(duration, meanResponseTimeWithoutTimeout); + }else { + duration = PING_TIME_OUT + 1; + } + + sumOfDiffsForJitterWithTimeout += Math.pow(duration, meanResponseTimeWithTimeout); + } + double jitterWithTimeout = Math.sqrt(sumOfDiffsForJitterWithTimeout / meanResponseTimeWithoutTimeoutMembersCount); + double jitterWithoutTimeout = Math.sqrt(sumOfDiffsForJitterWithoutTimeout / responseList.size()); + + final PingMeasurementCalculationsDTO calculations = new PingMeasurementCalculationsDTO(); + //TODO fill calculation setters ... + return calculations; } //------------------------------------------------------------------------------------------------- @@ -206,23 +244,11 @@ private void pingSystem(final SystemResponseDTO systemResponseDTO ) { throw new InvalidParameterException("System.address" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE); } - final Optional systemOptional = systemRepository.findBySystemNameAndAddressAndPort( - systemResponseDTO.getSystemName(), - systemResponseDTO.getAddress(), - systemResponseDTO.getPort()); - final System system; - if (systemOptional.isPresent()) { - - system = systemOptional.get(); - }else { - throw new ArrowheadException("Requested system is not in DB"); - } - final String address = systemResponseDTO.getAddress(); final List responseList = getPingResponseList(address); - final QoSIntraMeasurement measurement = getMeasurement(system, aroundNow); + final QoSIntraMeasurement measurement = qoSDatabaseService.getMeasurement(systemResponseDTO, aroundNow); handelPingMeasurement(address, measurement, responseList, aroundNow); updateMeasurement(aroundNow, measurement); @@ -230,7 +256,6 @@ private void pingSystem(final SystemResponseDTO systemResponseDTO ) { } //------------------------------------------------------------------------------------------------- - @Transactional (rollbackFor = ArrowheadException.class) private void handelPingMeasurement(final String address, final QoSIntraMeasurement measurement, final List responseList, final ZonedDateTime aroundNow) { logger.debug("handelPingMeasurement started..."); @@ -301,21 +326,6 @@ private void handelPingMeasurement(final String address, final QoSIntraMeasureme } } - //------------------------------------------------------------------------------------------------- - @Transactional (rollbackFor = ArrowheadException.class) - private QoSIntraMeasurement getMeasurement(final System system, final ZonedDateTime aroundNow) { - logger.debug("getMeasurement started..."); - - final QoSIntraMeasurement measurement; - final Optional qoSIntraMeasurementOptional = qoSIntraMeasurementRepository.findBySystemAndMeasurementType(system, QoSMeasurementType.PING); - if (qoSIntraMeasurementOptional.isEmpty()) { - measurement = createMeasurement(system, QoSMeasurementType.PING, aroundNow); - }else { - measurement = qoSIntraMeasurementOptional.get(); - } - return measurement; - } - //------------------------------------------------------------------------------------------------- @Transactional (rollbackFor = ArrowheadException.class) private void logMeasurementDetailsToDB(final String address, final QoSIntraPingMeasurementLog measurementLogSaved, @@ -412,7 +422,7 @@ private List getPingResponseList(final String address) { for (int count = 0; count < TIMES_TO_REPEAT; count ++) { final IcmpPingResponse response = IcmpPingUtil.executePingRequest (request); final String formattedResponse = IcmpPingUtil.formatResponse (response); - logger.info(formattedResponse); + logger.debug(formattedResponse); responseList.add(response); Thread.sleep (REST_BETWEEN_PINGS_MILLSEC); From 4fed902a7c97e07e663a2da51bca634c13d0ad57 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 31 Jan 2020 20:26:20 +0100 Subject: [PATCH 075/301] requested change: refactor calculations and move repository calls to DBService --- .../database/service/QoSDatabaseService.java | 164 +++++++++++++++- .../dto/PingMeasurementCalculationsDTO.java | 64 +++---- .../core/qos/quartz/task/PingTask.java | 179 +++--------------- 3 files changed, 216 insertions(+), 191 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java index 25aefcb2a..4d0ba5304 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java @@ -1,11 +1,13 @@ package eu.arrowhead.core.qos.database.service; import java.time.ZonedDateTime; +import java.util.ArrayList; import java.util.List; import java.util.Optional; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.icmp4j.IcmpPingResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -13,6 +15,8 @@ import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.database.entity.QoSIntraMeasurement; import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurementLog; +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurementLogDetails; import eu.arrowhead.common.database.entity.System; import eu.arrowhead.common.database.repository.QoSIntraMeasurementPingRepository; import eu.arrowhead.common.database.repository.QoSIntraMeasurementRepository; @@ -22,6 +26,7 @@ import eu.arrowhead.common.dto.shared.QoSMeasurementType; import eu.arrowhead.common.dto.shared.SystemResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.core.qos.dto.PingMeasurementCalculationsDTO; @Service public class QoSDatabaseService { @@ -62,7 +67,7 @@ public void updateCountStartedAt() { } qoSIntraMeasurementPingRepository.saveAll(measurementList); qoSIntraMeasurementPingRepository.flush(); - } catch (Exception ex) { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -70,7 +75,7 @@ public void updateCountStartedAt() { } //------------------------------------------------------------------------------------------------- - @Transactional (rollbackFor = ArrowheadException.class) + @Transactional (rollbackFor = ArrowheadException.class) public QoSIntraMeasurement createMeasurement(final System system,final QoSMeasurementType ping,final ZonedDateTime aroundNow) { logger.debug("createMeasurement started..."); @@ -80,7 +85,7 @@ public QoSIntraMeasurement createMeasurement(final System system,final QoSMeasur try { qoSIntraMeasurementRepository.saveAndFlush(measurement); - } catch (Exception ex) { + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } @@ -113,4 +118,157 @@ public QoSIntraMeasurement getMeasurement(final SystemResponseDTO systemResponse } return measurement; } + + //------------------------------------------------------------------------------------------------- + @Transactional (rollbackFor = ArrowheadException.class) + public QoSIntraPingMeasurement createPingMeasurement(final QoSIntraMeasurement measurementParam, + final List responseList,final PingMeasurementCalculationsDTO calculations, final ZonedDateTime aroundNow) { + logger.debug("createPingMeasurement started..."); + + final QoSIntraPingMeasurement pingMeasurement = new QoSIntraPingMeasurement(); + + pingMeasurement.setMeasurement(measurementParam); + pingMeasurement.setAvailable(calculations.isAvailable()); + pingMeasurement.setMaxResponseTime(calculations.getMaxResponseTime()); + pingMeasurement.setMinResponseTime(calculations.getMinResponseTime()); + pingMeasurement.setMeanResponseTimeWithoutTimeout(calculations.getMeanResponseTimeWithoutTimeout()); + pingMeasurement.setMeanResponseTimeWithTimeout(calculations.getMeanResponseTimeWithTimeout()); + pingMeasurement.setJitterWithoutTimeout(calculations.getJitterWithoutTimeout()); + pingMeasurement.setJitterWithTimeout(calculations.getJitterWithTimeout()); + pingMeasurement.setLostPerMeasurementPercent(calculations.getLostPerMeasurementPercent()); + pingMeasurement.setCountStartedAt(aroundNow); + pingMeasurement.setLastAccessAt(calculations.isAvailable() ? aroundNow : null); + pingMeasurement.setSent(calculations.getSentInThisPing()); + pingMeasurement.setSentAll(calculations.getSentInThisPing()); + pingMeasurement.setReceived(calculations.getReceivedInThisPing()); + pingMeasurement.setReceivedAll(calculations.getReceivedInThisPing()); + + try { + return qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + + } + + //------------------------------------------------------------------------------------------------- + public Optional getPingMeasurementByMeasurement(final QoSIntraMeasurement measurement) { + logger.debug("getPingMeasurementByMeasurement started..."); + + try { + return qoSIntraMeasurementPingRepository.findByMeasurement(measurement); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional (rollbackFor = ArrowheadException.class) + public QoSIntraPingMeasurementLog logMeasurementToDB(final String address, final QoSIntraPingMeasurement pingMeasurement, final ZonedDateTime aroundNow) { + logger.debug("logMeasurementToDB started..."); + + final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); + measurementLog.setMeasuredSystemAddress(address); + measurementLog.setAvailable(pingMeasurement.isAvailable()); + measurementLog.setMinResponseTime(pingMeasurement.getMinResponseTime()); + measurementLog.setMaxResponseTime(pingMeasurement.getMaxResponseTime()); + measurementLog.setMeanResponseTimeWithoutTimeout(pingMeasurement.getMeanResponseTimeWithoutTimeout()); + measurementLog.setMeanResponseTimeWithTimeout(pingMeasurement.getMeanResponseTimeWithTimeout()); + measurementLog.setJitterWithoutTimeout(pingMeasurement.getJitterWithoutTimeout()); + measurementLog.setJitterWithTimeout(pingMeasurement.getJitterWithTimeout()); + measurementLog.setLostPerMeasurementPercent(pingMeasurement.getLostPerMeasurementPercent()); + measurementLog.setSent(pingMeasurement.getSent()); + measurementLog.setReceived(pingMeasurement.getReceived()); + measurementLog.setMeasuredAt(aroundNow); + + try { + return qoSIntraPingMeasurementLogRepository.saveAndFlush(measurementLog); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + + } + + //------------------------------------------------------------------------------------------------- + @Transactional (rollbackFor = ArrowheadException.class) + public void logMeasurementDetailsToDB(final QoSIntraPingMeasurementLog measurementLogSaved, + final List responseList, final ZonedDateTime aroundNow) { + logger.debug("logMeasurementDetailsToDB started..."); + + final List measurementLogDetailsList = new ArrayList<>(responseList.size()); + + for (final IcmpPingResponse icmpPingResponse : responseList) { + + final QoSIntraPingMeasurementLogDetails measurementLogDetails = new QoSIntraPingMeasurementLogDetails(); + measurementLogDetails.setMeasurementLog(measurementLogSaved); + measurementLogDetails.setSuccessFlag(icmpPingResponse.getSuccessFlag()); + measurementLogDetails.setTimeoutFlag(icmpPingResponse.getTimeoutFlag()); + measurementLogDetails.setErrorMessage(icmpPingResponse.getErrorMessage()); + measurementLogDetails.setThrowable(icmpPingResponse.getThrowable() == null ? null : icmpPingResponse.getThrowable().toString()); + measurementLogDetails.setSize(icmpPingResponse.getSize()); + measurementLogDetails.setTtl(icmpPingResponse.getTtl()); + measurementLogDetails.setRtt(icmpPingResponse.getRtt()); + measurementLogDetails.setDuration((int) icmpPingResponse.getDuration()); + measurementLogDetails.setMeasuredAt(aroundNow); + + measurementLogDetailsList.add(measurementLogDetails); + } + + try { + qoSIntraPingMeasurementLogDetailsRepository.saveAll(measurementLogDetailsList); + qoSIntraPingMeasurementLogDetailsRepository.flush(); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + @Transactional (rollbackFor = ArrowheadException.class) + public QoSIntraPingMeasurement updatePingMeasurement(final QoSIntraMeasurement measurement, + final PingMeasurementCalculationsDTO calculations, final QoSIntraPingMeasurement pingMeasurement,final ZonedDateTime aroundNow) { + logger.debug("updatePingMeasurement started..."); + + pingMeasurement.setMeasurement(measurement); + pingMeasurement.setAvailable(calculations.isAvailable()); + pingMeasurement.setMaxResponseTime(calculations.getMaxResponseTime()); + pingMeasurement.setMinResponseTime(calculations.getMinResponseTime()); + pingMeasurement.setMeanResponseTimeWithoutTimeout(calculations.getMeanResponseTimeWithoutTimeout()); + pingMeasurement.setMeanResponseTimeWithTimeout(calculations.getMeanResponseTimeWithTimeout()); + pingMeasurement.setJitterWithoutTimeout(calculations.getJitterWithoutTimeout()); + pingMeasurement.setJitterWithTimeout(calculations.getJitterWithTimeout()); + pingMeasurement.setLostPerMeasurementPercent(calculations.getLostPerMeasurementPercent()); + pingMeasurement.setCountStartedAt(pingMeasurement.getCountStartedAt()); + pingMeasurement.setLastAccessAt(calculations.isAvailable() ? aroundNow : pingMeasurement.getLastAccessAt()); + pingMeasurement.setSent(pingMeasurement.getSent() + calculations.getSentInThisPing()); + pingMeasurement.setSentAll(pingMeasurement.getSentAll() + calculations.getSentInThisPing()); + pingMeasurement.setReceived(pingMeasurement.getReceived() + calculations.getReceivedInThisPing()); + pingMeasurement.setReceivedAll(pingMeasurement.getReceivedAll() + calculations.getReceivedInThisPing()); + + try { + return qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + + } + + //------------------------------------------------------------------------------------------------- + @Transactional (rollbackFor = ArrowheadException.class) + public void updateMeasurement(final ZonedDateTime aroundNow, final QoSIntraMeasurement measurement) { + logger.debug("updateMeasurement started..."); + + measurement.setLastMeasurementAt(aroundNow); + try { + qoSIntraMeasurementRepository.saveAndFlush(measurement); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + } \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/dto/PingMeasurementCalculationsDTO.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/dto/PingMeasurementCalculationsDTO.java index 89d387821..4f0e76e80 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/dto/PingMeasurementCalculationsDTO.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/dto/PingMeasurementCalculationsDTO.java @@ -10,15 +10,15 @@ public class PingMeasurementCalculationsDTO implements Serializable{ private static final long serialVersionUID = -1645860899758857162L; private boolean available; - private int maxResponseTime; - private int minResponseTime; - private int meanResponseTimeWithTimeout; - private int meanResponseTimeWithOutTimeout; - private int jitterWithTimeout; - private int jitterWithoutTimeout; - private int sentInThisPing; - private int receivedInThisPing; - private int lostPerMeasurementPercent; + private Integer maxResponseTime; + private Integer minResponseTime; + private Integer meanResponseTimeWithTimeout; + private Integer meanResponseTimeWithoutTimeout; + private Integer jitterWithTimeout; + private Integer jitterWithoutTimeout; + private Integer sentInThisPing; + private Integer receivedInThisPing; + private Integer lostPerMeasurementPercent; //================================================================================================= // methods @@ -27,15 +27,15 @@ public class PingMeasurementCalculationsDTO implements Serializable{ public PingMeasurementCalculationsDTO() {} //------------------------------------------------------------------------------------------------- - public PingMeasurementCalculationsDTO(final boolean available, final int maxResponseTime, final int minResponseTime, - final int meanResponseTimeWithTimeout, final int meanResponseTimeWithOutTimeout, final int jitterWithTimeout, - final int jitterWithoutTimeout, final int sentInThisPing, final int receivedInThisPing, final int lostPerMeasurementPercent) { + public PingMeasurementCalculationsDTO(final boolean available, final Integer maxResponseTime, final Integer minResponseTime, + final Integer meanResponseTimeWithTimeout, final Integer meanResponseTimeWithoutTimeout, final Integer jitterWithTimeout, + final Integer jitterWithoutTimeout, final Integer sentInThisPing, final Integer receivedInThisPing, final Integer lostPerMeasurementPercent) { this.available = available; this.maxResponseTime = maxResponseTime; this.minResponseTime = minResponseTime; this.meanResponseTimeWithTimeout = meanResponseTimeWithTimeout; - this.meanResponseTimeWithOutTimeout = meanResponseTimeWithOutTimeout; + this.meanResponseTimeWithoutTimeout = meanResponseTimeWithoutTimeout; this.jitterWithTimeout = jitterWithTimeout; this.jitterWithoutTimeout = jitterWithoutTimeout; this.sentInThisPing = sentInThisPing; @@ -45,26 +45,26 @@ public PingMeasurementCalculationsDTO(final boolean available, final int maxResp //------------------------------------------------------------------------------------------------- public boolean isAvailable() { return available; } - public int getMaxResponseTime() { return maxResponseTime; } - public int getMinResponseTime() { return minResponseTime; } - public int getMeanResponseTimeWithTimeout() { return meanResponseTimeWithTimeout; } - public int getMeanResponseTimeWithOutTimeout() { return meanResponseTimeWithOutTimeout; } - public int getJitterWithTimeout() { return jitterWithTimeout; } - public int getJitterWithoutTimeout() { return jitterWithoutTimeout; } - public int getSentInThisPing() { return sentInThisPing; } - public int getReceivedInThisPing() { return receivedInThisPing; } - public int getLostPerMeasurementPercent() { return lostPerMeasurementPercent; } + public Integer getMaxResponseTime() { return maxResponseTime; } + public Integer getMinResponseTime() { return minResponseTime; } + public Integer getMeanResponseTimeWithTimeout() { return meanResponseTimeWithTimeout; } + public Integer getMeanResponseTimeWithoutTimeout() { return meanResponseTimeWithoutTimeout; } + public Integer getJitterWithTimeout() { return jitterWithTimeout; } + public Integer getJitterWithoutTimeout() { return jitterWithoutTimeout; } + public Integer getSentInThisPing() { return sentInThisPing; } + public Integer getReceivedInThisPing() { return receivedInThisPing; } + public Integer getLostPerMeasurementPercent() { return lostPerMeasurementPercent; } //------------------------------------------------------------------------------------------------- public void setAvailable(final boolean available) { this.available = available; } - public void setMaxResponseTime(final int maxResponseTime) { this.maxResponseTime = maxResponseTime; } - public void setMinResponseTime(final int minResponseTime) { this.minResponseTime = minResponseTime; } - public void setMeanResponseTimeWithTimeout(final int meanResponseTimeWithTimeout) { this.meanResponseTimeWithTimeout = meanResponseTimeWithTimeout; } - public void setMeanResponseTimeWithOutTimeout(final int meanResponseTimeWithOutTimeout) { this.meanResponseTimeWithOutTimeout = meanResponseTimeWithOutTimeout; } - public void setJitterWithTimeout(final int jitterWithTimeout) { this.jitterWithTimeout = jitterWithTimeout; } - public void setJitterWithoutTimeout(final int jitterWithoutTimeout) { this.jitterWithoutTimeout = jitterWithoutTimeout; } - public void setSentInThisPing(final int sentInThisPing) { this.sentInThisPing = sentInThisPing; } - public void setReceivedInThisPing(final int receivedInThisPing) { this.receivedInThisPing = receivedInThisPing; } - public void setLostPerMeasurementPercent(final int lostPerMeasurementPercent) { this.lostPerMeasurementPercent = lostPerMeasurementPercent; } + public void setMaxResponseTime(final Integer maxResponseTime) { this.maxResponseTime = maxResponseTime; } + public void setMinResponseTime(final Integer minResponseTime) { this.minResponseTime = minResponseTime; } + public void setMeanResponseTimeWithTimeout(final Integer meanResponseTimeWithTimeout) { this.meanResponseTimeWithTimeout = meanResponseTimeWithTimeout; } + public void setMeanResponseTimeWithoutTimeout(final Integer meanResponseTimeWithoutTimeout) { this.meanResponseTimeWithoutTimeout = meanResponseTimeWithoutTimeout; } + public void setJitterWithTimeout(final Integer jitterWithTimeout) { this.jitterWithTimeout = jitterWithTimeout; } + public void setJitterWithoutTimeout(final Integer jitterWithoutTimeout) { this.jitterWithoutTimeout = jitterWithoutTimeout; } + public void setSentInThisPing(final Integer sentInThisPing) { this.sentInThisPing = sentInThisPing; } + public void setReceivedInThisPing(final Integer receivedInThisPing) { this.receivedInThisPing = receivedInThisPing; } + public void setLostPerMeasurementPercent(final Integer lostPerMeasurementPercent) { this.lostPerMeasurementPercent = lostPerMeasurementPercent; } -} +} \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 6fe1fd64b..7651ee54a 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -109,63 +109,6 @@ private Set getSystemsToMeasure() { return systemList; } - //------------------------------------------------------------------------------------------------- - private QoSIntraPingMeasurement createPingMeasurement(final QoSIntraMeasurement measurementParam, - final List responseList, final ZonedDateTime aroundNow) { - logger.debug("createPingMeasurement started..."); - - final PingMeasurementCalculationsDTO calculations = calculatePingMeasurementValues(responseList); - - final boolean available = calculateAvailable(responseList); - final int maxResponseTime = calculateMaxResponseTime(responseList); - final int minResponseTime = calculateMinResponseTime(responseList); - final int meanResponseTimeWithTimeout = calculateMeanResponseTimeWithTimeout(responseList); - final int meanResponseTimeWithOutTimeout = calculateMeanResponseTimeWithoutTimeout(responseList); - final int jitterWithTimeout = calculateJitterWithTimeout(responseList); - final int jitterWithoutTimeout = calculateJitterWithoutTimeout(responseList); - - final ZonedDateTime countStartedAt = aroundNow; - - final long sent = 0; - final long sentAll = 0; - final long received = 0; - final long receivedAll = 0; - - final int sentInThisPing = getSentInThisPing(responseList); - final int receivedInThisPing = getReceivedInThisPing(responseList); - - final int lostPerMeasurementPercent = (int) (receivedInThisPing == 0 ? 0 : 100 - ((double)receivedInThisPing / (double)sentInThisPing) * 100); - - final QoSIntraMeasurement measurement ; - final Optional measurementOptional = qoSIntraMeasurementRepository.findById(measurementParam.getId()); - if (measurementOptional.isPresent()) { - measurement = measurementOptional.get(); - }else { - throw new ArrowheadException("Could not find measurment in DB"); - } - - final QoSIntraPingMeasurement pingMeasurement = new QoSIntraPingMeasurement(); - - pingMeasurement.setMeasurement(measurement); - pingMeasurement.setAvailable(available); - pingMeasurement.setMaxResponseTime(maxResponseTime); - pingMeasurement.setMinResponseTime(minResponseTime); - pingMeasurement.setMeanResponseTimeWithoutTimeout(meanResponseTimeWithOutTimeout); - pingMeasurement.setMeanResponseTimeWithTimeout(meanResponseTimeWithTimeout); - pingMeasurement.setJitterWithoutTimeout(jitterWithoutTimeout); - pingMeasurement.setJitterWithTimeout(jitterWithTimeout); - pingMeasurement.setLostPerMeasurementPercent(lostPerMeasurementPercent); - pingMeasurement.setCountStartedAt(countStartedAt); - pingMeasurement.setLastAccessAt(calculateLastAccessAt(responseList, pingMeasurement, aroundNow)); - pingMeasurement.setSent(sent + sentInThisPing); - pingMeasurement.setSentAll(sentAll + sentInThisPing); - pingMeasurement.setReceived(received + receivedInThisPing); - pingMeasurement.setReceivedAll(receivedAll + getReceivedInThisPing(responseList)); - - qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); - - return pingMeasurement; - } //------------------------------------------------------------------------------------------------- private PingMeasurementCalculationsDTO calculatePingMeasurementValues(List responseList) { logger.debug("calculatePingMeasurementValues started..."); @@ -230,7 +173,17 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(List responseList = getPingResponseList(address); final QoSIntraMeasurement measurement = qoSDatabaseService.getMeasurement(systemResponseDTO, aroundNow); - handelPingMeasurement(address, measurement, responseList, aroundNow); + handelPingMeasurement(measurement, responseList, aroundNow); - updateMeasurement(aroundNow, measurement); + qoSDatabaseService.updateMeasurement(aroundNow, measurement); } //------------------------------------------------------------------------------------------------- - private void handelPingMeasurement(final String address, final QoSIntraMeasurement measurement, + private void handelPingMeasurement(final QoSIntraMeasurement measurement, final List responseList, final ZonedDateTime aroundNow) { logger.debug("handelPingMeasurement started..."); - final boolean available = calculateAvailable(responseList); - final int maxResponseTime = calculateMaxResponseTime(responseList); - final int minResponseTime = calculateMinResponseTime(responseList); - final int meanResponseTimeWithTimeout = calculateMeanResponseTimeWithTimeout(responseList); - final int meanResponseTimeWithoutTimeout = calculateMeanResponseTimeWithoutTimeout(responseList); - final int jitterWithTimeout = calculateJitterWithTimeout(responseList); - final int jitterWithoutTimeout = calculateJitterWithoutTimeout(responseList); - final ZonedDateTime countStartedAt = aroundNow; - - final int sentInThisPing = getSentInThisPing(responseList); - final int receivedInThisPing = getReceivedInThisPing(responseList); - - Assert.isTrue(sentInThisPing > 0, "Sent in this Ping value must be greater than zero"); - final int lostPerMeasurementPercent = (int) (receivedInThisPing == 0 ? 100 : 100 - ( (double)receivedInThisPing / (double)sentInThisPing ) * 100); - + final PingMeasurementCalculationsDTO calculationsDTO = calculatePingMeasurementValues(responseList); final QoSIntraPingMeasurement pingMeasurement; - final Optional pingMeasurementOptional = qoSIntraMeasurementPingRepository.findByMeasurement(measurement); + final Optional pingMeasurementOptional = qoSDatabaseService.getPingMeasurementByMeasurement(measurement); + if (pingMeasurementOptional.isEmpty()) { - pingMeasurement = createPingMeasurement(measurement, responseList, aroundNow); - qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); + pingMeasurement = qoSDatabaseService.createPingMeasurement(measurement, responseList, calculationsDTO, aroundNow); if(LOG_MEASUREMENT) { - final QoSIntraPingMeasurementLog measurementLogSaved = logMeasurementToDB(address, pingMeasurement, aroundNow); + final QoSIntraPingMeasurementLog measurementLogSaved = qoSDatabaseService.logMeasurementToDB(measurement.getSystem().getAddress(), pingMeasurement, aroundNow); if(LOG_MEASUREMENT_DETAILS && measurementLogSaved != null) { - logMeasurementDetailsToDB(address, measurementLogSaved, responseList, aroundNow); + qoSDatabaseService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); } - } }else { - pingMeasurement = pingMeasurementOptional.get(); - - pingMeasurement.setMeasurement(measurement); - pingMeasurement.setAvailable(available); - pingMeasurement.setMaxResponseTime(maxResponseTime); - pingMeasurement.setMinResponseTime(minResponseTime); - pingMeasurement.setMeanResponseTimeWithoutTimeout(meanResponseTimeWithoutTimeout); - pingMeasurement.setMeanResponseTimeWithTimeout(meanResponseTimeWithTimeout); - pingMeasurement.setJitterWithoutTimeout(jitterWithoutTimeout); - pingMeasurement.setJitterWithTimeout(jitterWithTimeout); - pingMeasurement.setLostPerMeasurementPercent(lostPerMeasurementPercent); - pingMeasurement.setCountStartedAt(countStartedAt); - pingMeasurement.setLastAccessAt(calculateLastAccessAt(responseList, pingMeasurement, aroundNow)); - pingMeasurement.setSent(pingMeasurement.getSent() + sentInThisPing); - pingMeasurement.setSentAll(pingMeasurement.getSentAll() + sentInThisPing); - pingMeasurement.setReceived(pingMeasurement.getReceived() + receivedInThisPing); - pingMeasurement.setReceivedAll(pingMeasurement.getReceivedAll() + getReceivedInThisPing(responseList)); - - qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); + pingMeasurement = qoSDatabaseService.updatePingMeasurement(measurement, calculationsDTO, pingMeasurementOptional.get(), aroundNow); if(LOG_MEASUREMENT) { - final QoSIntraPingMeasurementLog measurementLogSaved = logMeasurementToDB(address, pingMeasurement, aroundNow); + final QoSIntraPingMeasurementLog measurementLogSaved = qoSDatabaseService.logMeasurementToDB(measurement.getSystem().getAddress(), pingMeasurement, aroundNow); if(LOG_MEASUREMENT_DETAILS && measurementLogSaved != null) { - logMeasurementDetailsToDB(address, measurementLogSaved, responseList, aroundNow); + qoSDatabaseService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); } } } } - //------------------------------------------------------------------------------------------------- - @Transactional (rollbackFor = ArrowheadException.class) - private void logMeasurementDetailsToDB(final String address, final QoSIntraPingMeasurementLog measurementLogSaved, - final List responseList, final ZonedDateTime aroundNow) { - logger.debug("logMeasurementDetailsToDB started..."); - - final List measurementLogDetailsList = new ArrayList<>(responseList.size()); - - for (final IcmpPingResponse icmpPingResponse : responseList) { - - final QoSIntraPingMeasurementLogDetails measurementLogDetails = new QoSIntraPingMeasurementLogDetails(); - measurementLogDetails.setMeasurementLog(measurementLogSaved); - measurementLogDetails.setSuccessFlag(icmpPingResponse.getSuccessFlag()); - measurementLogDetails.setTimeoutFlag(icmpPingResponse.getTimeoutFlag()); - measurementLogDetails.setErrorMessage(icmpPingResponse.getErrorMessage()); - measurementLogDetails.setThrowable(icmpPingResponse.getThrowable() == null ? null : icmpPingResponse.getThrowable().toString()); - measurementLogDetails.setSize(icmpPingResponse.getSize()); - measurementLogDetails.setTtl(icmpPingResponse.getTtl()); - measurementLogDetails.setRtt(icmpPingResponse.getRtt()); - measurementLogDetails.setDuration((int) icmpPingResponse.getDuration()); - measurementLogDetails.setMeasuredAt(aroundNow); - - measurementLogDetailsList.add(measurementLogDetails); - } - - qoSIntraPingMeasurementLogDetailsRepository.saveAll(measurementLogDetailsList); - qoSIntraPingMeasurementLogDetailsRepository.flush(); - } - - //------------------------------------------------------------------------------------------------- - @Transactional (rollbackFor = ArrowheadException.class) - private QoSIntraPingMeasurementLog logMeasurementToDB(final String address, final QoSIntraPingMeasurement pingMeasurement, final ZonedDateTime aroundNow) { - logger.debug("logMeasurementToDB started..."); - - final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); - measurementLog.setMeasuredSystemAddress(address); - measurementLog.setAvailable(pingMeasurement.isAvailable()); - measurementLog.setMinResponseTime(pingMeasurement.getMinResponseTime()); - measurementLog.setMaxResponseTime(pingMeasurement.getMaxResponseTime()); - measurementLog.setMeanResponseTimeWithoutTimeout(pingMeasurement.getMeanResponseTimeWithoutTimeout()); - measurementLog.setMeanResponseTimeWithTimeout(pingMeasurement.getMeanResponseTimeWithTimeout()); - measurementLog.setJitterWithoutTimeout(pingMeasurement.getJitterWithoutTimeout()); - measurementLog.setJitterWithTimeout(pingMeasurement.getJitterWithTimeout()); - measurementLog.setLostPerMeasurementPercent(pingMeasurement.getLostPerMeasurementPercent()); - measurementLog.setSent(pingMeasurement.getSent()); - measurementLog.setReceived(pingMeasurement.getReceived()); - measurementLog.setMeasuredAt(aroundNow); - - final QoSIntraPingMeasurementLog measurementLogSaved = qoSIntraPingMeasurementLogRepository.saveAndFlush(measurementLog); - - return measurementLogSaved; - } - //------------------------------------------------------------------------------------------------- private ServiceRegistryListResponseDTO queryServiceRegistryAll() { logger.debug("queryServiceRegistryAll started..."); From a6868ae76f164037f45691214816ff5cfec4d2fc Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 3 Feb 2020 10:28:41 +0100 Subject: [PATCH 076/301] removed unused methods --- .../core/qos/quartz/task/PingTask.java | 192 +----------------- 1 file changed, 1 insertion(+), 191 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 7651ee54a..b675ec074 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -23,12 +23,8 @@ import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.util.UriComponents; - -import com.rabbitmq.client.impl.AMQImpl.Basic.Qos; - import org.springframework.util.Assert; +import org.springframework.web.util.UriComponents; import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; @@ -36,15 +32,7 @@ import eu.arrowhead.common.database.entity.QoSIntraMeasurement; import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; import eu.arrowhead.common.database.entity.QoSIntraPingMeasurementLog; -import eu.arrowhead.common.database.entity.QoSIntraPingMeasurementLogDetails; -import eu.arrowhead.common.database.entity.System; -import eu.arrowhead.common.database.repository.QoSIntraMeasurementPingRepository; -import eu.arrowhead.common.database.repository.QoSIntraMeasurementRepository; -import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogDetailsRepository; -import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogRepository; -import eu.arrowhead.common.database.repository.SystemRepository; import eu.arrowhead.common.dto.internal.ServiceRegistryListResponseDTO; -import eu.arrowhead.common.dto.shared.QoSMeasurementType; import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; import eu.arrowhead.common.dto.shared.SystemResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; @@ -301,182 +289,4 @@ private List getPingResponseList(final String address) { return responseList; } - //------------------------------------------------------------------------------------------------- - private int getReceivedInThisPing(final List responseList) { - logger.debug("getReceivedInThisPing started..."); - - int countReceived = 0; - for (final IcmpPingResponse icmpPingResponse : responseList) { - - if (icmpPingResponse.getSuccessFlag()) { - - ++ countReceived; - } - } - return countReceived; - } - - //------------------------------------------------------------------------------------------------- - private int getSentInThisPing(final List responseList) { - logger.debug("getSentInThisPing started..."); - - return responseList.size(); - } - - //------------------------------------------------------------------------------------------------- - private ZonedDateTime calculateLastAccessAt(final List responseList, final QoSIntraPingMeasurement pingMeasurement, final ZonedDateTime aroundNow) { - logger.debug("calculateLastAccessAt started..."); - - ZonedDateTime accessedAt = null; - for (final IcmpPingResponse icmpPingResponse : responseList) { - - if (icmpPingResponse.getSuccessFlag()) { - accessedAt = aroundNow; - break; - } - } - - if (accessedAt == null) { - if (pingMeasurement.getLastAccessAt() == null) { - accessedAt = null; - }else { - accessedAt = pingMeasurement.getLastAccessAt(); - } - } - - return accessedAt; - } - - //------------------------------------------------------------------------------------------------- - private int calculateMeanResponseTimeWithoutTimeout(final List responseList) { - logger.debug("calculateMeanResponseTime started..."); - - final double mean; - long sum = 0; - int count = 0; - for (final IcmpPingResponse icmpPingResponse : responseList) { - if (icmpPingResponse.getSuccessFlag()) { - sum += icmpPingResponse.getDuration(); - ++count; - } - } - - mean = (double)sum / (double)count; - return (int) Math.round(mean); - } - - //------------------------------------------------------------------------------------------------- - private int calculateMeanResponseTimeWithTimeout(final List responseList) { - logger.debug("calculateMeanResponseTime started..."); - - final double mean; - long sum = 0; - for (final IcmpPingResponse icmpPingResponse : responseList) { - - if (!icmpPingResponse.getSuccessFlag()) { - sum += PING_TIME_OUT; - }else { - sum += icmpPingResponse.getDuration(); - } - } - - mean = (double)sum / (double)responseList.size(); - return (int) Math.round(mean); - } - - //------------------------------------------------------------------------------------------------- - private int calculateMinResponseTime(final List responseList) { - logger.debug("calculateMinResponseTime started..."); - - int min = PING_TIME_OUT; - for (final IcmpPingResponse icmpPingResponse : responseList) { - - if (icmpPingResponse.getSuccessFlag()) { - if(icmpPingResponse.getDuration() < min) { - min = (int) icmpPingResponse.getDuration(); - } - } - } - - return min; - } - - //------------------------------------------------------------------------------------------------- - private int calculateMaxResponseTime(final List responseList) { - logger.debug("calculateMaxResponseTime started..."); - - int max = 0; - for (final IcmpPingResponse icmpPingResponse : responseList) { - - if (icmpPingResponse.getSuccessFlag()) { - if(icmpPingResponse.getDuration() > max) { - max = (int) icmpPingResponse.getDuration(); - } - } - } - - return max; - } - - //------------------------------------------------------------------------------------------------- - private boolean calculateAvailable(final List responseList) { - logger.debug("calculateAvailable started..."); - - for (final IcmpPingResponse icmpPingResponse : responseList) { - - if (icmpPingResponse.getSuccessFlag()) { - - return true; - } - } - - return false; - } - - //------------------------------------------------------------------------------------------------- - private int calculateJitterWithTimeout(final List responseList) { - logger.debug("calculateJitterWithTimeout started..."); - - final int meanResponseTimeWithTimeout = calculateMeanResponseTimeWithTimeout(responseList); - int sumOfDiffs = 0; - for (final IcmpPingResponse icmpPingResponse : responseList) { - - final int duration; - if (!icmpPingResponse.getSuccessFlag()) { - duration = PING_TIME_OUT + 1; - }else { - duration = (int) icmpPingResponse.getDuration(); - } - sumOfDiffs += Math.pow( (duration - meanResponseTimeWithTimeout), 2); - - } - - final int jitter = (int) Math.sqrt(sumOfDiffs / responseList.size()); - - return jitter; - } - - //------------------------------------------------------------------------------------------------- - private int calculateJitterWithoutTimeout(final List responseList) { - logger.debug("calculateJitterWithoutTimeout started..."); - - final int meanResponseTimeWithTimeout = calculateMeanResponseTimeWithoutTimeout(responseList); - int sumOfDiffs = 0; - int count = 0; - for (final IcmpPingResponse icmpPingResponse : responseList) { - - final int duration; - if (icmpPingResponse.getSuccessFlag()) { - duration = (int) icmpPingResponse.getDuration(); - sumOfDiffs += Math.pow( (duration - meanResponseTimeWithTimeout), 2); - - ++ count; - } - - } - - final int jitter = (int) Math.sqrt(sumOfDiffs / count); - - return jitter; - } } \ No newline at end of file From 7d00bb91bb4bbb95bfbbeee2e124ddab67b753fc Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 3 Feb 2020 11:56:59 +0100 Subject: [PATCH 077/301] corrected jitter calculations --- .../java/eu/arrowhead/core/qos/quartz/task/PingTask.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index b675ec074..50ac0746e 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -50,6 +50,7 @@ public class PingTask implements Job { private static final String NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE = " is null or blank."; private static final int TIMES_TO_REPEAT = 35; private static final int PING_TIME_OUT = 5000; + private static final int PING_POCKET_SIZE = 32; private static final int REST_BETWEEN_PINGS_MILLSEC = 1000; private static final boolean LOG_MEASUREMENT = true; @@ -150,12 +151,12 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(List getPingResponseList(final String address) { try { final IcmpPingRequest request = IcmpPingUtil.createIcmpPingRequest (); request.setHost (address); + request.setTimeout(PING_TIME_OUT); + request.setPacketSize(PING_POCKET_SIZE); for (int count = 0; count < TIMES_TO_REPEAT; count ++) { final IcmpPingResponse response = IcmpPingUtil.executePingRequest (request); From bf15c1cf2aac49e99fbebade06265ed009f10ee8 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 3 Feb 2020 12:03:46 +0100 Subject: [PATCH 078/301] corrected lostPerMeasurementPercent calculation --- .../main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 50ac0746e..23cbe5142 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -138,7 +138,7 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(List Date: Mon, 3 Feb 2020 12:14:06 +0100 Subject: [PATCH 079/301] corrected MeanResponseTimeWithTimeout calculation --- .../main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java | 1 + 1 file changed, 1 insertion(+) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 23cbe5142..a83ffc413 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -131,6 +131,7 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(List Date: Mon, 3 Feb 2020 13:03:29 +0100 Subject: [PATCH 080/301] corrected PingResponse error handling --- .../core/qos/quartz/task/PingTask.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index a83ffc413..f52905e6f 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -1,5 +1,6 @@ package eu.arrowhead.core.qos.quartz.task; +import java.net.UnknownHostException; import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.List; @@ -279,11 +280,22 @@ private List getPingResponseList(final String address) { request.setPacketSize(PING_POCKET_SIZE); for (int count = 0; count < TIMES_TO_REPEAT; count ++) { - final IcmpPingResponse response = IcmpPingUtil.executePingRequest (request); - final String formattedResponse = IcmpPingUtil.formatResponse (response); - logger.debug(formattedResponse); + IcmpPingResponse response; + try { + response = IcmpPingUtil.executePingRequest (request); + final String formattedResponse = IcmpPingUtil.formatResponse (response); + logger.debug(formattedResponse); + + responseList.add(response); + } catch (final Exception ex) { + response = new IcmpPingResponse(); + response.setErrorMessage(ex.getMessage()); + response.setSuccessFlag(false); + response.setThrowable(ex); + + responseList.add(response); + } - responseList.add(response); Thread.sleep (REST_BETWEEN_PINGS_MILLSEC); } } catch ( final InterruptedException | IllegalArgumentException ex) { From 0da222181fa146304137502c0172573837830cb4 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 3 Feb 2020 13:31:49 +0100 Subject: [PATCH 081/301] corrected typo: handel > handle --- .../java/eu/arrowhead/core/qos/quartz/task/PingTask.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index f52905e6f..3c127ef2e 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -1,6 +1,5 @@ package eu.arrowhead.core.qos.quartz.task; -import java.net.UnknownHostException; import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.List; @@ -193,14 +192,14 @@ private void pingSystem(final SystemResponseDTO systemResponseDTO ) { final List responseList = getPingResponseList(address); final QoSIntraMeasurement measurement = qoSDatabaseService.getMeasurement(systemResponseDTO, aroundNow); - handelPingMeasurement(measurement, responseList, aroundNow); + handlePingMeasurement(measurement, responseList, aroundNow); qoSDatabaseService.updateMeasurement(aroundNow, measurement); } //------------------------------------------------------------------------------------------------- - private void handelPingMeasurement(final QoSIntraMeasurement measurement, + private void handlePingMeasurement(final QoSIntraMeasurement measurement, final List responseList, final ZonedDateTime aroundNow) { logger.debug("handelPingMeasurement started..."); From 64422569bcae1254e2316fb4228128256acc3df1 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 3 Feb 2020 14:02:04 +0100 Subject: [PATCH 082/301] refactored measurement loging --- .../database/service/QoSDatabaseService.java | 18 +++++++++++------- .../core/qos/quartz/task/PingTask.java | 10 +++++----- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java index 4d0ba5304..412be1dba 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java @@ -121,7 +121,7 @@ public QoSIntraMeasurement getMeasurement(final SystemResponseDTO systemResponse //------------------------------------------------------------------------------------------------- @Transactional (rollbackFor = ArrowheadException.class) - public QoSIntraPingMeasurement createPingMeasurement(final QoSIntraMeasurement measurementParam, + public void createPingMeasurement(final QoSIntraMeasurement measurementParam, final List responseList,final PingMeasurementCalculationsDTO calculations, final ZonedDateTime aroundNow) { logger.debug("createPingMeasurement started..."); @@ -144,7 +144,9 @@ public QoSIntraPingMeasurement createPingMeasurement(final QoSIntraMeasurement m pingMeasurement.setReceivedAll(calculations.getReceivedInThisPing()); try { - return qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); + + qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); @@ -166,7 +168,7 @@ public Optional getPingMeasurementByMeasurement(final Q //------------------------------------------------------------------------------------------------- @Transactional (rollbackFor = ArrowheadException.class) - public QoSIntraPingMeasurementLog logMeasurementToDB(final String address, final QoSIntraPingMeasurement pingMeasurement, final ZonedDateTime aroundNow) { + public QoSIntraPingMeasurementLog logMeasurementToDB(final String address, final PingMeasurementCalculationsDTO pingMeasurement, final ZonedDateTime aroundNow) { logger.debug("logMeasurementToDB started..."); final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); @@ -179,8 +181,8 @@ public QoSIntraPingMeasurementLog logMeasurementToDB(final String address, final measurementLog.setJitterWithoutTimeout(pingMeasurement.getJitterWithoutTimeout()); measurementLog.setJitterWithTimeout(pingMeasurement.getJitterWithTimeout()); measurementLog.setLostPerMeasurementPercent(pingMeasurement.getLostPerMeasurementPercent()); - measurementLog.setSent(pingMeasurement.getSent()); - measurementLog.setReceived(pingMeasurement.getReceived()); + measurementLog.setSent(pingMeasurement.getSentInThisPing()); + measurementLog.setReceived(pingMeasurement.getReceivedInThisPing()); measurementLog.setMeasuredAt(aroundNow); try { @@ -228,7 +230,7 @@ public void logMeasurementDetailsToDB(final QoSIntraPingMeasurementLog measureme //------------------------------------------------------------------------------------------------- @Transactional (rollbackFor = ArrowheadException.class) - public QoSIntraPingMeasurement updatePingMeasurement(final QoSIntraMeasurement measurement, + public void updatePingMeasurement(final QoSIntraMeasurement measurement, final PingMeasurementCalculationsDTO calculations, final QoSIntraPingMeasurement pingMeasurement,final ZonedDateTime aroundNow) { logger.debug("updatePingMeasurement started..."); @@ -249,7 +251,9 @@ public QoSIntraPingMeasurement updatePingMeasurement(final QoSIntraMeasurement m pingMeasurement.setReceivedAll(pingMeasurement.getReceivedAll() + calculations.getReceivedInThisPing()); try { - return qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); + + qoSIntraMeasurementPingRepository.saveAndFlush(pingMeasurement); + } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 3c127ef2e..39804e32d 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -204,16 +204,15 @@ private void handlePingMeasurement(final QoSIntraMeasurement measurement, logger.debug("handelPingMeasurement started..."); final PingMeasurementCalculationsDTO calculationsDTO = calculatePingMeasurementValues(responseList); - final QoSIntraPingMeasurement pingMeasurement; final Optional pingMeasurementOptional = qoSDatabaseService.getPingMeasurementByMeasurement(measurement); if (pingMeasurementOptional.isEmpty()) { - pingMeasurement = qoSDatabaseService.createPingMeasurement(measurement, responseList, calculationsDTO, aroundNow); + qoSDatabaseService.createPingMeasurement(measurement, responseList, calculationsDTO, aroundNow); if(LOG_MEASUREMENT) { - final QoSIntraPingMeasurementLog measurementLogSaved = qoSDatabaseService.logMeasurementToDB(measurement.getSystem().getAddress(), pingMeasurement, aroundNow); + final QoSIntraPingMeasurementLog measurementLogSaved = qoSDatabaseService.logMeasurementToDB(measurement.getSystem().getAddress(), calculationsDTO, aroundNow); if(LOG_MEASUREMENT_DETAILS && measurementLogSaved != null) { @@ -222,11 +221,12 @@ private void handlePingMeasurement(final QoSIntraMeasurement measurement, } }else { - pingMeasurement = qoSDatabaseService.updatePingMeasurement(measurement, calculationsDTO, pingMeasurementOptional.get(), aroundNow); + + qoSDatabaseService.updatePingMeasurement(measurement, calculationsDTO, pingMeasurementOptional.get(), aroundNow); if(LOG_MEASUREMENT) { - final QoSIntraPingMeasurementLog measurementLogSaved = qoSDatabaseService.logMeasurementToDB(measurement.getSystem().getAddress(), pingMeasurement, aroundNow); + final QoSIntraPingMeasurementLog measurementLogSaved = qoSDatabaseService.logMeasurementToDB(measurement.getSystem().getAddress(), calculationsDTO, aroundNow); if(LOG_MEASUREMENT_DETAILS && measurementLogSaved != null) { From 461df449fde6032bec35a494e194be3e10e2e0d7 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Mon, 3 Feb 2020 15:25:53 +0100 Subject: [PATCH 083/301] Service time verifier implementation --- .../dto/shared/ServiceRegistryRequestDTO.java | 2 + .../service/OrchestratorService.java | 16 ++++- .../core/qos/manager/QoSVerifiers.java | 25 +++++++ .../core/qos/manager/impl/QoSManagerImpl.java | 16 ++++- .../qos/manager/impl/ServiceTimeVerifier.java | 68 +++++++++++++++++++ 5 files changed, 125 insertions(+), 2 deletions(-) create mode 100644 orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSVerifiers.java create mode 100644 orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/ServiceTimeVerifier.java diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceRegistryRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceRegistryRequestDTO.java index 0631ffab6..549df5cc8 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceRegistryRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceRegistryRequestDTO.java @@ -9,6 +9,8 @@ public class ServiceRegistryRequestDTO implements Serializable { //================================================================================================= // members + public static final String KEY_RECOMMENDED_ORCHESTRATION_TIME = "recommendedOrchestrationTime"; // in seconds + private static final long serialVersionUID = -3805773665976065056L; private String serviceDefinition; diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java index ce2bd2cd3..4372510ed 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java @@ -67,7 +67,7 @@ public class OrchestratorService { private static final String LESS_THAN_ONE_ERROR_MESSAGE= " must be greater than zero."; private static final String MORE_THAN_ONE_ERROR_MESSAGE= " must not have more than one element."; - private static final int EXPIRING_TIME_IN_MINUTES = 2; + public static final int EXPIRING_TIME_IN_MINUTES = 2; private static final Logger logger = LogManager.getLogger(OrchestratorService.class); @@ -95,6 +95,9 @@ public class OrchestratorService { @Value(CoreCommonConstants.$QOS_ENABLED_WD) private boolean qosEnabled; + @Value(CoreCommonConstants.$QOS_MAX_RESERVATION_DURATION_WD) + private int maxReservationDuration; // in seconds + //================================================================================================= // methods @@ -363,6 +366,17 @@ private void checkServiceRequestForm(final OrchestrationFormRequestDTO request, request.validateCrossParameterConstraints(); + if (qosEnabled && request.getOrchestrationFlags().get(Flag.ENABLE_QOS) && request.getCommands().containsKey(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY)) { + try { + final int exclusivityTime = Integer.parseInt(request.getCommands().get(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY)); + if (exclusivityTime <= 0 || exclusivityTime > maxReservationDuration) { + throw new InvalidParameterException("Exclusivity time must be specified in seconds. Valid interval: [1, " + maxReservationDuration + "]."); + } + } catch (final NumberFormatException ex) { + throw new InvalidParameterException("Exclusivity time is in the wrong format."); + } + } + // Requested service checkRequestedServiceForm(request.getRequestedService()); diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSVerifiers.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSVerifiers.java new file mode 100644 index 000000000..30a3a7d87 --- /dev/null +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSVerifiers.java @@ -0,0 +1,25 @@ +package eu.arrowhead.core.qos.manager; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import eu.arrowhead.core.qos.manager.impl.ServiceTimeVerifier; + +@Configuration +public class QoSVerifiers { + + //================================================================================================= + // members + + public static final String SERVICE_TIME_VERIFIER = "serviceTimeVerifier"; + + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Bean(SERVICE_TIME_VERIFIER) + public QoSVerifier getServiceTimeVerifier() { + return new ServiceTimeVerifier(); + } +} \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java index 387bda203..30a1b9d54 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java @@ -3,9 +3,12 @@ import java.util.ArrayList; import java.util.List; +import javax.annotation.PostConstruct; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; import org.springframework.util.Assert; import eu.arrowhead.common.Utilities; @@ -17,6 +20,7 @@ import eu.arrowhead.core.qos.database.service.QoSReservationDBService; import eu.arrowhead.core.qos.manager.QoSManager; import eu.arrowhead.core.qos.manager.QoSVerifier; +import eu.arrowhead.core.qos.manager.QoSVerifiers; public class QoSManagerImpl implements QoSManager { @@ -28,10 +32,20 @@ public class QoSManagerImpl implements QoSManager { @Autowired private QoSReservationDBService qosReservationDBService; - private List verifiers = List.of(); // TODO: add verifier here + @Autowired + private ApplicationContext appContext; + + private List verifiers = new ArrayList<>(2); //================================================================================================= // methods + + //------------------------------------------------------------------------------------------------- + @PostConstruct + public void init() { + verifiers.add(appContext.getBean(QoSVerifiers.SERVICE_TIME_VERIFIER, QoSVerifier.class)); + //TODO: add verifiers here + } //------------------------------------------------------------------------------------------------- @Override diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/ServiceTimeVerifier.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/ServiceTimeVerifier.java new file mode 100644 index 000000000..f3cc5ee7c --- /dev/null +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/ServiceTimeVerifier.java @@ -0,0 +1,68 @@ +package eu.arrowhead.core.qos.manager.impl; + +import java.util.Map; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; +import eu.arrowhead.common.dto.shared.OrchestratorWarnings; +import eu.arrowhead.common.dto.shared.ServiceRegistryRequestDTO; +import eu.arrowhead.core.orchestrator.service.OrchestratorDriver; +import eu.arrowhead.core.orchestrator.service.OrchestratorService; +import eu.arrowhead.core.qos.manager.QoSVerifier; + +public class ServiceTimeVerifier implements QoSVerifier { + + //================================================================================================= + // members + + private static final double recommendedTimeFactor = 1.1; + private static final int extraSeconds = 5; + + private static final Logger logger = LogManager.getLogger(ServiceTimeVerifier.class); + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Override + public boolean verify(final OrchestrationResultDTO result, final Map qosRequirements, final Map commands) { + int recommendedTime = -1; // no restrictions + if (result.getMetadata().containsKey(ServiceRegistryRequestDTO.KEY_RECOMMENDED_ORCHESTRATION_TIME)) { + try { + recommendedTime = Integer.parseInt(result.getMetadata().get(ServiceRegistryRequestDTO.KEY_RECOMMENDED_ORCHESTRATION_TIME)); + } catch (final NumberFormatException ex) { + logger.debug("Invalid recommended orchestration time: {}, ignored.", result.getMetadata().get(ServiceRegistryRequestDTO.KEY_RECOMMENDED_ORCHESTRATION_TIME)); + } + } + + int calculatedTime = recommendedTime; + if (commands.containsKey(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY)) { + final int exclusivityTime = Integer.parseInt(commands.get(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY)); + + if (recommendedTime > 0 && exclusivityTime > Math.round(recommendedTime * recommendedTimeFactor)) { // means this provider's time frame is not long enough + return false; + } + + calculatedTime = exclusivityTime; + } + + if (calculatedTime > 0) { + calculatedTime += extraSeconds; // give some extra seconds because of orchestration overhead + result.getMetadata().put(OrchestratorDriver.KEY_CALCULATED_SERVICE_TIME_FRAME, String.valueOf(calculatedTime)); + + // adjust TTL warnings + result.getWarnings().remove(OrchestratorWarnings.TTL_UNKNOWN); + if (!result.getWarnings().contains(OrchestratorWarnings.TTL_EXPIRED) && + !result.getWarnings().contains(OrchestratorWarnings.TTL_EXPIRING) && + calculatedTime <= OrchestratorService.EXPIRING_TIME_IN_MINUTES * CommonConstants.CONVERSION_SECOND_TO_MINUTE) { + result.getWarnings().add(OrchestratorWarnings.TTL_EXPIRING); + } + } + + return true; + } +} \ No newline at end of file From 5527bae69f3db7d1e8b14bbe87861eb4b989397d Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 3 Feb 2020 18:05:13 +0100 Subject: [PATCH 084/301] implemented qos-monitor endpoints --- .../eu/arrowhead/common/CommonConstants.java | 1 + .../entity/QoSIntraPingMeasurement.java | 3 + .../common/dto/internal/DTOConverter.java | 65 ++++++++++- .../PingMeasurementListResponseDTO.java | 35 ++++++ .../internal/PingMeasurementResponseDTO.java | 77 +++++++++++++ .../QoSIntraMeasurementResponseDTO.java | 57 +++++++++ .../core/qos/QoSMonitorController.java | 108 +++++++++++++++++- .../database/service/QoSDatabaseService.java | 94 ++++++++++++++- .../QosMonitorAccessControlFilter.java | 18 ++- 9 files changed, 452 insertions(+), 6 deletions(-) create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/internal/PingMeasurementListResponseDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/internal/PingMeasurementResponseDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/internal/QoSIntraMeasurementResponseDTO.java diff --git a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java index a0a5f5300..87054fcc7 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java @@ -110,6 +110,7 @@ public class CommonConstants { public static final String OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE = "/publish/authupdate"; public static final String QOS_MONITOR_URI = "/qosmonitor"; + public static final String OP_QOS_MONITOR_PING_MEASUREMENT = "/ping/measurement"; public static final String SWAGGER_COMMON_PACKAGE = "eu.arrowhead.common.swagger"; public static final String SWAGGER_UI_URI = "/swagger-ui.html"; diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java index 2a9d345f7..557794d76 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java @@ -1,6 +1,7 @@ package eu.arrowhead.common.database.entity; import java.time.ZonedDateTime; +import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; @@ -21,6 +22,8 @@ public class QoSIntraPingMeasurement { //================================================================================================= // members + public static final List SORTABLE_FIELDS_BY = List.of( "id", "updatedAt", "createdAt"); //NOSONAR + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java index d2cc2b0cf..40ea1f6ec 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java @@ -9,7 +9,6 @@ import java.util.Map.Entry; import java.util.Set; -import eu.arrowhead.common.database.entity.System; import org.springframework.data.domain.Page; import org.springframework.util.Assert; @@ -31,6 +30,8 @@ import eu.arrowhead.common.database.entity.EventType; import eu.arrowhead.common.database.entity.ForeignSystem; import eu.arrowhead.common.database.entity.OrchestratorStore; +import eu.arrowhead.common.database.entity.QoSIntraMeasurement; +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; import eu.arrowhead.common.database.entity.Relay; import eu.arrowhead.common.database.entity.ServiceDefinition; import eu.arrowhead.common.database.entity.ServiceInterface; @@ -38,6 +39,7 @@ import eu.arrowhead.common.database.entity.ServiceRegistryInterfaceConnection; import eu.arrowhead.common.database.entity.Subscription; import eu.arrowhead.common.database.entity.SubscriptionPublisherConnection; +import eu.arrowhead.common.database.entity.System; import eu.arrowhead.common.dto.shared.ChoreographerActionPlanResponseDTO; import eu.arrowhead.common.dto.shared.ChoreographerActionResponseDTO; import eu.arrowhead.common.dto.shared.ChoreographerActionStepResponseDTO; @@ -650,7 +652,65 @@ public static ChoreographerActionPlanResponseDTO convertChoreographerActionPlanT Utilities.convertZonedDateTimeToUTCString(actionPlanEntry.getCreatedAt()), Utilities.convertZonedDateTimeToUTCString(actionPlanEntry.getUpdatedAt())); } - + + //------------------------------------------------------------------------------------------------- + public static PingMeasurementResponseDTO convertQoSIntraPingMeasurementToPingMeasurementResponseDTO( + final QoSIntraPingMeasurement pingMeasurement) { + Assert.notNull(pingMeasurement, "pingMeasurement is null"); + + final QoSIntraMeasurementResponseDTO measurementResponseDTO = convertQoSIntraMeasurementToQoSIntraMeasurementResponseDTO(pingMeasurement.getMeasurement()); + + final PingMeasurementResponseDTO pingMeasurementResponseDTO = new PingMeasurementResponseDTO(); + pingMeasurementResponseDTO.setId(pingMeasurement.getId()); + pingMeasurementResponseDTO.setMeasurement(measurementResponseDTO); + pingMeasurementResponseDTO.setAvailable(pingMeasurement.isAvailable()); + pingMeasurementResponseDTO.setLastAccessAt(pingMeasurement.getLastAccessAt()); + pingMeasurementResponseDTO.setMinResponseTime(pingMeasurement.getMinResponseTime()); + pingMeasurementResponseDTO.setMaxResponseTime(pingMeasurement.getMinResponseTime()); + pingMeasurementResponseDTO.setMeanResponseTimeWithTimeout(pingMeasurement.getMeanResponseTimeWithTimeout()); + pingMeasurementResponseDTO.setMeanResponseTimeWithoutTimeout(pingMeasurement.getMeanResponseTimeWithoutTimeout()); + pingMeasurementResponseDTO.setJitterWithTimeout(pingMeasurement.getJitterWithTimeout()); + pingMeasurementResponseDTO.setJitterWithoutTimeout(pingMeasurement.getJitterWithoutTimeout()); + pingMeasurementResponseDTO.setLostPerMeasurementPercent(pingMeasurement.getLostPerMeasurementPercent()); + pingMeasurementResponseDTO.setSent(pingMeasurement.getSent()); + pingMeasurementResponseDTO.setReceived(pingMeasurement.getReceived()); + pingMeasurementResponseDTO.setCountStartedAt(pingMeasurement.getCountStartedAt()); + pingMeasurementResponseDTO.setSentAll(pingMeasurement.getSentAll()); + pingMeasurementResponseDTO.setReceivedAll(pingMeasurement.getReceivedAll()); + pingMeasurementResponseDTO.setCreatedAt(pingMeasurement.getUpdatedAt()); + pingMeasurementResponseDTO.setUpdatedAt(pingMeasurement.getUpdatedAt()); + + return pingMeasurementResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + public static QoSIntraMeasurementResponseDTO convertQoSIntraMeasurementToQoSIntraMeasurementResponseDTO( + final QoSIntraMeasurement measurement) { + Assert.notNull(measurement, "measurement is null"); + + final SystemResponseDTO system = convertSystemToSystemResponseDTO(measurement.getSystem()); + + return new QoSIntraMeasurementResponseDTO( + measurement.getId(), + system, + measurement.getMeasurementType(), + measurement.getLastMeasurementAt(), + measurement.getCreatedAt(), + measurement.getUpdatedAt()); + } + + //------------------------------------------------------------------------------------------------- + public static PingMeasurementListResponseDTO convertQoSIntraPingMeasurementPageToPingMeasurementListResponseDTO( + final Page entries) { + Assert.notNull(entries, "pingMeasurementPage is null"); + + final List pingMeasurementEntries = new ArrayList<>(entries.getNumberOfElements()); + for (final QoSIntraPingMeasurement entry : entries) { + pingMeasurementEntries.add(convertQoSIntraPingMeasurementToPingMeasurementResponseDTO(entry)); + } + + return new PingMeasurementListResponseDTO(pingMeasurementEntries, entries.getTotalElements()); + } //================================================================================================= // assistant methods @@ -754,4 +814,5 @@ private static Set collectAuthorizedPublishersFromSubscriptio return result; } + } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/PingMeasurementListResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/PingMeasurementListResponseDTO.java new file mode 100644 index 000000000..5bff5f6af --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/PingMeasurementListResponseDTO.java @@ -0,0 +1,35 @@ +package eu.arrowhead.common.dto.internal; + +import java.io.Serializable; +import java.util.List; + +public class PingMeasurementListResponseDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = 1261528929899029505L; + + private List data; + private long count; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public PingMeasurementListResponseDTO() {} + + //------------------------------------------------------------------------------------------------- + public PingMeasurementListResponseDTO(final List data, final long count) { + this.data = data; + this.count = count; + } + + //------------------------------------------------------------------------------------------------- + public List getData() { return data; } + public long getCount() { return count; } + + //------------------------------------------------------------------------------------------------- + public void setData(final List data) { this.data = data; } + public void setCount(final long count) { this.count = count; } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/PingMeasurementResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/PingMeasurementResponseDTO.java new file mode 100644 index 000000000..c4234015f --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/PingMeasurementResponseDTO.java @@ -0,0 +1,77 @@ +package eu.arrowhead.common.dto.internal; + +import java.io.Serializable; +import java.time.ZonedDateTime; + +public class PingMeasurementResponseDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = 4436693629791850816L; + + private long id; + private QoSIntraMeasurementResponseDTO measurement; + private boolean available = false; + private ZonedDateTime lastAccessAt; + private Integer minResponseTime; + private Integer maxResponseTime; + private Integer meanResponseTimeWithTimeout; + private Integer meanResponseTimeWithoutTimeout; + private Integer jitterWithTimeout; + private Integer jitterWithoutTimeout; + private Integer lostPerMeasurementPercent; + private long sent; + private long received; + private ZonedDateTime countStartedAt; + private long sentAll; + private long receivedAll; + private ZonedDateTime createdAt; + private ZonedDateTime updatedAt; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public PingMeasurementResponseDTO() {} + + //------------------------------------------------------------------------------------------------- + public long getId() { return id; } + public QoSIntraMeasurementResponseDTO getMeasurement() { return measurement; } + public boolean isAvailable() {return available; } + public ZonedDateTime getLastAccessAt() { return lastAccessAt; } + public Integer getMinResponseTime() { return minResponseTime; } + public Integer getMaxResponseTime() { return maxResponseTime; } + public Integer getMeanResponseTimeWithTimeout() { return meanResponseTimeWithTimeout; } + public Integer getMeanResponseTimeWithoutTimeout() { return meanResponseTimeWithoutTimeout; } + public Integer getJitterWithTimeout() { return jitterWithTimeout; } + public Integer getJitterWithoutTimeout() { return jitterWithoutTimeout; } + public Integer getLostPerMeasurementPercent() { return lostPerMeasurementPercent; } + public long getSent() { return sent; } + public long getReceived() { return received; } + public ZonedDateTime getCountStartedAt() { return countStartedAt; } + public long getSentAll() { return sentAll; } + public long getReceivedAll() { return receivedAll; } + public ZonedDateTime getCreatedAt() { return createdAt; } + public ZonedDateTime getUpdatedAt() { return updatedAt; } + + //------------------------------------------------------------------------------------------------- + public void setId(final long id) { this.id = id; } + public void setMeasurement(final QoSIntraMeasurementResponseDTO measurement) { this.measurement = measurement; } + public void setAvailable(final boolean available) { this.available = available; } + public void setLastAccessAt(final ZonedDateTime lastAccessAt) { this.lastAccessAt = lastAccessAt; } + public void setMinResponseTime(final Integer minResponseTime) { this.minResponseTime = minResponseTime; } + public void setMaxResponseTime(final Integer maxResponseTime) { this.maxResponseTime = maxResponseTime; } + public void setMeanResponseTimeWithTimeout(final Integer meanResponseTimeWithTimeout) { this.meanResponseTimeWithTimeout = meanResponseTimeWithTimeout; } + public void setMeanResponseTimeWithoutTimeout(final Integer meanResponseTimeWithoutTimeout) { this.meanResponseTimeWithoutTimeout = meanResponseTimeWithoutTimeout; } + public void setJitterWithTimeout(final Integer jitterWithTimeout) { this.jitterWithTimeout = jitterWithTimeout; } + public void setJitterWithoutTimeout(final Integer jitterWithoutTimeout) { this.jitterWithoutTimeout = jitterWithoutTimeout; } + public void setLostPerMeasurementPercent(final Integer lostPerMeasurementPercent) { this.lostPerMeasurementPercent = lostPerMeasurementPercent; } + public void setSent(final long sent) { this.sent = sent; } + public void setReceived(final long received) { this.received = received; } + public void setCountStartedAt(final ZonedDateTime countStartedAt) { this.countStartedAt = countStartedAt; } + public void setSentAll(final long sentAll) { this.sentAll = sentAll; } + public void setReceivedAll(final long receivedAll) { this.receivedAll = receivedAll; } + public void setCreatedAt(final ZonedDateTime createdAt) { this.createdAt = createdAt; } + public void setUpdatedAt(final ZonedDateTime updatedAt) { this.updatedAt = updatedAt; } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/QoSIntraMeasurementResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/QoSIntraMeasurementResponseDTO.java new file mode 100644 index 000000000..6641dc2e2 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/QoSIntraMeasurementResponseDTO.java @@ -0,0 +1,57 @@ +package eu.arrowhead.common.dto.internal; + +import java.io.Serializable; +import java.time.ZonedDateTime; + +import eu.arrowhead.common.dto.shared.QoSMeasurementType; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; + +public class QoSIntraMeasurementResponseDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = -8158447252910402563L; + + private long id; + private SystemResponseDTO system; + private QoSMeasurementType measurementType; + private ZonedDateTime lastMeasurementAt; + private ZonedDateTime createdAt; + private ZonedDateTime updatedAt; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public QoSIntraMeasurementResponseDTO() {} + + //------------------------------------------------------------------------------------------------- + public QoSIntraMeasurementResponseDTO(final long id, final SystemResponseDTO system, final QoSMeasurementType measurementType, + final ZonedDateTime lastMeasurementAt, final ZonedDateTime createdAt, final ZonedDateTime updatedAt) { + + this.id = id; + this.system = system; + this.measurementType = measurementType; + this.lastMeasurementAt = lastMeasurementAt; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + //------------------------------------------------------------------------------------------------- + public long getId() { return id; } + public SystemResponseDTO getSystem() { return system; } + public QoSMeasurementType getMeasurementType() { return measurementType; } + public ZonedDateTime getLastMeasurementAt() { return lastMeasurementAt; } + public ZonedDateTime getCreatedAt() { return createdAt; } + public ZonedDateTime getUpdatedAt() { return updatedAt; } + + //------------------------------------------------------------------------------------------------- + public void setId(final long id) { this.id = id; } + public void setSystem(final SystemResponseDTO system) { this.system = system; } + public void setMeasurementType(final QoSMeasurementType measurementType) { this.measurementType = measurementType; } + public void setLastMeasurementAt(final ZonedDateTime lastMeasurementAt) { this.lastMeasurementAt = lastMeasurementAt; } + public void setCreatedAt(final ZonedDateTime createdAt) { this.createdAt = createdAt; } + public void setUpdatedAt(final ZonedDateTime updatedAt) { this.updatedAt = updatedAt; } + +} \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java index 27a030ad0..9e4af9163 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java @@ -3,15 +3,28 @@ import org.apache.http.HttpStatus; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.CoreDefaults; +import eu.arrowhead.common.CoreUtilities; +import eu.arrowhead.common.CoreUtilities.ValidatedPageParams; import eu.arrowhead.common.Defaults; +import eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO; +import eu.arrowhead.common.dto.internal.PingMeasurementListResponseDTO; +import eu.arrowhead.common.exception.BadPayloadException; +import eu.arrowhead.core.qos.database.service.QoSDatabaseService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; @@ -24,9 +37,32 @@ @RestController @RequestMapping(CommonConstants.QOS_MONITOR_URI) public class QoSMonitorController { - + //================================================================================================= // members + private static final String PATH_VARIABLE_ID = "id"; + + private static final String PING_MEASUREMENTS = "/ping/measurements"; + private static final String QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI = CoreCommonConstants.MGMT_URI + PING_MEASUREMENTS; + private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_URI = QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI + "/{" + PATH_VARIABLE_ID + "}"; + private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_URI = CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT + "/{" + PATH_VARIABLE_ID + "}"; + + private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_MGMT_DESCRIPTION = "Return requested Ping-Measurements entries by the given parameters"; + private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_MGMT_HTTP_200_MESSAGE = "Ping-Measurement entries returned"; + private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_MGMT_HTTP_400_MESSAGE = "Could not retrieve Ping-Measurement entries"; + + private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_DESCRIPTION = "Return requested Ping-Measurements entries by system id."; + private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_HTTP_200_MESSAGE = "Ping-Measurement entrie returned"; + private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_HTTP_400_MESSAGE = "Could not retrieve Ping-Measurement entrie"; + + private static final String OP_GET_QOS_MONITOR_PING_MEASUREMENT_BY_SYSTEM_ID_DESCRIPTION = "Return requested Ping-Measurements entries by system id."; + private static final String OP_GET_QOS_MONITOR_PING_MEASUREMENT_BY_SYSTEM_ID_HTTP_200_MESSAGE = "Ping-Measurement entrie returned"; + private static final String OP_GET_QOS_MONITOR_PING_MEASUREMENT_BY_SYSTEM_ID_HTTP_400_MESSAGE = "Could not retrieve Ping-Measurement entrie"; + + private static final String ID_NOT_VALID_ERROR_MESSAGE = " Id must be greater than 0. "; + + @Autowired + private QoSDatabaseService qoSDatabaseService; private final Logger logger = LogManager.getLogger(QoSMonitorController.class); @@ -46,4 +82,74 @@ public String echoService() { return "Got it!"; } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = GET_QOS_MONITOR_PING_MEASUREMENTS_MGMT_DESCRIPTION, response = Page.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_QOS_MONITOR_PING_MEASUREMENTS_MGMT_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_QOS_MONITOR_PING_MEASUREMENTS_MGMT_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public PingMeasurementListResponseDTO getPingMeasurements( + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("New getMeasurements get request recieved with page: {} and item_per page: {}", page, size); + + final ValidatedPageParams validParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.QOS_MONITOR_URI + QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI); + final PingMeasurementListResponseDTO measurementResponse = qoSDatabaseService.getPingMeasurementResponse(validParameters.getValidatedPage(), validParameters.getValidatedSize(), + validParameters.getValidatedDirecion(), sortField); + + logger.debug("Measurements with page: {} and item_per page: {} retrieved successfully", page, size); + return measurementResponse; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_DESCRIPTION, response = PingMeasurementResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public PingMeasurementResponseDTO getManagementPingMeasurementBySystemId(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New getPingMeasurementBySystemId get request recieved with id: {}", id); + + final String origin = CommonConstants.QOS_MONITOR_URI + GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_URI; + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + final eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO pingMeasurementResponse = qoSDatabaseService.getPingMeasurementBySystemIdResponse(id); + + logger.debug("PingMeasurement entry with system id: {} successfully retrieved", id); + return pingMeasurementResponse; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = OP_GET_QOS_MONITOR_PING_MEASUREMENT_BY_SYSTEM_ID_DESCRIPTION, response = PingMeasurementResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_PRIVATE }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = OP_GET_QOS_MONITOR_PING_MEASUREMENT_BY_SYSTEM_ID_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = OP_GET_QOS_MONITOR_PING_MEASUREMENT_BY_SYSTEM_ID_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public PingMeasurementResponseDTO getPingMeasurementBySystemId(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New getPingMeasurementBySystemId get request recieved with id: {}", id); + + final String origin = CommonConstants.QOS_MONITOR_URI + GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_URI; + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + final PingMeasurementResponseDTO pingMeasurementResponse = qoSDatabaseService.getPingMeasurementBySystemIdResponse(id); + + logger.debug("PingMeasurement entry with system id: {} successfully retrieved", id); + return pingMeasurementResponse; + } } \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java index 412be1dba..9274aecfc 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java @@ -9,10 +9,15 @@ import org.apache.logging.log4j.Logger; import org.icmp4j.IcmpPingResponse; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort.Direction; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.Utilities; import eu.arrowhead.common.database.entity.QoSIntraMeasurement; import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; import eu.arrowhead.common.database.entity.QoSIntraPingMeasurementLog; @@ -23,9 +28,13 @@ import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogDetailsRepository; import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogRepository; import eu.arrowhead.common.database.repository.SystemRepository; +import eu.arrowhead.common.dto.internal.DTOConverter; +import eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO; +import eu.arrowhead.common.dto.internal.PingMeasurementListResponseDTO; import eu.arrowhead.common.dto.shared.QoSMeasurementType; import eu.arrowhead.common.dto.shared.SystemResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.common.exception.InvalidParameterException; import eu.arrowhead.core.qos.dto.PingMeasurementCalculationsDTO; @Service @@ -34,6 +43,15 @@ public class QoSDatabaseService { //================================================================================================= // members + private static final String LESS_THAN_ONE_ERROR_MESSAGE= " must be greater than zero."; + private static final String NOT_AVAILABLE_SORTABLE_FIELD_ERROR_MESSAGE = " sortable field is not available."; + private static final String NOT_IN_DB_ERROR_MESSAGE = " is not available in database"; + private static final String EMPTY_OR_NULL_ERROR_MESSAGE = " is empty or null"; + private static final String NULL_ERROR_MESSAGE = " is null"; + private static final String VIOLATES_UNIQUE_CONSTRAINT = " violates uniqueConstraint rules"; + private static final String IS_BEFORE_TOLERATED_DIFF_ERROR_MESSAGE = " is further in the past than the tolerated time difference"; + private static final String INVALID_TYPE_ERROR_MESSAGE = " is not valid."; + @Autowired private QoSIntraMeasurementRepository qoSIntraMeasurementRepository; @@ -106,7 +124,7 @@ public QoSIntraMeasurement getMeasurement(final SystemResponseDTO systemResponse system = systemOptional.get(); }else { - throw new ArrowheadException("Requested system is not in DB"); + throw new ArrowheadException("Requested system" + NOT_IN_DB_ERROR_MESSAGE); } final QoSIntraMeasurement measurement; @@ -275,4 +293,78 @@ public void updateMeasurement(final ZonedDateTime aroundNow, final QoSIntraMeasu } } + //------------------------------------------------------------------------------------------------- + public PingMeasurementListResponseDTO getPingMeasurementResponse(final int page, final int size, final Direction direction, final String sortField) { + logger.debug("getPingMeasurementResponse started..."); + + return DTOConverter.convertQoSIntraPingMeasurementPageToPingMeasurementListResponseDTO(getPingMeasurementPage(page, size, direction, sortField)); + } + + //------------------------------------------------------------------------------------------------- + public Page getPingMeasurementPage(final int page, final int size, final Direction direction, final String sortField) { + logger.debug("getPingMeasurementPage started..."); + + final int validatedPage = page < 0 ? 0 : page; + final int validatedSize = size < 1 ? Integer.MAX_VALUE : size; + final Direction validatedDirection = direction == null ? Direction.ASC : direction; + final String validatedSortField = Utilities.isEmpty(sortField) ? CommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); + + if (!QoSIntraPingMeasurement.SORTABLE_FIELDS_BY.contains(validatedSortField)) { + throw new InvalidParameterException(validatedSortField + NOT_AVAILABLE_SORTABLE_FIELD_ERROR_MESSAGE); + } + + try { + return qoSIntraMeasurementPingRepository.findAll(PageRequest.of(validatedPage, validatedSize, validatedDirection, validatedSortField)); + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + + //------------------------------------------------------------------------------------------------- + public PingMeasurementResponseDTO getPingMeasurementBySystemIdResponse(final long id) { + logger.debug("getPingMeasurementBySystemIdResponse started ..."); + + return DTOConverter.convertQoSIntraPingMeasurementToPingMeasurementResponseDTO(getPingMeasurementById(id)); + } + + //------------------------------------------------------------------------------------------------- + public QoSIntraPingMeasurement getPingMeasurementById(final long id) { + logger.debug("getPingMeasurementById started ..."); + + if (id < 1) { + throw new InvalidParameterException("SubscriberSystemId" + LESS_THAN_ONE_ERROR_MESSAGE); + } + + final System system; + final Optional systemOptional = systemRepository.findById(id); + if (systemOptional.isPresent()) { + system = systemOptional.get(); + }else { + throw new ArrowheadException("Requested system" + NOT_IN_DB_ERROR_MESSAGE); + } + + final QoSIntraMeasurement measurement; + final Optional qoSIntraMeasurementOptional = qoSIntraMeasurementRepository.findBySystemAndMeasurementType(system, QoSMeasurementType.PING); + if (qoSIntraMeasurementOptional.isEmpty()) { + throw new InvalidParameterException("QoSIntraMeasurement with system id of '" + id + "' not exists"); + }else { + measurement = qoSIntraMeasurementOptional.get(); + } + + try { + final Optional measurementOptional = qoSIntraMeasurementPingRepository.findByMeasurement(measurement); + if (measurementOptional.isPresent()) { + return measurementOptional.get(); + } else { + throw new InvalidParameterException("PingMeasurement with id of '" + id + "' not exists"); + } + } catch (final InvalidParameterException ex) { + throw ex; + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + } + } \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilter.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilter.java index f1ac7aa19..18ae03357 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilter.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilter.java @@ -6,6 +6,8 @@ import org.springframework.stereotype.Component; import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.core.CoreSystem; import eu.arrowhead.common.security.CoreSystemAccessControlFilter; @Component @@ -14,7 +16,8 @@ public class QosMonitorAccessControlFilter extends CoreSystemAccessControlFilter //================================================================================================= // members - + private static final CoreSystem[] allowedCoreSystemsForGetMeasurements = { CoreSystem.ORCHESTRATOR }; + //================================================================================================= // assistant methods @@ -23,6 +26,17 @@ public class QosMonitorAccessControlFilter extends CoreSystemAccessControlFilter protected void checkClientAuthorized(final String clientCN, final String method, final String requestTarget, final String requestJSON, final Map queryParams) { super.checkClientAuthorized(clientCN, method, requestTarget, requestJSON, queryParams); - //TODO: add custom rules here + final String cloudCN = getServerCloudCN(); + + if (requestTarget.endsWith(CommonConstants.ECHO_URI)) { + // Everybody in the local cloud can test the server => no further check is necessary + } else if ( requestTarget.contains( CoreCommonConstants.MGMT_URI ) ) { + // Only the local System Operator can use these methods + checkIfLocalSystemOperator(clientCN, cloudCN, requestTarget); + }else if (requestTarget.endsWith(CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT)) { + // Only the specified core systems can use these methods + checkIfClientIsAnAllowedCoreSystem(clientCN, cloudCN, allowedCoreSystemsForGetMeasurements, requestTarget); + } } + } \ No newline at end of file From f939ad9d089d23ca96ce0477a08b96e926bfd004 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 4 Feb 2020 10:47:27 +0100 Subject: [PATCH 085/301] added final --- .../common/database/entity/QoSIntraPingMeasurementLog.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLog.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLog.java index aa7696ba3..d8a306891 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLog.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLog.java @@ -4,8 +4,6 @@ import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @@ -13,9 +11,6 @@ import javax.persistence.PreUpdate; import javax.persistence.Table; -import eu.arrowhead.common.CoreDefaults; -import eu.arrowhead.common.dto.shared.QoSMeasurementType; - @Entity @Table(name = "qos_intra_ping_measurement_log") public class QoSIntraPingMeasurementLog { @@ -114,6 +109,6 @@ public void onUpdate() { public void setLostPerMeasurementPercent(final Integer lostPerMeasurementPercent) { this.lostPerMeasurementPercent = lostPerMeasurementPercent; } public void setSent(final long sent) { this.sent = sent; } public void setReceived(final long received) { this.received = received; } - public void setMeasuredAt(ZonedDateTime measuredAt) { this.measuredAt = measuredAt; } + public void setMeasuredAt(final ZonedDateTime measuredAt) { this.measuredAt = measuredAt; } } From 3417174ce4527f5b8aedb59c8ce79d6516755420 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 4 Feb 2020 10:49:33 +0100 Subject: [PATCH 086/301] added MeasurementSequenceNumber column --- .../QoSIntraPingMeasurementLogDetails.java | 25 +++++++++------ .../core/qos/quartz/task/PingTask.java | 32 +++++++++---------- scripts/create_arrowhead_tables.sql | 1 + 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLogDetails.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLogDetails.java index 357f68cab..f19de5443 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLogDetails.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurementLogDetails.java @@ -29,6 +29,9 @@ public class QoSIntraPingMeasurementLogDetails { @JoinColumn(name = "measurement_log_id", referencedColumnName = "id", nullable = false, unique = true) private QoSIntraPingMeasurementLog measurementLog; + @Column(name = "measurement_sequenece_number", nullable = false) + private int measurementSequeneceNumber; + @Column(name = "success_flag", nullable = false) private boolean successFlag = false; @@ -83,6 +86,7 @@ public void onUpdate() { //------------------------------------------------------------------------------------------------- public QoSIntraPingMeasurementLog getMeasurementLog() { return measurementLog; } + public int getMeasurementSequeneceNumber() { return measurementSequeneceNumber; } public boolean isSuccessFlag() { return successFlag; } public boolean isTimeoutFlag() { return timeoutFlag; } public String getErrorMessage() { return errorMessage; } @@ -94,15 +98,16 @@ public void onUpdate() { public ZonedDateTime getMeasuredAt() { return measuredAt; } //------------------------------------------------------------------------------------------------- - public void setMeasurementLog(QoSIntraPingMeasurementLog measurementLog) { this.measurementLog = measurementLog; } - public void setSuccessFlag(boolean successFlag) { this.successFlag = successFlag; } - public void setTimeoutFlag(boolean timeoutFlag) { this.timeoutFlag = timeoutFlag; } - public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } - public void setThrowable(String throwable) { this.throwable = throwable; } - public void setSize(Integer size) { this.size = size; } - public void setRtt(Integer rtt) { this.rtt = rtt; } - public void setTtl(Integer ttl) { this.ttl = ttl; } - public void setDuration(Integer duration) { this.duration = duration; } - public void setMeasuredAt(ZonedDateTime measuredAt) { this.measuredAt = measuredAt; } + public void setMeasurementLog(final QoSIntraPingMeasurementLog measurementLog) { this.measurementLog = measurementLog; } + public void setMeasurementSequeneceNumber(final int measurementSequeneceNumber) { this.measurementSequeneceNumber = measurementSequeneceNumber; } + public void setSuccessFlag(final boolean successFlag) { this.successFlag = successFlag; } + public void setTimeoutFlag(final boolean timeoutFlag) { this.timeoutFlag = timeoutFlag; } + public void setErrorMessage(final String errorMessage) { this.errorMessage = errorMessage; } + public void setThrowable(final String throwable) { this.throwable = throwable; } + public void setSize(final Integer size) { this.size = size; } + public void setRtt(final Integer rtt) { this.rtt = rtt; } + public void setTtl(final Integer ttl) { this.ttl = ttl; } + public void setDuration(final Integer duration) { this.duration = duration; } + public void setMeasuredAt(final ZonedDateTime measuredAt) { this.measuredAt = measuredAt; } } diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 39804e32d..0a91957f7 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -40,6 +40,7 @@ import eu.arrowhead.common.http.HttpService; import eu.arrowhead.core.qos.database.service.QoSDatabaseService; import eu.arrowhead.core.qos.dto.PingMeasurementCalculationsDTO; +import eu.arrowhead.core.qos.measurement.properties.PingMeasurementProperties; @Component @DisallowConcurrentExecution @@ -48,16 +49,15 @@ public class PingTask implements Job { //================================================================================================= // members private static final String NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE = " is null or blank."; - private static final int TIMES_TO_REPEAT = 35; - private static final int PING_TIME_OUT = 5000; - private static final int PING_POCKET_SIZE = 32; - private static final int REST_BETWEEN_PINGS_MILLSEC = 1000; private static final boolean LOG_MEASUREMENT = true; private static final boolean LOG_MEASUREMENT_DETAILS = true; protected Logger logger = LogManager.getLogger(PingTask.class); + @Autowired + private PingMeasurementProperties pingMeasurementProperties; + @Autowired private QoSDatabaseService qoSDatabaseService; @@ -99,7 +99,7 @@ private Set getSystemsToMeasure() { } //------------------------------------------------------------------------------------------------- - private PingMeasurementCalculationsDTO calculatePingMeasurementValues(List responseList) { + private PingMeasurementCalculationsDTO calculatePingMeasurementValues(final List responseList) { logger.debug("calculatePingMeasurementValues started..."); final int sentInThisPing = responseList.size(); @@ -116,7 +116,7 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(List getPingResponseList(final String address) { logger.debug("getPingResponseList started..."); - final List responseList = new ArrayList<>(TIMES_TO_REPEAT); + final List responseList = new ArrayList<>(pingMeasurementProperties.getTimeToRepeat()); try { final IcmpPingRequest request = IcmpPingUtil.createIcmpPingRequest (); request.setHost (address); - request.setTimeout(PING_TIME_OUT); - request.setPacketSize(PING_POCKET_SIZE); + request.setTimeout(pingMeasurementProperties.getTimeout()); + request.setPacketSize(pingMeasurementProperties.getPocketSize()); - for (int count = 0; count < TIMES_TO_REPEAT; count ++) { + for (int count = 0; count < pingMeasurementProperties.getTimeToRepeat(); count ++) { IcmpPingResponse response; try { response = IcmpPingUtil.executePingRequest (request); @@ -295,7 +295,7 @@ private List getPingResponseList(final String address) { responseList.add(response); } - Thread.sleep (REST_BETWEEN_PINGS_MILLSEC); + Thread.sleep (pingMeasurementProperties.getRest()); } } catch ( final InterruptedException | IllegalArgumentException ex) { logger.debug("" + ex.getMessage()); diff --git a/scripts/create_arrowhead_tables.sql b/scripts/create_arrowhead_tables.sql index 39b88aa18..78677d895 100644 --- a/scripts/create_arrowhead_tables.sql +++ b/scripts/create_arrowhead_tables.sql @@ -392,6 +392,7 @@ CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement_log` ( CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement_log_details` ( `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, `measurement_log_id` bigint(20) NOT NULL, + `measurement_sequenece_number` int(3) NOT NULL, `success_flag` int(1) NOT NULL DEFAULT 0, `timeout_flag` int(1) NOT NULL DEFAULT 0, `error_message` varchar(255) NOT NULL, From 7c931cb2654eab4d2ea856d4aa4423af84237611 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 4 Feb 2020 10:51:26 +0100 Subject: [PATCH 087/301] added PingMeasurementProperties --- .../eu/arrowhead/core/qos/QoSMonitorMain.java | 3 ++ .../database/service/QoSDatabaseService.java | 17 ++++--- .../properties/PingMeasurementProperties.java | 45 +++++++++++++++++++ ...itional-spring-configuration-metadata.json | 10 +++++ .../src/main/resources/application.properties | 16 +++++++ 5 files changed, 82 insertions(+), 9 deletions(-) create mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorMain.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorMain.java index b629e6057..2346305aa 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorMain.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorMain.java @@ -3,15 +3,18 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.ComponentScan; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.database.repository.RefreshableRepositoryImpl; +import eu.arrowhead.core.qos.measurement.properties.PingMeasurementProperties; import springfox.documentation.swagger2.annotations.EnableSwagger2; @SpringBootApplication +@EnableConfigurationProperties(PingMeasurementProperties.class) @ComponentScan (CommonConstants.BASE_PACKAGE) @EntityScan (CoreCommonConstants.DATABASE_ENTITY_PACKAGE) @EnableJpaRepositories (basePackages = CoreCommonConstants.DATABASE_REPOSITORY_PACKAGE, repositoryBaseClass = RefreshableRepositoryImpl.class) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java index 9274aecfc..4a9fa480a 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java @@ -46,11 +46,6 @@ public class QoSDatabaseService { private static final String LESS_THAN_ONE_ERROR_MESSAGE= " must be greater than zero."; private static final String NOT_AVAILABLE_SORTABLE_FIELD_ERROR_MESSAGE = " sortable field is not available."; private static final String NOT_IN_DB_ERROR_MESSAGE = " is not available in database"; - private static final String EMPTY_OR_NULL_ERROR_MESSAGE = " is empty or null"; - private static final String NULL_ERROR_MESSAGE = " is null"; - private static final String VIOLATES_UNIQUE_CONSTRAINT = " violates uniqueConstraint rules"; - private static final String IS_BEFORE_TOLERATED_DIFF_ERROR_MESSAGE = " is further in the past than the tolerated time difference"; - private static final String INVALID_TYPE_ERROR_MESSAGE = " is not valid."; @Autowired private QoSIntraMeasurementRepository qoSIntraMeasurementRepository; @@ -220,10 +215,12 @@ public void logMeasurementDetailsToDB(final QoSIntraPingMeasurementLog measureme final List measurementLogDetailsList = new ArrayList<>(responseList.size()); + int measurementSequenece = 0; for (final IcmpPingResponse icmpPingResponse : responseList) { final QoSIntraPingMeasurementLogDetails measurementLogDetails = new QoSIntraPingMeasurementLogDetails(); measurementLogDetails.setMeasurementLog(measurementLogSaved); + measurementLogDetails.setMeasurementSequeneceNumber( measurementSequenece++ ); measurementLogDetails.setSuccessFlag(icmpPingResponse.getSuccessFlag()); measurementLogDetails.setTimeoutFlag(icmpPingResponse.getTimeoutFlag()); measurementLogDetails.setErrorMessage(icmpPingResponse.getErrorMessage()); @@ -325,12 +322,12 @@ public Page getPingMeasurementPage(final int page, fina public PingMeasurementResponseDTO getPingMeasurementBySystemIdResponse(final long id) { logger.debug("getPingMeasurementBySystemIdResponse started ..."); - return DTOConverter.convertQoSIntraPingMeasurementToPingMeasurementResponseDTO(getPingMeasurementById(id)); + return DTOConverter.convertQoSIntraPingMeasurementToPingMeasurementResponseDTO(getPingMeasurementBySystemId(id)); } //------------------------------------------------------------------------------------------------- - public QoSIntraPingMeasurement getPingMeasurementById(final long id) { - logger.debug("getPingMeasurementById started ..."); + public QoSIntraPingMeasurement getPingMeasurementBySystemId(final long id) { + logger.debug("getPingMeasurementBySystemId started ..."); if (id < 1) { throw new InvalidParameterException("SubscriberSystemId" + LESS_THAN_ONE_ERROR_MESSAGE); @@ -355,9 +352,11 @@ public QoSIntraPingMeasurement getPingMeasurementById(final long id) { try { final Optional measurementOptional = qoSIntraMeasurementPingRepository.findByMeasurement(measurement); if (measurementOptional.isPresent()) { + return measurementOptional.get(); + } else { - throw new InvalidParameterException("PingMeasurement with id of '" + id + "' not exists"); + throw new InvalidParameterException("PingMeasurement with system id of '" + id + "' not exists"); } } catch (final InvalidParameterException ex) { throw ex; diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java new file mode 100644 index 000000000..43f09201b --- /dev/null +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java @@ -0,0 +1,45 @@ +package eu.arrowhead.core.qos.measurement.properties; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Configuration +@ConfigurationProperties(prefix = "ping") +public class PingMeasurementProperties { + + //================================================================================================= + // members + + private int timeToRepeat; + private int timeout; + private int pocketSize; + private int rest; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public PingMeasurementProperties() {} + + //------------------------------------------------------------------------------------------------- + public PingMeasurementProperties(final int timeToRepeat, final int timeout, final int pocketSize, final int rest) { + + this.timeToRepeat = timeToRepeat; + this.timeout = timeout; + this.pocketSize = pocketSize; + this.rest = rest; + } + + //------------------------------------------------------------------------------------------------- + public int getTimeToRepeat() { return timeToRepeat; } + public int getTimeout() { return timeout; } + public int getPocketSize() { return pocketSize; } + public int getRest() { return rest; } + + //------------------------------------------------------------------------------------------------- + public void setTimeToRepeat(final int timeToRepeat) { this.timeToRepeat = timeToRepeat; } + public void setTimeout(final int timeout) { this.timeout = timeout; } + public void setPocketSize(final int pocketSize) { this.pocketSize = pocketSize; } + public void setRest(final int rest) { this.rest = rest; } + +} diff --git a/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 4a240f9ba..3f8638b92 100644 --- a/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -48,5 +48,15 @@ "name": "ping_ttl_interval", "type": "java.lang.String", "description": "A description for 'ping_ttl_interval'" + }, + { + "name": "ping.pocket_size", + "type": "java.lang.Integer", + "description": "A description for 'ping.pocket_size'" + }, + { + "name": "ping.time_to_repeat", + "type": "java.lang.Integer", + "description": "A description for 'ping.time_to_repeat'" } ]} \ No newline at end of file diff --git a/qos-monitor/src/main/resources/application.properties b/qos-monitor/src/main/resources/application.properties index 134e30d05..2e096690e 100644 --- a/qos-monitor/src/main/resources/application.properties +++ b/qos-monitor/src/main/resources/application.properties @@ -43,6 +43,22 @@ cloud_ping_ttl_interval=2 ping_ttl_interval=2 +############################################ +### PING MEASUREMENT PARAMETERS ### +############################################ + +# Set times to repeat the ping per measurement +ping.time_to_repeat=35 + +# Set timeout of ping +ping.timeout=5000 + +# Set pocket size of ping +ping.pocket_size=32 + +# Set millsec to sleep between single pings in a measurement +ping.rest=1000 + ############################################ ### SECURE MODE ### ############################################ From 7fad1cdf2c96c09140aef5ed859a64d157001aac Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 4 Feb 2020 11:09:39 +0100 Subject: [PATCH 088/301] renamed QoSDatabaseService to QoSDBService --- .../core/qos/QoSMonitorController.java | 10 ++++----- ...DatabaseService.java => QoSDBService.java} | 4 ++-- .../qos/quartz/task/CountRestarterTask.java | 6 ++--- .../core/qos/quartz/task/PingTask.java | 22 +++++++++---------- 4 files changed, 21 insertions(+), 21 deletions(-) rename qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/{QoSDatabaseService.java => QoSDBService.java} (99%) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java index 9e4af9163..c9810ba4b 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java @@ -24,7 +24,7 @@ import eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO; import eu.arrowhead.common.dto.internal.PingMeasurementListResponseDTO; import eu.arrowhead.common.exception.BadPayloadException; -import eu.arrowhead.core.qos.database.service.QoSDatabaseService; +import eu.arrowhead.core.qos.database.service.QoSDBService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; @@ -62,7 +62,7 @@ public class QoSMonitorController { private static final String ID_NOT_VALID_ERROR_MESSAGE = " Id must be greater than 0. "; @Autowired - private QoSDatabaseService qoSDatabaseService; + private QoSDBService qoSDBService; private final Logger logger = LogManager.getLogger(QoSMonitorController.class); @@ -100,7 +100,7 @@ public String echoService() { logger.debug("New getMeasurements get request recieved with page: {} and item_per page: {}", page, size); final ValidatedPageParams validParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.QOS_MONITOR_URI + QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI); - final PingMeasurementListResponseDTO measurementResponse = qoSDatabaseService.getPingMeasurementResponse(validParameters.getValidatedPage(), validParameters.getValidatedSize(), + final PingMeasurementListResponseDTO measurementResponse = qoSDBService.getPingMeasurementResponse(validParameters.getValidatedPage(), validParameters.getValidatedSize(), validParameters.getValidatedDirecion(), sortField); logger.debug("Measurements with page: {} and item_per page: {} retrieved successfully", page, size); @@ -124,7 +124,7 @@ public String echoService() { throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); } - final eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO pingMeasurementResponse = qoSDatabaseService.getPingMeasurementBySystemIdResponse(id); + final eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO pingMeasurementResponse = qoSDBService.getPingMeasurementBySystemIdResponse(id); logger.debug("PingMeasurement entry with system id: {} successfully retrieved", id); return pingMeasurementResponse; @@ -147,7 +147,7 @@ public String echoService() { throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); } - final PingMeasurementResponseDTO pingMeasurementResponse = qoSDatabaseService.getPingMeasurementBySystemIdResponse(id); + final PingMeasurementResponseDTO pingMeasurementResponse = qoSDBService.getPingMeasurementBySystemIdResponse(id); logger.debug("PingMeasurement entry with system id: {} successfully retrieved", id); return pingMeasurementResponse; diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java similarity index 99% rename from qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java rename to qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index 4a9fa480a..c5d345252 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDatabaseService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -38,7 +38,7 @@ import eu.arrowhead.core.qos.dto.PingMeasurementCalculationsDTO; @Service -public class QoSDatabaseService { +public class QoSDBService { //================================================================================================= // members @@ -62,7 +62,7 @@ public class QoSDatabaseService { @Autowired private SystemRepository systemRepository; - protected Logger logger = LogManager.getLogger(QoSDatabaseService.class); + protected Logger logger = LogManager.getLogger(QoSDBService.class); //================================================================================================= // methods diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java index f43da6b5a..2dff87698 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java @@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import eu.arrowhead.core.qos.database.service.QoSDatabaseService; +import eu.arrowhead.core.qos.database.service.QoSDBService; @Component @DisallowConcurrentExecution @@ -21,7 +21,7 @@ public class CountRestarterTask implements Job { protected Logger logger = LogManager.getLogger(CountRestarterTask.class); @Autowired - private QoSDatabaseService qoSDatabaseService; + private QoSDBService qoSDBService; //================================================================================================= // methods @@ -31,7 +31,7 @@ public class CountRestarterTask implements Job { public void execute(final JobExecutionContext context) throws JobExecutionException { logger.debug("STARTED: count restarter task"); - qoSDatabaseService.updateCountStartedAt(); + qoSDBService.updateCountStartedAt(); logger.debug("Finished: count restarter task"); } diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 0a91957f7..88ffdf70a 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -38,7 +38,7 @@ import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.exception.InvalidParameterException; import eu.arrowhead.common.http.HttpService; -import eu.arrowhead.core.qos.database.service.QoSDatabaseService; +import eu.arrowhead.core.qos.database.service.QoSDBService; import eu.arrowhead.core.qos.dto.PingMeasurementCalculationsDTO; import eu.arrowhead.core.qos.measurement.properties.PingMeasurementProperties; @@ -59,7 +59,7 @@ public class PingTask implements Job { private PingMeasurementProperties pingMeasurementProperties; @Autowired - private QoSDatabaseService qoSDatabaseService; + private QoSDBService qoSDBService; @Autowired private HttpService httpService; @@ -191,10 +191,10 @@ private void pingSystem(final SystemResponseDTO systemResponseDTO ) { final List responseList = getPingResponseList(address); - final QoSIntraMeasurement measurement = qoSDatabaseService.getMeasurement(systemResponseDTO, aroundNow); + final QoSIntraMeasurement measurement = qoSDBService.getMeasurement(systemResponseDTO, aroundNow); handlePingMeasurement(measurement, responseList, aroundNow); - qoSDatabaseService.updateMeasurement(aroundNow, measurement); + qoSDBService.updateMeasurement(aroundNow, measurement); } @@ -204,33 +204,33 @@ private void handlePingMeasurement(final QoSIntraMeasurement measurement, logger.debug("handelPingMeasurement started..."); final PingMeasurementCalculationsDTO calculationsDTO = calculatePingMeasurementValues(responseList); - final Optional pingMeasurementOptional = qoSDatabaseService.getPingMeasurementByMeasurement(measurement); + final Optional pingMeasurementOptional = qoSDBService.getPingMeasurementByMeasurement(measurement); if (pingMeasurementOptional.isEmpty()) { - qoSDatabaseService.createPingMeasurement(measurement, responseList, calculationsDTO, aroundNow); + qoSDBService.createPingMeasurement(measurement, responseList, calculationsDTO, aroundNow); if(LOG_MEASUREMENT) { - final QoSIntraPingMeasurementLog measurementLogSaved = qoSDatabaseService.logMeasurementToDB(measurement.getSystem().getAddress(), calculationsDTO, aroundNow); + final QoSIntraPingMeasurementLog measurementLogSaved = qoSDBService.logMeasurementToDB(measurement.getSystem().getAddress(), calculationsDTO, aroundNow); if(LOG_MEASUREMENT_DETAILS && measurementLogSaved != null) { - qoSDatabaseService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); + qoSDBService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); } } }else { - qoSDatabaseService.updatePingMeasurement(measurement, calculationsDTO, pingMeasurementOptional.get(), aroundNow); + qoSDBService.updatePingMeasurement(measurement, calculationsDTO, pingMeasurementOptional.get(), aroundNow); if(LOG_MEASUREMENT) { - final QoSIntraPingMeasurementLog measurementLogSaved = qoSDatabaseService.logMeasurementToDB(measurement.getSystem().getAddress(), calculationsDTO, aroundNow); + final QoSIntraPingMeasurementLog measurementLogSaved = qoSDBService.logMeasurementToDB(measurement.getSystem().getAddress(), calculationsDTO, aroundNow); if(LOG_MEASUREMENT_DETAILS && measurementLogSaved != null) { - qoSDatabaseService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); + qoSDBService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); } } } From 717269b4b7af6a0cc35e59287c1da5234b5c69de Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 4 Feb 2020 12:19:43 +0100 Subject: [PATCH 089/301] started to implement qos-monitor controller tests --- .../core/qos/QoSMonitorControllerTest.java | 159 ++++++++++++++++++ .../core/qos/QoSMonitorTestContext.java | 22 +++ .../qos/StandaloneModeInQoSMonitorTests.java | 10 ++ 3 files changed, 191 insertions(+) create mode 100644 qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java create mode 100644 qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorTestContext.java create mode 100644 qos-monitor/src/test/java/eu/arrowhead/core/qos/StandaloneModeInQoSMonitorTests.java diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java new file mode 100644 index 000000000..54fc70174 --- /dev/null +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java @@ -0,0 +1,159 @@ +package eu.arrowhead.core.qos; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.when; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import java.time.ZonedDateTime; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.http.MediaType; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.MvcResult; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.web.context.WebApplicationContext; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO; +import eu.arrowhead.common.dto.internal.QoSIntraMeasurementResponseDTO; +import eu.arrowhead.common.dto.internal.RelayResponseDTO; +import eu.arrowhead.common.dto.shared.QoSMeasurementType; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import eu.arrowhead.core.qos.database.service.QoSDBService; +import eu.arrowhead.core.qos.measurement.properties.PingMeasurementProperties; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = QoSMonitorMain.class) +@ContextConfiguration(classes = { QoSMonitorTestContext.class }) +public class QoSMonitorControllerTest { + + //================================================================================================= + // members + + private static final String PATH_VARIABLE_ID = "id"; + private static final String PING_MEASUREMENTS = "/ping/measurements"; + private static final String QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI = CoreCommonConstants.MGMT_URI + PING_MEASUREMENTS; + private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_URI = QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI + "/{" + PATH_VARIABLE_ID + "}"; + private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_URI = CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT + "/{" + PATH_VARIABLE_ID + "}"; + + + @Autowired + private WebApplicationContext wac; + + private MockMvc mockMvc; + + @Autowired + private ObjectMapper objectMapper; + + @MockBean(name = "mockQoSDBService") + QoSDBService qoSDBService; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Before + public void setup() { + this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void echoTest() throws Exception { + this.mockMvc.perform(get(CommonConstants.QOS_MONITOR_URI + CommonConstants.ECHO_URI) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()); + } + + //================================================================================================= + // Test of getManagementPingMeasurementBySystemId + + //------------------------------------------------------------------------------------------------- + @Test + public void getManagementPingMeasurementBySystemIdTest() throws Exception { + final int requestedId = 1; + final PingMeasurementResponseDTO pingMeasurementResponseDTO = getPingMeasurementResponseDTOForTest(); + + when(qoSDBService.getPingMeasurementBySystemIdResponse(anyLong())).thenReturn(pingMeasurementResponseDTO); + + final MvcResult response = this.mockMvc.perform(get(CommonConstants.QOS_MONITOR_URI + QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI + "/" + requestedId) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final PingMeasurementResponseDTO responseBody = objectMapper.readValue(response.getResponse().getContentAsString(), PingMeasurementResponseDTO.class); + assertEquals(requestedId, responseBody.getId()); + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private PingMeasurementResponseDTO getPingMeasurementResponseDTOForTest() { + + final QoSIntraMeasurementResponseDTO qoSIntraMeasurementResponseDTO = getQoSIntraMeasurementResponseDTOForTest(); + + final PingMeasurementResponseDTO pingMeasurementResponseDTO = new PingMeasurementResponseDTO(); + pingMeasurementResponseDTO.setId(1); + pingMeasurementResponseDTO.setMeasurement(qoSIntraMeasurementResponseDTO); + pingMeasurementResponseDTO.setAvailable(true); + pingMeasurementResponseDTO.setLastAccessAt(ZonedDateTime.now()); + pingMeasurementResponseDTO.setMinResponseTime(1); + pingMeasurementResponseDTO.setMaxResponseTime(1); + pingMeasurementResponseDTO.setMeanResponseTimeWithTimeout(1); + pingMeasurementResponseDTO.setMeanResponseTimeWithoutTimeout(1); + pingMeasurementResponseDTO.setJitterWithTimeout(0); + pingMeasurementResponseDTO.setJitterWithoutTimeout(0); + pingMeasurementResponseDTO.setLostPerMeasurementPercent(0); + pingMeasurementResponseDTO.setSent(35); + pingMeasurementResponseDTO.setReceived(35); + pingMeasurementResponseDTO.setCountStartedAt(ZonedDateTime.now()); + pingMeasurementResponseDTO.setSentAll(35); + pingMeasurementResponseDTO.setReceivedAll(35); + pingMeasurementResponseDTO.setCreatedAt(ZonedDateTime.now()); + pingMeasurementResponseDTO.setUpdatedAt(ZonedDateTime.now()); + + return pingMeasurementResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + private QoSIntraMeasurementResponseDTO getQoSIntraMeasurementResponseDTOForTest() { + + final SystemResponseDTO system = getSystemResponseDTOForTest(); + + return new QoSIntraMeasurementResponseDTO( + 1,//measurement.getId(), + system, + QoSMeasurementType.PING,//measurement.getMeasurementType(), + ZonedDateTime.now(),//measurement.getLastMeasurementAt(), + ZonedDateTime.now(),//measurement.getCreatedAt(), + ZonedDateTime.now());//measurement.getUpdatedAt()); + } + + //------------------------------------------------------------------------------------------------- + private SystemResponseDTO getSystemResponseDTOForTest() { + + return new SystemResponseDTO( + 1L, + "testSystemName",//system.getSystemName(), + "localhost",//system.getAddress(), + 12345,//system.getPort(), + "authinfo",//system.getAuthenticationInfo(), + Utilities.convertZonedDateTimeToUTCString(ZonedDateTime.now()), + Utilities.convertZonedDateTimeToUTCString(ZonedDateTime.now())); + + } +} diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorTestContext.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorTestContext.java new file mode 100644 index 000000000..98d9170f7 --- /dev/null +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorTestContext.java @@ -0,0 +1,22 @@ +package eu.arrowhead.core.qos; + +import org.mockito.Mockito; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; + +import eu.arrowhead.core.qos.database.service.QoSDBService; + +@Configuration +public class QoSMonitorTestContext { + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Bean + @Primary // This bean is primary only in test context + public QoSDBService mockQoSDBService() { + return Mockito.mock(QoSDBService.class); + } +} diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/StandaloneModeInQoSMonitorTests.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/StandaloneModeInQoSMonitorTests.java new file mode 100644 index 000000000..2c3ef196c --- /dev/null +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/StandaloneModeInQoSMonitorTests.java @@ -0,0 +1,10 @@ +package eu.arrowhead.core.qos; + +import org.springframework.stereotype.Component; + +import eu.arrowhead.common.testhelper.StandaloneModeInTests; + +@Component +public class StandaloneModeInQoSMonitorTests extends StandaloneModeInTests { + +} From 11020a17667c1f9b7c76a3ae2f626391fef3f5a2 Mon Sep 17 00:00:00 2001 From: borditamas Date: Tue, 4 Feb 2020 12:21:41 +0100 Subject: [PATCH 090/301] fix debian installer relay truststore path --- core-common/src/deb/ah_gen_relay_cert.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-common/src/deb/ah_gen_relay_cert.sh b/core-common/src/deb/ah_gen_relay_cert.sh index b5f664bab..1ad1a10e4 100644 --- a/core-common/src/deb/ah_gen_relay_cert.sh +++ b/core-common/src/deb/ah_gen_relay_cert.sh @@ -13,7 +13,7 @@ RELAY_HOST=${5} RELAY_IP=${6} RELAY_STORE="${RELAY_NAME}/${RELAY_NAME}.p12" -RELAY_TRUSTSTORE="${RELAY_NAME}/${RELAY_NAME}_truststore.p12" +RELAY_TRUSTSTORE="${RELAY_NAME}/${RELAY_NAME}-truststore.p12" echo "Generating certificate for '${RELAY_NAME}'" >&2 mkdir ${RELAY_NAME} From a4fd747148ae7fcfe5d5fdbbe1912df201edb276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bordi=20Tam=C3=A1s?= Date: Tue, 4 Feb 2020 13:04:34 +0100 Subject: [PATCH 091/301] Update GatekeeperSetup.md --- documentation/gatekeeper/GatekeeperSetup.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/gatekeeper/GatekeeperSetup.md b/documentation/gatekeeper/GatekeeperSetup.md index 3abce9451..f5c08b30d 100644 --- a/documentation/gatekeeper/GatekeeperSetup.md +++ b/documentation/gatekeeper/GatekeeperSetup.md @@ -93,11 +93,11 @@ After you have the necessary certificate and trust store you have to install the ``` -- In the lines above we assume that the certificate file named `relay1.p12`, the trust store file named `relay-truststore.p12` and all the passwords are `123456`. If this is not true, please adjust the settings accordingly. +- In the lines above we assume that the certificate file named `relay1.p12`, the trust store file named `relay1_truststore.p12` and all the passwords are `123456`. If this is not true, please adjust the settings accordingly. #### 1.2.3 Configuring transport connector From 30de57cfd3fc7ee44e63831568409e1aa87a6bbb Mon Sep 17 00:00:00 2001 From: rbocsi Date: Tue, 4 Feb 2020 13:08:52 +0100 Subject: [PATCH 092/301] ping verifier skeleton --- .../core/qos/manager/QoSVerifiers.java | 9 ++++++++- .../impl/PingRequirementsVerifier.java | 19 +++++++++++++++++++ .../core/qos/manager/impl/QoSManagerImpl.java | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifier.java diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSVerifiers.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSVerifiers.java index 30a3a7d87..662d0da27 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSVerifiers.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/QoSVerifiers.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import eu.arrowhead.core.qos.manager.impl.PingRequirementsVerifier; import eu.arrowhead.core.qos.manager.impl.ServiceTimeVerifier; @Configuration @@ -12,7 +13,7 @@ public class QoSVerifiers { // members public static final String SERVICE_TIME_VERIFIER = "serviceTimeVerifier"; - + public static final String PING_REQUIREMENTS_VERIFIER = "pingRequirementsVerifier"; //================================================================================================= // methods @@ -22,4 +23,10 @@ public class QoSVerifiers { public QoSVerifier getServiceTimeVerifier() { return new ServiceTimeVerifier(); } + + //------------------------------------------------------------------------------------------------- + @Bean(PING_REQUIREMENTS_VERIFIER) + public QoSVerifier getPingRequirementsVerifier() { + return new PingRequirementsVerifier(); + } } \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifier.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifier.java new file mode 100644 index 000000000..16f98d358 --- /dev/null +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifier.java @@ -0,0 +1,19 @@ +package eu.arrowhead.core.qos.manager.impl; + +import java.util.Map; + +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; +import eu.arrowhead.core.qos.manager.QoSVerifier; + +public class PingRequirementsVerifier implements QoSVerifier { + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Override + public boolean verify(final OrchestrationResultDTO result, final Map qosRequirements, final Map commands) { + // TODO Auto-generated method stub + return true; + } +} \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java index 30a1b9d54..0ee006111 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java @@ -44,6 +44,7 @@ public class QoSManagerImpl implements QoSManager { @PostConstruct public void init() { verifiers.add(appContext.getBean(QoSVerifiers.SERVICE_TIME_VERIFIER, QoSVerifier.class)); + verifiers.add(appContext.getBean(QoSVerifiers.PING_REQUIREMENTS_VERIFIER, QoSVerifier.class)); //TODO: add verifiers here } From 9a5190bf3df21371a72c4572dc2ac2ff41fa995f Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 4 Feb 2020 13:36:59 +0100 Subject: [PATCH 093/301] removed whitespaces --- .../eu/arrowhead/core/qos/QoSMonitorControllerTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java index 54fc70174..57230179a 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java @@ -90,9 +90,9 @@ public void getManagementPingMeasurementBySystemIdTest() throws Exception { when(qoSDBService.getPingMeasurementBySystemIdResponse(anyLong())).thenReturn(pingMeasurementResponseDTO); final MvcResult response = this.mockMvc.perform(get(CommonConstants.QOS_MONITOR_URI + QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI + "/" + requestedId) - .accept(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()) - .andReturn(); + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); final PingMeasurementResponseDTO responseBody = objectMapper.readValue(response.getResponse().getContentAsString(), PingMeasurementResponseDTO.class); assertEquals(requestedId, responseBody.getId()); From 4e5d543a71d6874cbf2cf0a027e04a20ce485e49 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 4 Feb 2020 13:42:18 +0100 Subject: [PATCH 094/301] incorporeted StandalonMode in Tasks --- .../core/qos/quartz/task/CloudPingTask.java | 16 +++++++++++++++- .../core/qos/quartz/task/CountRestarterTask.java | 14 ++++++++++++++ .../arrowhead/core/qos/quartz/task/PingTask.java | 5 +++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTask.java index 5d7594f2d..3e040a1d8 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTask.java @@ -1,5 +1,9 @@ package eu.arrowhead.core.qos.quartz.task; +import java.util.Map; + +import javax.annotation.Resource; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.quartz.DisallowConcurrentExecution; @@ -8,6 +12,9 @@ import org.quartz.JobExecutionException; import org.springframework.stereotype.Component; +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; + @Component @DisallowConcurrentExecution public class CloudPingTask implements Job { @@ -15,6 +22,8 @@ public class CloudPingTask implements Job { //================================================================================================= // members + @Resource(name = CommonConstants.ARROWHEAD_CONTEXT) + private Map arrowheadContext; protected Logger logger = LogManager.getLogger(CloudPingTask.class); //================================================================================================= @@ -24,7 +33,12 @@ public class CloudPingTask implements Job { @Override public void execute(final JobExecutionContext context) throws JobExecutionException { logger.debug("STARTED: Intra cloud ping task"); - + + if (arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)) { + + return; + } + logger.debug("Finished: Intra cloud ping task"); } diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java index 2dff87698..f0c37379c 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTask.java @@ -1,5 +1,9 @@ package eu.arrowhead.core.qos.quartz.task; +import java.util.Map; + +import javax.annotation.Resource; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.quartz.DisallowConcurrentExecution; @@ -9,6 +13,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.core.qos.database.service.QoSDBService; @Component @@ -23,6 +29,9 @@ public class CountRestarterTask implements Job { @Autowired private QoSDBService qoSDBService; + @Resource(name = CommonConstants.ARROWHEAD_CONTEXT) + private Map arrowheadContext; + //================================================================================================= // methods @@ -31,6 +40,11 @@ public class CountRestarterTask implements Job { public void execute(final JobExecutionContext context) throws JobExecutionException { logger.debug("STARTED: count restarter task"); + if (arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)) { + + return; + } + qoSDBService.updateCountStartedAt(); logger.debug("Finished: count restarter task"); diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 88ffdf70a..4b61584b4 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -75,6 +75,11 @@ public class PingTask implements Job { public void execute(final JobExecutionContext context) throws JobExecutionException { logger.debug("STARTED: ping task"); + if (arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)) { + + return; + } + final Set systems = getSystemsToMeasure(); for (final SystemResponseDTO systemResponseDTO : systems) { From 75c291e783a70ddc9a662ad03e6e50b94877cca8 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 4 Feb 2020 13:51:07 +0100 Subject: [PATCH 095/301] added minutes to timing property names and corrected typo : pocket > packet --- .../arrowhead/common/CoreCommonConstants.java | 4 ++-- .../properties/PingMeasurementProperties.java | 8 +++---- .../core/qos/quartz/task/PingTask.java | 2 +- ...itional-spring-configuration-metadata.json | 22 +++++++++---------- .../src/main/resources/application.properties | 6 ++--- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java index d87c602e4..a95146506 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java @@ -155,10 +155,10 @@ public class CoreCommonConstants { public static final String $EVENT_HANDLER_MAX_EXPRESS_SUBSCRIBERS_WD = "${" + EVENT_HANDLER_MAX_EXPRESS_SUBSCRIBERS + ":" + CoreDefaults.DEFAULT_EVENT_HANDLER_MAX_EXPRESS_SUBSCRIBERS + "}"; public static final String EVENT_PUBLISHING_EXPRESS_EXECUTOR = "eventPublishingExpressExecutor"; - public static final String PING_TTL_INTERVAL = "ping_ttl_interval"; + public static final String PING_TTL_INTERVAL = "ping_ttl_interval_minutes"; public static final String $PING_TTL_INTERVAL_WD = "${" + PING_TTL_INTERVAL + ":" + CoreDefaults.DEFAULT_PING_TTL_INTERVAL_MINUTES + "}"; - public static final String CLOUD_PING_TTL_INTERVAL = "cloud_ping_ttl_interval"; + public static final String CLOUD_PING_TTL_INTERVAL = "cloud_ping_ttl_interval_minutes"; public static final String $CLOUD_PING_TTL_INTERVAL_WD = "${" + CLOUD_PING_TTL_INTERVAL + ":" + CoreDefaults.DEFAULT_CLOUD_PING_TTL_INTERVAL_MINUTES + "}"; //================================================================================================= diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java index 43f09201b..321613c01 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java @@ -12,7 +12,7 @@ public class PingMeasurementProperties { private int timeToRepeat; private int timeout; - private int pocketSize; + private int packetSize; private int rest; //================================================================================================= @@ -26,20 +26,20 @@ public PingMeasurementProperties(final int timeToRepeat, final int timeout, fina this.timeToRepeat = timeToRepeat; this.timeout = timeout; - this.pocketSize = pocketSize; + this.packetSize = pocketSize; this.rest = rest; } //------------------------------------------------------------------------------------------------- public int getTimeToRepeat() { return timeToRepeat; } public int getTimeout() { return timeout; } - public int getPocketSize() { return pocketSize; } + public int getPacketSize() { return packetSize; } public int getRest() { return rest; } //------------------------------------------------------------------------------------------------- public void setTimeToRepeat(final int timeToRepeat) { this.timeToRepeat = timeToRepeat; } public void setTimeout(final int timeout) { this.timeout = timeout; } - public void setPocketSize(final int pocketSize) { this.pocketSize = pocketSize; } + public void setPacketSize(final int packetSize) { this.packetSize = packetSize; } public void setRest(final int rest) { this.rest = rest; } } diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 4b61584b4..063c6edae 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -281,7 +281,7 @@ private List getPingResponseList(final String address) { final IcmpPingRequest request = IcmpPingUtil.createIcmpPingRequest (); request.setHost (address); request.setTimeout(pingMeasurementProperties.getTimeout()); - request.setPacketSize(pingMeasurementProperties.getPocketSize()); + request.setPacketSize(pingMeasurementProperties.getPacketSize()); for (int count = 0; count < pingMeasurementProperties.getTimeToRepeat(); count ++) { IcmpPingResponse response; diff --git a/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 3f8638b92..7b5e95ab5 100644 --- a/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -40,17 +40,7 @@ "description": "A description for 'gatekeeper_is_present'" }, { - "name": "cloud_ping_ttl_interval", - "type": "java.lang.String", - "description": "A description for 'cloud_ping_ttl_interval'" - }, - { - "name": "ping_ttl_interval", - "type": "java.lang.String", - "description": "A description for 'ping_ttl_interval'" - }, - { - "name": "ping.pocket_size", + "name": "ping.packet_size", "type": "java.lang.Integer", "description": "A description for 'ping.pocket_size'" }, @@ -58,5 +48,15 @@ "name": "ping.time_to_repeat", "type": "java.lang.Integer", "description": "A description for 'ping.time_to_repeat'" + }, + { + "name": "cloud_ping_ttl_interval_minutes", + "type": "java.lang.String", + "description": "A description for 'cloud_ping_ttl_interval_minutes'" + }, + { + "name": "ping_ttl_interval_minutes", + "type": "java.lang.String", + "description": "A description for 'ping_ttl_interval_minutes'" } ]} \ No newline at end of file diff --git a/qos-monitor/src/main/resources/application.properties b/qos-monitor/src/main/resources/application.properties index 2e096690e..275df216b 100644 --- a/qos-monitor/src/main/resources/application.properties +++ b/qos-monitor/src/main/resources/application.properties @@ -39,9 +39,9 @@ sr_port=8443 gatekeeper_is_present=true # Monitor timings -cloud_ping_ttl_interval=2 +cloud_ping_ttl_interval_minutes=2 -ping_ttl_interval=2 +ping_ttl_interval_minutes=2 ############################################ ### PING MEASUREMENT PARAMETERS ### @@ -54,7 +54,7 @@ ping.time_to_repeat=35 ping.timeout=5000 # Set pocket size of ping -ping.pocket_size=32 +ping.packet_size=32 # Set millsec to sleep between single pings in a measurement ping.rest=1000 From c4fd79aecff7d94e60012b6d5b2ab3c075e67480 Mon Sep 17 00:00:00 2001 From: borditamas Date: Tue, 4 Feb 2020 14:35:38 +0100 Subject: [PATCH 096/301] fix debian installer relay truststore path --- core-common/src/deb/ah_gen_relay_cert.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-common/src/deb/ah_gen_relay_cert.sh b/core-common/src/deb/ah_gen_relay_cert.sh index 1ad1a10e4..b5f664bab 100644 --- a/core-common/src/deb/ah_gen_relay_cert.sh +++ b/core-common/src/deb/ah_gen_relay_cert.sh @@ -13,7 +13,7 @@ RELAY_HOST=${5} RELAY_IP=${6} RELAY_STORE="${RELAY_NAME}/${RELAY_NAME}.p12" -RELAY_TRUSTSTORE="${RELAY_NAME}/${RELAY_NAME}-truststore.p12" +RELAY_TRUSTSTORE="${RELAY_NAME}/${RELAY_NAME}_truststore.p12" echo "Generating certificate for '${RELAY_NAME}'" >&2 mkdir ${RELAY_NAME} From c450e9bf25fba7b8a8fba8e30a5185d932412240 Mon Sep 17 00:00:00 2001 From: Svetlin Tanyi Date: Tue, 4 Feb 2020 14:46:25 +0100 Subject: [PATCH 097/301] Updated Docker Compose --- docker/docker-compose.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index a3692f5e6..09a7cd25b 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -14,7 +14,7 @@ services: serviceregistry: container_name: serviceregistry - image: portus.arrowhead-ci.tmit.bme.hu/arrowhead/serviceregistry:latest + image: svetlint/serviceregistry:latest depends_on: - mysql volumes: @@ -26,17 +26,17 @@ services: authorization: container_name: authorization - image: portus.arrowhead-ci.tmit.bme.hu/arrowhead/authorization:latest + image: svetlint/authorization:latest depends_on: - mysql volumes: - - ./core_system_config/authorization.properties:/authorization/application.properties + - ./core_system_config/authorizaton.properties:/authorization/application.properties ports: - 8445:8445 orchestrator: container_name: orchestrator - image: portus.arrowhead-ci.tmit.bme.hu/arrowhead/orchestrator:latest + image: svetlint/orchestrator:latest depends_on: - mysql volumes: @@ -46,7 +46,7 @@ services: eventhandler: container_name: eventhandler - image: portus.arrowhead-ci.tmit.bme.hu/arrowhead/eventhandler:latest + image: svetlint/eventhandler:latest depends_on: - mysql volumes: @@ -56,7 +56,7 @@ services: gatekeeper: container_name: gatekeeper - image: portus.arrowhead-ci.tmit.bme.hu/arrowhead/gatekeeper:latest + image: svetlint/gatekeeper:latest depends_on: - mysql volumes: @@ -66,7 +66,7 @@ services: gateway: container_name: gateway - image: portus.arrowhead-ci.tmit.bme.hu/arrowhead/gateway:latest + image: svetlint/gateway:latest depends_on: - mysql volumes: From f3c2c6cd507fa0aeed93b2bc1f5dd19e6a9c1921 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 4 Feb 2020 15:06:07 +0100 Subject: [PATCH 098/301] corrected handling of MeasurementNotInDB case --- .../internal/PingMeasurementResponseDTO.java | 6 +- .../core/qos/QoSMonitorController.java | 12 +++- .../qos/database/service/QoSDBService.java | 14 +++- .../core/qos/QoSMonitorControllerTest.java | 67 +++++++++++++++++-- 4 files changed, 87 insertions(+), 12 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/PingMeasurementResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/PingMeasurementResponseDTO.java index c4234015f..3bb53ac97 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/PingMeasurementResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/PingMeasurementResponseDTO.java @@ -10,7 +10,7 @@ public class PingMeasurementResponseDTO implements Serializable { private static final long serialVersionUID = 4436693629791850816L; - private long id; + private Long id; private QoSIntraMeasurementResponseDTO measurement; private boolean available = false; private ZonedDateTime lastAccessAt; @@ -36,7 +36,7 @@ public class PingMeasurementResponseDTO implements Serializable { public PingMeasurementResponseDTO() {} //------------------------------------------------------------------------------------------------- - public long getId() { return id; } + public Long getId() { return id; } public QoSIntraMeasurementResponseDTO getMeasurement() { return measurement; } public boolean isAvailable() {return available; } public ZonedDateTime getLastAccessAt() { return lastAccessAt; } @@ -56,7 +56,7 @@ public PingMeasurementResponseDTO() {} public ZonedDateTime getUpdatedAt() { return updatedAt; } //------------------------------------------------------------------------------------------------- - public void setId(final long id) { this.id = id; } + public void setId(final Long id) { this.id = id; } public void setMeasurement(final QoSIntraMeasurementResponseDTO measurement) { this.measurement = measurement; } public void setAvailable(final boolean available) { this.available = available; } public void setLastAccessAt(final ZonedDateTime lastAccessAt) { this.lastAccessAt = lastAccessAt; } diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java index c9810ba4b..cab4aae5f 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java @@ -124,9 +124,17 @@ public String echoService() { throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); } - final eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO pingMeasurementResponse = qoSDBService.getPingMeasurementBySystemIdResponse(id); + final PingMeasurementResponseDTO pingMeasurementResponse = qoSDBService.getPingMeasurementBySystemIdResponse(id); + + if (pingMeasurementResponse.getId() == null) { + + logger.debug("PingMeasurement entry with system id: {} is not available.", id); + + }else { + + logger.debug("PingMeasurement entry with system id: {} successfully retrieved.", id); + } - logger.debug("PingMeasurement entry with system id: {} successfully retrieved", id); return pingMeasurementResponse; } diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index c5d345252..34df31af4 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -322,7 +322,16 @@ public Page getPingMeasurementPage(final int page, fina public PingMeasurementResponseDTO getPingMeasurementBySystemIdResponse(final long id) { logger.debug("getPingMeasurementBySystemIdResponse started ..."); - return DTOConverter.convertQoSIntraPingMeasurementToPingMeasurementResponseDTO(getPingMeasurementBySystemId(id)); + final QoSIntraPingMeasurement pingMeausrement = getPingMeasurementBySystemId(id); + if (pingMeausrement == null ) { + + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + response.setId( null ); + + return response; + } + + return DTOConverter.convertQoSIntraPingMeasurementToPingMeasurementResponseDTO(pingMeausrement); } //------------------------------------------------------------------------------------------------- @@ -344,7 +353,8 @@ public QoSIntraPingMeasurement getPingMeasurementBySystemId(final long id) { final QoSIntraMeasurement measurement; final Optional qoSIntraMeasurementOptional = qoSIntraMeasurementRepository.findBySystemAndMeasurementType(system, QoSMeasurementType.PING); if (qoSIntraMeasurementOptional.isEmpty()) { - throw new InvalidParameterException("QoSIntraMeasurement with system id of '" + id + "' not exists"); + + return null; }else { measurement = qoSIntraMeasurementOptional.get(); } diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java index 57230179a..eeea75a27 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java @@ -1,8 +1,9 @@ package eu.arrowhead.core.qos; import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.when; +import static org.junit.Assert.assertNull; import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.Mockito.when; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -29,11 +30,12 @@ import eu.arrowhead.common.Utilities; import eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO; import eu.arrowhead.common.dto.internal.QoSIntraMeasurementResponseDTO; -import eu.arrowhead.common.dto.internal.RelayResponseDTO; +import eu.arrowhead.common.dto.shared.ErrorMessageDTO; import eu.arrowhead.common.dto.shared.QoSMeasurementType; import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.common.exception.ExceptionType; import eu.arrowhead.core.qos.database.service.QoSDBService; -import eu.arrowhead.core.qos.measurement.properties.PingMeasurementProperties; @RunWith(SpringRunner.class) @SpringBootTest(classes = QoSMonitorMain.class) @@ -49,6 +51,8 @@ public class QoSMonitorControllerTest { private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_URI = QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI + "/{" + PATH_VARIABLE_ID + "}"; private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_URI = CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT + "/{" + PATH_VARIABLE_ID + "}"; + private static final String ID_NOT_VALID_ERROR_MESSAGE = " Id must be greater than 0. "; + @Autowired private WebApplicationContext wac; @@ -95,9 +99,62 @@ public void getManagementPingMeasurementBySystemIdTest() throws Exception { .andReturn(); final PingMeasurementResponseDTO responseBody = objectMapper.readValue(response.getResponse().getContentAsString(), PingMeasurementResponseDTO.class); - assertEquals(requestedId, responseBody.getId()); + assertEquals(requestedId, responseBody.getMeasurement().getSystem().getId()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void getManagementPingMeasurementBySystemIdInvalidSystemIdTest() throws Exception { + final int requestedId = 0; + final PingMeasurementResponseDTO pingMeasurementResponseDTO = getPingMeasurementResponseDTOForTest(); + + when(qoSDBService.getPingMeasurementBySystemIdResponse(anyLong())).thenReturn(pingMeasurementResponseDTO); + + final MvcResult response = this.mockMvc.perform(get(CommonConstants.QOS_MONITOR_URI + QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI + "/" + requestedId) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); + + final ErrorMessageDTO responseBody = objectMapper.readValue(response.getResponse().getContentAsString(), ErrorMessageDTO.class); + assertEquals(ExceptionType.BAD_PAYLOAD, responseBody.getExceptionType()); + assertEquals(ID_NOT_VALID_ERROR_MESSAGE, responseBody.getErrorMessage()); + assertEquals(CommonConstants.QOS_MONITOR_URI + GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_URI, responseBody.getOrigin()); } + //------------------------------------------------------------------------------------------------- + @Test + public void getManagementPingMeasurementBySystemIdDBExceptionTest() throws Exception { + final int requestedId = 1; + + when(qoSDBService.getPingMeasurementBySystemIdResponse(anyLong())).thenThrow(new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG)); + + final MvcResult response = this.mockMvc.perform(get(CommonConstants.QOS_MONITOR_URI + QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI + "/" + requestedId) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isInternalServerError()) + .andReturn(); + + final ErrorMessageDTO responseBody = objectMapper.readValue(response.getResponse().getContentAsString(), ErrorMessageDTO.class); + assertEquals(ExceptionType.ARROWHEAD, responseBody.getExceptionType()); + assertEquals(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG, responseBody.getErrorMessage()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void getManagementPingMeasurementBySystemIdNoMeasurementInDBTest() throws Exception { + final int requestedId = 1; + final PingMeasurementResponseDTO pingMeasurementResponseDTO = new PingMeasurementResponseDTO(); + pingMeasurementResponseDTO.setId( null ); + + when(qoSDBService.getPingMeasurementBySystemIdResponse(anyLong())).thenReturn(pingMeasurementResponseDTO); + + final MvcResult response = this.mockMvc.perform(get(CommonConstants.QOS_MONITOR_URI + QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI + "/" + requestedId) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final PingMeasurementResponseDTO responseBody = objectMapper.readValue(response.getResponse().getContentAsString(), PingMeasurementResponseDTO.class); + assertNull(responseBody.getId()); + } //================================================================================================= // assistant methods @@ -107,7 +164,7 @@ private PingMeasurementResponseDTO getPingMeasurementResponseDTOForTest() { final QoSIntraMeasurementResponseDTO qoSIntraMeasurementResponseDTO = getQoSIntraMeasurementResponseDTOForTest(); final PingMeasurementResponseDTO pingMeasurementResponseDTO = new PingMeasurementResponseDTO(); - pingMeasurementResponseDTO.setId(1); + pingMeasurementResponseDTO.setId(1L); pingMeasurementResponseDTO.setMeasurement(qoSIntraMeasurementResponseDTO); pingMeasurementResponseDTO.setAvailable(true); pingMeasurementResponseDTO.setLastAccessAt(ZonedDateTime.now()); From 57d5d898901d4ee316be1f0e52efc6204872d557 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 4 Feb 2020 15:07:48 +0100 Subject: [PATCH 099/301] corrected handling of MeasurementNotInDB case --- .../eu/arrowhead/core/qos/database/service/QoSDBService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index 34df31af4..2443bf77b 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -366,7 +366,8 @@ public QoSIntraPingMeasurement getPingMeasurementBySystemId(final long id) { return measurementOptional.get(); } else { - throw new InvalidParameterException("PingMeasurement with system id of '" + id + "' not exists"); + + return null; } } catch (final InvalidParameterException ex) { throw ex; From 2728946073aa12d5cac2fb67baf756547ba6e47d Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 4 Feb 2020 16:59:08 +0100 Subject: [PATCH 100/301] implemented getPingMeasurementsTests --- .../core/qos/QoSMonitorControllerTest.java | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java index eeea75a27..e6d8137ab 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java @@ -2,12 +2,18 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.when; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.List; import org.junit.Before; import org.junit.Test; @@ -28,6 +34,7 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.dto.internal.PingMeasurementListResponseDTO; import eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO; import eu.arrowhead.common.dto.internal.QoSIntraMeasurementResponseDTO; import eu.arrowhead.common.dto.shared.ErrorMessageDTO; @@ -52,6 +59,7 @@ public class QoSMonitorControllerTest { private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_URI = CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT + "/{" + PATH_VARIABLE_ID + "}"; private static final String ID_NOT_VALID_ERROR_MESSAGE = " Id must be greater than 0. "; + private static final String PAGE_OR_SIZE_ERROR_MESSAGE = "Defined page or size could not be with undefined size or page."; @Autowired @@ -82,6 +90,64 @@ public void echoTest() throws Exception { .andExpect(status().isOk()); } + //================================================================================================= + // Test of getPingMeasurements + + //------------------------------------------------------------------------------------------------- + @Test + public void getPingMeasurementsWithoutParametersTest() throws Exception { + final PingMeasurementListResponseDTO pingMeasurementListResponseDTO = getPingMeasurementListResponseDTOForTest(); + + when(qoSDBService.getPingMeasurementResponse( anyInt(), anyInt(), any(), anyString())).thenReturn(pingMeasurementListResponseDTO); + + final MvcResult response = this.mockMvc.perform(get(CommonConstants.QOS_MONITOR_URI + QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final PingMeasurementListResponseDTO responseBody = objectMapper.readValue(response.getResponse().getContentAsString(), PingMeasurementListResponseDTO.class); + assertEquals(pingMeasurementListResponseDTO.getData().size(), responseBody.getData().size()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void getPingMeasurementsWithPageAndSizeParametersTest() throws Exception { + final int responseSize = 3; + final PingMeasurementListResponseDTO pingMeasurementListResponseDTO = getPingMeasurementListResponseDTOForTest(responseSize); + + when(qoSDBService.getPingMeasurementResponse( anyInt(), anyInt(), any(), anyString())).thenReturn(pingMeasurementListResponseDTO); + + final MvcResult response = this.mockMvc.perform(get(CommonConstants.QOS_MONITOR_URI + QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI) + .param("page", "0") + .param("item_per_page", String.valueOf(responseSize)) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final PingMeasurementListResponseDTO responseBody = objectMapper.readValue(response.getResponse().getContentAsString(), PingMeasurementListResponseDTO.class); + assertEquals(pingMeasurementListResponseDTO.getData().size(), responseBody.getData().size()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void getPingMeasurementsWithNullPageButDefinedSizeParameterTest() throws Exception { + final int responseSize = 3; + final PingMeasurementListResponseDTO pingMeasurementListResponseDTO = getPingMeasurementListResponseDTOForTest(responseSize); + + when(qoSDBService.getPingMeasurementResponse( anyInt(), anyInt(), any(), anyString())).thenReturn(pingMeasurementListResponseDTO); + + final MvcResult response = this.mockMvc.perform(get(CommonConstants.QOS_MONITOR_URI + QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI) + .param("item_per_page", String.valueOf(responseSize)) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); + + final ErrorMessageDTO responseBody = objectMapper.readValue(response.getResponse().getContentAsString(), ErrorMessageDTO.class); + assertEquals(ExceptionType.BAD_PAYLOAD, responseBody.getExceptionType()); + assertTrue(responseBody.getErrorMessage().contains(PAGE_OR_SIZE_ERROR_MESSAGE)); + assertEquals(CommonConstants.QOS_MONITOR_URI + QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI, responseBody.getOrigin()); + } + //================================================================================================= // Test of getManagementPingMeasurementBySystemId @@ -155,9 +221,109 @@ public void getManagementPingMeasurementBySystemIdNoMeasurementInDBTest() throws final PingMeasurementResponseDTO responseBody = objectMapper.readValue(response.getResponse().getContentAsString(), PingMeasurementResponseDTO.class); assertNull(responseBody.getId()); } + + //================================================================================================= + // Test of getManagementPingMeasurementBySystemId + + //------------------------------------------------------------------------------------------------- + @Test + public void getPingMeasurementBySystemIdTest() throws Exception { + final int requestedId = 1; + final PingMeasurementResponseDTO pingMeasurementResponseDTO = getPingMeasurementResponseDTOForTest(); + + when(qoSDBService.getPingMeasurementBySystemIdResponse(anyLong())).thenReturn(pingMeasurementResponseDTO); + + final MvcResult response = this.mockMvc.perform(get(CommonConstants.QOS_MONITOR_URI + CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT + "/" + requestedId) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final PingMeasurementResponseDTO responseBody = objectMapper.readValue(response.getResponse().getContentAsString(), PingMeasurementResponseDTO.class); + assertEquals(requestedId, responseBody.getMeasurement().getSystem().getId()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void getPingMeasurementBySystemIdInvalidSystemIdTest() throws Exception { + final int requestedId = 0; + final PingMeasurementResponseDTO pingMeasurementResponseDTO = getPingMeasurementResponseDTOForTest(); + + when(qoSDBService.getPingMeasurementBySystemIdResponse(anyLong())).thenReturn(pingMeasurementResponseDTO); + + final MvcResult response = this.mockMvc.perform(get(CommonConstants.QOS_MONITOR_URI + CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT + "/" + requestedId) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); + + final ErrorMessageDTO responseBody = objectMapper.readValue(response.getResponse().getContentAsString(), ErrorMessageDTO.class); + assertEquals(ExceptionType.BAD_PAYLOAD, responseBody.getExceptionType()); + assertEquals(ID_NOT_VALID_ERROR_MESSAGE, responseBody.getErrorMessage()); + assertEquals(CommonConstants.QOS_MONITOR_URI + GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_URI, responseBody.getOrigin()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void getPingMeasurementBySystemIdDBExceptionTest() throws Exception { + final int requestedId = 1; + + when(qoSDBService.getPingMeasurementBySystemIdResponse(anyLong())).thenThrow(new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG)); + + final MvcResult response = this.mockMvc.perform(get(CommonConstants.QOS_MONITOR_URI + CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT + "/" + requestedId) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isInternalServerError()) + .andReturn(); + + final ErrorMessageDTO responseBody = objectMapper.readValue(response.getResponse().getContentAsString(), ErrorMessageDTO.class); + assertEquals(ExceptionType.ARROWHEAD, responseBody.getExceptionType()); + assertEquals(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG, responseBody.getErrorMessage()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void getPingMeasurementBySystemIdNoMeasurementInDBTest() throws Exception { + final int requestedId = 1; + final PingMeasurementResponseDTO pingMeasurementResponseDTO = new PingMeasurementResponseDTO(); + pingMeasurementResponseDTO.setId( null ); + + when(qoSDBService.getPingMeasurementBySystemIdResponse(anyLong())).thenReturn(pingMeasurementResponseDTO); + + final MvcResult response = this.mockMvc.perform(get(CommonConstants.QOS_MONITOR_URI + CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT + "/" + requestedId) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final PingMeasurementResponseDTO responseBody = objectMapper.readValue(response.getResponse().getContentAsString(), PingMeasurementResponseDTO.class); + assertNull(responseBody.getId()); + } + //================================================================================================= // assistant methods + //------------------------------------------------------------------------------------------------- + private PingMeasurementListResponseDTO getPingMeasurementListResponseDTOForTest() { + + final int responseSize = 3; + final List pingMeasurementList = new ArrayList<>(3); + + for (int i = 0; i < responseSize; i++) { + pingMeasurementList.add(getPingMeasurementResponseDTOForTest()); + } + + return new PingMeasurementListResponseDTO(pingMeasurementList, responseSize); + } + + //------------------------------------------------------------------------------------------------- + private PingMeasurementListResponseDTO getPingMeasurementListResponseDTOForTest(final int responseSize) { + + final List pingMeasurementList = new ArrayList<>(responseSize); + + for (int i = 0; i < responseSize; i++) { + pingMeasurementList.add(getPingMeasurementResponseDTOForTest()); + } + + return new PingMeasurementListResponseDTO(pingMeasurementList, responseSize); + } + //------------------------------------------------------------------------------------------------- private PingMeasurementResponseDTO getPingMeasurementResponseDTOForTest() { @@ -213,4 +379,5 @@ private SystemResponseDTO getSystemResponseDTOForTest() { Utilities.convertZonedDateTimeToUTCString(ZonedDateTime.now())); } + } From a829159a8bc4c1f8743205dc2a40887d6719d479 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 4 Feb 2020 17:15:22 +0100 Subject: [PATCH 101/301] removed unnecessary tabs --- .../java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java index e6d8137ab..e3772c209 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java @@ -87,7 +87,7 @@ public void setup() { public void echoTest() throws Exception { this.mockMvc.perform(get(CommonConstants.QOS_MONITOR_URI + CommonConstants.ECHO_URI) .accept(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()); + .andExpect(status().isOk()); } //================================================================================================= From 2af351b90aaecbb8c07db851c34f3a5e94e1838b Mon Sep 17 00:00:00 2001 From: rbocsi Date: Tue, 4 Feb 2020 17:17:25 +0100 Subject: [PATCH 102/301] PingRequirementsVerifier implementation --- .../eu/arrowhead/common/CommonConstants.java | 4 + .../arrowhead/common/CoreCommonConstants.java | 2 + .../eu/arrowhead/common/CoreDefaults.java | 1 + .../eu/arrowhead/common/core/CoreSystem.java | 2 +- .../common/core/CoreSystemService.java | 8 +- .../internal/PingMeasurementResponseDTO.java | 85 +++++++ .../QoSIntraMeasurementResponseDTO.java | 57 +++++ .../OrchestratorApplicationInitListener.java | 15 +- .../service/OrchestratorDriver.java | 31 ++- .../impl/PingRequirementsVerifier.java | 233 +++++++++++++++++- .../qos/manager/impl/ServiceTimeVerifier.java | 8 + ...itional-spring-configuration-metadata.json | 5 + .../src/main/resources/application.properties | 3 + 13 files changed, 445 insertions(+), 9 deletions(-) create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/internal/PingMeasurementResponseDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/internal/QoSIntraMeasurementResponseDTO.java diff --git a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java index a0a5f5300..2e2ead353 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java @@ -43,6 +43,8 @@ public class CommonConstants { public static final String CORE_SERVICE_EVENT_HANDLER_UNSUBSCRIBE = "event-unsubscribe"; public static final String CORE_SERVICE_EVENT_HANDLER_PUBLISH_AUTH_UPDATE = "event-publish-auth-update"; + public static final String CORE_SERVICE_QOS_MONITOR_PING_MEASUREMENT = "qos-monitor-ping-measurement"; + public static final String COMMON_FIELD_NAME_ID = "id"; public static final String ARROWHEAD_CONTEXT = "arrowheadContext"; @@ -110,6 +112,8 @@ public class CommonConstants { public static final String OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE = "/publish/authupdate"; public static final String QOS_MONITOR_URI = "/qosmonitor"; + public static final String OP_QOS_MONITOR_PING_MEASUREMENT = "/ping/measurement"; + public static final String OP_QOS_MONITOR_PING_MEASUREMENT_SUFFIX = "/{" + COMMON_FIELD_NAME_ID + "}"; public static final String SWAGGER_COMMON_PACKAGE = "eu.arrowhead.common.swagger"; public static final String SWAGGER_UI_URI = "/swagger-ui.html"; diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java index 4b89817dd..339648b26 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java @@ -125,6 +125,8 @@ public class CoreCommonConstants { public static final String $QOS_RESERVATION_TEMP_LOCK_DURATION_WD = "${" + QOS_RESERVATION_TEMP_LOCK_DURATION + ":" + CoreDefaults.DEFAULT_QOS_TEMPORARY_LOCK_DURATION + "}"; public static final String QOS_MAX_RESERVATION_DURATION = "qos_maximum_reservation_duration"; // in seconds public static final String $QOS_MAX_RESERVATION_DURATION_WD = "${" + QOS_MAX_RESERVATION_DURATION + ":" + CoreDefaults.DEFAULT_QOS_MAX_RESERVATION_DURATION + "}"; + public static final String QOS_PING_MEASUREMENT_CACHE_THRESHOLD = "qos_ping_measurement_cache_threshold"; // in seconds + public static final String $QOS_PING_MEASUREMENT_CACHE_THRESHOLD_WD = "${" + QOS_PING_MEASUREMENT_CACHE_THRESHOLD + ":" + CoreDefaults.DEFAULT_QOS_PING_MEASUREMENT_CACHE_THRESHOLD + "}"; public static final String NO_GATEKEEPER_RELAY_REQUEST_HANDLER_WORKERS = "no_gatekeeper_relay_request_handler_workers"; public static final String $NO_GATEKEEPER_RELAY_REQUEST_HANDLER_WORKERS_WD = "${" + NO_GATEKEEPER_RELAY_REQUEST_HANDLER_WORKERS + ":" + diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java b/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java index 62e4b9c76..1b326f793 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java @@ -56,6 +56,7 @@ public class CoreDefaults { public static final int DEFAULT_QOS_RESERVATION_CHECK_INTERVAL = 60; // in seconds public static final int DEFAULT_QOS_TEMPORARY_LOCK_DURATION = 60; // in seconds public static final int DEFAULT_QOS_MAX_RESERVATION_DURATION = 3600; // in seconds + public static final int DEFAULT_QOS_PING_MEASUREMENT_CACHE_THRESHOLD = 600; // in seconds //================================================================================================= // assistant methods diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java index 04e447acd..22fd1a918 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java @@ -23,7 +23,7 @@ public enum CoreSystem { , CoreSystemService.EVENT_UNSUBSCRIBE_SERVICE, CoreSystemService.EVENT_PUBLISH_AUTH_UPDATE_SERVICE)), GATEWAY(Defaults.DEFAULT_GATEWAY_PORT, List.of(CoreSystemService.GATEWAY_PUBLIC_KEY_SERVICE, CoreSystemService.GATEWAY_PROVIDER_SERVICE,CoreSystemService.GATEWAY_CONSUMER_SERVICE)), CHOREOGRAPHER(Defaults.DEFAULT_CHOREOGRAPHER_PORT, List.of()), // TODO: add services - QOS_MONITOR(Defaults.DEFAULT_QOS_MONITOR_PORT, List.of()), + QOS_MONITOR(Defaults.DEFAULT_QOS_MONITOR_PORT, List.of(CoreSystemService.QOS_MONITOR_PING_MEASUREMENT_SERVICE)), CERTIFICATE_AUTHORITY(Defaults.DEFAULT_CERTIFICATE_AUTHORITY_PORT, List.of()); // TODO: add services //================================================================================================= diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java index 39f6db738..1a8c3b100 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java @@ -29,11 +29,15 @@ public enum CoreSystemService { GATEWAY_PROVIDER_SERVICE(CommonConstants.CORE_SERVICE_GATEWAY_CONNECT_PROVIDER, CommonConstants.GATEWAY_URI + CommonConstants.OP_GATEWAY_CONNECT_PROVIDER_URI), GATEWAY_CONSUMER_SERVICE(CommonConstants.CORE_SERVICE_GATEWAY_CONNECT_CONSUMER, CommonConstants.GATEWAY_URI + CommonConstants.OP_GATEWAY_CONNECT_CONSUMER_URI), - //Eventhandler services + // Eventhandler services EVENT_PUBLISH_SERVICE(CommonConstants.CORE_SERVICE_EVENT_HANDLER_PUBLISH, CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_PUBLISH), EVENT_SUBSCRIBE_SERVICE(CommonConstants.CORE_SERVICE_EVENT_HANDLER_SUBSCRIBE, CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_SUBSCRIBE), EVENT_UNSUBSCRIBE_SERVICE(CommonConstants.CORE_SERVICE_EVENT_HANDLER_UNSUBSCRIBE, CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_UNSUBSCRIBE), - EVENT_PUBLISH_AUTH_UPDATE_SERVICE(CommonConstants.CORE_SERVICE_EVENT_HANDLER_PUBLISH_AUTH_UPDATE, CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE); + EVENT_PUBLISH_AUTH_UPDATE_SERVICE(CommonConstants.CORE_SERVICE_EVENT_HANDLER_PUBLISH_AUTH_UPDATE, CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE), + + // QoS Monitor services + QOS_MONITOR_PING_MEASUREMENT_SERVICE(CommonConstants.CORE_SERVICE_QOS_MONITOR_PING_MEASUREMENT, CommonConstants.QOS_MONITOR_URI + CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT + + CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT_SUFFIX); //TODO: additional services diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/PingMeasurementResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/PingMeasurementResponseDTO.java new file mode 100644 index 000000000..f9769de74 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/PingMeasurementResponseDTO.java @@ -0,0 +1,85 @@ +package eu.arrowhead.common.dto.internal; + +import java.io.Serializable; +import java.time.ZonedDateTime; + +import com.fasterxml.jackson.annotation.JsonIgnore; + +public class PingMeasurementResponseDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = 4436693629791850816L; + + private Long id; + private QoSIntraMeasurementResponseDTO measurement; + private boolean available = false; + private ZonedDateTime lastAccessAt; + private Integer minResponseTime; + private Integer maxResponseTime; + private Integer meanResponseTimeWithTimeout; + private Integer meanResponseTimeWithoutTimeout; + private Integer jitterWithTimeout; + private Integer jitterWithoutTimeout; + private Integer lostPerMeasurementPercent; + private long sent; + private long received; + private ZonedDateTime countStartedAt; + private long sentAll; + private long receivedAll; + private ZonedDateTime createdAt; + private ZonedDateTime updatedAt; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public PingMeasurementResponseDTO() {} + + //------------------------------------------------------------------------------------------------- + public Long getId() { return id; } + public QoSIntraMeasurementResponseDTO getMeasurement() { return measurement; } + public boolean isAvailable() {return available; } + public ZonedDateTime getLastAccessAt() { return lastAccessAt; } + public Integer getMinResponseTime() { return minResponseTime; } + public Integer getMaxResponseTime() { return maxResponseTime; } + public Integer getMeanResponseTimeWithTimeout() { return meanResponseTimeWithTimeout; } + public Integer getMeanResponseTimeWithoutTimeout() { return meanResponseTimeWithoutTimeout; } + public Integer getJitterWithTimeout() { return jitterWithTimeout; } + public Integer getJitterWithoutTimeout() { return jitterWithoutTimeout; } + public Integer getLostPerMeasurementPercent() { return lostPerMeasurementPercent; } + public long getSent() { return sent; } + public long getReceived() { return received; } + public ZonedDateTime getCountStartedAt() { return countStartedAt; } + public long getSentAll() { return sentAll; } + public long getReceivedAll() { return receivedAll; } + public ZonedDateTime getCreatedAt() { return createdAt; } + public ZonedDateTime getUpdatedAt() { return updatedAt; } + + //------------------------------------------------------------------------------------------------- + @JsonIgnore + public boolean hasRecord() { + return id != null; + } + + //------------------------------------------------------------------------------------------------- + public void setId(final Long id) { this.id = id; } + public void setMeasurement(final QoSIntraMeasurementResponseDTO measurement) { this.measurement = measurement; } + public void setAvailable(final boolean available) { this.available = available; } + public void setLastAccessAt(final ZonedDateTime lastAccessAt) { this.lastAccessAt = lastAccessAt; } + public void setMinResponseTime(final Integer minResponseTime) { this.minResponseTime = minResponseTime; } + public void setMaxResponseTime(final Integer maxResponseTime) { this.maxResponseTime = maxResponseTime; } + public void setMeanResponseTimeWithTimeout(final Integer meanResponseTimeWithTimeout) { this.meanResponseTimeWithTimeout = meanResponseTimeWithTimeout; } + public void setMeanResponseTimeWithoutTimeout(final Integer meanResponseTimeWithoutTimeout) { this.meanResponseTimeWithoutTimeout = meanResponseTimeWithoutTimeout; } + public void setJitterWithTimeout(final Integer jitterWithTimeout) { this.jitterWithTimeout = jitterWithTimeout; } + public void setJitterWithoutTimeout(final Integer jitterWithoutTimeout) { this.jitterWithoutTimeout = jitterWithoutTimeout; } + public void setLostPerMeasurementPercent(final Integer lostPerMeasurementPercent) { this.lostPerMeasurementPercent = lostPerMeasurementPercent; } + public void setSent(final long sent) { this.sent = sent; } + public void setReceived(final long received) { this.received = received; } + public void setCountStartedAt(final ZonedDateTime countStartedAt) { this.countStartedAt = countStartedAt; } + public void setSentAll(final long sentAll) { this.sentAll = sentAll; } + public void setReceivedAll(final long receivedAll) { this.receivedAll = receivedAll; } + public void setCreatedAt(final ZonedDateTime createdAt) { this.createdAt = createdAt; } + public void setUpdatedAt(final ZonedDateTime updatedAt) { this.updatedAt = updatedAt; } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/QoSIntraMeasurementResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/QoSIntraMeasurementResponseDTO.java new file mode 100644 index 000000000..6641dc2e2 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/QoSIntraMeasurementResponseDTO.java @@ -0,0 +1,57 @@ +package eu.arrowhead.common.dto.internal; + +import java.io.Serializable; +import java.time.ZonedDateTime; + +import eu.arrowhead.common.dto.shared.QoSMeasurementType; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; + +public class QoSIntraMeasurementResponseDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = -8158447252910402563L; + + private long id; + private SystemResponseDTO system; + private QoSMeasurementType measurementType; + private ZonedDateTime lastMeasurementAt; + private ZonedDateTime createdAt; + private ZonedDateTime updatedAt; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public QoSIntraMeasurementResponseDTO() {} + + //------------------------------------------------------------------------------------------------- + public QoSIntraMeasurementResponseDTO(final long id, final SystemResponseDTO system, final QoSMeasurementType measurementType, + final ZonedDateTime lastMeasurementAt, final ZonedDateTime createdAt, final ZonedDateTime updatedAt) { + + this.id = id; + this.system = system; + this.measurementType = measurementType; + this.lastMeasurementAt = lastMeasurementAt; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + //------------------------------------------------------------------------------------------------- + public long getId() { return id; } + public SystemResponseDTO getSystem() { return system; } + public QoSMeasurementType getMeasurementType() { return measurementType; } + public ZonedDateTime getLastMeasurementAt() { return lastMeasurementAt; } + public ZonedDateTime getCreatedAt() { return createdAt; } + public ZonedDateTime getUpdatedAt() { return updatedAt; } + + //------------------------------------------------------------------------------------------------- + public void setId(final long id) { this.id = id; } + public void setSystem(final SystemResponseDTO system) { this.system = system; } + public void setMeasurementType(final QoSMeasurementType measurementType) { this.measurementType = measurementType; } + public void setLastMeasurementAt(final ZonedDateTime lastMeasurementAt) { this.lastMeasurementAt = lastMeasurementAt; } + public void setCreatedAt(final ZonedDateTime createdAt) { this.createdAt = createdAt; } + public void setUpdatedAt(final ZonedDateTime updatedAt) { this.updatedAt = updatedAt; } + +} \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/OrchestratorApplicationInitListener.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/OrchestratorApplicationInitListener.java index 1e1f7cdea..5e137cd62 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/OrchestratorApplicationInitListener.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/OrchestratorApplicationInitListener.java @@ -1,5 +1,6 @@ package eu.arrowhead.core.orchestrator; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -70,12 +71,20 @@ public QoSManager getQoSManager() { //------------------------------------------------------------------------------------------------- @Override protected List getRequiredCoreSystemServiceUris() { + final List result = new ArrayList<>(5); + result.add(CoreSystemService.AUTH_TOKEN_GENERATION_SERVICE); + result.add(CoreSystemService.AUTH_CONTROL_INTRA_SERVICE); + if (gatekeeperIsPresent) { - return List.of(CoreSystemService.AUTH_TOKEN_GENERATION_SERVICE, CoreSystemService.AUTH_CONTROL_INTRA_SERVICE, CoreSystemService.GATEKEEPER_GLOBAL_SERVICE_DISCOVERY, - CoreSystemService.GATEKEEPER_INTER_CLOUD_NEGOTIATION); + result.add(CoreSystemService.GATEKEEPER_GLOBAL_SERVICE_DISCOVERY); + result.add(CoreSystemService.GATEKEEPER_INTER_CLOUD_NEGOTIATION); + } + + if (qosEnabled) { + result.add(CoreSystemService.QOS_MONITOR_PING_MEASUREMENT_SERVICE); } - return List.of(CoreSystemService.AUTH_TOKEN_GENERATION_SERVICE, CoreSystemService.AUTH_CONTROL_INTRA_SERVICE); + return result; } //------------------------------------------------------------------------------------------------- diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java index 0cc81138b..b34cefc76 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java @@ -32,6 +32,7 @@ import eu.arrowhead.common.dto.internal.ICNRequestFormDTO; import eu.arrowhead.common.dto.internal.ICNResultDTO; import eu.arrowhead.common.dto.internal.IdIdListDTO; +import eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO; import eu.arrowhead.common.dto.internal.TokenDataDTO; import eu.arrowhead.common.dto.internal.TokenGenerationProviderDTO; import eu.arrowhead.common.dto.internal.TokenGenerationRequestDTO; @@ -58,6 +59,7 @@ public class OrchestratorDriver { private static final String AUTH_INTRA_CHECK_URI_KEY = CoreSystemService.AUTH_CONTROL_INTRA_SERVICE.getServiceDefinition() + CoreCommonConstants.URI_SUFFIX; private static final String GATEKEEPER_INIT_GSD_URI_KEY = CoreSystemService.GATEKEEPER_GLOBAL_SERVICE_DISCOVERY.getServiceDefinition() + CoreCommonConstants.URI_SUFFIX; private static final String GATEKEEPER_INIT_ICN_URI_KEY = CoreSystemService.GATEKEEPER_INTER_CLOUD_NEGOTIATION.getServiceDefinition() + CoreCommonConstants.URI_SUFFIX; + private static final String QOS_MONITOR_PING_MEASUREMENT_URI_KEY = CoreSystemService.QOS_MONITOR_PING_MEASUREMENT_SERVICE.getServiceDefinition() + CoreCommonConstants.URI_SUFFIX; public static final String KEY_CALCULATED_SERVICE_TIME_FRAME = "QoSCalculatedServiceTimeFrame"; @@ -180,9 +182,8 @@ public ICNResultDTO doInterCloudNegotiation(final ICNRequestFormDTO icnForm) { return response.getBody(); } - //------------------------------------------------------------------------------------------------- - public GSDQueryResultDTO doGlobalServiceDiscovery(final GSDQueryFormDTO gsdForm ) { + public GSDQueryResultDTO doGlobalServiceDiscovery(final GSDQueryFormDTO gsdForm) { logger.debug("doGlobalServiceDiscovery started..."); Assert.notNull(gsdForm, "GSDPollRequestDTO is null."); @@ -192,6 +193,16 @@ public GSDQueryResultDTO doGlobalServiceDiscovery(final GSDQueryFormDTO gsdForm return response.getBody(); } + //------------------------------------------------------------------------------------------------- + public PingMeasurementResponseDTO getPingMeasurement(final long systemId) { + logger.debug("getPingMeasurement started..."); + + final UriComponents pingUri = getQosMonitorPingMeasurementUri(systemId); + final ResponseEntity response = httpService.sendRequest(pingUri, HttpMethod.GET, PingMeasurementResponseDTO.class); + + return response.getBody(); + } + //================================================================================================= // assistant methods @@ -300,6 +311,22 @@ private UriComponents getGatekeeperICNUri() { throw new ArrowheadException("Orchestrator can't find gatekeeper init_icn URI."); } + //------------------------------------------------------------------------------------------------- + private UriComponents getQosMonitorPingMeasurementUri(final long id) { + logger.debug("getQosMonitorPingMeasurementUri started..."); + + if (arrowheadContext.containsKey(QOS_MONITOR_PING_MEASUREMENT_URI_KEY)) { + try { + final UriComponents uri = (UriComponents) arrowheadContext.get(QOS_MONITOR_PING_MEASUREMENT_URI_KEY); + return uri.expand(id); + } catch (final ClassCastException ex) { + throw new ArrowheadException("Orchestrator can't find QoS Monitor ping/measurement URI."); + } + } + + throw new ArrowheadException("Orchestrator can't find gatekeeper init_icn URI."); + } + //------------------------------------------------------------------------------------------------- private List convertOrchestrationResultListToTokenGenHelperList(final List orList) { logger.debug("convertOrchestrationResultListToTokenGenHelperList started..."); diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifier.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifier.java index 16f98d358..3737b39f0 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifier.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifier.java @@ -1,19 +1,250 @@ package eu.arrowhead.core.qos.manager.impl; +import java.time.ZonedDateTime; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.util.Assert; + +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO; +import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; +import eu.arrowhead.common.exception.InvalidParameterException; +import eu.arrowhead.core.orchestrator.service.OrchestratorDriver; import eu.arrowhead.core.qos.manager.QoSVerifier; public class PingRequirementsVerifier implements QoSVerifier { + //================================================================================================= + // members + + private static final boolean verifyNotMeasuredSystem = true; // result of verify if a system has no ping records + + @Value(CoreCommonConstants.$QOS_PING_MEASUREMENT_CACHE_THRESHOLD_WD) + private int pingMeasurementCacheThreshold; + + @Autowired + private OrchestratorDriver orchestrationDriver; + + private static final Logger logger = LogManager.getLogger(PingRequirementsVerifier.class); + + private Map pingMeasurementCache = new ConcurrentHashMap<>(); + //================================================================================================= // methods //------------------------------------------------------------------------------------------------- @Override public boolean verify(final OrchestrationResultDTO result, final Map qosRequirements, final Map commands) { - // TODO Auto-generated method stub + logger.debug("verify started..."); + validateInput(result); + + if (qosRequirements == null || qosRequirements.isEmpty()) { // no need to verify anything + return true; + } + + final PingMeasurementResponseDTO measurement = getPingMeasurement(result.getProvider().getId()); + + if (!measurement.hasRecord()) { // no record => use related constant to determine output + return verifyNotMeasuredSystem; + } + + if (!measurement.isAvailable()) { + return false; + } + + if (hasMaximumResponseTimeThreshold(qosRequirements)) { + final int threshold = getMaximumResponseTimeThreshold(qosRequirements); + if (measurement.getMaxResponseTime().intValue() > threshold) { + logger.debug("Provider '{}' (id: {}) removed because of maximum response time threshold", result.getProvider().getSystemName(), result.getProvider().getId()); + return false; + } + } + + if (hasAverageResponseTimeThreshold(qosRequirements)) { + final int threshold = getAverageResponseTimeThreshold(qosRequirements); + if (measurement.getMeanResponseTimeWithoutTimeout().intValue() > threshold) { + logger.debug("Provider '{}' (id: {}) removed because of average response time threshold", result.getProvider().getSystemName(), result.getProvider().getId()); + return false; + } + } + + if (hasJitterThreshold(qosRequirements)) { + final int threshold = getJitterThreshold(qosRequirements); + if (measurement.getJitterWithoutTimeout().intValue() > threshold) { + logger.debug("Provider '{}' (id: {}) removed because of jitter threshold", result.getProvider().getSystemName(), result.getProvider().getId()); + return false; + } + } + + if (hasRecentPacketLossThreshold(qosRequirements)) { + final double threshold = getRecentPacketLossThreshold(qosRequirements); + final double recentPacketLoss = measurement.getReceived() / (double) measurement.getSent(); + if (recentPacketLoss > threshold) { + logger.debug("Provider '{}' (id: {}) removed because of recent packet loss threshold", result.getProvider().getSystemName(), result.getProvider().getId()); + return false; + } + } + + if (hasPacketLossThreshold(qosRequirements)) { + final double threshold = getPacketLossThreshold(qosRequirements); + final double packetLoss = measurement.getReceivedAll() / (double) measurement.getSentAll(); + if (packetLoss > threshold) { + logger.debug("Provider '{}' (id: {}) removed because of packet loss threshold", result.getProvider().getSystemName(), result.getProvider().getId()); + return false; + } + } + return true; } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private void validateInput(final OrchestrationResultDTO result) { + logger.debug("validateInput started..."); + + Assert.notNull(result, "'result' is null"); + Assert.notNull(result.getProvider(), "Provider is null"); + } + + //------------------------------------------------------------------------------------------------- + private boolean hasMaximumResponseTimeThreshold(final Map qosRequirements) { + return qosRequirements.containsKey(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RESPONSE_TIME_THRESHOLD); + } + + //------------------------------------------------------------------------------------------------- + private boolean hasAverageResponseTimeThreshold(final Map qosRequirements) { + return qosRequirements.containsKey(OrchestrationFormRequestDTO.QOS_REQUIREMENT_AVERAGE_RESPONSE_TIME_THRESHOLD); + } + + //------------------------------------------------------------------------------------------------- + private boolean hasJitterThreshold(final Map qosRequirements) { + return qosRequirements.containsKey(OrchestrationFormRequestDTO.QOS_REQUIREMENT_JITTER_THRESHOLD); + } + + //------------------------------------------------------------------------------------------------- + private boolean hasRecentPacketLossThreshold(final Map qosRequirements) { + return qosRequirements.containsKey(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RECENT_PACKET_LOSS); + } + + //------------------------------------------------------------------------------------------------- + private boolean hasPacketLossThreshold(final Map qosRequirements) { + return qosRequirements.containsKey(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_PACKET_LOSS); + } + + //------------------------------------------------------------------------------------------------- + private int getMaximumResponseTimeThreshold(final Map qosRequirements) { + logger.debug("getMaximumResponseTimeThreshold started..."); + + final String valueStr = qosRequirements.get(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RESPONSE_TIME_THRESHOLD); + try { + final int value = Integer.parseInt(valueStr); + if (value <= 0) { + throw new InvalidParameterException(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RESPONSE_TIME_THRESHOLD + " has invalid value: " + valueStr); + } + + return value; + } catch (final NumberFormatException ex) { + throw new InvalidParameterException(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RESPONSE_TIME_THRESHOLD + " has invalid value: " + valueStr); + } + } + + //------------------------------------------------------------------------------------------------- + private int getAverageResponseTimeThreshold(final Map qosRequirements) { + logger.debug("getAverageResponseTimeThreshold started..."); + + final String valueStr = qosRequirements.get(OrchestrationFormRequestDTO.QOS_REQUIREMENT_AVERAGE_RESPONSE_TIME_THRESHOLD); + try { + final int value = Integer.parseInt(valueStr); + if (value <= 0) { + throw new InvalidParameterException(OrchestrationFormRequestDTO.QOS_REQUIREMENT_AVERAGE_RESPONSE_TIME_THRESHOLD + " has invalid value: " + valueStr); + } + + return value; + } catch (final NumberFormatException ex) { + throw new InvalidParameterException(OrchestrationFormRequestDTO.QOS_REQUIREMENT_AVERAGE_RESPONSE_TIME_THRESHOLD + " has invalid value: " + valueStr); + } + } + + //------------------------------------------------------------------------------------------------- + private int getJitterThreshold(final Map qosRequirements) { + logger.debug("getJitterThreshold started..."); + + final String valueStr = qosRequirements.get(OrchestrationFormRequestDTO.QOS_REQUIREMENT_JITTER_THRESHOLD); + try { + final int value = Integer.parseInt(valueStr); + if (value <= 0) { + throw new InvalidParameterException(OrchestrationFormRequestDTO.QOS_REQUIREMENT_JITTER_THRESHOLD + " has invalid value: " + valueStr); + } + + return value; + } catch (final NumberFormatException ex) { + throw new InvalidParameterException(OrchestrationFormRequestDTO.QOS_REQUIREMENT_JITTER_THRESHOLD + " has invalid value: " + valueStr); + } + } + + //------------------------------------------------------------------------------------------------- + private double getRecentPacketLossThreshold(final Map qosRequirements) { + logger.debug("getRecentPacketLossThreshold started..."); + + final String valueStr = qosRequirements.get(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RECENT_PACKET_LOSS); + try { + final int value = Integer.parseInt(valueStr); + if (value <= 0) { + throw new InvalidParameterException(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RECENT_PACKET_LOSS + " has invalid value: " + valueStr); + } + + return value / 100.; + } catch (final NumberFormatException ex) { + throw new InvalidParameterException(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RECENT_PACKET_LOSS + " has invalid value: " + valueStr); + } + } + + //------------------------------------------------------------------------------------------------- + private double getPacketLossThreshold(final Map qosRequirements) { + logger.debug("getPacketLossThreshold started..."); + + final String valueStr = qosRequirements.get(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_PACKET_LOSS); + try { + final int value = Integer.parseInt(valueStr); + if (value <= 0) { + throw new InvalidParameterException(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_PACKET_LOSS + " has invalid value: " + valueStr); + } + + return value / 100.; + } catch (final NumberFormatException ex) { + throw new InvalidParameterException(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_PACKET_LOSS + " has invalid value: " + valueStr); + } + } + + //------------------------------------------------------------------------------------------------- + private PingMeasurementResponseDTO getPingMeasurement(final long systemId) { + logger.debug("getPingMeasurement started..."); + + final PingMeasurementResponseDTO measurement = pingMeasurementCache.get(systemId); + + if (measurement == null) { + return getPingMeasurementFromQoSMonitor(systemId); + } + + if (measurement.getMeasurement().getLastMeasurementAt().plusSeconds(pingMeasurementCacheThreshold).isBefore(ZonedDateTime.now())) { // obsolete record + pingMeasurementCache.remove(systemId); + return getPingMeasurementFromQoSMonitor(systemId); + } + + return measurement; + } + + //------------------------------------------------------------------------------------------------- + private PingMeasurementResponseDTO getPingMeasurementFromQoSMonitor(final long systemId) { + logger.debug("getPingMeasurementFromQoSMonitor started..."); + return orchestrationDriver.getPingMeasurement(systemId); + } } \ No newline at end of file diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/ServiceTimeVerifier.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/ServiceTimeVerifier.java index f3cc5ee7c..ef78739ee 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/ServiceTimeVerifier.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/ServiceTimeVerifier.java @@ -4,6 +4,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.springframework.util.Assert; import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; @@ -30,6 +31,13 @@ public class ServiceTimeVerifier implements QoSVerifier { //------------------------------------------------------------------------------------------------- @Override public boolean verify(final OrchestrationResultDTO result, final Map qosRequirements, final Map commands) { + logger.debug("verify started..."); + Assert.notNull(result, "'result' is null."); + Assert.notNull(result.getMetadata(), "'result.getMetadata()' is null."); + Assert.notNull(result.getWarnings(), "'result.getWarnings()' is null."); + Assert.notNull(commands, "'commands' is null."); + + int recommendedTime = -1; // no restrictions if (result.getMetadata().containsKey(ServiceRegistryRequestDTO.KEY_RECOMMENDED_ORCHESTRATION_TIME)) { try { diff --git a/orchestrator/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/orchestrator/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 02ef2b997..c6a4240dd 100644 --- a/orchestrator/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/orchestrator/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -53,5 +53,10 @@ "name": "qos_reservation_check_interval", "type": "java.lang.Integer", "description": "A description for 'qos_reservation_check_interval'" + }, + { + "name": "qos_ping_measurement_cache_threshold", + "type": "java.lang.Integer", + "description": "A description for 'qos_ping_measurement_cache_threshold'" } ]} \ No newline at end of file diff --git a/orchestrator/src/main/resources/application.properties b/orchestrator/src/main/resources/application.properties index bc3c596b4..da28b1c45 100644 --- a/orchestrator/src/main/resources/application.properties +++ b/orchestrator/src/main/resources/application.properties @@ -44,6 +44,9 @@ enable_qos=true #How frequently the database should be checked for expired reservations, in seconds qos_reservation_check_interval=120 +#How long a cached ping measurement can use without refreshing using the Qos Monitor's webservice, in seconds +qos_ping_measurement_cache_threshold=600 + # Interface names has to follow this format --, where security can be SECURE or INSECURE and protocol and format must be a sequence of letters, numbers and underscore. # A regexp checker will verify that. If this setting is set to true then the PROTOCOL and FORMAT must come from a predefined set. use_strict_service_intf_name_verifier=false From 3ac55c1dd952829a8943c4e0c0f0d8dc432a7e7c Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 4 Feb 2020 17:56:53 +0100 Subject: [PATCH 103/301] started to implement QoSDBServiceTests --- .../qos/databse/service/QoSDBServiceTest.java | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 qos-monitor/src/test/java/eu/arrowhead/core/qos/databse/service/QoSDBServiceTest.java diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/databse/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/databse/service/QoSDBServiceTest.java new file mode 100644 index 000000000..d21b275fd --- /dev/null +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/databse/service/QoSDBServiceTest.java @@ -0,0 +1,125 @@ +package eu.arrowhead.core.qos.databse.service; + +import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.List; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.junit4.SpringRunner; + +import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.database.entity.QoSIntraMeasurement; +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; +import eu.arrowhead.common.database.repository.QoSIntraMeasurementPingRepository; +import eu.arrowhead.common.database.repository.QoSIntraMeasurementRepository; +import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogDetailsRepository; +import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogRepository; +import eu.arrowhead.common.database.repository.SystemRepository; +import eu.arrowhead.common.dto.shared.QoSMeasurementType; +import eu.arrowhead.common.exception.InvalidParameterException; +import eu.arrowhead.core.qos.database.service.QoSDBService; + +@RunWith(SpringRunner.class) +public class QoSDBServiceTest { + + //================================================================================================= + // members + @InjectMocks + private QoSDBService qoSDBService; + + @Mock + private QoSIntraMeasurementRepository qoSIntraMeasurementRepository; + + @Mock + private QoSIntraMeasurementPingRepository qoSIntraMeasurementPingRepository; + + @Mock + private QoSIntraPingMeasurementLogRepository qoSIntraPingMeasurementLogRepository; + + @Mock + private QoSIntraPingMeasurementLogDetailsRepository qoSIntraPingMeasurementLogDetailsRepository; + + @Mock + private SystemRepository systemRepository; + + private static final String LESS_THAN_ONE_ERROR_MESSAGE= " must be greater than zero."; + private static final String NOT_AVAILABLE_SORTABLE_FIELD_ERROR_MESSAGE = " sortable field is not available."; + private static final String NOT_IN_DB_ERROR_MESSAGE = " is not available in database"; + + //================================================================================================= + // methods + + //================================================================================================= + // Tests of updateCountStartedAt + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testUpdateCountStartedAt() { + + final List measurementList = getQosIntraPingMeasurementListForTest(); + + //TODO Implement testing logic here + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private List getQosIntraPingMeasurementListForTest() { + + final int sizeOfMeasurementList = 3; + final List qoSIntraPingMeasurementList = new ArrayList<>(sizeOfMeasurementList); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + for (int i = 0; i < sizeOfMeasurementList; i++) { + + final QoSIntraPingMeasurement pingMeasurement = new QoSIntraPingMeasurement(); + pingMeasurement.setMeasurement(measurement); + pingMeasurement.setAvailable(true); + pingMeasurement.setMaxResponseTime(1); + pingMeasurement.setMinResponseTime(1); + pingMeasurement.setMeanResponseTimeWithoutTimeout(1); + pingMeasurement.setMeanResponseTimeWithTimeout(1); + pingMeasurement.setJitterWithoutTimeout(1); + pingMeasurement.setJitterWithTimeout(1); + pingMeasurement.setLostPerMeasurementPercent(0); + pingMeasurement.setCountStartedAt(ZonedDateTime.now()); + pingMeasurement.setLastAccessAt(ZonedDateTime.now()); + pingMeasurement.setSent(35); + pingMeasurement.setSentAll(35); + pingMeasurement.setReceived(35); + pingMeasurement.setReceivedAll(35); + } + + return qoSIntraPingMeasurementList; + } + + //------------------------------------------------------------------------------------------------- + private QoSIntraMeasurement getQoSIntraMeasurementForTest() { + + final System system = getSystemForTest(); + final QoSIntraMeasurement measurement = new QoSIntraMeasurement( + system, + QoSMeasurementType.PING, + ZonedDateTime.now()); + + return measurement; + } + + //------------------------------------------------------------------------------------------------- + private System getSystemForTest() { + + final System system = new System( + "testSystem", + "address", + 12345, + "authenticationInfo"); + + return system; + } +} From 864f4e9f39c49e224e8b374ea2bdb0f70db79b27 Mon Sep 17 00:00:00 2001 From: Svetlin Tanyi Date: Tue, 4 Feb 2020 18:57:06 +0100 Subject: [PATCH 104/301] Fixed a typo in documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ba608b505..aca133d2d 100644 --- a/README.md +++ b/README.md @@ -3322,7 +3322,7 @@ __ServiceRequestForm__ is the input "string" ], "securityRequirements": [ - "NOT_SECURE", "CEERTIFICATE", "TOKEN" + "NOT_SECURE", "CERTIFICATE", "TOKEN" ], "metadataRequirements": { "additionalProp1": "string", From e21ed47408e226aa0836c403e6b8ba1fabd20b8b Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 5 Feb 2020 10:34:16 +0100 Subject: [PATCH 105/301] implemented updateCountStartedAt tests --- .../database/service/QoSDBServiceTest.java | 263 ++++++++++++++++++ .../qos/databse/service/QoSDBServiceTest.java | 125 --------- 2 files changed, 263 insertions(+), 125 deletions(-) create mode 100644 qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java delete mode 100644 qos-monitor/src/test/java/eu/arrowhead/core/qos/databse/service/QoSDBServiceTest.java diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java new file mode 100644 index 000000000..42fc5b431 --- /dev/null +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -0,0 +1,263 @@ +package eu.arrowhead.core.qos.database.service; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.List; + +import org.hibernate.HibernateException; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.springframework.test.context.junit4.SpringRunner; + +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.database.entity.QoSIntraMeasurement; +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; +import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.database.repository.QoSIntraMeasurementPingRepository; +import eu.arrowhead.common.database.repository.QoSIntraMeasurementRepository; +import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogDetailsRepository; +import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogRepository; +import eu.arrowhead.common.database.repository.SystemRepository; +import eu.arrowhead.common.dto.shared.QoSMeasurementType; +import eu.arrowhead.common.exception.ArrowheadException; + +@RunWith(SpringRunner.class) +public class QoSDBServiceTest { + + //================================================================================================= + // members + @InjectMocks + private QoSDBService qoSDBService; + + @Mock + private QoSIntraMeasurementRepository qoSIntraMeasurementRepository; + + @Mock + private QoSIntraMeasurementPingRepository qoSIntraMeasurementPingRepository; + + @Mock + private QoSIntraPingMeasurementLogRepository qoSIntraPingMeasurementLogRepository; + + @Mock + private QoSIntraPingMeasurementLogDetailsRepository qoSIntraPingMeasurementLogDetailsRepository; + + @Mock + private SystemRepository systemRepository; + + private static final String LESS_THAN_ONE_ERROR_MESSAGE= " must be greater than zero."; + private static final String NOT_AVAILABLE_SORTABLE_FIELD_ERROR_MESSAGE = " sortable field is not available."; + private static final String NOT_IN_DB_ERROR_MESSAGE = " is not available in database"; + + //================================================================================================= + // methods + + //================================================================================================= + // Tests of updateCountStartedAt + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Test + public void testUpdateCountStartedAt() { + + final ZonedDateTime testStartedAt = ZonedDateTime.now(); + final List measurementList = getQosIntraPingMeasurementListForTest(); + final ArgumentCaptor valueCapture = ArgumentCaptor.forClass(List.class); + + when(qoSIntraMeasurementPingRepository.findAll()).thenReturn(measurementList); + when(qoSIntraMeasurementPingRepository.saveAll(valueCapture.capture())).thenReturn(List.of()); + doNothing().when(qoSIntraMeasurementPingRepository).flush(); + + qoSDBService.updateCountStartedAt(); + + verify(qoSIntraMeasurementPingRepository, times(1)).findAll(); + verify(qoSIntraMeasurementPingRepository, times(1)).saveAll(any()); + verify(qoSIntraMeasurementPingRepository, times(1)).flush(); + + final List captured = valueCapture.getValue(); + assertEquals(measurementList.size(), captured.size()); + for (final QoSIntraPingMeasurement qoSIntraPingMeasurement : captured) { + + assertEquals(0, qoSIntraPingMeasurement.getSent()); + assertEquals(0, qoSIntraPingMeasurement.getReceived()); + assertTrue(qoSIntraPingMeasurement.getCountStartedAt().isAfter(testStartedAt)); + } + } + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Test(expected = ArrowheadException.class) + public void testUpdateCountStartedAtFlushThrowDatabaseException() { + + final ZonedDateTime testStartedAt = ZonedDateTime.now(); + final List measurementList = getQosIntraPingMeasurementListForTest(); + final ArgumentCaptor valueCapture = ArgumentCaptor.forClass(List.class); + + when(qoSIntraMeasurementPingRepository.findAll()).thenReturn(measurementList); + when(qoSIntraMeasurementPingRepository.saveAll(valueCapture.capture())).thenReturn(List.of()); + doThrow(HibernateException.class).when(qoSIntraMeasurementPingRepository).flush(); + + try { + + qoSDBService.updateCountStartedAt(); + + } catch (Exception ex) { + + assertEquals(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG, ex.getMessage()); + + verify(qoSIntraMeasurementPingRepository, times(1)).findAll(); + verify(qoSIntraMeasurementPingRepository, times(1)).saveAll(any()); + verify(qoSIntraMeasurementPingRepository, times(1)).flush(); + + final List captured = valueCapture.getValue(); + assertEquals(measurementList.size(), captured.size()); + for (final QoSIntraPingMeasurement qoSIntraPingMeasurement : captured) { + + assertEquals(0, qoSIntraPingMeasurement.getSent()); + assertEquals(0, qoSIntraPingMeasurement.getReceived()); + assertTrue(qoSIntraPingMeasurement.getCountStartedAt().isAfter(testStartedAt)); + } + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Test(expected = ArrowheadException.class) + public void testUpdateCountStartedAtSaveAllThrowDatabaseException() { + + final ZonedDateTime testStartedAt = ZonedDateTime.now(); + final List measurementList = getQosIntraPingMeasurementListForTest(); + final ArgumentCaptor valueCapture = ArgumentCaptor.forClass(List.class); + + when(qoSIntraMeasurementPingRepository.findAll()).thenReturn(measurementList); + when(qoSIntraMeasurementPingRepository.saveAll(valueCapture.capture())).thenThrow(HibernateException.class); + doNothing().when(qoSIntraMeasurementPingRepository).flush(); + + try { + + qoSDBService.updateCountStartedAt(); + + } catch (Exception ex) { + + assertEquals(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG, ex.getMessage()); + + verify(qoSIntraMeasurementPingRepository, times(1)).findAll(); + verify(qoSIntraMeasurementPingRepository, times(1)).saveAll(any()); + verify(qoSIntraMeasurementPingRepository, times(0)).flush(); + + final List captured = valueCapture.getValue(); + assertEquals(measurementList.size(), captured.size()); + for (final QoSIntraPingMeasurement qoSIntraPingMeasurement : captured) { + + assertEquals(0, qoSIntraPingMeasurement.getSent()); + assertEquals(0, qoSIntraPingMeasurement.getReceived()); + assertTrue(qoSIntraPingMeasurement.getCountStartedAt().isAfter(testStartedAt)); + } + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Test(expected = ArrowheadException.class) + public void testUpdateCountStartedAtFindAllThrowDatabaseException() { + + final List measurementList = getQosIntraPingMeasurementListForTest(); + + when(qoSIntraMeasurementPingRepository.findAll()).thenThrow(HibernateException.class); + when(qoSIntraMeasurementPingRepository.saveAll(any())).thenReturn(measurementList); + doNothing().when(qoSIntraMeasurementPingRepository).flush(); + + try { + + qoSDBService.updateCountStartedAt(); + + } catch (Exception ex) { + + assertEquals(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG, ex.getMessage()); + + verify(qoSIntraMeasurementPingRepository, times(1)).findAll(); + verify(qoSIntraMeasurementPingRepository, times(0)).saveAll(any()); + verify(qoSIntraMeasurementPingRepository, times(0)).flush(); + + throw ex; + } + + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private List getQosIntraPingMeasurementListForTest() { + + final int sizeOfMeasurementList = 3; + final List qoSIntraPingMeasurementList = new ArrayList<>(sizeOfMeasurementList); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + for (int i = 0; i < sizeOfMeasurementList; i++) { + + final QoSIntraPingMeasurement pingMeasurement = new QoSIntraPingMeasurement(); + pingMeasurement.setMeasurement(measurement); + pingMeasurement.setAvailable(true); + pingMeasurement.setMaxResponseTime(1); + pingMeasurement.setMinResponseTime(1); + pingMeasurement.setMeanResponseTimeWithoutTimeout(1); + pingMeasurement.setMeanResponseTimeWithTimeout(1); + pingMeasurement.setJitterWithoutTimeout(1); + pingMeasurement.setJitterWithTimeout(1); + pingMeasurement.setLostPerMeasurementPercent(0); + pingMeasurement.setCountStartedAt(ZonedDateTime.now()); + pingMeasurement.setLastAccessAt(ZonedDateTime.now()); + pingMeasurement.setSent(35); + pingMeasurement.setSentAll(35); + pingMeasurement.setReceived(35); + pingMeasurement.setReceivedAll(35); + + qoSIntraPingMeasurementList.add(pingMeasurement); + } + + return qoSIntraPingMeasurementList; + } + + //------------------------------------------------------------------------------------------------- + private QoSIntraMeasurement getQoSIntraMeasurementForTest() { + + final System system = getSystemForTest(); + final QoSIntraMeasurement measurement = new QoSIntraMeasurement( + system, + QoSMeasurementType.PING, + ZonedDateTime.now()); + + return measurement; + } + + //------------------------------------------------------------------------------------------------- + private System getSystemForTest() { + + final System system = new System( + "testSystem", + "address", + 12345, + "authenticationInfo"); + + return system; + } +} diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/databse/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/databse/service/QoSDBServiceTest.java deleted file mode 100644 index d21b275fd..000000000 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/databse/service/QoSDBServiceTest.java +++ /dev/null @@ -1,125 +0,0 @@ -package eu.arrowhead.core.qos.databse.service; - -import java.time.ZonedDateTime; -import java.util.ArrayList; -import java.util.List; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.junit4.SpringRunner; - -import eu.arrowhead.common.database.entity.System; -import eu.arrowhead.common.database.entity.QoSIntraMeasurement; -import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; -import eu.arrowhead.common.database.repository.QoSIntraMeasurementPingRepository; -import eu.arrowhead.common.database.repository.QoSIntraMeasurementRepository; -import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogDetailsRepository; -import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogRepository; -import eu.arrowhead.common.database.repository.SystemRepository; -import eu.arrowhead.common.dto.shared.QoSMeasurementType; -import eu.arrowhead.common.exception.InvalidParameterException; -import eu.arrowhead.core.qos.database.service.QoSDBService; - -@RunWith(SpringRunner.class) -public class QoSDBServiceTest { - - //================================================================================================= - // members - @InjectMocks - private QoSDBService qoSDBService; - - @Mock - private QoSIntraMeasurementRepository qoSIntraMeasurementRepository; - - @Mock - private QoSIntraMeasurementPingRepository qoSIntraMeasurementPingRepository; - - @Mock - private QoSIntraPingMeasurementLogRepository qoSIntraPingMeasurementLogRepository; - - @Mock - private QoSIntraPingMeasurementLogDetailsRepository qoSIntraPingMeasurementLogDetailsRepository; - - @Mock - private SystemRepository systemRepository; - - private static final String LESS_THAN_ONE_ERROR_MESSAGE= " must be greater than zero."; - private static final String NOT_AVAILABLE_SORTABLE_FIELD_ERROR_MESSAGE = " sortable field is not available."; - private static final String NOT_IN_DB_ERROR_MESSAGE = " is not available in database"; - - //================================================================================================= - // methods - - //================================================================================================= - // Tests of updateCountStartedAt - - //------------------------------------------------------------------------------------------------- - @Test(expected = InvalidParameterException.class) - public void testUpdateCountStartedAt() { - - final List measurementList = getQosIntraPingMeasurementListForTest(); - - //TODO Implement testing logic here - } - - //================================================================================================= - // assistant methods - - //------------------------------------------------------------------------------------------------- - private List getQosIntraPingMeasurementListForTest() { - - final int sizeOfMeasurementList = 3; - final List qoSIntraPingMeasurementList = new ArrayList<>(sizeOfMeasurementList); - - final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - - for (int i = 0; i < sizeOfMeasurementList; i++) { - - final QoSIntraPingMeasurement pingMeasurement = new QoSIntraPingMeasurement(); - pingMeasurement.setMeasurement(measurement); - pingMeasurement.setAvailable(true); - pingMeasurement.setMaxResponseTime(1); - pingMeasurement.setMinResponseTime(1); - pingMeasurement.setMeanResponseTimeWithoutTimeout(1); - pingMeasurement.setMeanResponseTimeWithTimeout(1); - pingMeasurement.setJitterWithoutTimeout(1); - pingMeasurement.setJitterWithTimeout(1); - pingMeasurement.setLostPerMeasurementPercent(0); - pingMeasurement.setCountStartedAt(ZonedDateTime.now()); - pingMeasurement.setLastAccessAt(ZonedDateTime.now()); - pingMeasurement.setSent(35); - pingMeasurement.setSentAll(35); - pingMeasurement.setReceived(35); - pingMeasurement.setReceivedAll(35); - } - - return qoSIntraPingMeasurementList; - } - - //------------------------------------------------------------------------------------------------- - private QoSIntraMeasurement getQoSIntraMeasurementForTest() { - - final System system = getSystemForTest(); - final QoSIntraMeasurement measurement = new QoSIntraMeasurement( - system, - QoSMeasurementType.PING, - ZonedDateTime.now()); - - return measurement; - } - - //------------------------------------------------------------------------------------------------- - private System getSystemForTest() { - - final System system = new System( - "testSystem", - "address", - 12345, - "authenticationInfo"); - - return system; - } -} From 71199b11f88183716409442590f6aeb311dfb1ad Mon Sep 17 00:00:00 2001 From: rbocsi Date: Wed, 5 Feb 2020 10:35:13 +0100 Subject: [PATCH 106/301] fix verify bug --- .../core/qos/manager/impl/QoSManagerImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java index 0ee006111..3fdac3a7b 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java @@ -130,11 +130,13 @@ public void confirmReservation(final OrchestrationResultDTO selected, final List public List verifyServices(final List orList, final OrchestrationFormRequestDTO request) { logger.debug("verifyServices started ..."); + final boolean needLockRelease = request.getCommands().containsKey(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY); + final List result = new ArrayList<>(); for (final OrchestrationResultDTO dto : orList) { - final boolean needLockRelease = request.getCommands().containsKey(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY); + boolean verified = true; for (final QoSVerifier verifier : verifiers) { - final boolean verified = verifier.verify(dto, request.getQosRequirements(), request.getCommands()); + verified = verifier.verify(dto, request.getQosRequirements(), request.getCommands()); if (!verified) { if (needLockRelease) { qosReservationDBService.removeTemporaryLock(dto); @@ -144,7 +146,9 @@ public List verifyServices(final List Date: Wed, 5 Feb 2020 10:59:01 +0100 Subject: [PATCH 107/301] ping measurement driver method tests --- .../service/OrchestratorDriverTest.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriverTest.java b/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriverTest.java index 5384af3da..8187e9afe 100644 --- a/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriverTest.java +++ b/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriverTest.java @@ -31,6 +31,7 @@ import eu.arrowhead.common.dto.internal.ICNRequestFormDTO; import eu.arrowhead.common.dto.internal.ICNResultDTO; import eu.arrowhead.common.dto.internal.IdIdListDTO; +import eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO; import eu.arrowhead.common.dto.internal.TokenDataDTO; import eu.arrowhead.common.dto.internal.TokenGenerationRequestDTO; import eu.arrowhead.common.dto.internal.TokenGenerationResponseDTO; @@ -395,6 +396,42 @@ public void testDoInterCloudNegotiationsNullRequest() { orchestratorDriver.doInterCloudNegotiation(null); } + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testGetPingMeasurementUriNotFound() { + when(arrowheadContext.containsKey(any(String.class))).thenReturn(false); + + orchestratorDriver.getPingMeasurement(1); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testGetPingMeasurementUriWrongType() { + when(arrowheadContext.containsKey(any(String.class))).thenReturn(true); + when(arrowheadContext.get(any(String.class))).thenReturn("invalid"); + + orchestratorDriver.getPingMeasurement(1); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testGetPingMeasurementOk() { + final int systemId = 23; + final UriComponents uri = Utilities.createURI(CommonConstants.HTTPS, "localhost", 8451, CommonConstants.QOS_MONITOR_URI + CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT + + CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT_SUFFIX).expand(systemId); + Assert.assertTrue(uri.toString().contains("/ping/measurement/23")); + + final PingMeasurementResponseDTO responseDTO = new PingMeasurementResponseDTO(); + when(arrowheadContext.containsKey(any(String.class))).thenReturn(true); + when(arrowheadContext.get(any(String.class))).thenReturn(uri); + when(httpService.sendRequest(eq(uri), eq(HttpMethod.GET), eq(PingMeasurementResponseDTO.class))).thenReturn(new ResponseEntity(responseDTO, HttpStatus.OK)); + + final PingMeasurementResponseDTO result = orchestratorDriver.getPingMeasurement(systemId); + + Assert.assertNotNull(result); + Assert.assertFalse(result.hasRecord()); + } + //================================================================================================= // assistant methods From 6547550947aa6f659cbc982bf257372f6b17c947 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 5 Feb 2020 12:38:41 +0100 Subject: [PATCH 108/301] implemented createMeasurement --- .../qos/database/service/QoSDBService.java | 3 +- .../database/service/QoSDBServiceTest.java | 89 ++++++++++++++++++- 2 files changed, 88 insertions(+), 4 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index 2443bf77b..070706418 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -89,7 +89,7 @@ public void updateCountStartedAt() { //------------------------------------------------------------------------------------------------- @Transactional (rollbackFor = ArrowheadException.class) - public QoSIntraMeasurement createMeasurement(final System system,final QoSMeasurementType ping,final ZonedDateTime aroundNow) { + public QoSIntraMeasurement createMeasurement(final System system, final QoSMeasurementType ping, final ZonedDateTime aroundNow) { logger.debug("createMeasurement started..."); final QoSIntraMeasurement measurement = new QoSIntraMeasurement(system, QoSMeasurementType.PING, aroundNow); @@ -102,6 +102,7 @@ public QoSIntraMeasurement createMeasurement(final System system,final QoSMeasur logger.debug(ex.getMessage(), ex); throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } + return measurement; } diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index 42fc5b431..9cd184df9 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -3,6 +3,8 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.times; @@ -12,6 +14,7 @@ import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.List; +import java.util.Optional; import org.hibernate.HibernateException; import org.junit.Test; @@ -30,7 +33,9 @@ import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogDetailsRepository; import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogRepository; import eu.arrowhead.common.database.repository.SystemRepository; +import eu.arrowhead.common.dto.internal.DTOConverter; import eu.arrowhead.common.dto.shared.QoSMeasurementType; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; @RunWith(SpringRunner.class) @@ -71,7 +76,7 @@ public class QoSDBServiceTest { @Test public void testUpdateCountStartedAt() { - final ZonedDateTime testStartedAt = ZonedDateTime.now(); + final ZonedDateTime testStartedAt = ZonedDateTime.now().minusMinutes(1); final List measurementList = getQosIntraPingMeasurementListForTest(); final ArgumentCaptor valueCapture = ArgumentCaptor.forClass(List.class); @@ -100,7 +105,7 @@ public void testUpdateCountStartedAt() { @Test(expected = ArrowheadException.class) public void testUpdateCountStartedAtFlushThrowDatabaseException() { - final ZonedDateTime testStartedAt = ZonedDateTime.now(); + final ZonedDateTime testStartedAt = ZonedDateTime.now().minusMinutes(1);; final List measurementList = getQosIntraPingMeasurementListForTest(); final ArgumentCaptor valueCapture = ArgumentCaptor.forClass(List.class); @@ -122,6 +127,7 @@ public void testUpdateCountStartedAtFlushThrowDatabaseException() { final List captured = valueCapture.getValue(); assertEquals(measurementList.size(), captured.size()); + for (final QoSIntraPingMeasurement qoSIntraPingMeasurement : captured) { assertEquals(0, qoSIntraPingMeasurement.getSent()); @@ -139,7 +145,7 @@ public void testUpdateCountStartedAtFlushThrowDatabaseException() { @Test(expected = ArrowheadException.class) public void testUpdateCountStartedAtSaveAllThrowDatabaseException() { - final ZonedDateTime testStartedAt = ZonedDateTime.now(); + final ZonedDateTime testStartedAt = ZonedDateTime.now().minusMinutes(1); final List measurementList = getQosIntraPingMeasurementListForTest(); final ArgumentCaptor valueCapture = ArgumentCaptor.forClass(List.class); @@ -161,6 +167,7 @@ public void testUpdateCountStartedAtSaveAllThrowDatabaseException() { final List captured = valueCapture.getValue(); assertEquals(measurementList.size(), captured.size()); + for (final QoSIntraPingMeasurement qoSIntraPingMeasurement : captured) { assertEquals(0, qoSIntraPingMeasurement.getSent()); @@ -201,6 +208,76 @@ public void testUpdateCountStartedAtFindAllThrowDatabaseException() { } + //================================================================================================= + // Tests of createMeasurement + + //------------------------------------------------------------------------------------------------- + @Test + public void testCreateMeasurement() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final System system = getSystemForTest(); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final ArgumentCaptor valueCapture = ArgumentCaptor.forClass(QoSIntraMeasurement.class); + + when(qoSIntraMeasurementRepository.saveAndFlush(valueCapture.capture())).thenReturn(measurement); + + qoSDBService.createMeasurement(system, QoSMeasurementType.PING, aroundNow); + + verify(qoSIntraMeasurementRepository, times(1)).saveAndFlush(any()); + + final QoSIntraMeasurement captured = valueCapture.getValue(); + assertEquals(system.getId(), captured.getSystem().getId()); + assertEquals(QoSMeasurementType.PING, captured.getMeasurementType()); + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testCreateMeasurementSaveAndFlushThrowException() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final System system = getSystemForTest(); + + final ArgumentCaptor valueCapture = ArgumentCaptor.forClass(QoSIntraMeasurement.class); + + when(qoSIntraMeasurementRepository.saveAndFlush(valueCapture.capture())).thenThrow(HibernateException.class); + + qoSDBService.createMeasurement(system, QoSMeasurementType.PING, aroundNow); + + verify(qoSIntraMeasurementRepository, times(1)).saveAndFlush(any()); + + final QoSIntraMeasurement captured = valueCapture.getValue(); + assertEquals(system.getId(), captured.getSystem().getId()); + assertEquals(QoSMeasurementType.PING, captured.getMeasurementType()); + + } + + //================================================================================================= + // Tests of getMeasurement + + //------------------------------------------------------------------------------------------------- + @Test + public void testGetMeasurement() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final SystemResponseDTO systemResponseDTO = getSystemResponseDTOForTest(); + final System system = getSystemForTest(); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final ArgumentCaptor valueCapture = ArgumentCaptor.forClass(QoSIntraMeasurement.class); + + when(systemRepository.findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt())).thenReturn(Optional.of(system)); + when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.of(measurement)); + + qoSDBService.getMeasurement(systemResponseDTO, aroundNow); + + verify(systemRepository, times(1)).findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt()); + verify(qoSIntraMeasurementRepository, times(1)).findBySystemAndMeasurementType(any(), any()); + + } + //================================================================================================= // assistant methods @@ -260,4 +337,10 @@ private System getSystemForTest() { return system; } + + //------------------------------------------------------------------------------------------------- + private SystemResponseDTO getSystemResponseDTOForTest() { + + return DTOConverter.convertSystemToSystemResponseDTO(getSystemForTest()); + } } From 50e22e1044554351e0055f89dae58f8b0f462948 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Wed, 5 Feb 2020 13:09:26 +0100 Subject: [PATCH 109/301] additional tests typo fix --- .../service/OrchestratorDriver.java | 2 +- .../service/OrchestratorDriverTest.java | 88 ++++++++++++++++++- 2 files changed, 88 insertions(+), 2 deletions(-) diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java index b34cefc76..c0e05f754 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java @@ -362,7 +362,7 @@ private TokenGenerationProviderDTO createTokenGenerationProvider(final Orchestra tokenDuration = Integer.parseInt(result.getMetadata().get(KEY_CALCULATED_SERVICE_TIME_FRAME)); } catch (final NumberFormatException ex) { logger.debug(ex.getMessage()); - logger.trace("Stacktracke:", ex); + logger.trace("Stacktrace:", ex); } } diff --git a/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriverTest.java b/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriverTest.java index 8187e9afe..1e8c90103 100644 --- a/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriverTest.java +++ b/orchestrator/src/test/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriverTest.java @@ -5,18 +5,21 @@ import static org.mockito.Mockito.when; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; import org.mockito.InjectMocks; import org.mockito.Mock; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.util.ReflectionTestUtils; import org.springframework.web.util.UriComponents; import eu.arrowhead.common.CommonConstants; @@ -168,6 +171,89 @@ public void testGenerateAuthTokensTokenIsFilled() { Assert.assertEquals("ABCDE", dto.getAuthorizationTokens().get(dto.getInterfaces().get(0).getInterfaceName())); } + //------------------------------------------------------------------------------------------------- + @Test + public void testGenerateAuthTokensTokenNoCalculatedServiceTimeFrame() { + ReflectionTestUtils.setField(orchestratorDriver, "tokenDuration", 1001); + + final OrchestrationResultDTO dto = getOrchestrationResultDTO(1); + final UriComponents tokenUri = Utilities.createURI(CommonConstants.HTTPS, "localhost", 8445, "/token"); + final Map tokenMap = Map.of(dto.getInterfaces().get(0).getInterfaceName(), "ABCDE"); + final TokenDataDTO tokenDataDTO = new TokenDataDTO(DTOConverter.convertSystemResponseDTOToSystemRequestDTO(dto.getProvider()), tokenMap); + final TokenGenerationResponseDTO responseDTO = new TokenGenerationResponseDTO(); + responseDTO.setTokenData(List.of(tokenDataDTO)); + + final ArgumentCaptor captor = ArgumentCaptor.forClass(TokenGenerationRequestDTO.class); + when(arrowheadContext.containsKey(any(String.class))).thenReturn(true); + when(arrowheadContext.get(any(String.class))).thenReturn(tokenUri); + when(httpService.sendRequest(eq(tokenUri), eq(HttpMethod.POST), eq(TokenGenerationResponseDTO.class), captor.capture())). + thenReturn(new ResponseEntity(responseDTO, HttpStatus.OK)); + + final OrchestrationFormRequestDTO request = new OrchestrationFormRequestDTO(); + request.setRequesterSystem(new SystemRequestDTO()); + + orchestratorDriver.generateAuthTokens(request, List.of(dto)); + + final TokenGenerationRequestDTO requestDTO = captor.getValue(); + Assert.assertEquals(1001, requestDTO.getProviders().get(0).getTokenDuration()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testGenerateAuthTokensTokenInvalidCalculatedServiceTimeFrame() { + ReflectionTestUtils.setField(orchestratorDriver, "tokenDuration", 1000); + + final OrchestrationResultDTO dto = getOrchestrationResultDTO(1); + dto.getMetadata().put(OrchestratorDriver.KEY_CALCULATED_SERVICE_TIME_FRAME, "300invalid"); + final UriComponents tokenUri = Utilities.createURI(CommonConstants.HTTPS, "localhost", 8445, "/token"); + final Map tokenMap = Map.of(dto.getInterfaces().get(0).getInterfaceName(), "ABCDE"); + final TokenDataDTO tokenDataDTO = new TokenDataDTO(DTOConverter.convertSystemResponseDTOToSystemRequestDTO(dto.getProvider()), tokenMap); + final TokenGenerationResponseDTO responseDTO = new TokenGenerationResponseDTO(); + responseDTO.setTokenData(List.of(tokenDataDTO)); + + final ArgumentCaptor captor = ArgumentCaptor.forClass(TokenGenerationRequestDTO.class); + when(arrowheadContext.containsKey(any(String.class))).thenReturn(true); + when(arrowheadContext.get(any(String.class))).thenReturn(tokenUri); + when(httpService.sendRequest(eq(tokenUri), eq(HttpMethod.POST), eq(TokenGenerationResponseDTO.class), captor.capture())). + thenReturn(new ResponseEntity(responseDTO, HttpStatus.OK)); + + final OrchestrationFormRequestDTO request = new OrchestrationFormRequestDTO(); + request.setRequesterSystem(new SystemRequestDTO()); + + orchestratorDriver.generateAuthTokens(request, List.of(dto)); + + final TokenGenerationRequestDTO requestDTO = captor.getValue(); + Assert.assertEquals(1000, requestDTO.getProviders().get(0).getTokenDuration()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testGenerateAuthTokensTokenValidCalculatedServiceTimeFrame() { + ReflectionTestUtils.setField(orchestratorDriver, "tokenDuration", 1000); + + final OrchestrationResultDTO dto = getOrchestrationResultDTO(1); + dto.getMetadata().put(OrchestratorDriver.KEY_CALCULATED_SERVICE_TIME_FRAME, "300"); + final UriComponents tokenUri = Utilities.createURI(CommonConstants.HTTPS, "localhost", 8445, "/token"); + final Map tokenMap = Map.of(dto.getInterfaces().get(0).getInterfaceName(), "ABCDE"); + final TokenDataDTO tokenDataDTO = new TokenDataDTO(DTOConverter.convertSystemResponseDTOToSystemRequestDTO(dto.getProvider()), tokenMap); + final TokenGenerationResponseDTO responseDTO = new TokenGenerationResponseDTO(); + responseDTO.setTokenData(List.of(tokenDataDTO)); + + final ArgumentCaptor captor = ArgumentCaptor.forClass(TokenGenerationRequestDTO.class); + when(arrowheadContext.containsKey(any(String.class))).thenReturn(true); + when(arrowheadContext.get(any(String.class))).thenReturn(tokenUri); + when(httpService.sendRequest(eq(tokenUri), eq(HttpMethod.POST), eq(TokenGenerationResponseDTO.class), captor.capture())). + thenReturn(new ResponseEntity(responseDTO, HttpStatus.OK)); + + final OrchestrationFormRequestDTO request = new OrchestrationFormRequestDTO(); + request.setRequesterSystem(new SystemRequestDTO()); + + orchestratorDriver.generateAuthTokens(request, List.of(dto)); + + final TokenGenerationRequestDTO requestDTO = captor.getValue(); + Assert.assertEquals(300, requestDTO.getProviders().get(0).getTokenDuration()); + } + //------------------------------------------------------------------------------------------------- @Test(expected = IllegalArgumentException.class) public void testQueryAuthorizationConsumerNull() { @@ -442,7 +528,7 @@ private OrchestrationResultDTO getOrchestrationResultDTO(final int index) { final List intfs = new ArrayList<>(1); intfs.add(new ServiceInterfaceResponseDTO(1, "HTTP-SECURE-JSON", null, null)); - return new OrchestrationResultDTO(provider, service, "/uri" + index, ServiceSecurityType.TOKEN, null, intfs, null); + return new OrchestrationResultDTO(provider, service, "/uri" + index, ServiceSecurityType.TOKEN, new HashMap<>(), intfs, null); } //------------------------------------------------------------------------------------------------- From 17f4dfe3974680e82a268aee719b7d34ce25e4e2 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 5 Feb 2020 13:25:25 +0100 Subject: [PATCH 110/301] started to implement getMeasurement tests --- .../database/service/QoSDBServiceTest.java | 55 +++++++++++++++++-- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index 9cd184df9..2b993c98f 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -117,7 +117,7 @@ public void testUpdateCountStartedAtFlushThrowDatabaseException() { qoSDBService.updateCountStartedAt(); - } catch (Exception ex) { + } catch (final Exception ex) { assertEquals(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG, ex.getMessage()); @@ -157,7 +157,7 @@ public void testUpdateCountStartedAtSaveAllThrowDatabaseException() { qoSDBService.updateCountStartedAt(); - } catch (Exception ex) { + } catch (final Exception ex) { assertEquals(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG, ex.getMessage()); @@ -195,7 +195,7 @@ public void testUpdateCountStartedAtFindAllThrowDatabaseException() { qoSDBService.updateCountStartedAt(); - } catch (Exception ex) { + } catch (final Exception ex) { assertEquals(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG, ex.getMessage()); @@ -266,8 +266,6 @@ public void testGetMeasurement() { final System system = getSystemForTest(); final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final ArgumentCaptor valueCapture = ArgumentCaptor.forClass(QoSIntraMeasurement.class); - when(systemRepository.findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt())).thenReturn(Optional.of(system)); when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.of(measurement)); @@ -278,6 +276,53 @@ public void testGetMeasurement() { } + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testGetMeasurementRequestedSystemNotInDB() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final SystemResponseDTO systemResponseDTO = getSystemResponseDTOForTest(); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + when(systemRepository.findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt())).thenReturn(Optional.ofNullable(null)); + when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.of(measurement)); + + try { + + qoSDBService.getMeasurement(systemResponseDTO, aroundNow); + + } catch (final Exception ex) { + + assertEquals("Requested system" + NOT_IN_DB_ERROR_MESSAGE, ex.getMessage()); + + verify(systemRepository, times(1)).findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt()); + verify(qoSIntraMeasurementRepository, times(0)).findBySystemAndMeasurementType(any(), any()); + + throw ex; + } + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testGetMeasurementMeasurementNotInDB() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final SystemResponseDTO systemResponseDTO = getSystemResponseDTOForTest(); + final System system = getSystemForTest(); + + when(systemRepository.findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt())).thenReturn(Optional.of(system)); + when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.ofNullable(null)); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + when(qoSIntraMeasurementRepository.saveAndFlush(any())).thenReturn(measurement); + + qoSDBService.getMeasurement(systemResponseDTO, aroundNow); + + verify(systemRepository, times(1)).findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt()); + verify(qoSIntraMeasurementRepository, times(1)).findBySystemAndMeasurementType(any(), any()); + verify(qoSIntraMeasurementRepository, times(1)).saveAndFlush(any()); + } + //================================================================================================= // assistant methods From 8c1b4b88bb8a34e70cdbdcc15a58ca0264e2f0f5 Mon Sep 17 00:00:00 2001 From: borditamas Date: Wed, 5 Feb 2020 13:28:37 +0100 Subject: [PATCH 111/301] fix cloud update bug --- .../database/service/GatekeeperDBService.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gatekeeper/src/main/java/eu/arrowhead/core/gatekeeper/database/service/GatekeeperDBService.java b/gatekeeper/src/main/java/eu/arrowhead/core/gatekeeper/database/service/GatekeeperDBService.java index 29169e7bb..1c440d009 100644 --- a/gatekeeper/src/main/java/eu/arrowhead/core/gatekeeper/database/service/GatekeeperDBService.java +++ b/gatekeeper/src/main/java/eu/arrowhead/core/gatekeeper/database/service/GatekeeperDBService.java @@ -903,12 +903,14 @@ private List deleteUnnecessaryGatewayRelayConnectionsAndGetValidatedAddit final Set relaysToAssign = new HashSet<>(); for (final CloudGatewayRelay relayConn : cloud.getGatewayRelays()) { boolean relayConnToRemove = true; - for (final Long dtoRelayId : gatewayRealyIds) { - if (relayConn.getRelay().getId() == dtoRelayId) { - relaysToKeep.add(relayConn.getRelay().getId()); - relayConnToRemove = false; - break; - } + if (gatewayRealyIds != null && !gatewayRealyIds.isEmpty()) { + for (final Long dtoRelayId : gatewayRealyIds) { + if (relayConn.getRelay().getId() == dtoRelayId) { + relaysToKeep.add(relayConn.getRelay().getId()); + relayConnToRemove = false; + break; + } + } } if (relayConnToRemove) { @@ -916,7 +918,9 @@ private List deleteUnnecessaryGatewayRelayConnectionsAndGetValidatedAddit } } - relaysToAssign.addAll(gatewayRealyIds); + if (gatewayRealyIds != null && !gatewayRealyIds.isEmpty()) { + relaysToAssign.addAll(gatewayRealyIds); + } relaysToAssign.removeAll(relaysToKeep); final List entriesToDelete = cloudGatewayRelayRepository.findAllById(relaysConnToDelete); From 0843636986c09958d2745847c2abafe5ade5f592 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 5 Feb 2020 13:50:32 +0100 Subject: [PATCH 112/301] started to implement getMeasurement tests --- .../qos/database/service/QoSDBService.java | 34 ++++++++++++++++--- .../core/qos/quartz/task/PingTask.java | 2 +- .../database/service/QoSDBServiceTest.java | 11 +++--- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index 070706418..e7638977d 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -29,8 +29,8 @@ import eu.arrowhead.common.database.repository.QoSIntraPingMeasurementLogRepository; import eu.arrowhead.common.database.repository.SystemRepository; import eu.arrowhead.common.dto.internal.DTOConverter; -import eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO; import eu.arrowhead.common.dto.internal.PingMeasurementListResponseDTO; +import eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO; import eu.arrowhead.common.dto.shared.QoSMeasurementType; import eu.arrowhead.common.dto.shared.SystemResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; @@ -46,6 +46,8 @@ public class QoSDBService { private static final String LESS_THAN_ONE_ERROR_MESSAGE= " must be greater than zero."; private static final String NOT_AVAILABLE_SORTABLE_FIELD_ERROR_MESSAGE = " sortable field is not available."; private static final String NOT_IN_DB_ERROR_MESSAGE = " is not available in database"; + private static final String EMPTY_OR_NULL_ERROR_MESSAGE = " is empty or null"; + private static final String NULL_ERROR_MESSAGE = " is null"; @Autowired private QoSIntraMeasurementRepository qoSIntraMeasurementRepository; @@ -108,16 +110,17 @@ public QoSIntraMeasurement createMeasurement(final System system, final QoSMeasu //------------------------------------------------------------------------------------------------- @Transactional (rollbackFor = ArrowheadException.class) - public QoSIntraMeasurement getMeasurement(final SystemResponseDTO systemResponseDTO, final ZonedDateTime aroundNow) { + public QoSIntraMeasurement getMeasurement(final SystemResponseDTO systemResponseDTO) { logger.debug("getMeasurement started..."); + validateSystemResponseDTO(systemResponseDTO); + + final System system; final Optional systemOptional = systemRepository.findBySystemNameAndAddressAndPort( systemResponseDTO.getSystemName(), systemResponseDTO.getAddress(), systemResponseDTO.getPort()); - final System system; if (systemOptional.isPresent()) { - system = systemOptional.get(); }else { throw new ArrowheadException("Requested system" + NOT_IN_DB_ERROR_MESSAGE); @@ -126,10 +129,12 @@ public QoSIntraMeasurement getMeasurement(final SystemResponseDTO systemResponse final QoSIntraMeasurement measurement; final Optional qoSIntraMeasurementOptional = qoSIntraMeasurementRepository.findBySystemAndMeasurementType(system, QoSMeasurementType.PING); if (qoSIntraMeasurementOptional.isEmpty()) { + final ZonedDateTime aroundNow = ZonedDateTime.now(); measurement = createMeasurement(system, QoSMeasurementType.PING, aroundNow); }else { measurement = qoSIntraMeasurementOptional.get(); } + return measurement; } @@ -378,4 +383,25 @@ public QoSIntraPingMeasurement getPingMeasurementBySystemId(final long id) { } } + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private void validateSystemResponseDTO(final SystemResponseDTO systemResponseDTO) { + logger.debug("validateSystemRequestDTO started..."); + + if (systemResponseDTO == null) { + throw new InvalidParameterException("SystemRequestDTO" + NULL_ERROR_MESSAGE); + } + + if (Utilities.isEmpty(systemResponseDTO.getSystemName())) { + throw new InvalidParameterException("System name" + EMPTY_OR_NULL_ERROR_MESSAGE); + } + + if (Utilities.isEmpty(systemResponseDTO.getAddress())) { + throw new InvalidParameterException("System address" + EMPTY_OR_NULL_ERROR_MESSAGE); + } + + } + } \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 063c6edae..0019f9ebe 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -196,7 +196,7 @@ private void pingSystem(final SystemResponseDTO systemResponseDTO ) { final List responseList = getPingResponseList(address); - final QoSIntraMeasurement measurement = qoSDBService.getMeasurement(systemResponseDTO, aroundNow); + final QoSIntraMeasurement measurement = qoSDBService.getMeasurement(systemResponseDTO); handlePingMeasurement(measurement, responseList, aroundNow); qoSDBService.updateMeasurement(aroundNow, measurement); diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index 2b993c98f..561a7ac1c 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -3,8 +3,8 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.times; @@ -261,7 +261,6 @@ public void testCreateMeasurementSaveAndFlushThrowException() { @Test public void testGetMeasurement() { - final ZonedDateTime aroundNow = ZonedDateTime.now(); final SystemResponseDTO systemResponseDTO = getSystemResponseDTOForTest(); final System system = getSystemForTest(); final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); @@ -269,7 +268,7 @@ public void testGetMeasurement() { when(systemRepository.findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt())).thenReturn(Optional.of(system)); when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.of(measurement)); - qoSDBService.getMeasurement(systemResponseDTO, aroundNow); + qoSDBService.getMeasurement(systemResponseDTO); verify(systemRepository, times(1)).findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt()); verify(qoSIntraMeasurementRepository, times(1)).findBySystemAndMeasurementType(any(), any()); @@ -280,7 +279,6 @@ public void testGetMeasurement() { @Test(expected = ArrowheadException.class) public void testGetMeasurementRequestedSystemNotInDB() { - final ZonedDateTime aroundNow = ZonedDateTime.now(); final SystemResponseDTO systemResponseDTO = getSystemResponseDTOForTest(); final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); @@ -289,7 +287,7 @@ public void testGetMeasurementRequestedSystemNotInDB() { try { - qoSDBService.getMeasurement(systemResponseDTO, aroundNow); + qoSDBService.getMeasurement(systemResponseDTO); } catch (final Exception ex) { @@ -306,7 +304,6 @@ public void testGetMeasurementRequestedSystemNotInDB() { @Test public void testGetMeasurementMeasurementNotInDB() { - final ZonedDateTime aroundNow = ZonedDateTime.now(); final SystemResponseDTO systemResponseDTO = getSystemResponseDTOForTest(); final System system = getSystemForTest(); @@ -316,7 +313,7 @@ public void testGetMeasurementMeasurementNotInDB() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); when(qoSIntraMeasurementRepository.saveAndFlush(any())).thenReturn(measurement); - qoSDBService.getMeasurement(systemResponseDTO, aroundNow); + qoSDBService.getMeasurement(systemResponseDTO); verify(systemRepository, times(1)).findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt()); verify(qoSIntraMeasurementRepository, times(1)).findBySystemAndMeasurementType(any(), any()); From 382587b3c3c8326cd7a310c3223ba803e284aeb8 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 5 Feb 2020 14:46:32 +0100 Subject: [PATCH 113/301] started to implement CreatePingMeasurement tests --- .../database/service/QoSDBServiceTest.java | 253 ++++++++++++++++-- 1 file changed, 233 insertions(+), 20 deletions(-) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index 561a7ac1c..6f5c14590 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -17,6 +17,7 @@ import java.util.Optional; import org.hibernate.HibernateException; +import org.icmp4j.IcmpPingResponse; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; @@ -37,6 +38,8 @@ import eu.arrowhead.common.dto.shared.QoSMeasurementType; import eu.arrowhead.common.dto.shared.SystemResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.common.exception.InvalidParameterException; +import eu.arrowhead.core.qos.dto.PingMeasurementCalculationsDTO; @RunWith(SpringRunner.class) public class QoSDBServiceTest { @@ -64,6 +67,8 @@ public class QoSDBServiceTest { private static final String LESS_THAN_ONE_ERROR_MESSAGE= " must be greater than zero."; private static final String NOT_AVAILABLE_SORTABLE_FIELD_ERROR_MESSAGE = " sortable field is not available."; private static final String NOT_IN_DB_ERROR_MESSAGE = " is not available in database"; + private static final String EMPTY_OR_NULL_ERROR_MESSAGE = " is empty or null"; + private static final String NULL_ERROR_MESSAGE = " is null"; //================================================================================================= // methods @@ -320,6 +325,162 @@ public void testGetMeasurementMeasurementNotInDB() { verify(qoSIntraMeasurementRepository, times(1)).saveAndFlush(any()); } + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testGetMeasurementNullRequestParameter() { + + final System system = getSystemForTest(); + final SystemResponseDTO systemResponseDTO = null; + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + when(systemRepository.findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt())).thenReturn(Optional.of(system)); + when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.of(measurement)); + + try { + + qoSDBService.getMeasurement(systemResponseDTO); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("SystemRequestDTO" + NULL_ERROR_MESSAGE)); + + verify(systemRepository, times(0)).findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt()); + verify(qoSIntraMeasurementRepository, times(0)).findBySystemAndMeasurementType(any(), any()); + + throw ex; + } + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testGetMeasurementSystemNameIsNullSystemResponseDTOParameter() { + + final System system = getSystemForTest(); + final SystemResponseDTO systemResponseDTO = getSystemResponseDTOForTest(); + systemResponseDTO.setSystemName(null); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + when(systemRepository.findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt())).thenReturn(Optional.of(system)); + when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.of(measurement)); + + try { + + qoSDBService.getMeasurement(systemResponseDTO); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("System name" + EMPTY_OR_NULL_ERROR_MESSAGE)); + + verify(systemRepository, times(0)).findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt()); + verify(qoSIntraMeasurementRepository, times(0)).findBySystemAndMeasurementType(any(), any()); + + throw ex; + } + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testGetMeasurementSystemNameIsEmptySystemResponseDTOParameter() { + + final System system = getSystemForTest(); + final SystemResponseDTO systemResponseDTO = getSystemResponseDTOForTest(); + systemResponseDTO.setSystemName(" "); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + when(systemRepository.findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt())).thenReturn(Optional.of(system)); + when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.of(measurement)); + + try { + + qoSDBService.getMeasurement(systemResponseDTO); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("System name" + EMPTY_OR_NULL_ERROR_MESSAGE)); + + verify(systemRepository, times(0)).findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt()); + verify(qoSIntraMeasurementRepository, times(0)).findBySystemAndMeasurementType(any(), any()); + + throw ex; + } + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testGetMeasurementSystemAddressIsNullSystemResponseDTOParameter() { + + final System system = getSystemForTest(); + final SystemResponseDTO systemResponseDTO = getSystemResponseDTOForTest(); + systemResponseDTO.setAddress(null); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + when(systemRepository.findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt())).thenReturn(Optional.of(system)); + when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.of(measurement)); + + try { + + qoSDBService.getMeasurement(systemResponseDTO); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("System address" + EMPTY_OR_NULL_ERROR_MESSAGE)); + + verify(systemRepository, times(0)).findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt()); + verify(qoSIntraMeasurementRepository, times(0)).findBySystemAndMeasurementType(any(), any()); + + throw ex; + } + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testGetMeasurementSystemAddressIsEmptySystemResponseDTOParameter() { + + final System system = getSystemForTest(); + final SystemResponseDTO systemResponseDTO = getSystemResponseDTOForTest(); + systemResponseDTO.setAddress(" "); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + when(systemRepository.findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt())).thenReturn(Optional.of(system)); + when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.of(measurement)); + + try { + + qoSDBService.getMeasurement(systemResponseDTO); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("System address" + EMPTY_OR_NULL_ERROR_MESSAGE)); + + verify(systemRepository, times(0)).findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt()); + verify(qoSIntraMeasurementRepository, times(0)).findBySystemAndMeasurementType(any(), any()); + + throw ex; + } + } + + //================================================================================================= + // Tests of createMeasurement + + //------------------------------------------------------------------------------------------------- + @Test + public void testCreatePingMeasurement() { + + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + + final QoSIntraMeasurement measurementParam = getQoSIntraMeasurementForTest(); + final List responseList = getResponseListForTest(); + final PingMeasurementCalculationsDTO calculations = getCalculationsForTest(); + final ZonedDateTime aroundNow = ZonedDateTime.now(); + + when(qoSIntraMeasurementPingRepository.saveAndFlush(any())).thenReturn(pingMeasurement); + + qoSDBService.createPingMeasurement(measurementParam, responseList, calculations, aroundNow); + + verify(qoSIntraMeasurementPingRepository, times(1)).saveAndFlush(any()); + + } + //================================================================================================= // assistant methods @@ -329,33 +490,40 @@ private List getQosIntraPingMeasurementListForTest() { final int sizeOfMeasurementList = 3; final List qoSIntraPingMeasurementList = new ArrayList<>(sizeOfMeasurementList); - final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - for (int i = 0; i < sizeOfMeasurementList; i++) { - final QoSIntraPingMeasurement pingMeasurement = new QoSIntraPingMeasurement(); - pingMeasurement.setMeasurement(measurement); - pingMeasurement.setAvailable(true); - pingMeasurement.setMaxResponseTime(1); - pingMeasurement.setMinResponseTime(1); - pingMeasurement.setMeanResponseTimeWithoutTimeout(1); - pingMeasurement.setMeanResponseTimeWithTimeout(1); - pingMeasurement.setJitterWithoutTimeout(1); - pingMeasurement.setJitterWithTimeout(1); - pingMeasurement.setLostPerMeasurementPercent(0); - pingMeasurement.setCountStartedAt(ZonedDateTime.now()); - pingMeasurement.setLastAccessAt(ZonedDateTime.now()); - pingMeasurement.setSent(35); - pingMeasurement.setSentAll(35); - pingMeasurement.setReceived(35); - pingMeasurement.setReceivedAll(35); - - qoSIntraPingMeasurementList.add(pingMeasurement); + qoSIntraPingMeasurementList.add(getQosIntraPingMeasurementForTest()); } return qoSIntraPingMeasurementList; } + //------------------------------------------------------------------------------------------------- + private QoSIntraPingMeasurement getQosIntraPingMeasurementForTest() { + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurement pingMeasurement = new QoSIntraPingMeasurement(); + + pingMeasurement.setMeasurement(measurement); + pingMeasurement.setAvailable(true); + pingMeasurement.setMaxResponseTime(1); + pingMeasurement.setMinResponseTime(1); + pingMeasurement.setMeanResponseTimeWithoutTimeout(1); + pingMeasurement.setMeanResponseTimeWithTimeout(1); + pingMeasurement.setJitterWithoutTimeout(1); + pingMeasurement.setJitterWithTimeout(1); + pingMeasurement.setLostPerMeasurementPercent(0); + pingMeasurement.setCountStartedAt(ZonedDateTime.now()); + pingMeasurement.setLastAccessAt(ZonedDateTime.now()); + pingMeasurement.setSent(35); + pingMeasurement.setSentAll(35); + pingMeasurement.setReceived(35); + pingMeasurement.setReceivedAll(35); + + return pingMeasurement; + } + //------------------------------------------------------------------------------------------------- private QoSIntraMeasurement getQoSIntraMeasurementForTest() { @@ -385,4 +553,49 @@ private SystemResponseDTO getSystemResponseDTOForTest() { return DTOConverter.convertSystemToSystemResponseDTO(getSystemForTest()); } + + //------------------------------------------------------------------------------------------------- + private List getResponseListForTest() { + + final int sizeOfList = 3; + final List responseList = new ArrayList<>(3); + + for (int i = 0; i < sizeOfList; i++) { + responseList.add(getIcmpResponseForTest()); + } + + return responseList; + } + + //------------------------------------------------------------------------------------------------- + private IcmpPingResponse getIcmpResponseForTest() { + + final IcmpPingResponse response = new IcmpPingResponse(); + response.setDuration(1); + response.setRtt(1); + response.setSuccessFlag(true); + response.setTimeoutFlag(false); + response.setSize(32); + response.setTtl(64); + + return response; + } + + //------------------------------------------------------------------------------------------------- + private PingMeasurementCalculationsDTO getCalculationsForTest() { + + final PingMeasurementCalculationsDTO calculatiions = new PingMeasurementCalculationsDTO( + true,//available, + 1,//maxResponseTime, + 1,//minResponseTime, + 1,//meanResponseTimeWithTimeout, + 1,//meanResponseTimeWithoutTimeout, + 1,//jitterWithTimeout, + 1,//jitterWithoutTimeout, + 35,//sentInThisPing, + 35,//receivedInThisPing, + 0);//lostPerMeasurementPercent); + + return calculatiions; + } } From d741d1ef2492a9a4403a26ead6c61656056f354a Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 5 Feb 2020 14:49:58 +0100 Subject: [PATCH 114/301] removed unused parameter from createPingMeasurement --- .../eu/arrowhead/core/qos/database/service/QoSDBService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index e7638977d..70eff64c1 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -140,8 +140,7 @@ public QoSIntraMeasurement getMeasurement(final SystemResponseDTO systemResponse //------------------------------------------------------------------------------------------------- @Transactional (rollbackFor = ArrowheadException.class) - public void createPingMeasurement(final QoSIntraMeasurement measurementParam, - final List responseList,final PingMeasurementCalculationsDTO calculations, final ZonedDateTime aroundNow) { + public void createPingMeasurement(final QoSIntraMeasurement measurementParam, final PingMeasurementCalculationsDTO calculations, final ZonedDateTime aroundNow) { logger.debug("createPingMeasurement started..."); final QoSIntraPingMeasurement pingMeasurement = new QoSIntraPingMeasurement(); From 662c1544ddc86f3f36ba2f709c89bd222eb8e76f Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 5 Feb 2020 14:59:07 +0100 Subject: [PATCH 115/301] implemented parameter validation at createPingMeasurement --- .../core/qos/database/service/QoSDBService.java | 10 ++++++++++ .../core/qos/database/service/QoSDBServiceTest.java | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index 70eff64c1..69f5c6003 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -143,6 +143,16 @@ public QoSIntraMeasurement getMeasurement(final SystemResponseDTO systemResponse public void createPingMeasurement(final QoSIntraMeasurement measurementParam, final PingMeasurementCalculationsDTO calculations, final ZonedDateTime aroundNow) { logger.debug("createPingMeasurement started..."); + if (measurementParam == null) { + throw new InvalidParameterException("QoSIntraMeasurement" + NULL_ERROR_MESSAGE); + } + if (calculations == null) { + throw new InvalidParameterException("PingMeasurementCalculationsDTO" + NULL_ERROR_MESSAGE); + } + if (aroundNow == null) { + throw new InvalidParameterException("ZonedDateTime" + NULL_ERROR_MESSAGE); + } + final QoSIntraPingMeasurement pingMeasurement = new QoSIntraPingMeasurement(); pingMeasurement.setMeasurement(measurementParam); diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index 6f5c14590..375eaf0fd 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -475,7 +475,7 @@ public void testCreatePingMeasurement() { when(qoSIntraMeasurementPingRepository.saveAndFlush(any())).thenReturn(pingMeasurement); - qoSDBService.createPingMeasurement(measurementParam, responseList, calculations, aroundNow); + qoSDBService.createPingMeasurement(measurementParam, calculations, aroundNow); verify(qoSIntraMeasurementPingRepository, times(1)).saveAndFlush(any()); From b4d9dfe270b6d7ee90d69a7a5d185c5deb48eb27 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 5 Feb 2020 15:16:47 +0100 Subject: [PATCH 116/301] updated createPingMeasurement to reduced parameters --- .../main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 0019f9ebe..4277deda7 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -213,7 +213,7 @@ private void handlePingMeasurement(final QoSIntraMeasurement measurement, if (pingMeasurementOptional.isEmpty()) { - qoSDBService.createPingMeasurement(measurement, responseList, calculationsDTO, aroundNow); + qoSDBService.createPingMeasurement(measurement, calculationsDTO, aroundNow); if(LOG_MEASUREMENT) { From 3b1c1d02a1234bee7cddc9a5e5bc6da1ddba31c1 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 5 Feb 2020 15:39:38 +0100 Subject: [PATCH 117/301] started to implement getPingMeasurementByMeasurement tests --- .../qos/database/service/QoSDBService.java | 4 + .../database/service/QoSDBServiceTest.java | 120 +++++++++++++++++- 2 files changed, 123 insertions(+), 1 deletion(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index 69f5c6003..c0812a754 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -186,6 +186,10 @@ public void createPingMeasurement(final QoSIntraMeasurement measurementParam, fi public Optional getPingMeasurementByMeasurement(final QoSIntraMeasurement measurement) { logger.debug("getPingMeasurementByMeasurement started..."); + if (measurement == null) { + throw new InvalidParameterException("QoSIntraMeasurement" + NULL_ERROR_MESSAGE); + } + try { return qoSIntraMeasurementPingRepository.findByMeasurement(measurement); } catch (final Exception ex) { diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index 375eaf0fd..72edf55f3 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -10,6 +10,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import java.time.ZonedDateTime; import java.util.ArrayList; @@ -469,7 +470,6 @@ public void testCreatePingMeasurement() { final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); final QoSIntraMeasurement measurementParam = getQoSIntraMeasurementForTest(); - final List responseList = getResponseListForTest(); final PingMeasurementCalculationsDTO calculations = getCalculationsForTest(); final ZonedDateTime aroundNow = ZonedDateTime.now(); @@ -481,6 +481,124 @@ public void testCreatePingMeasurement() { } + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testCreatePingMeasurementWithNullMeasurementParameter() { + + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + + final QoSIntraMeasurement measurementParam = null; + final PingMeasurementCalculationsDTO calculations = getCalculationsForTest(); + final ZonedDateTime aroundNow = ZonedDateTime.now(); + + when(qoSIntraMeasurementPingRepository.saveAndFlush(any())).thenReturn(pingMeasurement); + + try { + + qoSDBService.createPingMeasurement(measurementParam, calculations, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("QoSIntraMeasurement" + NULL_ERROR_MESSAGE)); + verify(qoSIntraMeasurementPingRepository, times(0)).saveAndFlush(any()); + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testCreatePingMeasurementWithNullCalculationsParameter() { + + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + + final QoSIntraMeasurement measurementParam = getQoSIntraMeasurementForTest(); + final PingMeasurementCalculationsDTO calculations = null;//getCalculationsForTest(); + final ZonedDateTime aroundNow = ZonedDateTime.now(); + + when(qoSIntraMeasurementPingRepository.saveAndFlush(any())).thenReturn(pingMeasurement); + + try { + + qoSDBService.createPingMeasurement(measurementParam, calculations, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("PingMeasurementCalculationsDTO" + NULL_ERROR_MESSAGE)); + verify(qoSIntraMeasurementPingRepository, times(0)).saveAndFlush(any()); + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testCreatePingMeasurementWithNullAroundNowParameter() { + + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + + final QoSIntraMeasurement measurementParam = getQoSIntraMeasurementForTest(); + final PingMeasurementCalculationsDTO calculations = getCalculationsForTest(); + final ZonedDateTime aroundNow = null;//ZonedDateTime.now(); + + when(qoSIntraMeasurementPingRepository.saveAndFlush(any())).thenReturn(pingMeasurement); + + try { + + qoSDBService.createPingMeasurement(measurementParam, calculations, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("ZonedDateTime" + NULL_ERROR_MESSAGE)); + verify(qoSIntraMeasurementPingRepository, times(0)).saveAndFlush(any()); + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testCreatePingMeasurementSaveAndFlushThrowsDatabseException() { + + final QoSIntraMeasurement measurementParam = getQoSIntraMeasurementForTest(); + final PingMeasurementCalculationsDTO calculations = getCalculationsForTest(); + final ZonedDateTime aroundNow = ZonedDateTime.now(); + + when(qoSIntraMeasurementPingRepository.saveAndFlush(any())).thenThrow(HibernateException.class); + + try { + + qoSDBService.createPingMeasurement(measurementParam, calculations, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG)); + verify(qoSIntraMeasurementPingRepository, times(1)).saveAndFlush(any()); + throw ex; + } + + } + + //================================================================================================= + // Tests of getPingMeasurementByMeasurement + + //------------------------------------------------------------------------------------------------- + @Test + public void testGetPingMeasurementByMeasurement() { + + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + + final QoSIntraMeasurement measurementParam = getQoSIntraMeasurementForTest(); + + when(qoSIntraMeasurementPingRepository.findByMeasurement(any())).thenReturn(Optional.of(pingMeasurement)); + + qoSDBService.getPingMeasurementByMeasurement(measurementParam); + + verify(qoSIntraMeasurementPingRepository, times(1)).findByMeasurement(any()); + + } + + //================================================================================================= // assistant methods From 4e540deac2dad89f8a0eae5220bbb96b2cb6540f Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 5 Feb 2020 15:48:31 +0100 Subject: [PATCH 118/301] implemented getPingMeasurementByMeasurement tests --- .../database/service/QoSDBServiceTest.java | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index 72edf55f3..d9a5405d0 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -598,7 +598,50 @@ public void testGetPingMeasurementByMeasurement() { } - + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testGetPingMeasurementByMeasurementWithNullMeasurementParameter() { + + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + + final QoSIntraMeasurement measurementParam = null;//getQoSIntraMeasurementForTest(); + + when(qoSIntraMeasurementPingRepository.findByMeasurement(any())).thenReturn(Optional.of(pingMeasurement)); + + try { + + qoSDBService.getPingMeasurementByMeasurement(measurementParam); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("QoSIntraMeasurement" + NULL_ERROR_MESSAGE)); + verify(qoSIntraMeasurementPingRepository, times(0)).findByMeasurement(any()); + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testGetPingMeasurementByMeasurementFindByMeasurementThrowsException() { + + final QoSIntraMeasurement measurementParam = getQoSIntraMeasurementForTest(); + + when(qoSIntraMeasurementPingRepository.findByMeasurement(any())).thenThrow(HibernateException.class); + + try { + + qoSDBService.getPingMeasurementByMeasurement(measurementParam); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG)); + verify(qoSIntraMeasurementPingRepository, times(1)).findByMeasurement(any()); + throw ex; + } + + } + //================================================================================================= // assistant methods From a917f7e011e80d841532498ef245075a83fe31a2 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 5 Feb 2020 15:50:11 +0100 Subject: [PATCH 119/301] removed unused import --- .../eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index d9a5405d0..e8066ef06 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -10,7 +10,6 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import java.time.ZonedDateTime; import java.util.ArrayList; From 99cf45773b8aab236d9ebf9388ee80ca7cd6d42e Mon Sep 17 00:00:00 2001 From: rbocsi Date: Wed, 5 Feb 2020 16:03:05 +0100 Subject: [PATCH 120/301] qos reservation db tests related bugfixes --- .../service/QoSReservationDBService.java | 6 +- .../service/QoSReservationDBServiceTest.java | 291 ++++++++++++++++++ 2 files changed, 295 insertions(+), 2 deletions(-) create mode 100644 orchestrator/src/test/java/eu/arrowhead/core/qos/database/service/QoSReservationDBServiceTest.java diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java index 66d6464d2..381135145 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/database/service/QoSReservationDBService.java @@ -84,7 +84,8 @@ public void applyTemporaryLock(final String systemName, final String address, fi Assert.notNull(dto.getService(), "Service is null."); final ZonedDateTime reservedTo = ZonedDateTime.now().plusSeconds(lockDuration); - final QoSReservation reservation = new QoSReservation(dto.getProvider().getId(), dto.getService().getId(), systemName, address, port, reservedTo, true); + final QoSReservation reservation = new QoSReservation(dto.getProvider().getId(), dto.getService().getId(), systemName.trim().toLowerCase(), address.trim().toLowerCase(), port, + reservedTo, true); try { qosReservationRepository.saveAndFlush(reservation); } catch (final Exception ex) { @@ -134,7 +135,8 @@ public void extendReservation(final OrchestrationResultDTO reserved, final Syste final Optional optReservation = qosReservationRepository.findByReservedProviderIdAndReservedServiceId(reserved.getProvider().getId(), reserved.getService().getId()); QoSReservation reservation; if (optReservation.isEmpty()) { // maybe temporary lock is expired and removed - reservation = new QoSReservation(reserved.getProvider().getId(), reserved.getService().getId(), requester.getSystemName(), requester.getAddress(), requester.getPort(), + reservation = new QoSReservation(reserved.getProvider().getId(), reserved.getService().getId(), requester.getSystemName().trim().toLowerCase(), + requester.getAddress().trim().toLowerCase(), requester.getPort(), null, false); } else { reservation = optReservation.get(); diff --git a/orchestrator/src/test/java/eu/arrowhead/core/qos/database/service/QoSReservationDBServiceTest.java b/orchestrator/src/test/java/eu/arrowhead/core/qos/database/service/QoSReservationDBServiceTest.java new file mode 100644 index 000000000..6c2c84108 --- /dev/null +++ b/orchestrator/src/test/java/eu/arrowhead/core/qos/database/service/QoSReservationDBServiceTest.java @@ -0,0 +1,291 @@ +package eu.arrowhead.core.qos.database.service; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.util.List; +import java.util.Optional; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.util.ReflectionTestUtils; + +import eu.arrowhead.common.database.entity.QoSReservation; +import eu.arrowhead.common.database.repository.QoSReservationRepository; +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; +import eu.arrowhead.common.dto.shared.ServiceDefinitionResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import junit.framework.Assert; + +@RunWith(SpringRunner.class) +public class QoSReservationDBServiceTest { + + //================================================================================================= + // members + + @InjectMocks + private QoSReservationDBService testingObject; + + @Mock + private QoSReservationRepository qosReservationRepository; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testGetAllReservationsExceptMineSystemNameNull() { + testingObject.getAllReservationsExceptMine(null, null, 0); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testGetAllReservationsExceptMineSystemNameEmpty() { + testingObject.getAllReservationsExceptMine(" ", null, 0); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testGetAllReservationsExceptMineAddressNull() { + testingObject.getAllReservationsExceptMine("system", null, 0); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testGetAllReservationsExceptMineAddressEmpty() { + testingObject.getAllReservationsExceptMine("system", " ", 0); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testGetAllReservationsExceptMineOk() { + when(qosReservationRepository.findAllByConsumerSystemNameNotOrConsumerAddressNotOrConsumerPortNot(anyString(), anyString(), anyInt())).thenReturn(List.of()); + testingObject.getAllReservationsExceptMine("System", "Address", 1234); + verify(qosReservationRepository, times(1)).findAllByConsumerSystemNameNotOrConsumerAddressNotOrConsumerPortNot("system", "address", 1234); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testApplyTemporaryLockSystemNameNull() { + testingObject.applyTemporaryLock(null, null, 0, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testApplyTemporaryLockSystemNameEmpty() { + testingObject.applyTemporaryLock("\t", null, 0, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testApplyTemporaryLockAddressNull() { + testingObject.applyTemporaryLock("system", null, 0, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testApplyTemporaryLockAddressEmpty() { + testingObject.applyTemporaryLock("system", "", 0, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testApplyTemporaryLockDTONull() { + testingObject.applyTemporaryLock("system", "address", 0, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testApplyTemporaryLockProviderNull() { + final OrchestrationResultDTO dto = new OrchestrationResultDTO(); + testingObject.applyTemporaryLock("system", "address", 0, dto); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testApplyTemporaryLockServiceNull() { + final OrchestrationResultDTO dto = new OrchestrationResultDTO(); + dto.setProvider(new SystemResponseDTO()); + testingObject.applyTemporaryLock("system", "address", 0, dto); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testApplyTemporaryLockOk() { + when(qosReservationRepository.saveAndFlush(any(QoSReservation.class))).thenReturn(new QoSReservation()); + + final OrchestrationResultDTO dto = new OrchestrationResultDTO(); + dto.setProvider(new SystemResponseDTO()); + dto.setService(new ServiceDefinitionResponseDTO()); + testingObject.applyTemporaryLock("system", "address", 1234, dto); + + verify(qosReservationRepository, times(1)).saveAndFlush(any(QoSReservation.class)); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testRemoveTemporaryLockDTONull() { + testingObject.removeTemporaryLock(null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testRemoveTemporaryLockProviderNull() { + final OrchestrationResultDTO dto = new OrchestrationResultDTO(); + testingObject.removeTemporaryLock(dto); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testRemoveTemporaryLockServiceNull() { + final OrchestrationResultDTO dto = new OrchestrationResultDTO(); + dto.setProvider(new SystemResponseDTO()); + testingObject.removeTemporaryLock(dto); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testRemoveTemporaryLockOkNotFound() { + when(qosReservationRepository.findByReservedProviderIdAndReservedServiceIdAndTemporaryLockTrue(anyLong(), anyLong())).thenReturn(Optional.empty()); + + final OrchestrationResultDTO dto = new OrchestrationResultDTO(); + dto.setProvider(new SystemResponseDTO()); + dto.setService(new ServiceDefinitionResponseDTO()); + testingObject.removeTemporaryLock(dto); + + verify(qosReservationRepository, never()).delete(any(QoSReservation.class)); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testRemoveTemporaryLockOkFound() { + final QoSReservation reservation = new QoSReservation(); + when(qosReservationRepository.findByReservedProviderIdAndReservedServiceIdAndTemporaryLockTrue(anyLong(), anyLong())).thenReturn(Optional.of(reservation)); + doNothing().when(qosReservationRepository).delete(reservation); + doNothing().when(qosReservationRepository).flush(); + + final OrchestrationResultDTO dto = new OrchestrationResultDTO(); + dto.setProvider(new SystemResponseDTO()); + dto.setService(new ServiceDefinitionResponseDTO()); + testingObject.removeTemporaryLock(dto); + + verify(qosReservationRepository, times(1)).delete(reservation); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testExtendReservationReservedNull() { + testingObject.extendReservation(null, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testExtendReservationProviderNull() { + final OrchestrationResultDTO dto = new OrchestrationResultDTO(); + testingObject.extendReservation(dto, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testExtendReservationServiceNull() { + final OrchestrationResultDTO dto = new OrchestrationResultDTO(); + dto.setProvider(new SystemResponseDTO()); + testingObject.extendReservation(dto, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testExtendReservationRequesterNull() { + final OrchestrationResultDTO dto = new OrchestrationResultDTO(); + dto.setProvider(new SystemResponseDTO()); + dto.setService(new ServiceDefinitionResponseDTO()); + testingObject.extendReservation(dto, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testExtendReservationRequesterSystemNameNull() { + final OrchestrationResultDTO dto = new OrchestrationResultDTO(); + dto.setProvider(new SystemResponseDTO()); + dto.setService(new ServiceDefinitionResponseDTO()); + final SystemRequestDTO requester = new SystemRequestDTO(); + testingObject.extendReservation(dto, requester); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testExtendReservationRequesterSystemNameEmpty() { + final OrchestrationResultDTO dto = new OrchestrationResultDTO(); + dto.setProvider(new SystemResponseDTO()); + dto.setService(new ServiceDefinitionResponseDTO()); + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName(" "); + testingObject.extendReservation(dto, requester); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testExtendReservationRequesterAddressNull() { + final OrchestrationResultDTO dto = new OrchestrationResultDTO(); + dto.setProvider(new SystemResponseDTO()); + dto.setService(new ServiceDefinitionResponseDTO()); + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + testingObject.extendReservation(dto, requester); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testExtendReservationRequesterAddressEmpty() { + final OrchestrationResultDTO dto = new OrchestrationResultDTO(); + dto.setProvider(new SystemResponseDTO()); + dto.setService(new ServiceDefinitionResponseDTO()); + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + requester.setAddress(" "); + testingObject.extendReservation(dto, requester); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testExtendReservationRequesterPortNull() { + final OrchestrationResultDTO dto = new OrchestrationResultDTO(); + dto.setProvider(new SystemResponseDTO()); + dto.setService(new ServiceDefinitionResponseDTO()); + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + requester.setAddress("address"); + testingObject.extendReservation(dto, requester); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testExtendReservationOk() { + ReflectionTestUtils.setField(testingObject, "maxReservationDuration", 1000); + final QoSReservation reservation = new QoSReservation(); + when(qosReservationRepository.findByReservedProviderIdAndReservedServiceId(anyLong(), anyLong())).thenReturn(Optional.of(reservation)); + when(qosReservationRepository.saveAndFlush(reservation)).thenReturn(reservation); + + final OrchestrationResultDTO dto = new OrchestrationResultDTO(); + dto.setProvider(new SystemResponseDTO()); + dto.setService(new ServiceDefinitionResponseDTO()); + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + requester.setAddress("address"); + requester.setPort(1234); + testingObject.extendReservation(dto, requester); + + verify(qosReservationRepository, times(1)).saveAndFlush(reservation); + } +} \ No newline at end of file From e1cb95c2b169d97558e643ab2c6e83107032fec7 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Wed, 5 Feb 2020 16:15:05 +0100 Subject: [PATCH 121/301] dummy qos manager (dummy) tests --- .../service/QoSReservationDBServiceTest.java | 1 - .../qos/manager/impl/DummyQoSManagerTest.java | 71 +++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManagerTest.java diff --git a/orchestrator/src/test/java/eu/arrowhead/core/qos/database/service/QoSReservationDBServiceTest.java b/orchestrator/src/test/java/eu/arrowhead/core/qos/database/service/QoSReservationDBServiceTest.java index 6c2c84108..b5b263bae 100644 --- a/orchestrator/src/test/java/eu/arrowhead/core/qos/database/service/QoSReservationDBServiceTest.java +++ b/orchestrator/src/test/java/eu/arrowhead/core/qos/database/service/QoSReservationDBServiceTest.java @@ -26,7 +26,6 @@ import eu.arrowhead.common.dto.shared.ServiceDefinitionResponseDTO; import eu.arrowhead.common.dto.shared.SystemRequestDTO; import eu.arrowhead.common.dto.shared.SystemResponseDTO; -import junit.framework.Assert; @RunWith(SpringRunner.class) public class QoSReservationDBServiceTest { diff --git a/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManagerTest.java b/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManagerTest.java new file mode 100644 index 000000000..08f5b9373 --- /dev/null +++ b/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/DummyQoSManagerTest.java @@ -0,0 +1,71 @@ +package eu.arrowhead.core.qos.manager.impl; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.test.context.junit4.SpringRunner; + +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; + +@RunWith(SpringRunner.class) +public class DummyQoSManagerTest { + + //================================================================================================= + // members + + private final DummyQoSManager qosManager = new DummyQoSManager(); + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Test + public void testFilterReservedProvidersDoNothing() { + final List filtered = qosManager.filterReservedProviders(getTestOrchestrationResults(), null); + Assert.assertEquals(3, filtered.size()); + for (int i = 0; i < 3; ++i) { + Assert.assertEquals(i, filtered.get(i).getProvider().getId()); + } + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testReserveProvidersTemporarilyDoNothing() { + final List reserved = qosManager.reserveProvidersTemporarily(getTestOrchestrationResults(), null); + Assert.assertEquals(3, reserved.size()); + for (int i = 0; i < 3; ++i) { + Assert.assertEquals(i, reserved.get(i).getProvider().getId()); + } + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyServicesDoNothing() { + final List verified = qosManager.verifyServices(getTestOrchestrationResults(), null); + Assert.assertEquals(3, verified.size()); + for (int i = 0; i < 3; ++i) { + Assert.assertEquals(i, verified.get(i).getProvider().getId()); + } + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private List getTestOrchestrationResults() { + final List result = new ArrayList<>(); + for (int i = 0; i < 3; ++i) { + final OrchestrationResultDTO dto = new OrchestrationResultDTO(); + final SystemResponseDTO system = new SystemResponseDTO(i, "System" + i, "localhost", 3000 + i, null, null, null); + dto.setProvider(system); + result.add(dto); + } + + return result; + } + +} \ No newline at end of file From 4747ea39951e64633c660621af46719abb1d7a70 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 08:53:19 +0100 Subject: [PATCH 122/301] renamed parameter --- .../qos/database/service/QoSDBService.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index c0812a754..e48d7347b 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -200,21 +200,21 @@ public Optional getPingMeasurementByMeasurement(final Q //------------------------------------------------------------------------------------------------- @Transactional (rollbackFor = ArrowheadException.class) - public QoSIntraPingMeasurementLog logMeasurementToDB(final String address, final PingMeasurementCalculationsDTO pingMeasurement, final ZonedDateTime aroundNow) { + public QoSIntraPingMeasurementLog logMeasurementToDB(final String address, final PingMeasurementCalculationsDTO calculations, final ZonedDateTime aroundNow) { logger.debug("logMeasurementToDB started..."); final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); measurementLog.setMeasuredSystemAddress(address); - measurementLog.setAvailable(pingMeasurement.isAvailable()); - measurementLog.setMinResponseTime(pingMeasurement.getMinResponseTime()); - measurementLog.setMaxResponseTime(pingMeasurement.getMaxResponseTime()); - measurementLog.setMeanResponseTimeWithoutTimeout(pingMeasurement.getMeanResponseTimeWithoutTimeout()); - measurementLog.setMeanResponseTimeWithTimeout(pingMeasurement.getMeanResponseTimeWithTimeout()); - measurementLog.setJitterWithoutTimeout(pingMeasurement.getJitterWithoutTimeout()); - measurementLog.setJitterWithTimeout(pingMeasurement.getJitterWithTimeout()); - measurementLog.setLostPerMeasurementPercent(pingMeasurement.getLostPerMeasurementPercent()); - measurementLog.setSent(pingMeasurement.getSentInThisPing()); - measurementLog.setReceived(pingMeasurement.getReceivedInThisPing()); + measurementLog.setAvailable(calculations.isAvailable()); + measurementLog.setMinResponseTime(calculations.getMinResponseTime()); + measurementLog.setMaxResponseTime(calculations.getMaxResponseTime()); + measurementLog.setMeanResponseTimeWithoutTimeout(calculations.getMeanResponseTimeWithoutTimeout()); + measurementLog.setMeanResponseTimeWithTimeout(calculations.getMeanResponseTimeWithTimeout()); + measurementLog.setJitterWithoutTimeout(calculations.getJitterWithoutTimeout()); + measurementLog.setJitterWithTimeout(calculations.getJitterWithTimeout()); + measurementLog.setLostPerMeasurementPercent(calculations.getLostPerMeasurementPercent()); + measurementLog.setSent(calculations.getSentInThisPing()); + measurementLog.setReceived(calculations.getReceivedInThisPing()); measurementLog.setMeasuredAt(aroundNow); try { From 00dce63f2c5a8d8ba9d266d4d756b7eafa7d5e73 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 09:06:20 +0100 Subject: [PATCH 123/301] implemented parameter validations at logMeasurementToDB --- .../arrowhead/core/qos/database/service/QoSDBService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index e48d7347b..57bcd545c 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -203,6 +203,14 @@ public Optional getPingMeasurementByMeasurement(final Q public QoSIntraPingMeasurementLog logMeasurementToDB(final String address, final PingMeasurementCalculationsDTO calculations, final ZonedDateTime aroundNow) { logger.debug("logMeasurementToDB started..."); + if (Utilities.isEmpty(address)) { + throw new InvalidParameterException("Address" + EMPTY_OR_NULL_ERROR_MESSAGE); + } else if (calculations == null) { + throw new InvalidParameterException("PingMeasurementCalculationsDTO" + NULL_ERROR_MESSAGE); + } else if (aroundNow == null) { + throw new InvalidParameterException("ZonedDateTime" + NULL_ERROR_MESSAGE); + } + final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); measurementLog.setMeasuredSystemAddress(address); measurementLog.setAvailable(calculations.isAvailable()); From e2cc2d0e64c5b0a59a5c8f0632d2a160caed9f8c Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 09:07:35 +0100 Subject: [PATCH 124/301] added whitespace before else if --- .../core/qos/security/QosMonitorAccessControlFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilter.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilter.java index 18ae03357..5650ded49 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilter.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilter.java @@ -33,7 +33,7 @@ protected void checkClientAuthorized(final String clientCN, final String method, } else if ( requestTarget.contains( CoreCommonConstants.MGMT_URI ) ) { // Only the local System Operator can use these methods checkIfLocalSystemOperator(clientCN, cloudCN, requestTarget); - }else if (requestTarget.endsWith(CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT)) { + } else if (requestTarget.endsWith(CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT)) { // Only the specified core systems can use these methods checkIfClientIsAnAllowedCoreSystem(clientCN, cloudCN, allowedCoreSystemsForGetMeasurements, requestTarget); } From c5dc9f058292778f0ce04b2267344a08f946687c Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 09:08:44 +0100 Subject: [PATCH 125/301] started to implement logMeasurementToDB tests --- .../database/service/QoSDBServiceTest.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index e8066ef06..5b6b60f39 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -28,6 +28,7 @@ import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.database.entity.QoSIntraMeasurement; import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurementLog; import eu.arrowhead.common.database.entity.System; import eu.arrowhead.common.database.repository.QoSIntraMeasurementPingRepository; import eu.arrowhead.common.database.repository.QoSIntraMeasurementRepository; @@ -641,6 +642,25 @@ public void testGetPingMeasurementByMeasurementFindByMeasurementThrowsException( } + //================================================================================================= + // Tests of logMeasurementToDB + + //------------------------------------------------------------------------------------------------- + @Test + public void testLogMeasurementToDB() { + + final String address = "address"; + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final PingMeasurementCalculationsDTO calculations = getCalculationsForTest(); + + when(qoSIntraPingMeasurementLogRepository.saveAndFlush(any())).thenReturn(QoSIntraPingMeasurementLog.class); + + qoSDBService.logMeasurementToDB(address, calculations, aroundNow); + + verify(qoSIntraPingMeasurementLogRepository, times(1)).saveAndFlush(any()); + + } + //================================================================================================= // assistant methods From 58233ccf67795b7261d0c68d3f23c3e3aa20b70e Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 09:22:21 +0100 Subject: [PATCH 126/301] implemented logMeasurementToDB tests --- .../database/service/QoSDBServiceTest.java | 132 +++++++++++++++++- 1 file changed, 131 insertions(+), 1 deletion(-) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index 5b6b60f39..4bd3706bb 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -653,7 +653,9 @@ public void testLogMeasurementToDB() { final ZonedDateTime aroundNow = ZonedDateTime.now(); final PingMeasurementCalculationsDTO calculations = getCalculationsForTest(); - when(qoSIntraPingMeasurementLogRepository.saveAndFlush(any())).thenReturn(QoSIntraPingMeasurementLog.class); + final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); + + when(qoSIntraPingMeasurementLogRepository.saveAndFlush(any())).thenReturn(measurementLog); qoSDBService.logMeasurementToDB(address, calculations, aroundNow); @@ -661,6 +663,134 @@ public void testLogMeasurementToDB() { } + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testLogMeasurementToDBWithNullAddressParameter() { + + final String address = null;//"address"; + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final PingMeasurementCalculationsDTO calculations = getCalculationsForTest(); + + final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); + + when(qoSIntraPingMeasurementLogRepository.saveAndFlush(any())).thenReturn(measurementLog); + + try { + + qoSDBService.logMeasurementToDB(address, calculations, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("Address" + EMPTY_OR_NULL_ERROR_MESSAGE)); + verify(qoSIntraPingMeasurementLogRepository, times(0)).saveAndFlush(any()); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testLogMeasurementToDBWithEmptyAddressParameter() { + + final String address = " ";//"address"; + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final PingMeasurementCalculationsDTO calculations = getCalculationsForTest(); + + final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); + + when(qoSIntraPingMeasurementLogRepository.saveAndFlush(any())).thenReturn(measurementLog); + + try { + + qoSDBService.logMeasurementToDB(address, calculations, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("Address" + EMPTY_OR_NULL_ERROR_MESSAGE)); + verify(qoSIntraPingMeasurementLogRepository, times(0)).saveAndFlush(any()); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testLogMeasurementToDBWithNullAroundNowParameter() { + + final String address = "address"; + final ZonedDateTime aroundNow = null;//ZonedDateTime.now(); + final PingMeasurementCalculationsDTO calculations = getCalculationsForTest(); + + final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); + + when(qoSIntraPingMeasurementLogRepository.saveAndFlush(any())).thenReturn(measurementLog); + + try { + + qoSDBService.logMeasurementToDB(address, calculations, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("ZonedDateTime" + NULL_ERROR_MESSAGE)); + verify(qoSIntraPingMeasurementLogRepository, times(0)).saveAndFlush(any()); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testLogMeasurementToDBWithNullCalculationsParameter() { + + final String address = "address"; + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final PingMeasurementCalculationsDTO calculations = null;//getCalculationsForTest(); + + final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); + + when(qoSIntraPingMeasurementLogRepository.saveAndFlush(any())).thenReturn(measurementLog); + + try { + + qoSDBService.logMeasurementToDB(address, calculations, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("PingMeasurementCalculationsDTO" + NULL_ERROR_MESSAGE)); + verify(qoSIntraPingMeasurementLogRepository, times(0)).saveAndFlush(any()); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testLogMeasurementToDBSaveAndFlushThrowException() { + + final String address = "address"; + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final PingMeasurementCalculationsDTO calculations = getCalculationsForTest(); + + when(qoSIntraPingMeasurementLogRepository.saveAndFlush(any())).thenThrow(HibernateException.class); + + try { + + qoSDBService.logMeasurementToDB(address, calculations, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG)); + verify(qoSIntraPingMeasurementLogRepository, times(1)).saveAndFlush(any()); + + throw ex; + } + + } + //================================================================================================= // assistant methods From e7f22fea9b348d1bc8705a420a473fa1ba26a6df Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 09:41:34 +0100 Subject: [PATCH 127/301] started to implement logMeasurementDetailsToDB tests --- .../database/service/QoSDBServiceTest.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index 4bd3706bb..026dd9ae2 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -1,6 +1,7 @@ package eu.arrowhead.core.qos.database.service; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; @@ -29,6 +30,7 @@ import eu.arrowhead.common.database.entity.QoSIntraMeasurement; import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; import eu.arrowhead.common.database.entity.QoSIntraPingMeasurementLog; +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurementLogDetails; import eu.arrowhead.common.database.entity.System; import eu.arrowhead.common.database.repository.QoSIntraMeasurementPingRepository; import eu.arrowhead.common.database.repository.QoSIntraMeasurementRepository; @@ -791,6 +793,41 @@ public void testLogMeasurementToDBSaveAndFlushThrowException() { } + //================================================================================================= + // Tests of logMeasurementDetailsToDB + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Test + public void testLogMeasurementDetailsToDB() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final List responseList = getResponseListForTest(); + final QoSIntraPingMeasurementLog measurementLogSaved = new QoSIntraPingMeasurementLog(); + + final ArgumentCaptor valueCapture = ArgumentCaptor.forClass(List.class); + final List measurementLogDetailsList = List.of(new QoSIntraPingMeasurementLogDetails()); + + when(qoSIntraPingMeasurementLogDetailsRepository.saveAll(valueCapture.capture())).thenReturn(measurementLogDetailsList); + doNothing().when(qoSIntraPingMeasurementLogDetailsRepository).flush(); + + qoSDBService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); + + verify(qoSIntraPingMeasurementLogDetailsRepository, times(1)).saveAll(any()); + verify(qoSIntraPingMeasurementLogDetailsRepository, times(1)).flush(); + + final List captured = valueCapture.getValue(); + assertEquals(responseList.size(), captured.size()); + for (final QoSIntraPingMeasurementLogDetails qoSIntraPingMeasurementLogDetails : captured) { + + assertNotNull(qoSIntraPingMeasurementLogDetails.getMeasurementLog()); + assertNotNull(qoSIntraPingMeasurementLogDetails.isSuccessFlag()); + assertNotNull(qoSIntraPingMeasurementLogDetails.getMeasuredAt()); + + } + + } + //================================================================================================= // assistant methods From 83ed61550f4e25410652b8ce0020da34d3cd2445 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 09:45:30 +0100 Subject: [PATCH 128/301] implemented parameter check at logMeasurementDetailsToDB --- .../arrowhead/core/qos/database/service/QoSDBService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index 57bcd545c..eba776ef9 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -240,6 +240,14 @@ public void logMeasurementDetailsToDB(final QoSIntraPingMeasurementLog measureme final List responseList, final ZonedDateTime aroundNow) { logger.debug("logMeasurementDetailsToDB started..."); + if (responseList == null || responseList.isEmpty()) { + throw new InvalidParameterException("List" + EMPTY_OR_NULL_ERROR_MESSAGE); + } else if (measurementLogSaved == null) { + throw new InvalidParameterException("QoSIntraPingMeasurementLog" + NULL_ERROR_MESSAGE); + } else if (aroundNow == null) { + throw new InvalidParameterException("ZonedDateTime" + NULL_ERROR_MESSAGE); + } + final List measurementLogDetailsList = new ArrayList<>(responseList.size()); int measurementSequenece = 0; From c913b4d1b6a4153dc65e05594f48a9e8766f91ea Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 10:14:27 +0100 Subject: [PATCH 129/301] implemented logMeasurementDetailsToDB tests --- .../database/service/QoSDBServiceTest.java | 195 ++++++++++++++++++ 1 file changed, 195 insertions(+) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index 026dd9ae2..e84b30b97 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -828,6 +828,201 @@ public void testLogMeasurementDetailsToDB() { } + //------------------------------------------------------------------------------------------------- + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Test(expected = InvalidParameterException.class) + public void testLogMeasurementDetailsToDBWithNullResponseListParameter() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final List responseList = null;//getResponseListForTest(); + final QoSIntraPingMeasurementLog measurementLogSaved = new QoSIntraPingMeasurementLog(); + + final List measurementLogDetailsList = List.of(new QoSIntraPingMeasurementLogDetails()); + + when(qoSIntraPingMeasurementLogDetailsRepository.saveAll(any())).thenReturn(measurementLogDetailsList); + doNothing().when(qoSIntraPingMeasurementLogDetailsRepository).flush(); + + try { + + qoSDBService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("List" + EMPTY_OR_NULL_ERROR_MESSAGE)); + verify(qoSIntraPingMeasurementLogDetailsRepository, times(0)).saveAll(any()); + verify(qoSIntraPingMeasurementLogDetailsRepository, times(0)).flush(); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Test(expected = InvalidParameterException.class) + public void testLogMeasurementDetailsToDBWithEmptyResponseListParameter() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final List responseList = List.of();//getResponseListForTest(); + final QoSIntraPingMeasurementLog measurementLogSaved = new QoSIntraPingMeasurementLog(); + + final List measurementLogDetailsList = List.of(new QoSIntraPingMeasurementLogDetails()); + + when(qoSIntraPingMeasurementLogDetailsRepository.saveAll(any())).thenReturn(measurementLogDetailsList); + doNothing().when(qoSIntraPingMeasurementLogDetailsRepository).flush(); + + try { + + qoSDBService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("List" + EMPTY_OR_NULL_ERROR_MESSAGE)); + verify(qoSIntraPingMeasurementLogDetailsRepository, times(0)).saveAll(any()); + verify(qoSIntraPingMeasurementLogDetailsRepository, times(0)).flush(); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Test(expected = InvalidParameterException.class) + public void testLogMeasurementDetailsToDBWithNullMeasurementLogSavedParameter() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final List responseList = getResponseListForTest(); + final QoSIntraPingMeasurementLog measurementLogSaved = null;//new QoSIntraPingMeasurementLog(); + + final List measurementLogDetailsList = List.of(new QoSIntraPingMeasurementLogDetails()); + + when(qoSIntraPingMeasurementLogDetailsRepository.saveAll(any())).thenReturn(measurementLogDetailsList); + doNothing().when(qoSIntraPingMeasurementLogDetailsRepository).flush(); + + try { + + qoSDBService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("QoSIntraPingMeasurementLog" + NULL_ERROR_MESSAGE)); + verify(qoSIntraPingMeasurementLogDetailsRepository, times(0)).saveAll(any()); + verify(qoSIntraPingMeasurementLogDetailsRepository, times(0)).flush(); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Test(expected = InvalidParameterException.class) + public void testLogMeasurementDetailsToDBWithNullAroundNowParameter() { + + final ZonedDateTime aroundNow = null;//ZonedDateTime.now(); + final List responseList = getResponseListForTest(); + final QoSIntraPingMeasurementLog measurementLogSaved = new QoSIntraPingMeasurementLog(); + + final List measurementLogDetailsList = List.of(new QoSIntraPingMeasurementLogDetails()); + + when(qoSIntraPingMeasurementLogDetailsRepository.saveAll(any())).thenReturn(measurementLogDetailsList); + doNothing().when(qoSIntraPingMeasurementLogDetailsRepository).flush(); + + try { + + qoSDBService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("ZonedDateTime" + NULL_ERROR_MESSAGE)); + verify(qoSIntraPingMeasurementLogDetailsRepository, times(0)).saveAll(any()); + verify(qoSIntraPingMeasurementLogDetailsRepository, times(0)).flush(); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Test(expected = ArrowheadException.class) + public void testLogMeasurementDetailsToDBSaveAllThrowsException() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final List responseList = getResponseListForTest(); + final QoSIntraPingMeasurementLog measurementLogSaved = new QoSIntraPingMeasurementLog(); + + final ArgumentCaptor valueCapture = ArgumentCaptor.forClass(List.class); + + when(qoSIntraPingMeasurementLogDetailsRepository.saveAll(valueCapture.capture())).thenThrow(HibernateException.class); + doNothing().when(qoSIntraPingMeasurementLogDetailsRepository).flush(); + + try { + + qoSDBService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG)); + verify(qoSIntraPingMeasurementLogDetailsRepository, times(1)).saveAll(any()); + verify(qoSIntraPingMeasurementLogDetailsRepository, times(0)).flush(); + + final List captured = valueCapture.getValue(); + assertEquals(responseList.size(), captured.size()); + for (final QoSIntraPingMeasurementLogDetails qoSIntraPingMeasurementLogDetails : captured) { + + assertNotNull(qoSIntraPingMeasurementLogDetails.getMeasurementLog()); + assertNotNull(qoSIntraPingMeasurementLogDetails.isSuccessFlag()); + assertNotNull(qoSIntraPingMeasurementLogDetails.getMeasuredAt()); + + } + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Test(expected = ArrowheadException.class) + public void testLogMeasurementDetailsToDBFlushThrowsException() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final List responseList = getResponseListForTest(); + final QoSIntraPingMeasurementLog measurementLogSaved = new QoSIntraPingMeasurementLog(); + + final ArgumentCaptor valueCapture = ArgumentCaptor.forClass(List.class); + final List measurementLogDetailsList = List.of(new QoSIntraPingMeasurementLogDetails()); + + when(qoSIntraPingMeasurementLogDetailsRepository.saveAll(valueCapture.capture())).thenReturn(measurementLogDetailsList); + doThrow(HibernateException.class).when(qoSIntraPingMeasurementLogDetailsRepository).flush(); + + try { + + qoSDBService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG)); + verify(qoSIntraPingMeasurementLogDetailsRepository, times(1)).saveAll(any()); + verify(qoSIntraPingMeasurementLogDetailsRepository, times(1)).flush(); + + final List captured = valueCapture.getValue(); + assertEquals(responseList.size(), captured.size()); + for (final QoSIntraPingMeasurementLogDetails qoSIntraPingMeasurementLogDetails : captured) { + + assertNotNull(qoSIntraPingMeasurementLogDetails.getMeasurementLog()); + assertNotNull(qoSIntraPingMeasurementLogDetails.isSuccessFlag()); + assertNotNull(qoSIntraPingMeasurementLogDetails.getMeasuredAt()); + + } + + throw ex; + } + + } + //================================================================================================= // assistant methods From efbb67479c3fb61f20ed0f6ab38db753ce23bee4 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 10:27:27 +0100 Subject: [PATCH 130/301] started to implement updatePingMeasurement tests --- .../database/service/QoSDBServiceTest.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index e84b30b97..6dcdc5762 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -1023,6 +1023,36 @@ public void testLogMeasurementDetailsToDBFlushThrowsException() { } + //================================================================================================= + // Tests of updatePingMeasurement + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Test + public void testUpdatePingMeasurement() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + final PingMeasurementCalculationsDTO calculations = getCalculationsForTest(); + calculations.setAvailable(true); + + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + pingMeasurement.setAvailable(true); + + final ArgumentCaptor valueCapture = ArgumentCaptor.forClass(QoSIntraPingMeasurement.class); + + when(qoSIntraMeasurementPingRepository.saveAndFlush(valueCapture.capture())).thenReturn(pingMeasurement); + doNothing().when(qoSIntraPingMeasurementLogDetailsRepository).flush(); + + qoSDBService.updatePingMeasurement(measurement, calculations, pingMeasurement, aroundNow); + + verify(qoSIntraMeasurementPingRepository, times(1)).saveAndFlush(any()); + + final QoSIntraPingMeasurement captured = valueCapture.getValue(); + assertTrue( calculations.isAvailable() == captured.isAvailable()); + + } + //================================================================================================= // assistant methods From 360df89d7780ecc5c69b7a38c058fb1b74a74ab3 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 10:31:36 +0100 Subject: [PATCH 131/301] implemented parameter nullcheks at updatePingMeasurement --- .../core/qos/database/service/QoSDBService.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index eba776ef9..703ce5e48 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -284,6 +284,16 @@ public void updatePingMeasurement(final QoSIntraMeasurement measurement, final PingMeasurementCalculationsDTO calculations, final QoSIntraPingMeasurement pingMeasurement,final ZonedDateTime aroundNow) { logger.debug("updatePingMeasurement started..."); + if (measurement == null) { + throw new InvalidParameterException("QoSIntraMeasurement" + NULL_ERROR_MESSAGE); + } else if (calculations == null) { + throw new InvalidParameterException("PingMeasurementCalculationsDTO" + NULL_ERROR_MESSAGE); + } else if (pingMeasurement == null) { + throw new InvalidParameterException("QoSIntraPingMeasurement" + NULL_ERROR_MESSAGE); + } else if (aroundNow == null) { + throw new InvalidParameterException("ZonedDateTime" + NULL_ERROR_MESSAGE); + } + pingMeasurement.setMeasurement(measurement); pingMeasurement.setAvailable(calculations.isAvailable()); pingMeasurement.setMaxResponseTime(calculations.getMaxResponseTime()); From 87265d1afc8bc85f0df7a104af352e48c118256d Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 10:49:07 +0100 Subject: [PATCH 132/301] implemented updatePingMeasurement tests --- .../database/service/QoSDBServiceTest.java | 131 +++++++++++++++++- 1 file changed, 129 insertions(+), 2 deletions(-) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index 6dcdc5762..6dbf37cfd 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -1027,7 +1027,6 @@ public void testLogMeasurementDetailsToDBFlushThrowsException() { // Tests of updatePingMeasurement //------------------------------------------------------------------------------------------------- - @SuppressWarnings({ "unchecked", "rawtypes" }) @Test public void testUpdatePingMeasurement() { @@ -1042,7 +1041,6 @@ public void testUpdatePingMeasurement() { final ArgumentCaptor valueCapture = ArgumentCaptor.forClass(QoSIntraPingMeasurement.class); when(qoSIntraMeasurementPingRepository.saveAndFlush(valueCapture.capture())).thenReturn(pingMeasurement); - doNothing().when(qoSIntraPingMeasurementLogDetailsRepository).flush(); qoSDBService.updatePingMeasurement(measurement, calculations, pingMeasurement, aroundNow); @@ -1053,6 +1051,135 @@ public void testUpdatePingMeasurement() { } + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testUpdatePingMeasurementSaveAndFlushThrowsException() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + final PingMeasurementCalculationsDTO calculations = getCalculationsForTest(); + calculations.setAvailable(true); + + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + pingMeasurement.setAvailable(true); + + final ArgumentCaptor valueCapture = ArgumentCaptor.forClass(QoSIntraPingMeasurement.class); + + when(qoSIntraMeasurementPingRepository.saveAndFlush(valueCapture.capture())).thenThrow(HibernateException.class); + + try { + + qoSDBService.updatePingMeasurement(measurement, calculations, pingMeasurement, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG)); + verify(qoSIntraMeasurementPingRepository, times(1)).saveAndFlush(any()); + + final QoSIntraPingMeasurement captured = valueCapture.getValue(); + assertTrue( calculations.isAvailable() == captured.isAvailable()); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testUpdatePingMeasurementWithNullMeasurementParameter() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final QoSIntraMeasurement measurement = null;//getQoSIntraMeasurementForTest(); + final PingMeasurementCalculationsDTO calculations = getCalculationsForTest(); + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + + when(qoSIntraMeasurementPingRepository.saveAndFlush(any())).thenReturn(pingMeasurement); + + try { + + qoSDBService.updatePingMeasurement(measurement, calculations, pingMeasurement, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("QoSIntraMeasurement" + NULL_ERROR_MESSAGE)); + verify(qoSIntraMeasurementPingRepository, times(0)).saveAndFlush(any()); + + throw ex; + } + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testUpdatePingMeasurementWithNullCalculationsParameter() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + final PingMeasurementCalculationsDTO calculations = null;//getCalculationsForTest(); + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + + when(qoSIntraMeasurementPingRepository.saveAndFlush(any())).thenReturn(pingMeasurement); + + try { + + qoSDBService.updatePingMeasurement(measurement, calculations, pingMeasurement, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("PingMeasurementCalculationsDTO" + NULL_ERROR_MESSAGE)); + verify(qoSIntraMeasurementPingRepository, times(0)).saveAndFlush(any()); + + throw ex; + } + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testUpdatePingMeasurementWithNullPingMeasurementParameter() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + final PingMeasurementCalculationsDTO calculations = getCalculationsForTest(); + final QoSIntraPingMeasurement pingMeasurement = null;//getQosIntraPingMeasurementForTest(); + + when(qoSIntraMeasurementPingRepository.saveAndFlush(any())).thenReturn(pingMeasurement); + + try { + + qoSDBService.updatePingMeasurement(measurement, calculations, pingMeasurement, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("QoSIntraPingMeasurement" + NULL_ERROR_MESSAGE)); + verify(qoSIntraMeasurementPingRepository, times(0)).saveAndFlush(any()); + + throw ex; + } + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testUpdatePingMeasurementWithNullAroundNowParameter() { + + final ZonedDateTime aroundNow = null;//ZonedDateTime.now(); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + final PingMeasurementCalculationsDTO calculations = getCalculationsForTest(); + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + + when(qoSIntraMeasurementPingRepository.saveAndFlush(any())).thenReturn(pingMeasurement); + + try { + + qoSDBService.updatePingMeasurement(measurement, calculations, pingMeasurement, aroundNow); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("ZonedDateTime" + NULL_ERROR_MESSAGE)); + verify(qoSIntraMeasurementPingRepository, times(0)).saveAndFlush(any()); + + throw ex; + } + } + //================================================================================================= // assistant methods From 860609bfd62f58fd900223eccb39989159a45049 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 11:02:03 +0100 Subject: [PATCH 133/301] implemented parameter null checks at updateMeasurement --- .../arrowhead/core/qos/database/service/QoSDBService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index 703ce5e48..0edf38ce1 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -326,6 +326,12 @@ public void updatePingMeasurement(final QoSIntraMeasurement measurement, public void updateMeasurement(final ZonedDateTime aroundNow, final QoSIntraMeasurement measurement) { logger.debug("updateMeasurement started..."); + if (measurement == null) { + throw new InvalidParameterException("QoSIntraMeasurement" + NULL_ERROR_MESSAGE); + } else if (aroundNow == null) { + throw new InvalidParameterException("ZonedDateTime" + NULL_ERROR_MESSAGE); + } + measurement.setLastMeasurementAt(aroundNow); try { qoSIntraMeasurementRepository.saveAndFlush(measurement); From 3b079f62f934d8341391856f3aef1b0a7fcc0c3f Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 11:08:07 +0100 Subject: [PATCH 134/301] started to implement updateMeasurement tests --- .../database/service/QoSDBServiceTest.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index 6dbf37cfd..e93f4794b 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -1180,6 +1180,29 @@ public void testUpdatePingMeasurementWithNullAroundNowParameter() { } } + //================================================================================================= + // Tests of updateMeasurement + + //------------------------------------------------------------------------------------------------- + @Test + public void testUpdateMeasurement() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final ArgumentCaptor valueCapture = ArgumentCaptor.forClass( QoSIntraMeasurement.class); + + when(qoSIntraMeasurementRepository.saveAndFlush(valueCapture.capture())).thenReturn(measurement); + + qoSDBService.updateMeasurement(aroundNow, measurement); + + verify(qoSIntraMeasurementRepository, times(1)).saveAndFlush(any()); + + final QoSIntraMeasurement captured = valueCapture.getValue(); + assertTrue( aroundNow == captured.getLastMeasurementAt()); + + } + //================================================================================================= // assistant methods From 7d7eb3b6047c7cab7f560d209522f1b52333496b Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 11:17:42 +0100 Subject: [PATCH 135/301] implemented updateMeasurement tests --- .../database/service/QoSDBServiceTest.java | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index e93f4794b..3e94636a3 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -1203,6 +1203,80 @@ public void testUpdateMeasurement() { } + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testUpdateMeasurementSaveAndFlushThrowsException() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final ArgumentCaptor valueCapture = ArgumentCaptor.forClass( QoSIntraMeasurement.class); + + when(qoSIntraMeasurementRepository.saveAndFlush(valueCapture.capture())).thenThrow(HibernateException.class); + + try { + + qoSDBService.updateMeasurement(aroundNow, measurement); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG)); + verify(qoSIntraMeasurementRepository, times(1)).saveAndFlush(any()); + + final QoSIntraMeasurement captured = valueCapture.getValue(); + assertTrue( aroundNow == captured.getLastMeasurementAt()); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testUpdateMeasurementWithNullMeasurementParameter() { + + final ZonedDateTime aroundNow = ZonedDateTime.now(); + final QoSIntraMeasurement measurement = null;//getQoSIntraMeasurementForTest(); + + when(qoSIntraMeasurementRepository.saveAndFlush(any())).thenReturn(measurement); + + try { + + qoSDBService.updateMeasurement(aroundNow, measurement); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("QoSIntraMeasurement" + NULL_ERROR_MESSAGE)); + verify(qoSIntraMeasurementRepository, times(0)).saveAndFlush(any()); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testUpdateMeasurementWithNullAroundNowParameter() { + + final ZonedDateTime aroundNow = null;//ZonedDateTime.now(); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + when(qoSIntraMeasurementRepository.saveAndFlush(any())).thenReturn(measurement); + + try { + + qoSDBService.updateMeasurement(aroundNow, measurement); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("ZonedDateTime" + NULL_ERROR_MESSAGE)); + verify(qoSIntraMeasurementRepository, times(0)).saveAndFlush(any()); + + throw ex; + } + + } + //================================================================================================= // assistant methods From 25221c840f57fc72e1efae692b5d5d31b69a414c Mon Sep 17 00:00:00 2001 From: rbocsi Date: Thu, 6 Feb 2020 11:49:10 +0100 Subject: [PATCH 136/301] unit tests for service time verifier --- .../manager/impl/ServiceTimeVerifierTest.java | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/ServiceTimeVerifierTest.java diff --git a/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/ServiceTimeVerifierTest.java b/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/ServiceTimeVerifierTest.java new file mode 100644 index 000000000..f39bf9761 --- /dev/null +++ b/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/ServiceTimeVerifierTest.java @@ -0,0 +1,173 @@ +package eu.arrowhead.core.qos.manager.impl; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.util.ReflectionTestUtils; + +import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; +import eu.arrowhead.common.dto.shared.OrchestratorWarnings; +import eu.arrowhead.common.dto.shared.ServiceRegistryRequestDTO; +import eu.arrowhead.core.orchestrator.service.OrchestratorDriver; + +@RunWith(SpringRunner.class) +public class ServiceTimeVerifierTest { + + //================================================================================================= + // members + + private ServiceTimeVerifier verfier = new ServiceTimeVerifier(); + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testVerifyResultNull() { + verfier.verify(null, null, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testVerifyResultMetadataNull() { + verfier.verify(new OrchestrationResultDTO(), null, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testVerifyResultWarningsNull() { + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + result.setMetadata(Map.of()); + result.setWarnings(null); + verfier.verify(result, null, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testVerifyResultCommandsNull() { + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + result.setMetadata(Map.of()); + verfier.verify(result, null, null); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyNoRecommendedTimeNoExclusivityNoChange() { + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + result.setMetadata(Map.of()); + result.getWarnings().add(OrchestratorWarnings.TTL_UNKNOWN); + + final boolean verified = verfier.verify(result, null, Map.of()); + Assert.assertTrue(verified); + Assert.assertEquals(OrchestratorWarnings.TTL_UNKNOWN, result.getWarnings().get(0)); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyIllFormedRecommendedTimeNoExclusivityNoChange() { + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + result.setMetadata(Map.of(ServiceRegistryRequestDTO.KEY_RECOMMENDED_ORCHESTRATION_TIME, "not a number")); + result.getWarnings().add(OrchestratorWarnings.TTL_UNKNOWN); + + final boolean verified = verfier.verify(result, null, Map.of()); + Assert.assertTrue(verified); + Assert.assertEquals(OrchestratorWarnings.TTL_UNKNOWN, result.getWarnings().get(0)); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyNoRecommendedTimeWithExclusivityVerified() { // answer true, calculated time: 15, warnings: TTL_EXPIRING + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + final Map metadata = new HashMap<>(); + result.setMetadata(metadata); + result.getWarnings().add(OrchestratorWarnings.TTL_UNKNOWN); + + final boolean verified = verfier.verify(result, null, Map.of(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY, "10")); + Assert.assertTrue(verified); + Assert.assertEquals("15", result.getMetadata().get(OrchestratorDriver.KEY_CALCULATED_SERVICE_TIME_FRAME)); + Assert.assertTrue(result.getWarnings().indexOf(OrchestratorWarnings.TTL_UNKNOWN) < 0); + Assert.assertEquals(OrchestratorWarnings.TTL_EXPIRING, result.getWarnings().get(0)); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyIllFormedRecommendedTimeWithExclusivityVerified() { // answer true, calculated time: 15, warnings: TTL_EXPIRING + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + final Map metadata = new HashMap<>(); + metadata.put(ServiceRegistryRequestDTO.KEY_RECOMMENDED_ORCHESTRATION_TIME, "not a number"); + result.setMetadata(metadata); + result.getWarnings().add(OrchestratorWarnings.TTL_UNKNOWN); + + final boolean verified = verfier.verify(result, null, Map.of(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY, "10")); + Assert.assertTrue(verified); + Assert.assertEquals("15", result.getMetadata().get(OrchestratorDriver.KEY_CALCULATED_SERVICE_TIME_FRAME)); + Assert.assertTrue(result.getWarnings().indexOf(OrchestratorWarnings.TTL_UNKNOWN) < 0); + Assert.assertEquals(OrchestratorWarnings.TTL_EXPIRING, result.getWarnings().get(0)); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyTooShortRecommendedTimeWithExclusivityNotVerified() { // answer false + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + final Map metadata = new HashMap<>(); + metadata.put(ServiceRegistryRequestDTO.KEY_RECOMMENDED_ORCHESTRATION_TIME, "5"); + result.setMetadata(metadata); + result.getWarnings().add(OrchestratorWarnings.TTL_UNKNOWN); + + final boolean verified = verfier.verify(result, null, Map.of(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY, "10")); + Assert.assertFalse(verified); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyEnoughRecommendedTimeWithExclusivityVerified() { // answer true, calculated time: 15, warnings: TTL_EXPIRING + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + final Map metadata = new HashMap<>(); + metadata.put(ServiceRegistryRequestDTO.KEY_RECOMMENDED_ORCHESTRATION_TIME, "14"); // extra seconds does not count + result.setMetadata(metadata); + result.getWarnings().add(OrchestratorWarnings.TTL_UNKNOWN); + + final boolean verified = verfier.verify(result, null, Map.of(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY, "10")); + Assert.assertTrue(verified); + Assert.assertEquals("15", result.getMetadata().get(OrchestratorDriver.KEY_CALCULATED_SERVICE_TIME_FRAME)); + Assert.assertTrue(result.getWarnings().indexOf(OrchestratorWarnings.TTL_UNKNOWN) < 0); + Assert.assertEquals(OrchestratorWarnings.TTL_EXPIRING, result.getWarnings().get(0)); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyAlmostEnoughRecommendedTimeWithExclusivityVerified() { // answer true, calculated time: 16, warnings: TTL_EXPIRING + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + final Map metadata = new HashMap<>(); + metadata.put(ServiceRegistryRequestDTO.KEY_RECOMMENDED_ORCHESTRATION_TIME, "10"); // extra seconds does not count + result.setMetadata(metadata); + result.getWarnings().add(OrchestratorWarnings.TTL_UNKNOWN); + + final boolean verified = verfier.verify(result, null, Map.of(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY, "11")); + Assert.assertTrue(verified); + Assert.assertEquals("16", result.getMetadata().get(OrchestratorDriver.KEY_CALCULATED_SERVICE_TIME_FRAME)); + Assert.assertTrue(result.getWarnings().indexOf(OrchestratorWarnings.TTL_UNKNOWN) < 0); + Assert.assertEquals(OrchestratorWarnings.TTL_EXPIRING, result.getWarnings().get(0)); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyEnoughRecommendedTimeWithExclusivityVerifiedNoWarning() { // answer true, calculated time: 126, warnings: none + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + final Map metadata = new HashMap<>(); + metadata.put(ServiceRegistryRequestDTO.KEY_RECOMMENDED_ORCHESTRATION_TIME, "240"); + result.setMetadata(metadata); + result.getWarnings().add(OrchestratorWarnings.TTL_UNKNOWN); + + final boolean verified = verfier.verify(result, null, Map.of(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY, "121")); + Assert.assertTrue(verified); + Assert.assertEquals("126", result.getMetadata().get(OrchestratorDriver.KEY_CALCULATED_SERVICE_TIME_FRAME)); + Assert.assertTrue(result.getWarnings().indexOf(OrchestratorWarnings.TTL_UNKNOWN) < 0); + Assert.assertEquals(0, result.getWarnings().size()); + } +} \ No newline at end of file From a727516b46e3900b5e5a9c6fd0be3355618a4cc5 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 12:31:23 +0100 Subject: [PATCH 137/301] implemented getPingMeasurementPage and getPingMeasurementResponse tests --- .../database/service/QoSDBServiceTest.java | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index 3e94636a3..ed6a304d9 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -17,6 +17,8 @@ import java.util.List; import java.util.Optional; +import javax.persistence.criteria.CriteriaBuilder.In; + import org.hibernate.HibernateException; import org.icmp4j.IcmpPingResponse; import org.junit.Test; @@ -24,9 +26,16 @@ import org.mockito.ArgumentCaptor; import org.mockito.InjectMocks; import org.mockito.Mock; +import org.springframework.boot.autoconfigure.data.web.SpringDataWebProperties.Pageable; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort.Direction; import org.springframework.test.context.junit4.SpringRunner; +import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.database.entity.OrchestratorStore; import eu.arrowhead.common.database.entity.QoSIntraMeasurement; import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; import eu.arrowhead.common.database.entity.QoSIntraPingMeasurementLog; @@ -1277,6 +1286,102 @@ public void testUpdateMeasurementWithNullAroundNowParameter() { } + //================================================================================================= + // Tests of getPingMeasurementResponse + + //------------------------------------------------------------------------------------------------- + @Test + public void testGetPingMeasurementResponse() { + + final int page = 0; + final int size = 0; + final Direction direction = Direction.ASC; + final String sortField = CommonConstants.COMMON_FIELD_NAME_ID; + + final Page pageResponse = getPageOfPingMeasurementForTest(); + + when(qoSIntraMeasurementPingRepository.findAll(any(PageRequest.class))).thenReturn(pageResponse); + + qoSDBService.getPingMeasurementResponse(page, size, direction, sortField); + + verify(qoSIntraMeasurementPingRepository, times(1)).findAll(any(PageRequest.class)); + + } + + //================================================================================================= + // Tests of getPingMeasurementPage + + //------------------------------------------------------------------------------------------------- + @Test + public void testGetPingMeasurementPage() { + + final int page = 0; + final int size = 0; + final Direction direction = Direction.ASC; + final String sortField = CommonConstants.COMMON_FIELD_NAME_ID; + + final Page pageResponse = getPageOfPingMeasurementForTest(); + + when(qoSIntraMeasurementPingRepository.findAll(any(PageRequest.class))).thenReturn(pageResponse); + + qoSDBService.getPingMeasurementPage(page, size, direction, sortField); + + verify(qoSIntraMeasurementPingRepository, times(1)).findAll(any(PageRequest.class)); + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testGetPingMeasurementPageWithInvalidSortField() { + + final int page = 0; + final int size = 0; + final Direction direction = Direction.ASC; + final String sortField = "invalid_sort_field"; + + final Page pageResponse = getPageOfPingMeasurementForTest(); + + when(qoSIntraMeasurementPingRepository.findAll(any(PageRequest.class))).thenReturn(pageResponse); + + try { + + qoSDBService.getPingMeasurementPage(page, size, direction, sortField); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains(NOT_AVAILABLE_SORTABLE_FIELD_ERROR_MESSAGE)); + verify(qoSIntraMeasurementPingRepository, times(0)).findAll(any(PageRequest.class)); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testGetPingMeasurementPagefindAllThrowsException() { + + final int page = 0; + final int size = 0; + final Direction direction = Direction.ASC; + final String sortField = "invalid_sort_field"; + + when(qoSIntraMeasurementPingRepository.findAll(any(PageRequest.class))).thenThrow(HibernateException.class); + + try { + + qoSDBService.getPingMeasurementPage(page, size, direction, sortField); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG)); + verify(qoSIntraMeasurementPingRepository, times(1)).findAll(any(PageRequest.class)); + + throw ex; + } + + } + //================================================================================================= // assistant methods @@ -1394,4 +1499,20 @@ private PingMeasurementCalculationsDTO getCalculationsForTest() { return calculatiions; } + + //------------------------------------------------------------------------------------------------- + private PageImpl getPageOfMeasurementForTest() { + + final List meausrementList = List.of(getQoSIntraMeasurementForTest()); + + return new PageImpl(meausrementList); + } + + //------------------------------------------------------------------------------------------------- + private PageImpl getPageOfPingMeasurementForTest() { + + final List pingMeausrementList = getQosIntraPingMeasurementListForTest(); + + return new PageImpl(pingMeausrementList); + } } From 786b76881e8f4afd91959c986fbbfcf9fe1ddb4d Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 12:58:46 +0100 Subject: [PATCH 138/301] corrected sortField at getPingMeasurementPage test --- .../arrowhead/core/qos/database/service/QoSDBServiceTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index ed6a304d9..46e820048 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -1364,7 +1364,7 @@ public void testGetPingMeasurementPagefindAllThrowsException() { final int page = 0; final int size = 0; final Direction direction = Direction.ASC; - final String sortField = "invalid_sort_field"; + final String sortField = CommonConstants.COMMON_FIELD_NAME_ID; when(qoSIntraMeasurementPingRepository.findAll(any(PageRequest.class))).thenThrow(HibernateException.class); From db4b4242e49c49dcc653b0e3d2eec8476b3257b0 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Thu, 6 Feb 2020 13:10:39 +0100 Subject: [PATCH 139/301] some unit tests: ping verifier some fix --- .../impl/PingRequirementsVerifierTest.java | 111 ++++++++++++++++++ .../manager/impl/ServiceTimeVerifierTest.java | 3 +- 2 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifierTest.java diff --git a/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifierTest.java b/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifierTest.java new file mode 100644 index 000000000..9ba147eba --- /dev/null +++ b/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifierTest.java @@ -0,0 +1,111 @@ +package eu.arrowhead.core.qos.manager.impl; + +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.Mockito.when; + +import java.time.ZonedDateTime; +import java.util.HashMap; +import java.util.Map; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.springframework.test.context.junit4.SpringRunner; + +import eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO; +import eu.arrowhead.common.dto.internal.QoSIntraMeasurementResponseDTO; +import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.common.exception.BadPayloadException; +import eu.arrowhead.core.orchestrator.service.OrchestratorDriver; + +@RunWith(SpringRunner.class) +public class PingRequirementsVerifierTest { + + //================================================================================================= + // members + + @InjectMocks + private PingRequirementsVerifier verifier; + + @Mock + private OrchestratorDriver orchestratorDriver; + + @Mock + private Map pingMeasurementCache; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testVerifyResultNull() { + verifier.verify(null, null, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testVerifyResultProviderNull() { + verifier.verify(new OrchestrationResultDTO(), null, null); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyQosRequirementsNull() { // answer true + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + result.setProvider(new SystemResponseDTO()); + + final boolean verified = verifier.verify(result, null, null); + Assert.assertTrue(verified); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyQosRequirementsEmpty() { // answer true + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + result.setProvider(new SystemResponseDTO()); + + final boolean verified = verifier.verify(result, Map.of(), null); + Assert.assertTrue(verified); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = BadPayloadException.class) + public void testVerifyInvalidSystemId() { + when(pingMeasurementCache.get(anyLong())).thenReturn(null); + when(orchestratorDriver.getPingMeasurement(anyLong())).thenThrow(new BadPayloadException("test")); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(-1); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RESPONSE_TIME_THRESHOLD, "500"); + + verifier.verify(result, qosRequirements, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testVerifyObsoleteCache() { + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now().minusHours(2)); + response.setMeasurement(measurement); + when(pingMeasurementCache.get(anyLong())).thenReturn(response); + when(orchestratorDriver.getPingMeasurement(anyLong())).thenThrow(new ArrowheadException("just for finish the method execution")); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RESPONSE_TIME_THRESHOLD, "500"); + + verifier.verify(result, qosRequirements, null); + } +} \ No newline at end of file diff --git a/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/ServiceTimeVerifierTest.java b/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/ServiceTimeVerifierTest.java index f39bf9761..3fdb9f31e 100644 --- a/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/ServiceTimeVerifierTest.java +++ b/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/ServiceTimeVerifierTest.java @@ -7,7 +7,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.util.ReflectionTestUtils; import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; @@ -21,7 +20,7 @@ public class ServiceTimeVerifierTest { //================================================================================================= // members - private ServiceTimeVerifier verfier = new ServiceTimeVerifier(); + private final ServiceTimeVerifier verfier = new ServiceTimeVerifier(); //================================================================================================= // methods From dcb3391afe844cf1f364014940c580cbe5474945 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 14:32:19 +0100 Subject: [PATCH 140/301] corrected error message --- .../eu/arrowhead/core/qos/database/service/QoSDBService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index 0edf38ce1..0c4ceac1a 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -390,7 +390,7 @@ public QoSIntraPingMeasurement getPingMeasurementBySystemId(final long id) { logger.debug("getPingMeasurementBySystemId started ..."); if (id < 1) { - throw new InvalidParameterException("SubscriberSystemId" + LESS_THAN_ONE_ERROR_MESSAGE); + throw new InvalidParameterException("SystemId" + LESS_THAN_ONE_ERROR_MESSAGE); } final System system; From 19e6cfb8b33f3e1b0d859da42d279d7130ed6d98 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 14:51:15 +0100 Subject: [PATCH 141/301] implemented Database operation exception handling at getPingMeasurementBySystemId --- .../qos/database/service/QoSDBService.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index 0c4ceac1a..8b5ed89a7 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -394,7 +394,16 @@ public QoSIntraPingMeasurement getPingMeasurementBySystemId(final long id) { } final System system; - final Optional systemOptional = systemRepository.findById(id); + final Optional systemOptional; + try { + + systemOptional = systemRepository.findById(id); + + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } + if (systemOptional.isPresent()) { system = systemOptional.get(); }else { @@ -402,7 +411,15 @@ public QoSIntraPingMeasurement getPingMeasurementBySystemId(final long id) { } final QoSIntraMeasurement measurement; - final Optional qoSIntraMeasurementOptional = qoSIntraMeasurementRepository.findBySystemAndMeasurementType(system, QoSMeasurementType.PING); + final Optional qoSIntraMeasurementOptional; + try { + + qoSIntraMeasurementOptional = qoSIntraMeasurementRepository.findBySystemAndMeasurementType(system, QoSMeasurementType.PING); + + } catch (final Exception ex) { + logger.debug(ex.getMessage(), ex); + throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); + } if (qoSIntraMeasurementOptional.isEmpty()) { return null; From c049acc27dba6502b09c1d6fe5be3956bacb3cb2 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 15:01:36 +0100 Subject: [PATCH 142/301] refactored exception handling at getPingMeasurementBySystemId --- .../qos/database/service/QoSDBService.java | 48 +++++++------------ 1 file changed, 16 insertions(+), 32 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index 8b5ed89a7..8e8760eda 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -398,44 +398,28 @@ public QoSIntraPingMeasurement getPingMeasurementBySystemId(final long id) { try { systemOptional = systemRepository.findById(id); + if (systemOptional.isPresent()) { + system = systemOptional.get(); + }else { + throw new InvalidParameterException("Requested system" + NOT_IN_DB_ERROR_MESSAGE); + } - } catch (final Exception ex) { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } - - if (systemOptional.isPresent()) { - system = systemOptional.get(); - }else { - throw new ArrowheadException("Requested system" + NOT_IN_DB_ERROR_MESSAGE); - } - - final QoSIntraMeasurement measurement; - final Optional qoSIntraMeasurementOptional; - try { - - qoSIntraMeasurementOptional = qoSIntraMeasurementRepository.findBySystemAndMeasurementType(system, QoSMeasurementType.PING); - - } catch (final Exception ex) { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } - if (qoSIntraMeasurementOptional.isEmpty()) { - - return null; - }else { - measurement = qoSIntraMeasurementOptional.get(); - } + final QoSIntraMeasurement measurement; + final Optional qoSIntraMeasurementOptional = qoSIntraMeasurementRepository.findBySystemAndMeasurementType(system, QoSMeasurementType.PING); + if (qoSIntraMeasurementOptional.isEmpty()) { + + return null; + }else { + measurement = qoSIntraMeasurementOptional.get(); + } - try { final Optional measurementOptional = qoSIntraMeasurementPingRepository.findByMeasurement(measurement); - if (measurementOptional.isPresent()) { - - return measurementOptional.get(); + if (measurementOptional.isEmpty()) { + return null; } else { - return null; + return measurementOptional.get(); } } catch (final InvalidParameterException ex) { throw ex; From 9f79d7750969ca3bf02cc73bc3ed2bfdf9ffdcde Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 15:02:58 +0100 Subject: [PATCH 143/301] implemented getPingMeasurementBySystemId tests --- .../database/service/QoSDBServiceTest.java | 213 ++++++++++++++++++ 1 file changed, 213 insertions(+) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index 46e820048..61ba7ec3d 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -2,9 +2,11 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doThrow; @@ -1382,6 +1384,217 @@ public void testGetPingMeasurementPagefindAllThrowsException() { } + //================================================================================================= + // Tests of getPingMeasurementBySystemId + + //------------------------------------------------------------------------------------------------- + @Test + public void testGetPingMeasurementBySystemId() { + + final long id = 1L; + final System system = getSystemForTest(); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + + when(systemRepository.findById(anyLong())).thenReturn(Optional.of(system)); + when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.of(measurement)); + when(qoSIntraMeasurementPingRepository.findByMeasurement(any())).thenReturn(Optional.of(pingMeasurement)); + + qoSDBService.getPingMeasurementBySystemId(id); + + verify(systemRepository, times(1)).findById(anyLong()); + verify(qoSIntraMeasurementRepository, times(1)).findBySystemAndMeasurementType(any(), any()); + verify(qoSIntraMeasurementPingRepository, times(1)).findByMeasurement(any()); + + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testGetPingMeasurementBySystemIdNoPingMeasurementInDB() { + + final long id = 1L; + final System system = getSystemForTest(); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + + when(systemRepository.findById(anyLong())).thenReturn(Optional.of(system)); + when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.of(measurement)); + when(qoSIntraMeasurementPingRepository.findByMeasurement(any())).thenReturn(Optional.ofNullable(null)); + + final QoSIntraPingMeasurement response = qoSDBService.getPingMeasurementBySystemId(id); + + assertNull(response); + + verify(systemRepository, times(1)).findById(anyLong()); + verify(qoSIntraMeasurementRepository, times(1)).findBySystemAndMeasurementType(any(), any()); + verify(qoSIntraMeasurementPingRepository, times(1)).findByMeasurement(any()); + + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testGetPingMeasurementBySystemIdNoMeasurementInDB() { + + final long id = 1L; + final System system = getSystemForTest(); + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + + when(systemRepository.findById(anyLong())).thenReturn(Optional.of(system)); + when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.ofNullable(null)); + when(qoSIntraMeasurementPingRepository.findByMeasurement(any())).thenReturn(Optional.of(pingMeasurement)); + + final QoSIntraPingMeasurement response = qoSDBService.getPingMeasurementBySystemId(id); + + assertNull(response); + + verify(systemRepository, times(1)).findById(anyLong()); + verify(qoSIntraMeasurementRepository, times(1)).findBySystemAndMeasurementType(any(), any()); + verify(qoSIntraMeasurementPingRepository, times(0)).findByMeasurement(any()); + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testGetPingMeasurementBySystemIdNoSystemInDB() { + + final long id = 1L; + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + + when(systemRepository.findById(anyLong())).thenReturn(Optional.ofNullable(null)); + when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.of(measurement)); + when(qoSIntraMeasurementPingRepository.findByMeasurement(any())).thenReturn(Optional.of(pingMeasurement)); + + try { + + qoSDBService.getPingMeasurementBySystemId(id); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("Requested system" + NOT_IN_DB_ERROR_MESSAGE)); + verify(systemRepository, times(1)).findById(anyLong()); + verify(qoSIntraMeasurementRepository, times(0)).findBySystemAndMeasurementType(any(), any()); + verify(qoSIntraMeasurementPingRepository, times(0)).findByMeasurement(any()); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testGetPingMeasurementBySystemIdWithInvalidIdParameter() { + + final long id = -1L; + final System system = getSystemForTest(); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + + when(systemRepository.findById(anyLong())).thenReturn(Optional.of(system)); + when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.of(measurement)); + when(qoSIntraMeasurementPingRepository.findByMeasurement(any())).thenReturn(Optional.of(pingMeasurement)); + + try { + + qoSDBService.getPingMeasurementBySystemId(id); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains("SystemId" + LESS_THAN_ONE_ERROR_MESSAGE)); + verify(systemRepository, times(0)).findById(anyLong()); + verify(qoSIntraMeasurementRepository, times(0)).findBySystemAndMeasurementType(any(), any()); + verify(qoSIntraMeasurementPingRepository, times(0)).findByMeasurement(any()); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testGetPingMeasurementBySystemIdFindByIdThrowsException() { + + final long id = 1L; + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + + when(systemRepository.findById(anyLong())).thenThrow(HibernateException.class); + when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.of(measurement)); + when(qoSIntraMeasurementPingRepository.findByMeasurement(any())).thenReturn(Optional.of(pingMeasurement)); + + try { + + qoSDBService.getPingMeasurementBySystemId(id); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG)); + verify(systemRepository, times(1)).findById(anyLong()); + verify(qoSIntraMeasurementRepository, times(0)).findBySystemAndMeasurementType(any(), any()); + verify(qoSIntraMeasurementPingRepository, times(0)).findByMeasurement(any()); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testGetPingMeasurementBySystemIdFindBySystemAndMeasurementTypeThrowsException() { + + final long id = 1L; + final System system = getSystemForTest(); + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + + when(systemRepository.findById(anyLong())).thenReturn(Optional.of(system)); + when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenThrow(HibernateException.class); + when(qoSIntraMeasurementPingRepository.findByMeasurement(any())).thenReturn(Optional.of(pingMeasurement)); + + try { + + qoSDBService.getPingMeasurementBySystemId(id); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG)); + verify(systemRepository, times(1)).findById(anyLong()); + verify(qoSIntraMeasurementRepository, times(1)).findBySystemAndMeasurementType(any(), any()); + verify(qoSIntraMeasurementPingRepository, times(0)).findByMeasurement(any()); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testGetPingMeasurementBySystemIdFindByMeasurementThrowsException() { + + final long id = 1L; + final System system = getSystemForTest(); + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + when(systemRepository.findById(anyLong())).thenReturn(Optional.of(system)); + when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.of(measurement)); + when(qoSIntraMeasurementPingRepository.findByMeasurement(any())).thenThrow(HibernateException.class); + + try { + + qoSDBService.getPingMeasurementBySystemId(id); + + } catch (final Exception ex) { + + assertTrue(ex.getMessage().contains(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG)); + verify(systemRepository, times(1)).findById(anyLong()); + verify(qoSIntraMeasurementRepository, times(1)).findBySystemAndMeasurementType(any(), any()); + verify(qoSIntraMeasurementPingRepository, times(1)).findByMeasurement(any()); + + throw ex; + } + + } + //================================================================================================= // assistant methods From 5f26d26d9e2b7e1e3feb95ec7559d19ce415e3c6 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 15:20:18 +0100 Subject: [PATCH 144/301] removed unused imports --- .../arrowhead/core/qos/database/service/QoSDBServiceTest.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index 61ba7ec3d..d844bb650 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -19,8 +19,6 @@ import java.util.List; import java.util.Optional; -import javax.persistence.criteria.CriteriaBuilder.In; - import org.hibernate.HibernateException; import org.icmp4j.IcmpPingResponse; import org.junit.Test; @@ -28,7 +26,6 @@ import org.mockito.ArgumentCaptor; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.springframework.boot.autoconfigure.data.web.SpringDataWebProperties.Pageable; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; @@ -37,7 +34,6 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; -import eu.arrowhead.common.database.entity.OrchestratorStore; import eu.arrowhead.common.database.entity.QoSIntraMeasurement; import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; import eu.arrowhead.common.database.entity.QoSIntraPingMeasurementLog; From 15fa929d64948cddbe46f117de68672833b12094 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 6 Feb 2020 15:50:35 +0100 Subject: [PATCH 145/301] started to implement PingTask tests --- .../core/qos/quartz/task/PingTaskTest.java | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java new file mode 100644 index 000000000..ea56bd32f --- /dev/null +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -0,0 +1,71 @@ +package eu.arrowhead.core.qos.quartz.task; + +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.mock; + +import java.util.Map; + +import org.apache.logging.log4j.Logger; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.util.ReflectionTestUtils; + +import eu.arrowhead.common.http.HttpService; +import eu.arrowhead.core.qos.database.service.QoSDBService; +import eu.arrowhead.core.qos.measurement.properties.PingMeasurementProperties; + +@RunWith(SpringRunner.class) +public class PingTaskTest { + + //================================================================================================= + // members + @InjectMocks + private PingTask pingTask = new PingTask(); + + @Mock + private QoSDBService qoSDBService; + + @Mock + private HttpService httpService; + + @Mock + private PingMeasurementProperties pingMeasurementProperties; + + @Mock + private Map arrowheadContext; + + private Logger logger; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + //@BeforeClass + //public void initializeArrowheadContext() { + // arrowheadContext. + //} + + //------------------------------------------------------------------------------------------------- + @Before + public void setUp() throws Exception { + logger = mock(Logger.class); + ReflectionTestUtils.setField(pingTask, "logger", logger); + } + + //================================================================================================= + // Tests of execute + @Test + public void testExecute() { + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + //TODO Implement testing logic here + } +} From 623d47ad015a42607e6cc9eb7e7eda513e1bb434 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Thu, 6 Feb 2020 17:02:39 +0100 Subject: [PATCH 146/301] more tests --- .../arrowhead/common/CoreCommonConstants.java | 2 + .../eu/arrowhead/common/CoreDefaults.java | 1 + .../impl/PingRequirementsVerifier.java | 18 +- .../impl/PingRequirementsVerifierTest.java | 558 ++++++++++++++++++ 4 files changed, 574 insertions(+), 5 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java index 339648b26..fd47c7d48 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java @@ -127,6 +127,8 @@ public class CoreCommonConstants { public static final String $QOS_MAX_RESERVATION_DURATION_WD = "${" + QOS_MAX_RESERVATION_DURATION + ":" + CoreDefaults.DEFAULT_QOS_MAX_RESERVATION_DURATION + "}"; public static final String QOS_PING_MEASUREMENT_CACHE_THRESHOLD = "qos_ping_measurement_cache_threshold"; // in seconds public static final String $QOS_PING_MEASUREMENT_CACHE_THRESHOLD_WD = "${" + QOS_PING_MEASUREMENT_CACHE_THRESHOLD + ":" + CoreDefaults.DEFAULT_QOS_PING_MEASUREMENT_CACHE_THRESHOLD + "}"; + public static final String QOS_NOT_MEASURED_SYSTEM_VERIFY_RESULT = "qos_not_measured_system_verify_result"; // result of verify if a system has no measurement records + public static final String $QOS_NOT_MEASURED_SYSTEM_VERIFY_RESULT = "${" + QOS_NOT_MEASURED_SYSTEM_VERIFY_RESULT + ":" + CoreDefaults.DEFAULT_QOS_NOT_MEASURED_SYSTEM_VERIFY_RESULT + "}"; public static final String NO_GATEKEEPER_RELAY_REQUEST_HANDLER_WORKERS = "no_gatekeeper_relay_request_handler_workers"; public static final String $NO_GATEKEEPER_RELAY_REQUEST_HANDLER_WORKERS_WD = "${" + NO_GATEKEEPER_RELAY_REQUEST_HANDLER_WORKERS + ":" + diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java b/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java index 1b326f793..d86f53db2 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreDefaults.java @@ -57,6 +57,7 @@ public class CoreDefaults { public static final int DEFAULT_QOS_TEMPORARY_LOCK_DURATION = 60; // in seconds public static final int DEFAULT_QOS_MAX_RESERVATION_DURATION = 3600; // in seconds public static final int DEFAULT_QOS_PING_MEASUREMENT_CACHE_THRESHOLD = 600; // in seconds + public static final boolean DEFAULT_QOS_NOT_MEASURED_SYSTEM_VERIFY_RESULT = true; //================================================================================================= // assistant methods diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifier.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifier.java index 3737b39f0..99f2a9a45 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifier.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifier.java @@ -23,7 +23,8 @@ public class PingRequirementsVerifier implements QoSVerifier { //================================================================================================= // members - private static final boolean verifyNotMeasuredSystem = true; // result of verify if a system has no ping records + @Value(CoreCommonConstants.$QOS_NOT_MEASURED_SYSTEM_VERIFY_RESULT) + private boolean verifyNotMeasuredSystem; // result of verify if a system has no ping records @Value(CoreCommonConstants.$QOS_PING_MEASUREMENT_CACHE_THRESHOLD_WD) private int pingMeasurementCacheThreshold; @@ -180,7 +181,7 @@ private int getJitterThreshold(final Map qosRequirements) { final String valueStr = qosRequirements.get(OrchestrationFormRequestDTO.QOS_REQUIREMENT_JITTER_THRESHOLD); try { final int value = Integer.parseInt(valueStr); - if (value <= 0) { + if (value < 0) { throw new InvalidParameterException(OrchestrationFormRequestDTO.QOS_REQUIREMENT_JITTER_THRESHOLD + " has invalid value: " + valueStr); } @@ -197,7 +198,7 @@ private double getRecentPacketLossThreshold(final Map qosRequirem final String valueStr = qosRequirements.get(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RECENT_PACKET_LOSS); try { final int value = Integer.parseInt(valueStr); - if (value <= 0) { + if (value < 0) { throw new InvalidParameterException(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RECENT_PACKET_LOSS + " has invalid value: " + valueStr); } @@ -214,7 +215,7 @@ private double getPacketLossThreshold(final Map qosRequirements) final String valueStr = qosRequirements.get(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_PACKET_LOSS); try { final int value = Integer.parseInt(valueStr); - if (value <= 0) { + if (value < 0) { throw new InvalidParameterException(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_PACKET_LOSS + " has invalid value: " + valueStr); } @@ -245,6 +246,13 @@ private PingMeasurementResponseDTO getPingMeasurement(final long systemId) { //------------------------------------------------------------------------------------------------- private PingMeasurementResponseDTO getPingMeasurementFromQoSMonitor(final long systemId) { logger.debug("getPingMeasurementFromQoSMonitor started..."); - return orchestrationDriver.getPingMeasurement(systemId); + + final PingMeasurementResponseDTO measurement = orchestrationDriver.getPingMeasurement(systemId); + + if (measurement.hasRecord() && measurement.isAvailable()) { // only caching when there are some data + pingMeasurementCache.put(systemId, measurement); + } + + return measurement; } } \ No newline at end of file diff --git a/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifierTest.java b/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifierTest.java index 9ba147eba..7fc025f94 100644 --- a/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifierTest.java +++ b/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifierTest.java @@ -1,6 +1,9 @@ package eu.arrowhead.core.qos.manager.impl; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import java.time.ZonedDateTime; @@ -8,11 +11,13 @@ import java.util.Map; import org.junit.Assert; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.util.ReflectionTestUtils; import eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO; import eu.arrowhead.common.dto.internal.QoSIntraMeasurementResponseDTO; @@ -21,6 +26,7 @@ import eu.arrowhead.common.dto.shared.SystemResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.exception.BadPayloadException; +import eu.arrowhead.common.exception.InvalidParameterException; import eu.arrowhead.core.orchestrator.service.OrchestratorDriver; @RunWith(SpringRunner.class) @@ -41,6 +47,12 @@ public class PingRequirementsVerifierTest { //================================================================================================= // methods + //------------------------------------------------------------------------------------------------- + @Before + public void setUp() { + ReflectionTestUtils.setField(verifier, "pingMeasurementCacheThreshold", 120); + } + //------------------------------------------------------------------------------------------------- @Test(expected = IllegalArgumentException.class) public void testVerifyResultNull() { @@ -108,4 +120,550 @@ public void testVerifyObsoleteCache() { verifier.verify(result, qosRequirements, null); } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyNoMeasurementRecordUsingDefaultTrue() { + ReflectionTestUtils.setField(verifier, "verifyNotMeasuredSystem", true); + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + Assert.assertFalse(response.hasRecord()); + when(pingMeasurementCache.get(anyLong())).thenReturn(null); + when(orchestratorDriver.getPingMeasurement(anyLong())).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RESPONSE_TIME_THRESHOLD, "500"); + + final boolean verified = verifier.verify(result, qosRequirements, null); + Assert.assertTrue(verified); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyNoMeasurementRecordUsingDefaultFalse() { + ReflectionTestUtils.setField(verifier, "verifyNotMeasuredSystem", false); + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + Assert.assertFalse(response.hasRecord()); + when(pingMeasurementCache.get(anyLong())).thenReturn(null); + when(orchestratorDriver.getPingMeasurement(anyLong())).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RESPONSE_TIME_THRESHOLD, "500"); + + final boolean verified = verifier.verify(result, qosRequirements, null); + Assert.assertFalse(verified); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifySystemNotAvailable() { + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + response.setId(12L); + response.setAvailable(false); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(anyLong())).thenReturn(null); + when(orchestratorDriver.getPingMeasurement(anyLong())).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RESPONSE_TIME_THRESHOLD, "500"); + + final boolean verified = verifier.verify(result, qosRequirements, null); + Assert.assertFalse(verified); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testVerifyMaximumThresholdResponseRequirementInvalid() { // also tests that cache is stored the measurement + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setMaxResponseTime(32); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(anyLong())).thenReturn(null); + when(pingMeasurementCache.put(anyLong(), any())).thenReturn(response); + when(orchestratorDriver.getPingMeasurement(anyLong())).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RESPONSE_TIME_THRESHOLD, "invalid"); + + try { + verifier.verify(result, qosRequirements, null); + } catch (final InvalidParameterException ex) { // catch exception to test the caching + verify(pingMeasurementCache, times(1)).put(anyLong(), any()); + throw ex; + } + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testVerifyMaximumThresholdResponseRequirementNotPositive() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setMaxResponseTime(32); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RESPONSE_TIME_THRESHOLD, "0"); + + verifier.verify(result, qosRequirements, null); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyMaximumThresholdResponseRequirementNotVerified() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setMaxResponseTime(32); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RESPONSE_TIME_THRESHOLD, "30"); + + final boolean verified = verifier.verify(result, qosRequirements, null); + Assert.assertFalse(verified); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyMaximumThresholdResponseRequirementVerified() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setMaxResponseTime(32); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RESPONSE_TIME_THRESHOLD, "300"); + + final boolean verified = verifier.verify(result, qosRequirements, null); + Assert.assertTrue(verified); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testVerifyAverageThresholdResponseRequirementInvalid() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setMeanResponseTimeWithTimeout(32); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_AVERAGE_RESPONSE_TIME_THRESHOLD, "invalid"); + + verifier.verify(result, qosRequirements, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testVerifyAverageThresholdResponseRequirementNotPositive() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setMeanResponseTimeWithTimeout(32); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_AVERAGE_RESPONSE_TIME_THRESHOLD, "0"); + + verifier.verify(result, qosRequirements, null); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyAverageThresholdResponseRequirementNotVerified() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setMeanResponseTimeWithoutTimeout(32); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_AVERAGE_RESPONSE_TIME_THRESHOLD, "30"); + + final boolean verified = verifier.verify(result, qosRequirements, null); + Assert.assertFalse(verified); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyAverageThresholdResponseRequirementVerified() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setMeanResponseTimeWithoutTimeout(32); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_AVERAGE_RESPONSE_TIME_THRESHOLD, "300"); + + final boolean verified = verifier.verify(result, qosRequirements, null); + Assert.assertTrue(verified); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testVerifyJitterThresholdResponseRequirementInvalid() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setJitterWithoutTimeout(32); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_JITTER_THRESHOLD, "invalid"); + + verifier.verify(result, qosRequirements, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testVerifyJitterThresholdResponseRequirementNegative() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setJitterWithoutTimeout(32); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_JITTER_THRESHOLD, "-2"); + + verifier.verify(result, qosRequirements, null); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyJitterThresholdResponseRequirementNotVerified() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setJitterWithoutTimeout(32); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_JITTER_THRESHOLD, "30"); + + final boolean verified = verifier.verify(result, qosRequirements, null); + Assert.assertFalse(verified); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyJitterThresholdResponseRequirementVerified() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setJitterWithoutTimeout(32); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_JITTER_THRESHOLD, "300"); + + final boolean verified = verifier.verify(result, qosRequirements, null); + Assert.assertTrue(verified); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testVerifyRecentPacketLossRequirementInvalid() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setReceived(20); + response.setSent(100); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RECENT_PACKET_LOSS, "invalid"); + + verifier.verify(result, qosRequirements, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testVerifyRecentPacketLossRequirementNegative() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setReceived(20); + response.setSent(100); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RECENT_PACKET_LOSS, "-2"); + + verifier.verify(result, qosRequirements, null); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyRecentPacketLossRequirementNotVerified() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setReceived(20); + response.setSent(100); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RECENT_PACKET_LOSS, "10"); + + final boolean verified = verifier.verify(result, qosRequirements, null); + Assert.assertFalse(verified); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyRecentPacketLossRequirementVerified() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setReceived(20); + response.setSent(100); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RECENT_PACKET_LOSS, "30"); + + final boolean verified = verifier.verify(result, qosRequirements, null); + Assert.assertTrue(verified); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testVerifyPacketLossRequirementInvalid() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setReceivedAll(20); + response.setSentAll(100); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_PACKET_LOSS, "invalid"); + + verifier.verify(result, qosRequirements, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testVerifyPacketLossRequirementNegative() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setReceivedAll(20); + response.setSentAll(100); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_PACKET_LOSS, "-2"); + + verifier.verify(result, qosRequirements, null); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyPacketLossRequirementNotVerified() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setReceivedAll(20); + response.setSentAll(100); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_PACKET_LOSS, "10"); + + final boolean verified = verifier.verify(result, qosRequirements, null); + Assert.assertFalse(verified); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyPacketLossRequirementVerified() { // measurement comes from cache + final PingMeasurementResponseDTO response = new PingMeasurementResponseDTO(); + final QoSIntraMeasurementResponseDTO measurement = new QoSIntraMeasurementResponseDTO(); + measurement.setLastMeasurementAt(ZonedDateTime.now()); + response.setMeasurement(measurement); + response.setId(12L); + response.setAvailable(true); + response.setReceivedAll(20); + response.setSentAll(100); + Assert.assertTrue(response.hasRecord()); + when(pingMeasurementCache.get(2L)).thenReturn(response); + + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(2); + result.setProvider(provider); + final Map qosRequirements = new HashMap<>(); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_PACKET_LOSS, "30"); + + final boolean verified = verifier.verify(result, qosRequirements, null); + Assert.assertTrue(verified); + } } \ No newline at end of file From e77a40fae4c1b5759b360e3cc259afe22c9c95fd Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 7 Feb 2020 09:16:49 +0100 Subject: [PATCH 147/301] implemented nullcheck at getSystemsToMeasure --- .../eu/arrowhead/core/qos/quartz/task/PingTask.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 4277deda7..a350efc42 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -1,5 +1,6 @@ package eu.arrowhead.core.qos.quartz.task; +import java.net.http.HttpConnectTimeoutException; import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.List; @@ -10,6 +11,7 @@ import javax.annotation.Resource; +import org.apache.http.HttpException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.icmp4j.IcmpPingRequest; @@ -81,6 +83,11 @@ public void execute(final JobExecutionContext context) throws JobExecutionExcept } final Set systems = getSystemsToMeasure(); + if (systems == null) { + + return; + } + for (final SystemResponseDTO systemResponseDTO : systems) { pingSystem(systemResponseDTO); @@ -98,6 +105,10 @@ private Set getSystemsToMeasure() { logger.debug("getSystemToMessure started..."); final ServiceRegistryListResponseDTO serviceRegistryListResponseDTO = queryServiceRegistryAll(); + if(serviceRegistryListResponseDTO == null || serviceRegistryListResponseDTO.getData() == null || serviceRegistryListResponseDTO.getData().isEmpty()) { + + return null; + } final Set systemList = serviceRegistryListResponseDTO.getData().stream().map(ServiceRegistryResponseDTO::getProvider).collect(Collectors.toSet()); return systemList; @@ -251,7 +262,7 @@ private ServiceRegistryListResponseDTO queryServiceRegistryAll() { return response.getBody(); - } catch (final ClassCastException ex) { + } catch (ClassCastException ex) { throw new ArrowheadException("QoS Mointor can't find Service Registry Query All URI."); } From c82d49d36c2ceeefa761343aa1b110db86eadeb9 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 7 Feb 2020 09:23:49 +0100 Subject: [PATCH 148/301] handle all exceptions in queryServiceRegistryAll --- .../eu/arrowhead/core/qos/quartz/task/PingTask.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index a350efc42..18e6cb09b 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -1,6 +1,5 @@ package eu.arrowhead.core.qos.quartz.task; -import java.net.http.HttpConnectTimeoutException; import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.List; @@ -11,7 +10,6 @@ import javax.annotation.Resource; -import org.apache.http.HttpException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.icmp4j.IcmpPingRequest; @@ -262,9 +260,11 @@ private ServiceRegistryListResponseDTO queryServiceRegistryAll() { return response.getBody(); - } catch (ClassCastException ex) { - throw new ArrowheadException("QoS Mointor can't find Service Registry Query All URI."); - } + } catch (final Throwable ex) { + + logger.debug("Exception:", ex.getMessage()); + return null; + } } From 2356bf535650fc69152618355806347bf33033ba Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 7 Feb 2020 11:16:30 +0100 Subject: [PATCH 149/301] refactored pingMeasurement service --- .../core/qos/quartz/task/PingTask.java | 43 ++--------- .../core/qos/service/PingService.java | 75 +++++++++++++++++++ 2 files changed, 80 insertions(+), 38 deletions(-) create mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/service/PingService.java diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 18e6cb09b..75500b421 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -41,6 +41,7 @@ import eu.arrowhead.core.qos.database.service.QoSDBService; import eu.arrowhead.core.qos.dto.PingMeasurementCalculationsDTO; import eu.arrowhead.core.qos.measurement.properties.PingMeasurementProperties; +import eu.arrowhead.core.qos.service.PingService; @Component @DisallowConcurrentExecution @@ -58,6 +59,9 @@ public class PingTask implements Job { @Autowired private PingMeasurementProperties pingMeasurementProperties; + @Autowired + private PingService pingService; + @Autowired private QoSDBService qoSDBService; @@ -203,7 +207,7 @@ private void pingSystem(final SystemResponseDTO systemResponseDTO ) { final String address = systemResponseDTO.getAddress(); - final List responseList = getPingResponseList(address); + final List responseList = pingService.getPingResponseList(address); final QoSIntraMeasurement measurement = qoSDBService.getMeasurement(systemResponseDTO); handlePingMeasurement(measurement, responseList, aroundNow); @@ -283,41 +287,4 @@ private UriComponents getQueryAllUri() { throw new ArrowheadException("QoS Mointor can't find Service Registry Query All URI."); } - //------------------------------------------------------------------------------------------------- - private List getPingResponseList(final String address) { - logger.debug("getPingResponseList started..."); - - final List responseList = new ArrayList<>(pingMeasurementProperties.getTimeToRepeat()); - try { - final IcmpPingRequest request = IcmpPingUtil.createIcmpPingRequest (); - request.setHost (address); - request.setTimeout(pingMeasurementProperties.getTimeout()); - request.setPacketSize(pingMeasurementProperties.getPacketSize()); - - for (int count = 0; count < pingMeasurementProperties.getTimeToRepeat(); count ++) { - IcmpPingResponse response; - try { - response = IcmpPingUtil.executePingRequest (request); - final String formattedResponse = IcmpPingUtil.formatResponse (response); - logger.debug(formattedResponse); - - responseList.add(response); - } catch (final Exception ex) { - response = new IcmpPingResponse(); - response.setErrorMessage(ex.getMessage()); - response.setSuccessFlag(false); - response.setThrowable(ex); - - responseList.add(response); - } - - Thread.sleep (pingMeasurementProperties.getRest()); - } - } catch ( final InterruptedException | IllegalArgumentException ex) { - logger.debug("" + ex.getMessage()); - } - - return responseList; - } - } \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/service/PingService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/service/PingService.java new file mode 100644 index 000000000..8ef4fadde --- /dev/null +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/service/PingService.java @@ -0,0 +1,75 @@ +package eu.arrowhead.core.qos.service; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.icmp4j.IcmpPingRequest; +import org.icmp4j.IcmpPingResponse; +import org.icmp4j.IcmpPingUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.exception.InvalidParameterException; +import eu.arrowhead.core.qos.measurement.properties.PingMeasurementProperties; + +@Service +public class PingService { + + //================================================================================================= + // members + + private static final String EMPTY_OR_NULL_ERROR_MESSAGE = " is empty or null"; + + @Autowired + private PingMeasurementProperties pingMeasurementProperties; + + protected Logger logger = LogManager.getLogger(PingMeasurementProperties.class); + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public List getPingResponseList(final String address) { + logger.debug("getPingResponseList started..."); + + if (Utilities.isEmpty(address)) { + throw new InvalidParameterException("Address" + EMPTY_OR_NULL_ERROR_MESSAGE); + } + + final List responseList = new ArrayList<>(pingMeasurementProperties.getTimeToRepeat()); + try { + final IcmpPingRequest request = IcmpPingUtil.createIcmpPingRequest (); + request.setHost (address); + request.setTimeout(pingMeasurementProperties.getTimeout()); + request.setPacketSize(pingMeasurementProperties.getPacketSize()); + + for (int count = 0; count < pingMeasurementProperties.getTimeToRepeat(); count ++) { + IcmpPingResponse response; + try { + response = IcmpPingUtil.executePingRequest (request); + final String formattedResponse = IcmpPingUtil.formatResponse (response); + logger.debug(formattedResponse); + + responseList.add(response); + } catch (final Exception ex) { + response = new IcmpPingResponse(); + response.setErrorMessage(ex.getMessage()); + response.setSuccessFlag(false); + response.setThrowable(ex); + + responseList.add(response); + } + + Thread.sleep (pingMeasurementProperties.getRest()); + } + } catch ( final InterruptedException | IllegalArgumentException ex) { + logger.debug("" + ex.getMessage()); + } + + return responseList; + } + +} From 915e1c7ac922c8f16f3c0ad01b2960c64e248115 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 7 Feb 2020 12:02:02 +0100 Subject: [PATCH 150/301] started to implement execute tests --- .../core/qos/quartz/task/PingTaskTest.java | 257 +++++++++++++++++- 1 file changed, 247 insertions(+), 10 deletions(-) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index ea56bd32f..dc7dee7d9 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -1,24 +1,56 @@ package eu.arrowhead.core.qos.quartz.task; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.List; import java.util.Map; +import java.util.Optional; import org.apache.logging.log4j.Logger; +import org.icmp4j.IcmpPingResponse; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.InjectMocks; import org.mockito.Mock; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.util.ReflectionTestUtils; +import org.springframework.web.util.UriComponents; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.database.entity.QoSIntraMeasurement; +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurement; +import eu.arrowhead.common.database.entity.QoSIntraPingMeasurementLog; +import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.dto.internal.DTOConverter; +import eu.arrowhead.common.dto.internal.ServiceRegistryListResponseDTO; +import eu.arrowhead.common.dto.shared.QoSMeasurementType; +import eu.arrowhead.common.dto.shared.ServiceDefinitionResponseDTO; +import eu.arrowhead.common.dto.shared.ServiceInterfaceResponseDTO; +import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.ServiceSecurityType; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; import eu.arrowhead.common.http.HttpService; import eu.arrowhead.core.qos.database.service.QoSDBService; import eu.arrowhead.core.qos.measurement.properties.PingMeasurementProperties; +import eu.arrowhead.core.qos.service.PingService; @RunWith(SpringRunner.class) public class PingTaskTest { @@ -26,7 +58,10 @@ public class PingTaskTest { //================================================================================================= // members @InjectMocks - private PingTask pingTask = new PingTask(); + private final PingTask pingTask = new PingTask(); + + @Mock + private PingService pingService; @Mock private QoSDBService qoSDBService; @@ -40,17 +75,16 @@ public class PingTaskTest { @Mock private Map arrowheadContext; + @Mock + private JobExecutionContext jobExecutionContext; + private Logger logger; + final static int TIME_TO_REPEAT_PING = 3; + //================================================================================================= // methods - //------------------------------------------------------------------------------------------------- - //@BeforeClass - //public void initializeArrowheadContext() { - // arrowheadContext. - //} - //------------------------------------------------------------------------------------------------- @Before public void setUp() throws Exception { @@ -61,11 +95,214 @@ public void setUp() throws Exception { //================================================================================================= // Tests of execute @Test - public void testExecute() { + public void testExecuteMeasurementIsInDB() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); doNothing().when(logger).debug( debugValueCapture.capture()); - //TODO Implement testing logic here + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeToRepeat()).thenReturn(TIME_TO_REPEAT_PING); + when(pingMeasurementProperties.getPacketSize()).thenReturn(32); + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + when(pingMeasurementProperties.getRest()).thenReturn(1000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.of(pingMeasurement)); + //when(qoSDBService.createPingMeasurement(any(), any(), any())).thenReturn(pingMeasurement); + doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + assertTrue(false); + } + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + public ServiceRegistryListResponseDTO getServiceRegistryListResponseDTOForTest() { + + final int sizeOfResponse = 3; + final ServiceRegistryListResponseDTO serviceRegistryListResponseDTO = new ServiceRegistryListResponseDTO(); + final List responseList = new ArrayList<>(sizeOfResponse); + + for (int i = 0; i < sizeOfResponse; i++) { + responseList.add(getServiceRegistryResponseDTOForTest()); + } + + serviceRegistryListResponseDTO.setCount(sizeOfResponse); + serviceRegistryListResponseDTO.setData(responseList); + + return serviceRegistryListResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + public ServiceRegistryResponseDTO getServiceRegistryResponseDTOForTest() { + + final ServiceRegistryResponseDTO serviceRegistryResponseDTO = new ServiceRegistryResponseDTO(); + + serviceRegistryResponseDTO.setId(1L); + serviceRegistryResponseDTO.setServiceDefinition(getServiceDefinitionResponseDTOForTest()); + serviceRegistryResponseDTO.setProvider(getSystemResponseDTOForTest()); + serviceRegistryResponseDTO.setServiceUri("serviceUri"); + serviceRegistryResponseDTO.setEndOfValidity(null); + serviceRegistryResponseDTO.setSecure(ServiceSecurityType.CERTIFICATE); + serviceRegistryResponseDTO.setMetadata(null); + serviceRegistryResponseDTO.setVersion(1); + serviceRegistryResponseDTO.setInterfaces(List.of(getServiceInterfaceResponseDTOForTest())); + serviceRegistryResponseDTO.setCreatedAt(Utilities.convertZonedDateTimeToUTCString(ZonedDateTime.now())); + serviceRegistryResponseDTO.setUpdatedAt(Utilities.convertZonedDateTimeToUTCString(ZonedDateTime.now())); + + return serviceRegistryResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + public ServiceDefinitionResponseDTO getServiceDefinitionResponseDTOForTest() { + + final ServiceDefinitionResponseDTO serviceDefinitionResponseDTO = new ServiceDefinitionResponseDTO(); + + serviceDefinitionResponseDTO.setId(1L); + serviceDefinitionResponseDTO.setServiceDefinition("serviceDefinition"); + serviceDefinitionResponseDTO.setCreatedAt(Utilities.convertZonedDateTimeToUTCString(ZonedDateTime.now())); + serviceDefinitionResponseDTO.setUpdatedAt(Utilities.convertZonedDateTimeToUTCString(ZonedDateTime.now())); + + return serviceDefinitionResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + private System getSystemForTest() { + + final System system = new System( + "testSystem", + "address", + 12345, + "authenticationInfo"); + + return system; + } + + //------------------------------------------------------------------------------------------------- + private SystemResponseDTO getSystemResponseDTOForTest() { + + final SystemResponseDTO systemResponseDTO = DTOConverter.convertSystemToSystemResponseDTO(getSystemForTest()); + + return systemResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + private ServiceInterfaceResponseDTO getServiceInterfaceResponseDTOForTest() { + + final ServiceInterfaceResponseDTO serviceInterfaceResponseDTO = new ServiceInterfaceResponseDTO(); + serviceInterfaceResponseDTO.setId(1L); + serviceInterfaceResponseDTO.setInterfaceName("interfaceName"); + serviceInterfaceResponseDTO.setCreatedAt(Utilities.convertZonedDateTimeToUTCString(ZonedDateTime.now())); + serviceInterfaceResponseDTO.setUpdatedAt(Utilities.convertZonedDateTimeToUTCString(ZonedDateTime.now())); + + return serviceInterfaceResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + private List getResponseListForTest() { + + final List responseList = new ArrayList<>(); + for (int i = 0; i < TIME_TO_REPEAT_PING; i++) { + responseList.add(getIcmpPingResponse()); + } + + return responseList; + } + + //------------------------------------------------------------------------------------------------- + private IcmpPingResponse getIcmpPingResponse() { + + final IcmpPingResponse pingResponse = new IcmpPingResponse(); + pingResponse.setSuccessFlag(true); + pingResponse.setTimeoutFlag(false); + pingResponse.setRtt(1); + pingResponse.setDuration(1L); + pingResponse.setTtl(64); + pingResponse.setSize(32); + pingResponse.setHost("localhost"); + + return pingResponse; + } + + //------------------------------------------------------------------------------------------------- + private QoSIntraMeasurement getQoSIntraMeasurementForTest() { + + final System system = getSystemForTest(); + final QoSIntraMeasurement measurement = new QoSIntraMeasurement( + system, + QoSMeasurementType.PING, + ZonedDateTime.now()); + + return measurement; + } + + //------------------------------------------------------------------------------------------------- + private QoSIntraPingMeasurement getQosIntraPingMeasurementForTest() { + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurement pingMeasurement = new QoSIntraPingMeasurement(); + + pingMeasurement.setMeasurement(measurement); + pingMeasurement.setAvailable(true); + pingMeasurement.setMaxResponseTime(1); + pingMeasurement.setMinResponseTime(1); + pingMeasurement.setMeanResponseTimeWithoutTimeout(1); + pingMeasurement.setMeanResponseTimeWithTimeout(1); + pingMeasurement.setJitterWithoutTimeout(1); + pingMeasurement.setJitterWithTimeout(1); + pingMeasurement.setLostPerMeasurementPercent(0); + pingMeasurement.setCountStartedAt(ZonedDateTime.now()); + pingMeasurement.setLastAccessAt(ZonedDateTime.now()); + pingMeasurement.setSent(35); + pingMeasurement.setSentAll(35); + pingMeasurement.setReceived(35); + pingMeasurement.setReceivedAll(35); + + return pingMeasurement; + } + + //------------------------------------------------------------------------------------------------- + private QoSIntraPingMeasurementLog getMeasurementLogForTest() { + + final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); + measurementLog.setAvailable(true); + + return measurementLog; + } + } From ce10e7c0d1d79a629804f9e44d361eef0e10d2b2 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 7 Feb 2020 12:38:18 +0100 Subject: [PATCH 151/301] refactored use of timeout property --- .../java/eu/arrowhead/core/qos/quartz/task/PingTask.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 75500b421..39514a1e4 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -1,7 +1,6 @@ package eu.arrowhead.core.qos.quartz.task; import java.time.ZonedDateTime; -import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; @@ -12,9 +11,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.icmp4j.IcmpPingRequest; import org.icmp4j.IcmpPingResponse; -import org.icmp4j.IcmpPingUtil; import org.quartz.DisallowConcurrentExecution; import org.quartz.Job; import org.quartz.JobExecutionContext; @@ -123,6 +120,8 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(final List final int sentInThisPing = responseList.size(); Assert.isTrue(sentInThisPing > 0, "Sent in this Ping value must be greater than zero"); + final int timeout = pingMeasurementProperties.getTimeout() + 1; + boolean available = false; int receivedInThisPing = 0; long maxResponseTime = 0; @@ -153,7 +152,7 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(final List ++meanResponseTimeWithoutTimeoutMembersCount; }else { - sumOfDurationForMeanResponseTimeWithTimeout += pingMeasurementProperties.getTimeout(); + sumOfDurationForMeanResponseTimeWithTimeout += timeout; } } @@ -172,7 +171,7 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(final List duration = icmpPingResponse.getDuration(); sumOfDiffsForJitterWithoutTimeout += Math.pow( (duration - meanResponseTimeWithoutTimeout), 2); }else { - duration = pingMeasurementProperties.getTimeout() + 1; + duration = timeout; } sumOfDiffsForJitterWithTimeout += Math.pow( (duration - meanResponseTimeWithTimeout), 2); From 76ffe66372203db37273ef2666727a13fa0dc6ad Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 7 Feb 2020 12:53:58 +0100 Subject: [PATCH 152/301] implemented method invocation times verifications at testExecuteMeasurementIsInDB --- .../core/qos/quartz/task/PingTaskTest.java | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index dc7dee7d9..3a41d18f9 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -7,6 +7,7 @@ import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -118,10 +119,7 @@ public void testExecuteMeasurementIsInDB() { when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); - when(pingMeasurementProperties.getTimeToRepeat()).thenReturn(TIME_TO_REPEAT_PING); - when(pingMeasurementProperties.getPacketSize()).thenReturn(32); when(pingMeasurementProperties.getTimeout()).thenReturn(5000); - when(pingMeasurementProperties.getRest()).thenReturn(1000); when(pingService.getPingResponseList(anyString())).thenReturn(responseList); @@ -145,6 +143,17 @@ public void testExecuteMeasurementIsInDB() { verify(logger, atLeastOnce()).debug(any(String.class)); final List debugMessages = debugValueCapture.getAllValues(); assertNotNull(debugMessages); + + verify(arrowheadContext, times(2)).containsKey(anyString()); + verify(arrowheadContext, times(1)).get(anyString()); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(1)).getTimeout(); + verify(pingService, atLeastOnce()).getPingResponseList(anyString()); + verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + + verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, atLeastOnce()).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); } //================================================================================================= @@ -237,7 +246,18 @@ private List getResponseListForTest() { final List responseList = new ArrayList<>(); for (int i = 0; i < TIME_TO_REPEAT_PING; i++) { - responseList.add(getIcmpPingResponse()); + + if (i%2 == 0) { + final IcmpPingResponse pingResponse = getIcmpPingResponse(); + pingResponse.setSuccessFlag(false); + pingResponse.setTimeoutFlag(true); + pingResponse.setRtt(0); + pingResponse.setDuration(0); + + responseList.add(pingResponse); + }else { + responseList.add(getIcmpPingResponse()); + } } return responseList; From e747c63de90d67b5d47697deec340e975a8b9631 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 7 Feb 2020 13:56:48 +0100 Subject: [PATCH 153/301] log if standalone exit --- .../java/eu/arrowhead/core/qos/quartz/task/PingTask.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 39514a1e4..49ab2c9fa 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -74,10 +74,11 @@ public class PingTask implements Job { //------------------------------------------------------------------------------------------------- @Override public void execute(final JobExecutionContext context) throws JobExecutionException { - logger.debug("STARTED: ping task"); + logger.debug("STARTED: ping task"); if (arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)) { + logger.debug("Finished: ping task can not run if server is in standalon mode"); return; } @@ -93,7 +94,7 @@ public void execute(final JobExecutionContext context) throws JobExecutionExcept } - logger.debug("Finished: ping task"); + logger.debug("Finished: ping task success"); } //================================================================================================= From 8e6541aa9a0cf07a470920a9e124afb5780db014 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Fri, 7 Feb 2020 14:14:02 +0100 Subject: [PATCH 154/301] more tests --- .../core/qos/manager/impl/QoSManagerImpl.java | 5 +- .../qos/manager/impl/QoSManagerImplTest.java | 434 ++++++++++++++++++ 2 files changed, 438 insertions(+), 1 deletion(-) create mode 100644 orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImplTest.java diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java index 3fdac3a7b..c390fe51d 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java @@ -45,7 +45,7 @@ public class QoSManagerImpl implements QoSManager { public void init() { verifiers.add(appContext.getBean(QoSVerifiers.SERVICE_TIME_VERIFIER, QoSVerifier.class)); verifiers.add(appContext.getBean(QoSVerifiers.PING_REQUIREMENTS_VERIFIER, QoSVerifier.class)); - //TODO: add verifiers here + //TODO: add further verifiers here } //------------------------------------------------------------------------------------------------- @@ -130,6 +130,9 @@ public void confirmReservation(final OrchestrationResultDTO selected, final List public List verifyServices(final List orList, final OrchestrationFormRequestDTO request) { logger.debug("verifyServices started ..."); + Assert.notNull(orList, "'orList' is null."); + Assert.notNull(request, "'request' is null."); + final boolean needLockRelease = request.getCommands().containsKey(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY); final List result = new ArrayList<>(); diff --git a/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImplTest.java b/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImplTest.java new file mode 100644 index 000000000..079b55f46 --- /dev/null +++ b/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImplTest.java @@ -0,0 +1,434 @@ +package eu.arrowhead.core.qos.manager.impl; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.anyMap; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.util.ReflectionTestUtils; + +import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; +import eu.arrowhead.common.dto.shared.ServiceDefinitionResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.core.qos.database.service.QoSReservationDBService; +import eu.arrowhead.core.qos.manager.QoSVerifier; + +@RunWith(SpringRunner.class) +public class QoSManagerImplTest { + + //================================================================================================= + // members + + @InjectMocks + private QoSManagerImpl qosManager; + + @Mock + private QoSReservationDBService qosReservationDBService; + + @Mock + private QoSVerifier verifier; + + @Mock + private QoSVerifier verifier2; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Before + public void setUp() { + @SuppressWarnings({ "unchecked", "rawtypes" }) + final List verifiers = (List) ReflectionTestUtils.getField(qosManager, "verifiers"); + verifiers.clear(); + verifiers.add(verifier); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testFilterReservedProvidersResultListNull() { + qosManager.filterReservedProviders(null, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testFilterReservedProvidersRequesterNull() { + qosManager.filterReservedProviders(List.of(), null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testFilterReservedProvidersRequesterSystemNameNull() { + final SystemRequestDTO requester = new SystemRequestDTO(); + qosManager.filterReservedProviders(List.of(), requester); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testFilterReservedProvidersRequesterSystemNameEmpty() { + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName(" "); + qosManager.filterReservedProviders(List.of(), requester); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testFilterReservedProvidersRequesterAddressNull() { + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + qosManager.filterReservedProviders(List.of(), requester); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testFilterReservedProvidersRequesterAddressEmpty() { + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + requester.setAddress(" "); + qosManager.filterReservedProviders(List.of(), requester); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testFilterReservedProvidersRequesterPortNull() { + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + requester.setAddress("localhost"); + qosManager.filterReservedProviders(List.of(), requester); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testFilterReservedProvidersResultListEmpty() { + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + requester.setAddress("localhost"); + requester.setPort(1234); + final List filtered = qosManager.filterReservedProviders(List.of(), requester); + Assert.assertEquals(0, filtered.size()); + verify(qosReservationDBService, never()).getAllReservationsExceptMine(anyString(), anyString(), anyInt()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testFilterReservedProvidersNothingIsReserved() { + when(qosReservationDBService.getAllReservationsExceptMine(anyString(), anyString(), anyInt())).thenReturn(List.of()); + + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + requester.setAddress("localhost"); + requester.setPort(1234); + final List filtered = qosManager.filterReservedProviders(getOrList(3), requester); + Assert.assertEquals(3, filtered.size()); + verify(qosReservationDBService, times(1)).getAllReservationsExceptMine(anyString(), anyString(), anyInt()); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testReserveProvidersTemporarilyResultListNull() { + qosManager.reserveProvidersTemporarily(null, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testReserveProvidersTemporarilyRequesterNull() { + qosManager.reserveProvidersTemporarily(List.of(), null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testReserveProvidersTemporarilyRequesterSystemNameNull() { + final SystemRequestDTO requester = new SystemRequestDTO(); + qosManager.reserveProvidersTemporarily(List.of(), requester); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testReserveProvidersTemporarilyRequesterSystemNameEmpty() { + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName(" "); + qosManager.reserveProvidersTemporarily(List.of(), requester); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testReserveProvidersTemporarilyRequesterAddressNull() { + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + qosManager.reserveProvidersTemporarily(List.of(), requester); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testReserveProvidersTemporarilyRequesterAddressEmpty() { + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + requester.setAddress(" "); + qosManager.reserveProvidersTemporarily(List.of(), requester); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testReserveProvidersTemporarilyRequesterPortNull() { + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + requester.setAddress("localhost"); + qosManager.reserveProvidersTemporarily(List.of(), requester); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testReserveProvidersTemporarilyResultListEmpty() { + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + requester.setAddress("localhost"); + requester.setPort(1234); + final List reserved = qosManager.reserveProvidersTemporarily(List.of(), requester); + Assert.assertEquals(0, reserved.size()); + verify(qosReservationDBService, never()).applyTemporaryLock(anyString(), anyString(), anyInt(), any(OrchestrationResultDTO.class)); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testReserveProvidersTemporarilyLockFailed() { + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + requester.setAddress("localhost"); + requester.setPort(1234); + doThrow(ArrowheadException.class).when(qosReservationDBService).applyTemporaryLock(anyString(), anyString(), anyInt(), any(OrchestrationResultDTO.class)); + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + result.setProvider(new SystemResponseDTO(1, "system", "localhost", 1234, null, null, null)); + result.setService(new ServiceDefinitionResponseDTO(1, "service", null, null)); + final List reserved = qosManager.reserveProvidersTemporarily(List.of(result), requester); + Assert.assertEquals(0, reserved.size()); + verify(qosReservationDBService, times(1)).applyTemporaryLock(anyString(), anyString(), anyInt(), any(OrchestrationResultDTO.class)); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testReserveProvidersTemporarilyLockSuccess() { + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + requester.setAddress("localhost"); + requester.setPort(1234); + doNothing().when(qosReservationDBService).applyTemporaryLock(anyString(), anyString(), anyInt(), any(OrchestrationResultDTO.class)); + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + result.setProvider(new SystemResponseDTO(1, "system", "localhost", 1234, null, null, null)); + result.setService(new ServiceDefinitionResponseDTO(1, "service", null, null)); + final List reserved = qosManager.reserveProvidersTemporarily(List.of(result), requester); + Assert.assertEquals(1, reserved.size()); + verify(qosReservationDBService, times(1)).applyTemporaryLock(anyString(), anyString(), anyInt(), any(OrchestrationResultDTO.class)); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testConfirmReservationSelectedNull() { + qosManager.confirmReservation(null, null, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testConfirmReservationResultListNull() { + qosManager.confirmReservation(new OrchestrationResultDTO(), null, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testConfirmReservationResultListEmpty() { + qosManager.confirmReservation(new OrchestrationResultDTO(), List.of(), null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testConfirmReservationRequesterNull() { + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + qosManager.confirmReservation(result, List.of(result), null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testConfirmReservationRequesterSystemNameNull() { + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + final SystemRequestDTO requester = new SystemRequestDTO(); + qosManager.confirmReservation(result, List.of(result), requester); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testConfirmReservationRequesterSystemNameEmpty() { + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName(" "); + qosManager.confirmReservation(result, List.of(result), requester); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testConfirmReservationRequesterAddressNull() { + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + qosManager.confirmReservation(result, List.of(result), requester); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testConfirmReservationRequesterAddressEmpty() { + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + requester.setAddress(" "); + qosManager.confirmReservation(result, List.of(result), requester); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testConfirmReservationRequesterPortNull() { + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + requester.setAddress("localhost"); + qosManager.confirmReservation(result, List.of(result), requester); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testConfirmReservationOk() { + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setSystemName("system"); + requester.setAddress("localhost"); + requester.setPort(1234); + final List orList = getOrList(3); + doNothing().when(qosReservationDBService).extendReservation(any(OrchestrationResultDTO.class), any(SystemRequestDTO.class)); + doNothing().when(qosReservationDBService).removeTemporaryLock(any(OrchestrationResultDTO.class)); + + qosManager.confirmReservation(orList.get(1), orList, requester); + + verify(qosReservationDBService, times(1)).extendReservation(any(OrchestrationResultDTO.class), any(SystemRequestDTO.class)); + verify(qosReservationDBService, times(2)).removeTemporaryLock(any(OrchestrationResultDTO.class)); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testVerifyServicesResultListNull() { + qosManager.verifyServices(null, null); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testVerifyServicesRequestNull() { + qosManager.verifyServices(List.of(), null); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyServicesTrue() { + when(verifier.verify(any(OrchestrationResultDTO.class), anyMap(), anyMap())).thenReturn(true); + + final OrchestrationFormRequestDTO request = new OrchestrationFormRequestDTO(); + request.setCommands(Map.of()); + final List verifiedList = qosManager.verifyServices(getOrList(1), request); + verify(verifier, times(1)).verify(any(OrchestrationResultDTO.class), anyMap(), anyMap()); + Assert.assertEquals(1, verifiedList.size()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyServicesFalseNoExclusivity() { + when(verifier.verify(any(OrchestrationResultDTO.class), anyMap(), anyMap())).thenReturn(false); + + final OrchestrationFormRequestDTO request = new OrchestrationFormRequestDTO(); + request.setCommands(Map.of()); + final List verifiedList = qosManager.verifyServices(getOrList(1), request); + verify(verifier, times(1)).verify(any(OrchestrationResultDTO.class), anyMap(), anyMap()); + Assert.assertEquals(0, verifiedList.size()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyServicesFalseWithExclusivity() { + when(verifier.verify(any(OrchestrationResultDTO.class), anyMap(), anyMap())).thenReturn(false); + doNothing().when(qosReservationDBService).removeTemporaryLock(any(OrchestrationResultDTO.class)); + + final OrchestrationFormRequestDTO request = new OrchestrationFormRequestDTO(); + request.setCommands(Map.of(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY, "100")); + final List verifiedList = qosManager.verifyServices(getOrList(1), request); + verify(verifier, times(1)).verify(any(OrchestrationResultDTO.class), anyMap(), anyMap()); + verify(qosReservationDBService).removeTemporaryLock(any(OrchestrationResultDTO.class)); + Assert.assertEquals(0, verifiedList.size()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyServicesNoVerifiers() { + @SuppressWarnings({ "unchecked", "rawtypes" }) + final List verifiers = (List) ReflectionTestUtils.getField(qosManager, "verifiers"); + verifiers.clear(); + when(verifier.verify(any(OrchestrationResultDTO.class), anyMap(), anyMap())).thenReturn(false); + + final OrchestrationFormRequestDTO request = new OrchestrationFormRequestDTO(); + request.setCommands(Map.of()); + final List verifiedList = qosManager.verifyServices(getOrList(1), request); + verify(verifier, never()).verify(any(OrchestrationResultDTO.class), anyMap(), anyMap()); + Assert.assertEquals(1, verifiedList.size()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testVerifyServicesFirstVerifierFalse() { + @SuppressWarnings({ "unchecked", "rawtypes" }) + final List verifiers = (List) ReflectionTestUtils.getField(qosManager, "verifiers"); + verifiers.clear(); + verifiers.add(verifier); + verifiers.add(verifier2); + when(verifier.verify(any(OrchestrationResultDTO.class), anyMap(), anyMap())).thenReturn(false); + when(verifier2.verify(any(OrchestrationResultDTO.class), anyMap(), anyMap())).thenReturn(true); + + final OrchestrationFormRequestDTO request = new OrchestrationFormRequestDTO(); + request.setCommands(Map.of()); + final List verifiedList = qosManager.verifyServices(getOrList(1), request); + verify(verifier, times(1)).verify(any(OrchestrationResultDTO.class), anyMap(), anyMap()); + verify(verifier2, never()).verify(any(OrchestrationResultDTO.class), anyMap(), anyMap()); + Assert.assertEquals(0, verifiedList.size()); + } + + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private List getOrList(final int num) { + final List orList = new ArrayList<>(num); + for (int i = 0; i < num; ++i) { + final SystemResponseDTO provider = new SystemResponseDTO(); + provider.setId(i); + final ServiceDefinitionResponseDTO service = new ServiceDefinitionResponseDTO(); + service.setId(1); + final OrchestrationResultDTO result = new OrchestrationResultDTO(); + result.setProvider(provider); + result.setService(service); + orList.add(result); + } + + return orList; + } +} \ No newline at end of file From a6f48d60a06ecafd17873dbd0c0513a91ddb78a0 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 7 Feb 2020 16:04:16 +0100 Subject: [PATCH 155/301] additional exception handling modifactions --- .../eu/arrowhead/core/qos/quartz/task/PingTask.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 49ab2c9fa..584481641 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -264,6 +264,10 @@ private ServiceRegistryListResponseDTO queryServiceRegistryAll() { return response.getBody(); + } catch (final ArrowheadException ex) { + + throw ex; + } catch (final Throwable ex) { logger.debug("Exception:", ex.getMessage()); @@ -280,11 +284,11 @@ private UriComponents getQueryAllUri() { try { return (UriComponents) arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL); } catch (final ClassCastException ex) { - throw new ArrowheadException("QoS Mointor can't find Service Registry Query All URI."); + throw new ArrowheadException("QoS Mointor can't find Service Registry Query All URI."); } + }else { + throw new ArrowheadException("QoS Mointor can't find Service Registry Query All URI."); } - - throw new ArrowheadException("QoS Mointor can't find Service Registry Query All URI."); } } \ No newline at end of file From 038668743754fa874615cd33d05957fb35c5f094 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 7 Feb 2020 16:05:12 +0100 Subject: [PATCH 156/301] implemented additional execute tests --- .../core/qos/quartz/task/PingTaskTest.java | 842 +++++++++++++++++- 1 file changed, 816 insertions(+), 26 deletions(-) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index 3a41d18f9..25b7fe5d6 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -2,6 +2,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.atLeastOnce; @@ -48,6 +49,8 @@ import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; import eu.arrowhead.common.dto.shared.ServiceSecurityType; import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.common.exception.InvalidParameterException; import eu.arrowhead.common.http.HttpService; import eu.arrowhead.core.qos.database.service.QoSDBService; import eu.arrowhead.core.qos.measurement.properties.PingMeasurementProperties; @@ -83,31 +86,561 @@ public class PingTaskTest { final static int TIME_TO_REPEAT_PING = 3; + private static final String NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE = " is null or blank."; + //================================================================================================= // methods //------------------------------------------------------------------------------------------------- - @Before - public void setUp() throws Exception { - logger = mock(Logger.class); - ReflectionTestUtils.setField(pingTask, "logger", logger); + @Before + public void setUp() throws Exception { + logger = mock(Logger.class); + ReflectionTestUtils.setField(pingTask, "logger", logger); + } + + //================================================================================================= + // Tests of execute + + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteMeasurementIsInDB() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.of(pingMeasurement)); + //when(qoSDBService.createPingMeasurement(any(), any(), any())).thenReturn(pingMeasurement); + doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(1)).getTimeout(); + verify(pingService, atLeastOnce()).getPingResponseList(anyString()); + verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + + verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, atLeastOnce()).updatePingMeasurement(any(), any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteMeasurementIsNotInDB() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), any(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(1)).getTimeout(); + verify(pingService, atLeastOnce()).getPingResponseList(anyString()); + verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + + verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteServerIsInStandalonMode() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(true); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), any(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(0)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(0)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(0)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(0)).getTimeout(); + verify(pingService, times(0)).getPingResponseList(anyString()); + verify(qoSDBService,times(0)).getMeasurement(any()); + + verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementDetailsToDB(any(), any(), any()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteNoSystemsToMeasure() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = new ServiceRegistryListResponseDTO(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), any(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(0)).getTimeout(); + verify(pingService, times(0)).getPingResponseList(anyString()); + verify(qoSDBService,times(0)).getMeasurement(any()); + + verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementDetailsToDB(any(), any(), any()); + } + + + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteHttpServiceThrowsException() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + //final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + //final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenThrow(NullPointerException.class); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), any(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + + fail(); + } + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(0)).getTimeout(); + verify(pingService, times(0)).getPingResponseList(anyString()); + verify(qoSDBService,times(0)).getMeasurement(any()); + + verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementDetailsToDB(any(), any(), any()); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testExecuteServiceRegistryUriNotInContext() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(false); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), any(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } catch (final ArrowheadException ex) { + + assertTrue(ex.getMessage().contains("QoS Mointor can't find Service Registry Query All URI.")); + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(0)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(0)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(0)).getTimeout(); + verify(pingService, times(0)).getPingResponseList(anyString()); + verify(qoSDBService,times(0)).getMeasurement(any()); + + verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementDetailsToDB(any(), any(), any()); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testExecuteServiceRegistryUriContextValueNotUriType() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenThrow(ClassCastException.class); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), any(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } catch (final ArrowheadException ex) { + + assertTrue(ex.getMessage().contains("QoS Mointor can't find Service Registry Query All URI.")); + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(0)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(0)).getTimeout(); + verify(pingService, times(0)).getPingResponseList(anyString()); + verify(qoSDBService,times(0)).getMeasurement(any()); + + verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementDetailsToDB(any(), any(), any()); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testExecuteSystemToMeasureHasNullAddressParameter() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOWithNullSystemAddressForTest(); + + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), any(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } catch (final InvalidParameterException ex) { + + assertTrue(ex.getMessage().contains("System.address" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE)); + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(0)).getTimeout(); + verify(pingService, times(0)).getPingResponseList(anyString()); + verify(qoSDBService,times(0)).getMeasurement(any()); + + verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementDetailsToDB(any(), any(), any()); + + throw ex; + } + } - //================================================================================================= - // Tests of execute - @Test - public void testExecuteMeasurementIsInDB() { + //------------------------------------------------------------------------------------------------- + @Test(expected = InvalidParameterException.class) + public void testExecuteSystemToMeasureHasEmptyAddressParameter() { final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); - final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOWithEmptySystemAddressForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); final List responseList = getResponseListForTest(); final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); @@ -126,9 +659,9 @@ public void testExecuteMeasurementIsInDB() { when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement - when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.of(pingMeasurement)); - //when(qoSDBService.createPingMeasurement(any(), any(), any())).thenReturn(pingMeasurement); - doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), any(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); @@ -137,25 +670,168 @@ public void testExecuteMeasurementIsInDB() { pingTask.execute(jobExecutionContext); } catch (final JobExecutionException ex) { - assertTrue(false); + fail(); + } catch (final InvalidParameterException ex) { + + assertTrue(ex.getMessage().contains("System.address" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE)); + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(0)).getTimeout(); + verify(pingService, times(0)).getPingResponseList(anyString()); + verify(qoSDBService,times(0)).getMeasurement(any()); + + verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementDetailsToDB(any(), any(), any()); + + throw ex; } - verify(logger, atLeastOnce()).debug(any(String.class)); - final List debugMessages = debugValueCapture.getAllValues(); - assertNotNull(debugMessages); + } - verify(arrowheadContext, times(2)).containsKey(anyString()); - verify(arrowheadContext, times(1)).get(anyString()); - verify(httpService, times(1)).sendRequest(any(), any(), any()); - verify(pingMeasurementProperties, times(1)).getTimeout(); - verify(pingService, atLeastOnce()).getPingResponseList(anyString()); - verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testExecuteGetPingResponseListThrowsException() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenThrow(ArrowheadException.class); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), any(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } catch (final ArrowheadException ex) { + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingService, times(1)).getPingResponseList(anyString()); + verify(pingMeasurementProperties, times(0)).getTimeout(); + verify(qoSDBService,times(0)).getMeasurement(any()); + + verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementDetailsToDB(any(), any(), any()); + + throw ex; + } - verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); - verify(qoSDBService, atLeastOnce()).logMeasurementToDB(any(), any(), any()); - verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); } + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testExecuteGetMeasurementThrowsException() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenThrow(ArrowheadException.class);//thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), any(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } catch (final ArrowheadException ex) { + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingService, times(1)).getPingResponseList(anyString()); + verify(qoSDBService,times(1)).getMeasurement(any()); + verify(pingMeasurementProperties, times(0)).getTimeout(); + + verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementDetailsToDB(any(), any(), any()); + + throw ex; + } + + } //================================================================================================= // assistant methods @@ -176,6 +852,40 @@ public ServiceRegistryListResponseDTO getServiceRegistryListResponseDTOForTest() return serviceRegistryListResponseDTO; } + //------------------------------------------------------------------------------------------------- + public ServiceRegistryListResponseDTO getServiceRegistryListResponseDTOWithNullSystemAddressForTest() { + + final int sizeOfResponse = 3; + final ServiceRegistryListResponseDTO serviceRegistryListResponseDTO = new ServiceRegistryListResponseDTO(); + final List responseList = new ArrayList<>(sizeOfResponse); + + for (int i = 0; i < sizeOfResponse; i++) { + responseList.add(getServiceRegistryResponseDTOWithNullSystemAddressForTest()); + } + + serviceRegistryListResponseDTO.setCount(sizeOfResponse); + serviceRegistryListResponseDTO.setData(responseList); + + return serviceRegistryListResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + public ServiceRegistryListResponseDTO getServiceRegistryListResponseDTOWithEmptySystemAddressForTest() { + + final int sizeOfResponse = 3; + final ServiceRegistryListResponseDTO serviceRegistryListResponseDTO = new ServiceRegistryListResponseDTO(); + final List responseList = new ArrayList<>(sizeOfResponse); + + for (int i = 0; i < sizeOfResponse; i++) { + responseList.add(getServiceRegistryResponseDTOWithEmptySystemAddressForTest()); + } + + serviceRegistryListResponseDTO.setCount(sizeOfResponse); + serviceRegistryListResponseDTO.setData(responseList); + + return serviceRegistryListResponseDTO; + } + //------------------------------------------------------------------------------------------------- public ServiceRegistryResponseDTO getServiceRegistryResponseDTOForTest() { @@ -196,6 +906,46 @@ public ServiceRegistryResponseDTO getServiceRegistryResponseDTOForTest() { return serviceRegistryResponseDTO; } + //------------------------------------------------------------------------------------------------- + public ServiceRegistryResponseDTO getServiceRegistryResponseDTOWithNullSystemAddressForTest() { + + final ServiceRegistryResponseDTO serviceRegistryResponseDTO = new ServiceRegistryResponseDTO(); + + serviceRegistryResponseDTO.setId(1L); + serviceRegistryResponseDTO.setServiceDefinition(getServiceDefinitionResponseDTOForTest()); + serviceRegistryResponseDTO.setProvider(getSystemResponseDTOWithNullAddressForTest()); + serviceRegistryResponseDTO.setServiceUri("serviceUri"); + serviceRegistryResponseDTO.setEndOfValidity(null); + serviceRegistryResponseDTO.setSecure(ServiceSecurityType.CERTIFICATE); + serviceRegistryResponseDTO.setMetadata(null); + serviceRegistryResponseDTO.setVersion(1); + serviceRegistryResponseDTO.setInterfaces(List.of(getServiceInterfaceResponseDTOForTest())); + serviceRegistryResponseDTO.setCreatedAt(Utilities.convertZonedDateTimeToUTCString(ZonedDateTime.now())); + serviceRegistryResponseDTO.setUpdatedAt(Utilities.convertZonedDateTimeToUTCString(ZonedDateTime.now())); + + return serviceRegistryResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + public ServiceRegistryResponseDTO getServiceRegistryResponseDTOWithEmptySystemAddressForTest() { + + final ServiceRegistryResponseDTO serviceRegistryResponseDTO = new ServiceRegistryResponseDTO(); + + serviceRegistryResponseDTO.setId(1L); + serviceRegistryResponseDTO.setServiceDefinition(getServiceDefinitionResponseDTOForTest()); + serviceRegistryResponseDTO.setProvider(getSystemResponseDTOWithEmptyAddressForTest()); + serviceRegistryResponseDTO.setServiceUri("serviceUri"); + serviceRegistryResponseDTO.setEndOfValidity(null); + serviceRegistryResponseDTO.setSecure(ServiceSecurityType.CERTIFICATE); + serviceRegistryResponseDTO.setMetadata(null); + serviceRegistryResponseDTO.setVersion(1); + serviceRegistryResponseDTO.setInterfaces(List.of(getServiceInterfaceResponseDTOForTest())); + serviceRegistryResponseDTO.setCreatedAt(Utilities.convertZonedDateTimeToUTCString(ZonedDateTime.now())); + serviceRegistryResponseDTO.setUpdatedAt(Utilities.convertZonedDateTimeToUTCString(ZonedDateTime.now())); + + return serviceRegistryResponseDTO; + } + //------------------------------------------------------------------------------------------------- public ServiceDefinitionResponseDTO getServiceDefinitionResponseDTOForTest() { @@ -221,6 +971,46 @@ private System getSystemForTest() { return system; } + //------------------------------------------------------------------------------------------------- + private System getSystemWithNullAddressForTest() { + + final System system = new System( + "testSystem", + null, + 12345, + "authenticationInfo"); + + return system; + } + + //------------------------------------------------------------------------------------------------- + private SystemResponseDTO getSystemResponseDTOWithNullAddressForTest() { + + final SystemResponseDTO systemResponseDTO = DTOConverter.convertSystemToSystemResponseDTO(getSystemWithNullAddressForTest()); + + return systemResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + private System getSystemWithEmptyAddressForTest() { + + final System system = new System( + "testSystem", + " ", + 12345, + "authenticationInfo"); + + return system; + } + + //------------------------------------------------------------------------------------------------- + private SystemResponseDTO getSystemResponseDTOWithEmptyAddressForTest() { + + final SystemResponseDTO systemResponseDTO = DTOConverter.convertSystemToSystemResponseDTO(getSystemWithEmptyAddressForTest()); + + return systemResponseDTO; + } + //------------------------------------------------------------------------------------------------- private SystemResponseDTO getSystemResponseDTOForTest() { From 1be022e3c79dddd2abf8cbc97c61fb5ecf1156c7 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 7 Feb 2020 16:11:58 +0100 Subject: [PATCH 157/301] temoral commit : comented out unused methods --- .../java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index 25b7fe5d6..e3f9bd63e 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -707,8 +707,6 @@ public void testExecuteGetPingResponseListThrowsException() { final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); - final List responseList = getResponseListForTest(); - final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); @@ -777,7 +775,7 @@ public void testExecuteGetMeasurementThrowsException() { final List responseList = getResponseListForTest(); - final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + //final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); From 630262779310809bb9a5197aee9a0a5463044484 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 10 Feb 2020 10:01:50 +0100 Subject: [PATCH 158/301] implemented testExecuteWithEmptyResponseList test --- .../core/qos/quartz/task/PingTaskTest.java | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index e3f9bd63e..1c34b6857 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -830,6 +830,77 @@ public void testExecuteGetMeasurementThrowsException() { } } + + //------------------------------------------------------------------------------------------------- + @Test(expected = IllegalArgumentException.class) + public void testExecuteWithEmptyResponseList() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getEmptyResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), any(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } catch (final IllegalArgumentException ex) { + + assertTrue(ex.getMessage().contains("Sent in this Ping value must be greater than zero")); + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingService, times(1)).getPingResponseList(anyString()); + verify(qoSDBService,times(1)).getMeasurement(any()); + verify(pingMeasurementProperties, times(0)).getTimeout(); + + verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementDetailsToDB(any(), any(), any()); + + throw ex; + } + + } + //================================================================================================= // assistant methods @@ -1051,6 +1122,14 @@ private List getResponseListForTest() { return responseList; } + //------------------------------------------------------------------------------------------------- + private List getEmptyResponseListForTest() { + + final List responseList = List.of(); + + return responseList; + } + //------------------------------------------------------------------------------------------------- private IcmpPingResponse getIcmpPingResponse() { From 633d4f0905435cfe673f11a09b64104c97519ebf Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 10 Feb 2020 10:15:45 +0100 Subject: [PATCH 159/301] implemented testExecuteCalculationsDTOIsPresent test --- .../core/qos/quartz/task/PingTaskTest.java | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index 1c34b6857..a06091d58 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -53,6 +53,7 @@ import eu.arrowhead.common.exception.InvalidParameterException; import eu.arrowhead.common.http.HttpService; import eu.arrowhead.core.qos.database.service.QoSDBService; +import eu.arrowhead.core.qos.dto.PingMeasurementCalculationsDTO; import eu.arrowhead.core.qos.measurement.properties.PingMeasurementProperties; import eu.arrowhead.core.qos.service.PingService; @@ -901,6 +902,75 @@ public void testExecuteWithEmptyResponseList() { } + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteCalculationsDTOIsPresent() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), calculationsValueCapture.capture(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + final PingMeasurementCalculationsDTO calculations = calculationsValueCapture.getValue(); + assertNotNull(calculations); + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(1)).getTimeout(); + verify(pingService, atLeastOnce()).getPingResponseList(anyString()); + verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + + verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); + } + + //================================================================================================= // assistant methods From 57fb781576c9697ab9a6e5d23b4dea8b234bd454 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 10 Feb 2020 11:08:25 +0100 Subject: [PATCH 160/301] implemented calculateAvailable and testExecuteAvailableCalculation --- .../properties/PingMeasurementProperties.java | 7 +- .../core/qos/quartz/task/PingTask.java | 24 ++++++- ...itional-spring-configuration-metadata.json | 5 ++ .../src/main/resources/application.properties | 3 + .../core/qos/quartz/task/PingTaskTest.java | 70 +++++++++++++++++++ 5 files changed, 105 insertions(+), 4 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java index 321613c01..2547901c5 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java @@ -14,7 +14,7 @@ public class PingMeasurementProperties { private int timeout; private int packetSize; private int rest; - + private int availableFromSuccessPercet; //================================================================================================= // methods @@ -22,12 +22,13 @@ public class PingMeasurementProperties { public PingMeasurementProperties() {} //------------------------------------------------------------------------------------------------- - public PingMeasurementProperties(final int timeToRepeat, final int timeout, final int pocketSize, final int rest) { + public PingMeasurementProperties(final int timeToRepeat, final int timeout, final int pocketSize, final int rest, final int availableFromSuccessPercet) { this.timeToRepeat = timeToRepeat; this.timeout = timeout; this.packetSize = pocketSize; this.rest = rest; + this.availableFromSuccessPercet = availableFromSuccessPercet; } //------------------------------------------------------------------------------------------------- @@ -35,11 +36,13 @@ public PingMeasurementProperties(final int timeToRepeat, final int timeout, fina public int getTimeout() { return timeout; } public int getPacketSize() { return packetSize; } public int getRest() { return rest; } + public int getAvailableFromSuccessPercet() { return availableFromSuccessPercet; } //------------------------------------------------------------------------------------------------- public void setTimeToRepeat(final int timeToRepeat) { this.timeToRepeat = timeToRepeat; } public void setTimeout(final int timeout) { this.timeout = timeout; } public void setPacketSize(final int packetSize) { this.packetSize = packetSize; } public void setRest(final int rest) { this.rest = rest; } + public void setAvailableFromSuccessPercet(final int availableFromSuccessPercet) { this.availableFromSuccessPercet = availableFromSuccessPercet; } } diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 584481641..07e98d748 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -123,20 +123,21 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(final List final int timeout = pingMeasurementProperties.getTimeout() + 1; - boolean available = false; + int receivedInThisPing = 0; long maxResponseTime = 0; long minResponseTime = Integer.MAX_VALUE; double sumOfDurationForMeanResponseTimeWithTimeout = 0; double sumOfDurationForMeanResponseTimeWithoutTimeout = 0; int meanResponseTimeWithoutTimeoutMembersCount = 0; + int availableCount = 0; for (final IcmpPingResponse icmpPingResponse : responseList) { final boolean successFlag = icmpPingResponse.getSuccessFlag(); if (successFlag) { - available = true; + ++availableCount; ++receivedInThisPing; final long duration = icmpPingResponse.getDuration(); @@ -157,6 +158,7 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(final List } } + final boolean available = calculateAvailable(sentInThisPing, availableCount); final int lostPerMeasurementPercent = (int) (receivedInThisPing == 0 ? 100 : 100 - ((double)receivedInThisPing / sentInThisPing) * 100); final double meanResponseTimeWithTimeout = sumOfDurationForMeanResponseTimeWithTimeout / responseList.size(); @@ -291,4 +293,22 @@ private UriComponents getQueryAllUri() { } } + //------------------------------------------------------------------------------------------------- + private boolean calculateAvailable(final int sentInThisPing, final int availableCount) { + logger.debug("calculateAvailable started..."); + + final boolean available; + final int availableFromSuccessPercent = pingMeasurementProperties.getAvailableFromSuccessPercet(); + final double availablePercent = 100 - ((sentInThisPing - availableCount) / (double)sentInThisPing) * 100 ; + + if (availableFromSuccessPercent < Math.round(availablePercent)) { + + available = true; + }else { + available = false; + } + + return available; + } + } \ No newline at end of file diff --git a/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 7b5e95ab5..6182faeef 100644 --- a/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -58,5 +58,10 @@ "name": "ping_ttl_interval_minutes", "type": "java.lang.String", "description": "A description for 'ping_ttl_interval_minutes'" + }, + { + "name": "ping.available_from_success_percet", + "type": "java.lang.Integer", + "description": "A description for 'ping.available_from_success_percet'" } ]} \ No newline at end of file diff --git a/qos-monitor/src/main/resources/application.properties b/qos-monitor/src/main/resources/application.properties index 275df216b..48d61170d 100644 --- a/qos-monitor/src/main/resources/application.properties +++ b/qos-monitor/src/main/resources/application.properties @@ -59,6 +59,9 @@ ping.packet_size=32 # Set millsec to sleep between single pings in a measurement ping.rest=1000 +# Set succes percentage of individual pings to accept measurement as available +ping.available_from_success_percet=100 + ############################################ ### SECURE MODE ### ############################################ diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index a06091d58..fa64a25c8 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -929,6 +929,7 @@ public void testExecuteCalculationsDTOIsPresent() { when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + when(pingMeasurementProperties.getAvailableFromSuccessPercet()).thenReturn(1); when(pingService.getPingResponseList(anyString())).thenReturn(responseList); @@ -970,6 +971,75 @@ public void testExecuteCalculationsDTOIsPresent() { verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); } + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteAvailableCalculation() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + when(pingMeasurementProperties.getAvailableFromSuccessPercet()).thenReturn(32); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), calculationsValueCapture.capture(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + final PingMeasurementCalculationsDTO calculations = calculationsValueCapture.getValue(); + assertNotNull(calculations); + assertTrue(calculations.isAvailable()); + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(1)).getTimeout(); + verify(pingService, atLeastOnce()).getPingResponseList(anyString()); + verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + + verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); + } //================================================================================================= // assistant methods From 39cf670e10fdedaccac80287999116e86427f324 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 10 Feb 2020 11:41:36 +0100 Subject: [PATCH 161/301] removed empty line --- .../main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java | 1 - 1 file changed, 1 deletion(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 07e98d748..e27d0cdf2 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -123,7 +123,6 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(final List final int timeout = pingMeasurementProperties.getTimeout() + 1; - int receivedInThisPing = 0; long maxResponseTime = 0; long minResponseTime = Integer.MAX_VALUE; From 256fa6aadcf82760506a3d2243d208d42a58c7bf Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 10 Feb 2020 11:43:34 +0100 Subject: [PATCH 162/301] implemented testExecuteAvailableCalculationWithNotAvailable --- .../core/qos/quartz/task/PingTaskTest.java | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index fa64a25c8..998cd3a12 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -1041,6 +1041,76 @@ public void testExecuteAvailableCalculation() { verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); } + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteAvailableCalculationWithNotAvailable() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + when(pingMeasurementProperties.getAvailableFromSuccessPercet()).thenReturn(34); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), calculationsValueCapture.capture(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + final PingMeasurementCalculationsDTO calculations = calculationsValueCapture.getValue(); + assertNotNull(calculations); + assertTrue(!calculations.isAvailable()); + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(1)).getTimeout(); + verify(pingService, atLeastOnce()).getPingResponseList(anyString()); + verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + + verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); + } + //================================================================================================= // assistant methods From 097cf2bd21ca25fe51554c8e261b6db9be835832 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 10 Feb 2020 12:17:05 +0100 Subject: [PATCH 163/301] implemented calculate responseTime tests --- .../core/qos/quartz/task/PingTaskTest.java | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index 998cd3a12..3ca8e5145 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -1111,6 +1111,144 @@ public void testExecuteAvailableCalculationWithNotAvailable() { verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); } + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteMinResponseTime() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = get100LongResponseListWithIncementingResponseTimeForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), calculationsValueCapture.capture(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + final PingMeasurementCalculationsDTO calculations = calculationsValueCapture.getValue(); + assertNotNull(calculations); + assertTrue(1 == calculations.getMinResponseTime()); + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(1)).getTimeout(); + verify(pingService, atLeastOnce()).getPingResponseList(anyString()); + verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + + verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteMaxResponseTime() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = get100LongResponseListWithIncementingResponseTimeForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), calculationsValueCapture.capture(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + final PingMeasurementCalculationsDTO calculations = calculationsValueCapture.getValue(); + assertNotNull(calculations); + assertTrue(100 == calculations.getMaxResponseTime()); + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(1)).getTimeout(); + verify(pingService, atLeastOnce()).getPingResponseList(anyString()); + verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + + verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); + } + //================================================================================================= // assistant methods @@ -1332,6 +1470,24 @@ private List getResponseListForTest() { return responseList; } + //------------------------------------------------------------------------------------------------- + private List get100LongResponseListWithIncementingResponseTimeForTest() { + + final List responseList = new ArrayList<>(); + for (int i = 1; i < 101; i++) { + + final IcmpPingResponse pingResponse = getIcmpPingResponse(); + pingResponse.setSuccessFlag(true); + pingResponse.setTimeoutFlag(false); + pingResponse.setRtt(i); + pingResponse.setDuration(i); + + responseList.add(pingResponse); + } + + return responseList; + } + //------------------------------------------------------------------------------------------------- private List getEmptyResponseListForTest() { From d0ce514e420147e26a6031f8a08ad8683c8576ca Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 10 Feb 2020 12:25:25 +0100 Subject: [PATCH 164/301] refactored calculate responseTime tests --- .../core/qos/quartz/task/PingTaskTest.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index 3ca8e5145..b43ac3970 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -1120,7 +1120,7 @@ public void testExecuteMinResponseTime() { final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); - final List responseList = get100LongResponseListWithIncementingResponseTimeForTest(); + final List responseList = get100LongResponseListWithIncementingResponseTimeAnd10PercentLossForTest(); final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); @@ -1189,7 +1189,7 @@ public void testExecuteMaxResponseTime() { final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); - final List responseList = get100LongResponseListWithIncementingResponseTimeForTest(); + final List responseList = get100LongResponseListWithIncementingResponseTimeAnd10PercentLossForTest(); final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); @@ -1229,7 +1229,7 @@ public void testExecuteMaxResponseTime() { final PingMeasurementCalculationsDTO calculations = calculationsValueCapture.getValue(); assertNotNull(calculations); - assertTrue(100 == calculations.getMaxResponseTime()); + assertTrue(90 == calculations.getMaxResponseTime()); verify(logger, atLeastOnce()).debug(any(String.class)); final List debugMessages = debugValueCapture.getAllValues(); @@ -1471,10 +1471,10 @@ private List getResponseListForTest() { } //------------------------------------------------------------------------------------------------- - private List get100LongResponseListWithIncementingResponseTimeForTest() { + private List get100LongResponseListWithIncementingResponseTimeAnd10PercentLossForTest() { final List responseList = new ArrayList<>(); - for (int i = 1; i < 101; i++) { + for (int i = 1; i < 91; i++) { final IcmpPingResponse pingResponse = getIcmpPingResponse(); pingResponse.setSuccessFlag(true); @@ -1485,6 +1485,15 @@ private List get100LongResponseListWithIncementingResponseTime responseList.add(pingResponse); } + for (int i = 0; i < 10; i++) { + + final IcmpPingResponse pingResponse = getIcmpPingResponse(); + pingResponse.setSuccessFlag(false); + pingResponse.setTimeoutFlag(true); + + responseList.add(pingResponse); + } + return responseList; } From a7572bbd0e71b778bc58fd5e8da2d79514a6f0e5 Mon Sep 17 00:00:00 2001 From: Emanuel Palm Date: Mon, 10 Feb 2020 12:52:16 +0100 Subject: [PATCH 165/301] Add Docker image containing all Core system --- docker-all/.gitignore | 1 + docker-all/Dockerfile | 8 + docker-all/README.md | 36 ++ docker-all/example/docker-compose.yml | 40 ++ .../properties/authorization.properties | 61 ++ .../properties/eventhandler.properties | 61 ++ .../example/properties/gatekeeper.properties | 60 ++ .../example/properties/gateway.properties | 55 ++ .../properties/orchestrator.properties | 54 ++ .../properties/serviceregistry.properties | 67 +++ docker-all/example/sql/setup.sql | 540 ++++++++++++++++++ docker-all/pom.xml | 110 ++++ docker-all/run.sh | 27 + pom.xml | 1 + 14 files changed, 1121 insertions(+) create mode 100644 docker-all/.gitignore create mode 100644 docker-all/Dockerfile create mode 100644 docker-all/README.md create mode 100644 docker-all/example/docker-compose.yml create mode 100644 docker-all/example/properties/authorization.properties create mode 100644 docker-all/example/properties/eventhandler.properties create mode 100644 docker-all/example/properties/gatekeeper.properties create mode 100644 docker-all/example/properties/gateway.properties create mode 100644 docker-all/example/properties/orchestrator.properties create mode 100644 docker-all/example/properties/serviceregistry.properties create mode 100644 docker-all/example/sql/setup.sql create mode 100644 docker-all/pom.xml create mode 100755 docker-all/run.sh diff --git a/docker-all/.gitignore b/docker-all/.gitignore new file mode 100644 index 000000000..b83d22266 --- /dev/null +++ b/docker-all/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/docker-all/Dockerfile b/docker-all/Dockerfile new file mode 100644 index 000000000..c363ff1d5 --- /dev/null +++ b/docker-all/Dockerfile @@ -0,0 +1,8 @@ +FROM openjdk:11-jre-slim + +WORKDIR /opt/arrowhead-core + +COPY target/*.jar ./ +COPY run.sh run.sh + +CMD ["./run.sh"] \ No newline at end of file diff --git a/docker-all/README.md b/docker-all/README.md new file mode 100644 index 000000000..e960e37d5 --- /dev/null +++ b/docker-all/README.md @@ -0,0 +1,36 @@ +# Docker Image of All Core Systems + +In certain scenarios, such as for development, demonstration or testing, it might be preferred to have one Docker image containing all Arrowhead Core systems instead of having one image for each system. +Most significantly, having a single container reduces memory overhead, both in terms of RAM and disk usage. +Note, however, that using this image is _NOT_ recommended for most kinds of production scenarios. + +## Evaluating Image + +To try this image, first make sure that the [`target`](target) folder, located in this directory, contains the `.jar` files of all core systems. +If not, they can be assembled and collected via the following Maven command: + +```sh +$ mvn -DskipTests=true package -pl docker-all -am +``` + +If you are using an IDE, running the maven `package` goal should also cause the [`target`](target) folder to be populated. + +Secondly, change the current directory to the [`example`](example) folder located in this directory, and then execute the following terminal commands: + +```sh +$ docker volume create arrowhead_core_mysql +$ docker-compose up --build +``` + +This should start up a Docker network called `example_default` with both a MySQL database and the image containing the Arrowhead Core systems. +Please refer to the [`example/docker-compose.yml`](example/docker-compose.yml) file for more details about how the latter image can be configured. + +## Building Image + +To build the image for use in other projects, the following command could be used: + +```sh +$ docker build . -t arrowhead-core-all +``` + +Please make sure the folder in which this file is located is the current working directory before executing the above command. diff --git a/docker-all/example/docker-compose.yml b/docker-all/example/docker-compose.yml new file mode 100644 index 000000000..ab10fdf71 --- /dev/null +++ b/docker-all/example/docker-compose.yml @@ -0,0 +1,40 @@ +version: "3" + +services: + arrowhead_core_mysql: + container_name: arrowhead_core_mysql + image: mysql:5.7 + environment: + - MYSQL_ROOT_PASSWORD=THIS_WILL_BE_YOUR_CONTAINERS_ROOT_PW + volumes: + - arrowhead_core_mysql:/var/lib/mysql + - ./sql:/docker-entrypoint-initdb.d/ + ports: + - 3306:3306 + + arrowhead_core: + container_name: arrowhead_core + build: ../ + depends_on: + - arrowhead_core_mysql + environment: + - JVM_FLAGS=-XX:+UseSerialGC -Xmx1G -Xms32m # Lowers memory usage of the services, but also lowers performance. + volumes: + # Only systems with provided .properties files will be started when the container stars. + - ./properties/serviceregistry.properties:/opt/arrowhead-core/serviceregistry/application.properties + - ./properties/authorization.properties:/opt/arrowhead-core/authorization/application.properties + - ./properties/orchestrator.properties:/opt/arrowhead-core/orchestrator/application.properties + #- ./properties/eventhandler.properties:/opt/arrowhead-core/eventhandler/application.properties + - ./properties/gatekeeper.properties:/opt/arrowhead-core/gatekeeper/application.properties + - ./properties/gateway.properties:/opt/arrowhead-core/gateway/application.properties + ports: + - 8443:8443 # Service Registry + - 8445:8445 # Authorization + - 8441:8441 # Orchestrator + #- 8455:8455 # Event Handler + - 8449:8449 # Gatekeeper + - 8453:8453 # Gateway + +volumes: + arrowhead_core_mysql: + external: true diff --git a/docker-all/example/properties/authorization.properties b/docker-all/example/properties/authorization.properties new file mode 100644 index 000000000..2d4aedd48 --- /dev/null +++ b/docker-all/example/properties/authorization.properties @@ -0,0 +1,61 @@ +############################################ +### APPLICATION PARAMETERS ### +############################################ + +# Database connection +spring.datasource.url=jdbc:mysql://arrowhead_core_mysql:3306/arrowhead?serverTimezone=Europe/Stockholm +spring.datasource.username=authorization +spring.datasource.password=hqZFUkuHxhekio3 +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +# use true only for debugging +spring.jpa.show-sql=false +spring.jpa.properties.hibernate.format_sql=true +spring.jpa.hibernate.ddl-auto=none + +# Authorization web-server parameters +domain.name=0.0.0.0 +domain.port=8445 +server.port=8445 + +############################################ +### CUSTOM PARAMETERS ### +############################################ + +# Name of the core system +core_system_name=AUTHORIZATION + +# Show all request/response in debug log +log_all_request_and_response=false + +# Service Registry web-server parameters (to register the Authorization services) +sr_address=127.0.0.1 +sr_port=8443 + +#Allow querying access to the authorization tables for application systems (true/false - only has effect in secure mode) +enable_auth_for_cloud=false + +# Interface names has to follow this format --, where security can be SECURE or INSECURE and protocol and format must be a sequence of letters, numbers and underscore. +# A regexp checker will verify that. If this setting is set to true then the PROTOCOL and FORMAT must come from a predefined set. +use_strict_service_intf_name_verifier=true + +# Event handler core system is present +eventhandler_is_present=true + +############################################ +### SECURE MODE ### +############################################ + +#server.ssl.enabled=true +#server.ssl.key-store-type=PKCS12 +#server.ssl.key-store=classpath:certificates/authorization.p12 +#server.ssl.key-store-password=123456 +#server.ssl.key-alias=authorization +#server.ssl.key-password=123456 +#server.ssl.client-auth=need +#server.ssl.trust-store-type=PKCS12 +#server.ssl.trust-store=classpath:certificates/truststore.p12 +#server.ssl.trust-store-password=123456 + +#disable.hostname.verifier=false diff --git a/docker-all/example/properties/eventhandler.properties b/docker-all/example/properties/eventhandler.properties new file mode 100644 index 000000000..62f77daff --- /dev/null +++ b/docker-all/example/properties/eventhandler.properties @@ -0,0 +1,61 @@ +############################################ +### APPLICATION PARAMETERS ### +############################################ + +# Database connection +spring.datasource.url=jdbc:mysql://arrowhead_core_mysql:3306/arrowhead?serverTimezone=Europe/Stockholm +spring.datasource.username=event_handler +spring.datasource.password=gRLjXbqu9YwYhfK +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +# use true only for debugging +spring.jpa.show-sql=false +spring.jpa.properties.hibernate.format_sql=true +spring.jpa.hibernate.ddl-auto=none + +# Event handler web-server parameters +domain.name=0.0.0.0 +domain.port=8455 +server.port=8455 + +############################################ +### CUSTOM PARAMETERS ### +############################################ + +# Name of the core system +core_system_name=EVENT_HANDLER + +# Show all request/response in debug log +log_all_request_and_response=false + +# Service Registry web-server parameters (to register the Event Handler services) +sr_address=127.0.0.1 +sr_port=8443 + +# Publishing tolerance: clients can publish events with timestamps X number of minutes before or after the current time +# 0 means the tolerance is infinite (events can be published with any timestamp) +event_publishing_tolerance=60 + +# Removing old filters from the database based on the endDate field (true/false) +remove_old_filters=false + +# DB check interval in minutes, if "remove_old_filters" is true +check_interval=60 + +############################################ +### SECURE MODE ### +############################################ + +#server.ssl.enabled=true +#server.ssl.key-store-type=PKCS12 +#server.ssl.key-store=classpath:certificates/eventhandler.p12 +#server.ssl.key-store-password=123456 +#server.ssl.key-alias=eventhandler +#server.ssl.key-password=123456 +#server.ssl.client-auth=need +#server.ssl.trust-store-type=PKCS12 +#server.ssl.trust-store=classpath:certificates/truststore.p12 +#server.ssl.trust-store-password=123456 + +#disable.hostname.verifier=false diff --git a/docker-all/example/properties/gatekeeper.properties b/docker-all/example/properties/gatekeeper.properties new file mode 100644 index 000000000..8d3dc3404 --- /dev/null +++ b/docker-all/example/properties/gatekeeper.properties @@ -0,0 +1,60 @@ +############################################ +### APPLICATION PARAMETERS ### +############################################ + +# Database connection +spring.datasource.url=jdbc:mysql://arrowhead_core_mysql:3306/arrowhead?serverTimezone=Europe/Stockholm +spring.datasource.username=gatekeeper +spring.datasource.password=fbJKYzKhU5t8QtT +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +# use true only for debugging +spring.jpa.show-sql=false +spring.jpa.properties.hibernate.format_sql=true +spring.jpa.hibernate.ddl-auto=none + +# Parameters of Gatekeeper web-server +domain.name=0.0.0.0 +domain.port=8449 +server.port=8449 + +############################################ +### CUSTOM PARAMETERS ### +############################################ + +# Name of the core system +core_system_name=GATEKEEPER + +# Show all request/response in debug log +log_all_request_and_response=false + +# Service Registry web-server parameters (to register the Gatekeeper services) +sr_address=127.0.0.1 +sr_port=8443 + +# Inter-Cloud communication timeout in milliseconds +timeout=30000 + +# If true, operational gateway must be present +gateway_is_present=true + +# Using the Gateway module is mandatory or not during Inter-Cloud orchestration (true/false) +gateway_is_mandatory=true + +############################################ +### SECURE MODE ### +############################################ + +#server.ssl.enabled=true +#server.ssl.key-store-type=PKCS12 +#server.ssl.key-store=classpath:certificates/gatekeeper.p12 +#server.ssl.key-store-password=123456 +#server.ssl.key-alias=gatekeeper +#server.ssl.key-password=123456 +#server.ssl.client-auth=need +#server.ssl.trust-store-type=PKCS12 +#server.ssl.trust-store=classpath:certificates/truststore.p12 +#server.ssl.trust-store-password=123456 + +#disable.hostname.verifier=false \ No newline at end of file diff --git a/docker-all/example/properties/gateway.properties b/docker-all/example/properties/gateway.properties new file mode 100644 index 000000000..810492eb8 --- /dev/null +++ b/docker-all/example/properties/gateway.properties @@ -0,0 +1,55 @@ +############################################ +### APPLICATION PARAMETERS ### +############################################ + +# Database connection +spring.datasource.url=jdbc:mysql://arrowhead_core_mysql:3306/arrowhead?serverTimezone=Europe/Stockholm +spring.datasource.username=gateway +spring.datasource.password=LfiSM9DpGfDEP5g +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +# use true only for debugging +spring.jpa.show-sql=false +spring.jpa.properties.hibernate.format_sql=true +spring.jpa.hibernate.ddl-auto=none + +# Parameters of Gateway web-server +domain.name=0.0.0.0 +domain.port=8453 +server.port=8453 + +############################################ +### CUSTOM PARAMETERS ### +############################################ + +# Name of the core system +core_system_name=GATEWAY + +# Show all request/response in debug log +log_all_request_and_response=false + +# Service Registry web-server parameters (to register the Gateway services) +sr_address=127.0.0.1 +sr_port=8443 + +# Port range for socket openings (to facilitate inter-cloud communication between consumer and provider systems) +min_port=8001 +max_port=8100 + +############################################ +### SECURE MODE ### +############################################ + +#server.ssl.enabled=true +#server.ssl.key-store-type=PKCS12 +#server.ssl.key-store=classpath:certificates/gateway.p12 +#server.ssl.key-store-password=123456 +#server.ssl.key-alias=gateway +#server.ssl.key-password=123456 +#server.ssl.client-auth=need +#server.ssl.trust-store-type=PKCS12 +#server.ssl.trust-store=classpath:certificates/truststore.p12 +#server.ssl.trust-store-password=123456 + +#disable.hostname.verifier=false diff --git a/docker-all/example/properties/orchestrator.properties b/docker-all/example/properties/orchestrator.properties new file mode 100644 index 000000000..c04642afd --- /dev/null +++ b/docker-all/example/properties/orchestrator.properties @@ -0,0 +1,54 @@ +############################################ +### APPLICATION PARAMETERS ### +############################################ + +# Database connection +spring.datasource.url=jdbc:mysql://arrowhead_core_mysql:3306/arrowhead?serverTimezone=Europe/Stockholm +spring.datasource.username=orchestrator +spring.datasource.password=KbgD2mTr8DQ4vtc +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +# use true only for debugging +spring.jpa.show-sql=false +spring.jpa.properties.hibernate.format_sql=true +spring.jpa.hibernate.ddl-auto=none + +# Orchestrator web-server parameters +domain.name=0.0.0.0 +domain.port=8441 +server.port=8441 + +############################################ +### CUSTOM PARAMETERS ### +############################################ + +# Name of the core system +core_system_name=ORCHESTRATOR + +# Show all request/response in debug log +log_all_request_and_response=false + +# Service Registry web-server parameters (to register the Orchestrator services) +sr_address=127.0.0.1 +sr_port=8443 + +#If true, operational gatekeeper must be present +gatekeeper_is_present=true + +############################################ +### SECURE MODE ### +############################################ + +#server.ssl.enabled=true +#server.ssl.key-store-type=PKCS12 +#server.ssl.key-store=classpath:certificates/orchestrator.p12 +#server.ssl.key-store-password=123456 +#server.ssl.key-alias=orchestrator +#server.ssl.key-password=123456 +#server.ssl.client-auth=need +#server.ssl.trust-store-type=PKCS12 +#server.ssl.trust-store=classpath:certificates/truststore.p12 +#server.ssl.trust-store-password=123456 + +#disable.hostname.verifier=false diff --git a/docker-all/example/properties/serviceregistry.properties b/docker-all/example/properties/serviceregistry.properties new file mode 100644 index 000000000..fac4899b3 --- /dev/null +++ b/docker-all/example/properties/serviceregistry.properties @@ -0,0 +1,67 @@ +############################################ +### APPLICATION PARAMETERS ### +############################################ + +# Database connection +spring.datasource.url=jdbc:mysql://arrowhead_core_mysql:3306/arrowhead?serverTimezone=Europe/Stockholm +spring.datasource.username=service_registry +spring.datasource.password=ZzNNpxrbZGVvfJ8 +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +# use true only for debugging +spring.jpa.show-sql=false +spring.jpa.properties.hibernate.format_sql=true +spring.jpa.hibernate.ddl-auto=none + +# Service Registry web-server parameters +domain.name=0.0.0.0 +domain.port=8443 +server.port=8443 + +############################################ +### CUSTOM PARAMETERS ### +############################################ + +# Name of the core system +core_system_name=SERVICE_REGISTRY + +# Show all request/response in debug log +log_all_request_and_response=false + +# Service Registry has an optional feature to ping service providers in a fixed time interval, +# and remove service offerings where the service provider was not available +# use this feature (true/false) +ping_scheduled=false +# how much time the Service Registry should wait for the ping response (in milliseconds) +ping_timeout=5000 +# how frequently should the ping happen, in minutes +ping_interval=60 + +# Service Registry has an optional feature to automatically remove service offerings, where the endOfValidity +# timestamp field is in the past, meaning the offering expired +# use this feature (true/false) +ttl_scheduled=false +# how frequently the database should be checked for expired services, in minutes +ttl_interval=10 + +# Interface names has to follow this format --, where security can be SECURE or INSECURE and protocol and format must be a sequence of letters, numbers and underscore. +# A regexp checker will verify that. If this setting is set to true then the PROTOCOL and FORMAT must come from a predefined set. +use_strict_service_intf_name_verifier=true + +############################################ +### SECURE MODE ### +############################################ + +#server.ssl.enabled=true +#server.ssl.key-store-type=PKCS12 +#server.ssl.key-store=classpath:certificates/serviceregistry.p12 +#server.ssl.key-store-password=123456 +#server.ssl.key-alias=serviceregistry +#server.ssl.key-password=123456 +#server.ssl.client-auth=need +#server.ssl.trust-store-type=PKCS12 +#server.ssl.trust-store=classpath:certificates/truststore.p12 +#server.ssl.trust-store-password=123456 + +#disable.hostname.verifier=false diff --git a/docker-all/example/sql/setup.sql b/docker-all/example/sql/setup.sql new file mode 100644 index 000000000..755b9a6e5 --- /dev/null +++ b/docker-all/example/sql/setup.sql @@ -0,0 +1,540 @@ +DROP DATABASE IF EXISTS `arrowhead`; +CREATE DATABASE IF NOT EXISTS `arrowhead`; +USE `arrowhead`; + +-- Common + +DROP TABLE IF EXISTS `cloud`; +CREATE TABLE `cloud` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `operator` varchar(255) NOT NULL, + `name` varchar(255) NOT NULL, + `secure` int(1) NOT NULL DEFAULT 0 COMMENT 'Is secure?', + `neighbor` int(1) NOT NULL DEFAULT 0 COMMENT 'Is neighbor cloud?', + `own_cloud` int(1) NOT NULL DEFAULT 0 COMMENT 'Is own cloud?', + `authentication_info` varchar(2047) DEFAULT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `cloud` (`operator`,`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `relay`; +CREATE TABLE `relay` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `address` varchar(255) NOT NULL, + `port` int(11) NOT NULL, + `secure` int(1) NOT NULL DEFAULT 0, + `exclusive` int(1) NOT NULL DEFAULT 0, + `type` varchar(255) NOT NULL DEFAULT 'GENERAL_RELAY', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `pair` (`address`, `port`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `cloud_gatekeeper_relay`; +CREATE TABLE `cloud_gatekeeper_relay` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `cloud_id` bigint(20) NOT NULL, + `relay_id` bigint(20) NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `pair` (`cloud_id`,`relay_id`), + CONSTRAINT `gk_cloud_constr` FOREIGN KEY (`cloud_id`) REFERENCES `cloud` (`id`) ON DELETE CASCADE, + CONSTRAINT `gk_relay_constr` FOREIGN KEY (`relay_id`) REFERENCES `relay` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `cloud_gateway_relay`; +CREATE TABLE `cloud_gateway_relay` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `cloud_id` bigint(20) NOT NULL, + `relay_id` bigint(20) NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `pair` (`cloud_id`,`relay_id`), + CONSTRAINT `gw_cloud_constr` FOREIGN KEY (`cloud_id`) REFERENCES `cloud` (`id`) ON DELETE CASCADE, + CONSTRAINT `gw_relay_constr` FOREIGN KEY (`relay_id`) REFERENCES `relay` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `system_`; +CREATE TABLE `system_` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `system_name` varchar(255) NOT NULL, + `address` varchar(255) NOT NULL, + `port` int(11) NOT NULL, + `authentication_info` varchar(2047) DEFAULT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `triple` (`system_name`,`address`,`port`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `service_definition`; +CREATE TABLE `service_definition` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `service_definition` varchar(255) NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `service_definition` (`service_definition`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `service_interface`; +CREATE TABLE `service_interface` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `interface_name` varchar(255) DEFAULT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `interface` (`interface_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `service_interface` (interface_name) VALUES ('HTTP-SECURE-JSON'); +INSERT INTO `service_interface` (interface_name) VALUES ('HTTP-INSECURE-JSON'); + +-- Service Registry + +DROP TABLE IF EXISTS `service_registry`; +CREATE TABLE `service_registry` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `service_id` bigint(20) NOT NULL, + `system_id` bigint(20) NOT NULL, + `service_uri` varchar(255) DEFAULT NULL, + `end_of_validity` timestamp NULL DEFAULT NULL, + `secure` varchar(255) NOT NULL DEFAULT 'NOT_SECURE', + `metadata` text, + `version` int(11) DEFAULT 1, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `pair` (`service_id`,`system_id`), + KEY `system` (`system_id`), + CONSTRAINT `service` FOREIGN KEY (`service_id`) REFERENCES `service_definition` (`id`) ON DELETE CASCADE, + CONSTRAINT `system` FOREIGN KEY (`system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `service_registry_interface_connection`; +CREATE TABLE `service_registry_interface_connection` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `service_registry_id` bigint(20) NOT NULL, + `interface_id` bigint(20) NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `pair` (`service_registry_id`,`interface_id`), + KEY `interface_sr` (`interface_id`), + CONSTRAINT `interface_sr` FOREIGN KEY (`interface_id`) REFERENCES `service_interface` (`id`) ON DELETE CASCADE, + CONSTRAINT `service_registry` FOREIGN KEY (`service_registry_id`) REFERENCES `service_registry` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- Authorization + +DROP TABLE IF EXISTS `authorization_intra_cloud`; +CREATE TABLE `authorization_intra_cloud` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `consumer_system_id` bigint(20) NOT NULL, + `provider_system_id` bigint(20) NOT NULL, + `service_id` bigint(20) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `rule` (`consumer_system_id`,`provider_system_id`,`service_id`), + KEY `provider` (`provider_system_id`), + KEY `service_intra_auth` (`service_id`), + CONSTRAINT `service_intra_auth` FOREIGN KEY (`service_id`) REFERENCES `service_definition` (`id`) ON DELETE CASCADE, + CONSTRAINT `provider` FOREIGN KEY (`provider_system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE, + CONSTRAINT `consumer` FOREIGN KEY (`consumer_system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `authorization_inter_cloud`; +CREATE TABLE `authorization_inter_cloud` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `consumer_cloud_id` bigint(20) NOT NULL, + `provider_system_id` bigint(20) NOT NULL, + `service_id` bigint(20) NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `rule` (`consumer_cloud_id`, `provider_system_id`, `service_id`), + KEY `service_inter_auth` (`service_id`), + CONSTRAINT `cloud` FOREIGN KEY (`consumer_cloud_id`) REFERENCES `cloud` (`id`) ON DELETE CASCADE, + CONSTRAINT `service_inter_auth` FOREIGN KEY (`service_id`) REFERENCES `service_definition` (`id`) ON DELETE CASCADE, + CONSTRAINT `provider_inter_auth` FOREIGN KEY (`provider_system_id`) REFERENCES `system_` (id) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `authorization_inter_cloud_interface_connection`; +CREATE TABLE `authorization_inter_cloud_interface_connection` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `authorization_inter_cloud_id` bigint(20) NOT NULL, + `interface_id` bigint(20) NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `pair` (`authorization_inter_cloud_id`,`interface_id`), + KEY `interface_inter` (`interface_id`), + CONSTRAINT `auth_inter_interface` FOREIGN KEY (`interface_id`) REFERENCES `service_interface` (`id`) ON DELETE CASCADE, + CONSTRAINT `auth_inter_cloud` FOREIGN KEY (`authorization_inter_cloud_id`) REFERENCES `authorization_inter_cloud` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `authorization_intra_cloud_interface_connection`; +CREATE TABLE `authorization_intra_cloud_interface_connection` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `authorization_intra_cloud_id` bigint(20) NOT NULL, + `interface_id` bigint(20) NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `pair` (`authorization_intra_cloud_id`,`interface_id`), + KEY `interface_intra` (`interface_id`), + CONSTRAINT `auth_intra_interface` FOREIGN KEY (`interface_id`) REFERENCES `service_interface` (`id`) ON DELETE CASCADE, + CONSTRAINT `auth_intra_cloud` FOREIGN KEY (`authorization_intra_cloud_id`) REFERENCES `authorization_intra_cloud` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- Orchestrator + +DROP TABLE IF EXISTS `orchestrator_store`; +CREATE TABLE `orchestrator_store` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `consumer_system_id` bigint(20) NOT NULL, + `provider_system_id` bigint(20) NOT NULL, + `foreign_` int(1) NOT NULL DEFAULT 0, + `service_id` bigint(20) NOT NULL, + `service_interface_id` bigint(20) NOT NULL, + `priority` int(11) NOT NULL, + `attribute` text, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `priority_rule` (`service_id`, `service_interface_id`, `consumer_system_id`,`priority`), + UNIQUE KEY `duplication_rule` (`service_id`, `service_interface_id`, `consumer_system_id`,`provider_system_id`, `foreign_`), + CONSTRAINT `consumer_orch` FOREIGN KEY (`consumer_system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE, + CONSTRAINT `service_orch` FOREIGN KEY (`service_id`) REFERENCES `service_definition` (`id`) ON DELETE CASCADE, + CONSTRAINT `service_intf_orch` FOREIGN KEY (`service_interface_id`) REFERENCES `service_interface` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `foreign_system`; +CREATE TABLE `foreign_system` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `provider_cloud_id` bigint(20) NOT NULL, + `system_name` varchar(255) NOT NULL, + `address` varchar(255) NOT NULL, + `port` int(11) NOT NULL, + `authentication_info` varchar(2047) DEFAULT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `triple` (`system_name`,`address`,`port`), + CONSTRAINT `foreign_cloud` FOREIGN KEY (`provider_cloud_id`) REFERENCES `cloud` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- Logs + +DROP TABLE IF EXISTS `logs`; +CREATE TABLE `logs` ( + `log_id` varchar(100) NOT NULL, + `entry_date` timestamp NULL DEFAULT NULL, + `logger` varchar(100) DEFAULT NULL, + `log_level` varchar(100) DEFAULT NULL, + `message` text, + `exception` text, + PRIMARY KEY (`log_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- Event Handler + +DROP TABLE IF EXISTS `event_type`; + CREATE TABLE `event_type` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `event_type_name` varchar(255) NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `eventtype` (`event_type_name`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `subscription`; +CREATE TABLE `subscription` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `system_id` bigint(20) NOT NULL, + `event_type_id` bigint(20) NOT NULL, + `filter_meta_data` text, + `match_meta_data` int(1) NOT NULL DEFAULT 0, + `only_predefined_publishers` int(1) NOT NULL DEFAULT 0, + `notify_uri` text NOT NULL, + `start_date` timestamp NULL DEFAULT NULL, + `end_date` timestamp NULL DEFAULT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `pair` (`event_type_id`,`system_id`), + CONSTRAINT `subscriber_system` FOREIGN KEY (`system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE, + CONSTRAINT `event_type` FOREIGN KEY (`event_type_id`) REFERENCES `event_type` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `subscription_publisher_connection`; +CREATE TABLE `subscription_publisher_connection` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `subscription_id` bigint(20) NOT NULL, + `system_id` bigint(20) NOT NULL, + `authorized` int(1) NOT NULL DEFAULT 0, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `pair` (`subscription_id`,`system_id`), + CONSTRAINT `subscription_constraint` FOREIGN KEY (`subscription_id`) REFERENCES `subscription` (`id`) ON DELETE CASCADE, + CONSTRAINT `system_constraint` FOREIGN KEY (`system_id`) REFERENCES `system_` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- Choreographer + +DROP TABLE IF EXISTS `choreographer_action_plan`; +CREATE TABLE `choreographer_action_plan` ( + `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, + `action_plan_name` varchar(255) UNIQUE NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP +)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `choreographer_action`; +CREATE TABLE `choreographer_action` ( + `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, + `action_name` varchar(255) UNIQUE NOT NULL, + `next_action_id` bigint(20) DEFAULT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + CONSTRAINT `next_action` FOREIGN KEY (`next_action_id`) REFERENCES `choreographer_action` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `choreographer_action_step`; +CREATE TABLE `choreographer_action_step` ( + `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, + `name` varchar(255) UNIQUE NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `choreographer_action_plan_action_connection`; +CREATE TABLE `choreographer_action_plan_action_connection` ( + `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, + `action_plan_id` bigint(20) NOT NULL, + `action_id` bigint(20) NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + CONSTRAINT `action_plan_fk1` FOREIGN KEY (`action_plan_id`) REFERENCES `choreographer_action_plan` (`id`) ON DELETE CASCADE, + CONSTRAINT `action_fk1` FOREIGN KEY (`action_id`) REFERENCES `choreographer_action` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `choreographer_action_action_step_connection`; +CREATE TABLE `choreographer_action_action_step_connection` ( + `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, + `action_id` bigint(20) NOT NULL, + `action_step_id` bigint(20) NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + CONSTRAINT `action_fk2` FOREIGN KEY (`action_id`) REFERENCES `choreographer_action` (`id`) ON DELETE CASCADE, + CONSTRAINT `action_step_fk1` FOREIGN KEY (`action_step_id`) REFERENCES `choreographer_action_step` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `choreographer_action_step_service_definition_connection`; +CREATE TABLE `choreographer_action_step_service_definition_connection` ( + `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, + `action_step_id` bigint(20) NOT NULL, + `service_definition_id` bigint(20) NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + CONSTRAINT `service_definition` FOREIGN KEY (`service_definition_id`) REFERENCES `service_definition` (`id`) ON DELETE CASCADE, + CONSTRAINT `action_step` FOREIGN KEY (`action_step_id`) REFERENCES `choreographer_action_step` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `choreographer_next_action_step`; +CREATE TABLE `choreographer_next_action_step` ( + `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, + `action_step_id` bigint(20) NOT NULL, + `next_action_step_id` bigint(20) NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + CONSTRAINT `current_action_step` FOREIGN KEY (`action_step_id`) REFERENCES `choreographer_action_step` (`id`) ON DELETE CASCADE, + CONSTRAINT `next_action_step` FOREIGN KEY (`action_step_id`) REFERENCES `choreographer_action_step` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- Set up privileges + +-- Service Registry +DROP USER IF EXISTS 'service_registry'@'localhost'; +CREATE USER IF NOT EXISTS 'service_registry'@'localhost' IDENTIFIED BY 'ZzNNpxrbZGVvfJ8'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'service_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'service_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'service_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'service_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'service_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'service_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'service_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'service_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'service_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'service_registry'@'localhost'; + +DROP USER IF EXISTS 'service_registry'@'%'; +CREATE USER IF NOT EXISTS 'service_registry'@'%' IDENTIFIED BY 'ZzNNpxrbZGVvfJ8'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'service_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'service_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'service_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'service_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'service_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'service_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'service_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'service_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'service_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'service_registry'@'%'; + +-- Authorization +DROP USER IF EXISTS 'authorization'@'localhost'; +CREATE USER IF NOT EXISTS 'authorization'@'localhost' IDENTIFIED BY 'hqZFUkuHxhekio3'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'authorization'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'authorization'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'authorization'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'authorization'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'authorization'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'authorization'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'authorization'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'authorization'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'authorization'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'authorization'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'authorization'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'authorization'@'localhost'; + +DROP USER IF EXISTS 'authorization'@'%'; +CREATE USER IF NOT EXISTS 'authorization'@'%' IDENTIFIED BY 'hqZFUkuHxhekio3'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'authorization'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'authorization'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'authorization'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'authorization'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'authorization'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'authorization'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'authorization'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'authorization'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'authorization'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'authorization'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'authorization'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'authorization'@'%'; + +-- Orchestrator +DROP USER IF EXISTS 'orchestrator'@'localhost'; +CREATE USER IF NOT EXISTS 'orchestrator'@'localhost' IDENTIFIED BY 'KbgD2mTr8DQ4vtc'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'orchestrator'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'orchestrator'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'orchestrator'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'orchestrator'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'orchestrator'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'orchestrator'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'orchestrator'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'orchestrator'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`foreign_system` TO 'orchestrator'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'orchestrator'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`foreign_system` TO 'orchestrator'@'localhost'; + +DROP USER IF EXISTS 'orchestrator'@'%'; +CREATE USER IF NOT EXISTS 'orchestrator'@'%' IDENTIFIED BY 'KbgD2mTr8DQ4vtc'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'orchestrator'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'orchestrator'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'orchestrator'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'orchestrator'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'orchestrator'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'orchestrator'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'orchestrator'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'orchestrator'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`foreign_system` TO 'orchestrator'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'orchestrator'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`foreign_system` TO 'orchestrator'@'%'; + +-- Event Handler +DROP USER IF EXISTS 'event_handler'@'localhost'; +CREATE USER IF NOT EXISTS 'event_handler'@'localhost' IDENTIFIED BY 'gRLjXbqu9YwYhfK'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'event_handler'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`event_type` TO 'event_handler'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'event_handler'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'event_handler'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'event_handler'@'localhost'; + +DROP USER IF EXISTS 'event_handler'@'%'; +CREATE USER IF NOT EXISTS 'event_handler'@'%' IDENTIFIED BY 'gRLjXbqu9YwYhfK'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'event_handler'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`event_type` TO 'event_handler'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'event_handler'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'event_handler'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'event_handler'@'%'; + +-- Choreographer +DROP USER IF EXISTS 'choreographer'@'localhost'; +CREATE USER IF NOT EXISTS 'choreographer'@'localhost' IDENTIFIED BY 'Qa5yx4oBp4Y9RLX'; +GRANT ALL PRIVILEGES ON `arrowhead`.`choreographer_action_plan` TO 'choreographer'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`choreographer_action` TO 'choreographer'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`choreographer_action_step` TO 'choreographer'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`choreographer_action_plan_action_connection` TO 'choreographer'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`choreographer_action_action_step_connection` TO 'choreographer'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`choreographer_action_step_service_definition_connection` TO 'choreographer'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`choreographer_next_action_step` TO 'choreographer'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'choreographer'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'choreographer'@'localhost'; + +DROP USER IF EXISTS 'choreographer'@'%'; +CREATE USER IF NOT EXISTS 'choreographer'@'%' IDENTIFIED BY 'Qa5yx4oBp4Y9RLX'; +GRANT ALL PRIVILEGES ON `arrowhead`.`choreographer_action_plan` TO 'choreographer'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`choreographer_action` TO 'choreographer'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`choreographer_action_step` TO 'choreographer'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`choreographer_action_plan_action_connection` TO 'choreographer'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`choreographer_action_action_step_connection` TO 'choreographer'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`choreographer_action_step_service_definition_connection` TO 'choreographer'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`choreographer_next_action_step` TO 'choreographer'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'choreographer'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'choreographer'@'%'; + +-- Gatekeeper +DROP USER IF EXISTS 'gatekeeper'@'localhost'; +CREATE USER IF NOT EXISTS 'gatekeeper'@'localhost' IDENTIFIED BY 'fbJKYzKhU5t8QtT'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'gatekeeper'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'gatekeeper'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'gatekeeper'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'gatekeeper'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'gatekeeper'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'gatekeeper'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'gatekeeper'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'gatekeeper'@'localhost'; + +DROP USER IF EXISTS 'gatekeeper'@'%'; +CREATE USER IF NOT EXISTS 'gatekeeper'@'%' IDENTIFIED BY 'fbJKYzKhU5t8QtT'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'gatekeeper'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'gatekeeper'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'gatekeeper'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'gatekeeper'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'gatekeeper'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'gatekeeper'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'gatekeeper'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'gatekeeper'@'%'; + +-- Gateway +DROP USER IF EXISTS 'gateway'@'localhost'; +CREATE USER IF NOT EXISTS 'gateway'@'localhost' IDENTIFIED BY 'LfiSM9DpGfDEP5g'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'gateway'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'gateway'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'gateway'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'gateway'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'gateway'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'gateway'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'gateway'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'gateway'@'localhost'; + +DROP USER IF EXISTS 'gateway'@'%'; +CREATE USER IF NOT EXISTS 'gateway'@'%' IDENTIFIED BY 'LfiSM9DpGfDEP5g'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'gateway'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'gateway'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'gateway'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'gateway'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'gateway'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'gateway'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'gateway'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'gateway'@'%'; + +FLUSH PRIVILEGES; \ No newline at end of file diff --git a/docker-all/pom.xml b/docker-all/pom.xml new file mode 100644 index 000000000..3ac1745df --- /dev/null +++ b/docker-all/pom.xml @@ -0,0 +1,110 @@ + + + 4.0.0 + + eu.arrowhead + core + ${revision} + + pom + docker-all + docker-all + Docker image containing all core systems + + https://github.com/arrowhead-f/core-java-spring + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + + eu.arrowhead + arrowhead-authorization + ${revision} + + + eu.arrowhead + arrowhead-eventhandler + ${revision} + + + eu.arrowhead + arrowhead-gatekeeper + ${revision} + + + eu.arrowhead + arrowhead-gateway + ${revision} + + + eu.arrowhead + arrowhead-orchestrator + ${revision} + + + eu.arrowhead + arrowhead-serviceregistry + ${revision} + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-jar + package + + copy + + + ${project.build.directory} + + + eu.arrowhead + arrowhead-authorization + jar + + + eu.arrowhead + arrowhead-eventhandler + jar + + + eu.arrowhead + arrowhead-gatekeeper + jar + + + eu.arrowhead + arrowhead-gateway + jar + + + eu.arrowhead + arrowhead-orchestrator + jar + + + eu.arrowhead + arrowhead-serviceregistry + jar + + + true + true + true + + + + + + + \ No newline at end of file diff --git a/docker-all/run.sh b/docker-all/run.sh new file mode 100755 index 000000000..f1528bc4c --- /dev/null +++ b/docker-all/run.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +exit_script() { + echo -e "\e[1;31mExiting ...\e[0m" + trap - INT TERM + kill -$$ +} +trap exit_script INT TERM + +PIDS=() +for JAR in *.jar; do + NAME=$(echo "${JAR}" | sed 's/arrowhead-\([^-]*\)-.*/\1/') + PROPERTIES="${NAME}/application.properties" + if [[ -f "${PROPERTIES}" ]]; then + echo -e "\e[1;32mjava ${JVM_FLAGS} -jar ${JAR} &\e[0m" + cd "${NAME}" + java ${JVM_FLAGS} -jar "../${JAR}" & + PIDS+=" $!" + cd .. + else + echo -e "\e[1;31m${PROPERTIES} not provided; skipping ${JAR}" + fi +done + +for PID in ${PIDS[*]}; do + wait "${PID}" +done diff --git a/pom.xml b/pom.xml index 785a20381..185899f38 100644 --- a/pom.xml +++ b/pom.xml @@ -32,6 +32,7 @@ gateway choreographer deb-installer + docker-all From 71bb26d416d37f825772800b32aaa434d03429cc Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 10 Feb 2020 13:15:57 +0100 Subject: [PATCH 166/301] implemented testExecuteMeanResponseTimeCalculations --- .../core/qos/quartz/task/PingTaskTest.java | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index b43ac3970..1dba18c37 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -1249,6 +1249,76 @@ public void testExecuteMaxResponseTime() { verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); } + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteMeanResponseTimeCalculations() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = get100LongResponseListWithIncementingResponseTimeAnd10PercentLossForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), calculationsValueCapture.capture(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + final PingMeasurementCalculationsDTO calculations = calculationsValueCapture.getValue(); + assertNotNull(calculations); + assertTrue(46 == calculations.getMeanResponseTimeWithoutTimeout()); + assertTrue(541 == calculations.getMeanResponseTimeWithTimeout()); + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(1)).getTimeout(); + verify(pingService, atLeastOnce()).getPingResponseList(anyString()); + verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + + verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); + } + //================================================================================================= // assistant methods From ff2b1250f4c54e23e94a439b84dc98d3e019be9d Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 10 Feb 2020 13:56:46 +0100 Subject: [PATCH 167/301] implemented execute tests --- .../core/qos/quartz/task/PingTask.java | 2 +- .../core/qos/quartz/task/PingTaskTest.java | 347 +++++++++++++++++- 2 files changed, 344 insertions(+), 5 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index e27d0cdf2..672cd6698 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -223,7 +223,7 @@ private void handlePingMeasurement(final QoSIntraMeasurement measurement, logger.debug("handelPingMeasurement started..."); final PingMeasurementCalculationsDTO calculationsDTO = calculatePingMeasurementValues(responseList); - final Optional pingMeasurementOptional = qoSDBService.getPingMeasurementByMeasurement(measurement); + final Optional pingMeasurementOptional = qoSDBService.getPingMeasurementByMeasurement(measurement); if (pingMeasurementOptional.isEmpty()) { diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index 1dba18c37..681c8e64c 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -7,6 +7,7 @@ import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -362,9 +363,6 @@ public void testExecuteHttpServiceThrowsException() { final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); - //final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); - //final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); - final List responseList = getResponseListForTest(); final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); @@ -793,7 +791,7 @@ public void testExecuteGetMeasurementThrowsException() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenThrow(ArrowheadException.class);//thenReturn(measurement); + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenThrow(ArrowheadException.class); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -1319,6 +1317,347 @@ public void testExecuteMeanResponseTimeCalculations() { verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); } + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteJitterCalculations() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = get100LongResponseListWithIncementingResponseTimeAnd10PercentLossForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), calculationsValueCapture.capture(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + final PingMeasurementCalculationsDTO calculations = calculationsValueCapture.getValue(); + assertNotNull(calculations); + assertTrue(1567 == calculations.getJitterWithTimeout()); + assertTrue(25 == calculations.getJitterWithoutTimeout()); + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(1)).getTimeout(); + verify(pingService, atLeastOnce()).getPingResponseList(anyString()); + verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + + verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testExecuteGetPingMeasurementByMeasurementThrowsException() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenThrow(ArrowheadException.class); + doNothing().when(qoSDBService).createPingMeasurement(any(), any(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } catch (final ArrowheadException ex) { + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingService, times(1)).getPingResponseList(anyString()); + verify(qoSDBService,times(1)).getMeasurement(any()); + verify(pingMeasurementProperties, atLeastOnce()).getTimeout(); + + verify(qoSDBService, times(1)).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementDetailsToDB(any(), any(), any()); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testExecuteCreatePingMeasurementThrowsException() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doThrow(ArrowheadException.class).when(qoSDBService).createPingMeasurement(any(), any(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } catch (final ArrowheadException ex) { + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingService, times(1)).getPingResponseList(anyString()); + verify(qoSDBService,times(1)).getMeasurement(any()); + verify(pingMeasurementProperties, atLeastOnce()).getTimeout(); + + verify(qoSDBService, times(1)).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, times(1)).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementDetailsToDB(any(), any(), any()); + + throw ex; + } + + } + + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testExecuteLogMeasurementToDBThrowsException() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), any(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenThrow(ArrowheadException.class); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } catch (final ArrowheadException ex) { + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingService, times(1)).getPingResponseList(anyString()); + verify(qoSDBService,times(1)).getMeasurement(any()); + verify(pingMeasurementProperties, atLeastOnce()).getTimeout(); + + verify(qoSDBService, times(1)).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, times(1)).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, times(1)).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, times(0)).logMeasurementDetailsToDB(any(), any(), any()); + + throw ex; + } + + } + + + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testExecuteLogMeasurementDetailsToDBThrowsException() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), any(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doThrow(ArrowheadException.class).when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } catch (final ArrowheadException ex) { + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingService, times(1)).getPingResponseList(anyString()); + verify(qoSDBService,times(1)).getMeasurement(any()); + verify(pingMeasurementProperties, atLeastOnce()).getTimeout(); + + verify(qoSDBService, times(1)).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, times(1)).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, times(1)).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, times(1)).logMeasurementDetailsToDB(any(), any(), any()); + + throw ex; + } + + } + //================================================================================================= // assistant methods From 16cb94d2453231e87c9f3f4257fdc99ebb93323c Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 10 Feb 2020 14:03:40 +0100 Subject: [PATCH 168/301] removed unneccessary tabs --- .../java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index 681c8e64c..9f678c5fe 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -96,7 +96,7 @@ public class PingTaskTest { //------------------------------------------------------------------------------------------------- @Before public void setUp() throws Exception { - logger = mock(Logger.class); + logger = mock(Logger.class); ReflectionTestUtils.setField(pingTask, "logger", logger); } From e1765378e129f623c249096697b6a4c515c77cdc Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 10 Feb 2020 14:23:11 +0100 Subject: [PATCH 169/301] implemted counRestarterTask tests --- .../quartz/task/CountRestarterTaskTest.java | 151 ++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskTest.java diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskTest.java new file mode 100644 index 000000000..5cd30d082 --- /dev/null +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskTest.java @@ -0,0 +1,151 @@ +package eu.arrowhead.core.qos.quartz.task; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.atLeastOnce; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.util.List; +import java.util.Map; + +import org.apache.logging.log4j.Logger; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.util.ReflectionTestUtils; + +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.core.qos.database.service.QoSDBService; + +@RunWith(SpringRunner.class) +public class CountRestarterTaskTest { + + //================================================================================================= + // members + @InjectMocks + private final CountRestarterTask counRestarterTask = new CountRestarterTask(); + + @Mock + private QoSDBService qoSDBService; + + @Mock + private Map arrowheadContext; + + @Mock + private JobExecutionContext jobExecutionContext; + + private Logger logger; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Before + public void setUp() throws Exception { + logger = mock(Logger.class); + ReflectionTestUtils.setField(counRestarterTask, "logger", logger); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteServerIsInStandalonMode() { + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(true); + + doNothing().when(qoSDBService).updateCountStartedAt(); + + try { + + counRestarterTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(qoSDBService, times(0)).updateCountStartedAt(); + + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testExecute() { + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + + doNothing().when(qoSDBService).updateCountStartedAt(); + + try { + + counRestarterTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(qoSDBService, times(1)).updateCountStartedAt(); + + } + + + //------------------------------------------------------------------------------------------------- + @Test(expected = ArrowheadException.class) + public void testExecuteUpdateCountStartedAtThrowsException() { + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + + doThrow(ArrowheadException.class).when(qoSDBService).updateCountStartedAt(); + + try { + + counRestarterTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + + fail(); + + }catch (final ArrowheadException ex) { + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(qoSDBService, times(1)).updateCountStartedAt(); + + throw ex; + } + + } +} From 5ed6dec2bc7593aff3f92f51f777341d61580c47 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 10 Feb 2020 14:49:12 +0100 Subject: [PATCH 170/301] removed CloudPingTask skeletons --- .../core/qos/quartz/task/CloudPingTask.java | 50 ------------ .../qos/quartz/task/CloudPingTaskConfig.java | 80 ------------------- 2 files changed, 130 deletions(-) delete mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTask.java delete mode 100644 qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTaskConfig.java diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTask.java deleted file mode 100644 index 3e040a1d8..000000000 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTask.java +++ /dev/null @@ -1,50 +0,0 @@ -package eu.arrowhead.core.qos.quartz.task; - -import java.util.Map; - -import javax.annotation.Resource; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.quartz.DisallowConcurrentExecution; -import org.quartz.Job; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; -import org.springframework.stereotype.Component; - -import eu.arrowhead.common.CommonConstants; -import eu.arrowhead.common.CoreCommonConstants; - -@Component -@DisallowConcurrentExecution -public class CloudPingTask implements Job { - - //================================================================================================= - // members - - @Resource(name = CommonConstants.ARROWHEAD_CONTEXT) - private Map arrowheadContext; - protected Logger logger = LogManager.getLogger(CloudPingTask.class); - - //================================================================================================= - // methods - - //------------------------------------------------------------------------------------------------- - @Override - public void execute(final JobExecutionContext context) throws JobExecutionException { - logger.debug("STARTED: Intra cloud ping task"); - - if (arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)) { - - return; - } - - logger.debug("Finished: Intra cloud ping task"); - } - - //================================================================================================= - // assistant methods - - //------------------------------------------------------------------------------------------------- - -} \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTaskConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTaskConfig.java deleted file mode 100644 index d9fd608a2..000000000 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CloudPingTaskConfig.java +++ /dev/null @@ -1,80 +0,0 @@ -package eu.arrowhead.core.qos.quartz.task; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.quartz.SimpleTrigger; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.quartz.JobDetailFactoryBean; -import org.springframework.scheduling.quartz.SchedulerFactoryBean; -import org.springframework.scheduling.quartz.SimpleTriggerFactoryBean; - -import eu.arrowhead.common.CommonConstants; -import eu.arrowhead.common.CoreCommonConstants; -import eu.arrowhead.common.quartz.AutoWiringSpringBeanQuartzTaskFactory; - -@Configuration -public class CloudPingTaskConfig { - - //================================================================================================= - // members - - protected Logger logger = LogManager.getLogger(CloudPingTaskConfig.class); - - @Autowired - private ApplicationContext applicationContext; //NOSONAR - - @Value(CoreCommonConstants.$CLOUD_PING_TTL_INTERVAL_WD) - private int ttlInterval; - - private static final int SCHEDULER_DELAY = 5; - - private static final String NAME_OF_TRIGGER = "Cloud_Ping_Task_Trigger"; - private static final String NAME_OF_TASK = "Cloud_Ping_Task_Detail"; - - //================================================================================================= - // methods - - //------------------------------------------------------------------------------------------------- - @Bean - public SchedulerFactoryBean cloudPingSheduler() { - final AutoWiringSpringBeanQuartzTaskFactory jobFactory = new AutoWiringSpringBeanQuartzTaskFactory(); - jobFactory.setApplicationContext(applicationContext); - - final SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean(); - - schedulerFactory.setJobFactory(jobFactory); - schedulerFactory.setJobDetails(cloudPingTaskDetails().getObject()); - schedulerFactory.setTriggers(cloudPingTaskTrigger().getObject()); - schedulerFactory.setStartupDelay(SCHEDULER_DELAY); - logger.info("Cloud ping task adjusted with ttl interval: {} minutes", ttlInterval); - - return schedulerFactory; - } - - //------------------------------------------------------------------------------------------------- - @Bean - public SimpleTriggerFactoryBean cloudPingTaskTrigger() { - final SimpleTriggerFactoryBean trigger = new SimpleTriggerFactoryBean(); - trigger.setJobDetail(cloudPingTaskDetails().getObject()); - trigger.setRepeatInterval(ttlInterval * CommonConstants.CONVERSION_MILLISECOND_TO_MINUTE); - trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY); - trigger.setName(NAME_OF_TRIGGER); - - return trigger; - } - - //------------------------------------------------------------------------------------------------- - @Bean - public JobDetailFactoryBean cloudPingTaskDetails() { - final JobDetailFactoryBean jobDetailFactory = new JobDetailFactoryBean(); - jobDetailFactory.setJobClass(PingTask.class); - jobDetailFactory.setName(NAME_OF_TASK); - jobDetailFactory.setDurability(true); - - return jobDetailFactory; - } -} \ No newline at end of file From dd5f777635e900718e9543ba244bb8605ed4b034 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 10 Feb 2020 16:10:45 +0100 Subject: [PATCH 171/301] changed endWith to contains --- .../core/qos/security/QosMonitorAccessControlFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilter.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilter.java index 5650ded49..2aef9c5d3 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilter.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilter.java @@ -33,7 +33,7 @@ protected void checkClientAuthorized(final String clientCN, final String method, } else if ( requestTarget.contains( CoreCommonConstants.MGMT_URI ) ) { // Only the local System Operator can use these methods checkIfLocalSystemOperator(clientCN, cloudCN, requestTarget); - } else if (requestTarget.endsWith(CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT)) { + } else if (requestTarget.contains(CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT)) { // Only the specified core systems can use these methods checkIfClientIsAnAllowedCoreSystem(clientCN, cloudCN, allowedCoreSystemsForGetMeasurements, requestTarget); } From 9903370b08f026d082b6a21fad649ba4249ef1c5 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 10 Feb 2020 16:15:01 +0100 Subject: [PATCH 172/301] implemented QosMonitorAccessControlFilter tests --- .../core/qos/QoSMonitorControllerTest.java | 2 +- .../QosMonitorAccessControlFilterTest.java | 143 ++++++++++++++++++ .../test/resources/certificates/notvalid.pem | 20 +++ .../resources/certificates/orchestrator.pem | 20 +++ .../resources/certificates/other_cloud.pem | 19 +++ .../test/resources/certificates/provider.p12 | Bin 0 -> 6288 bytes .../test/resources/certificates/provider.pem | 20 +++ .../src/test/resources/certificates/valid.pem | 20 +++ 8 files changed, 243 insertions(+), 1 deletion(-) create mode 100644 qos-monitor/src/test/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilterTest.java create mode 100644 qos-monitor/src/test/resources/certificates/notvalid.pem create mode 100644 qos-monitor/src/test/resources/certificates/orchestrator.pem create mode 100644 qos-monitor/src/test/resources/certificates/other_cloud.pem create mode 100644 qos-monitor/src/test/resources/certificates/provider.p12 create mode 100644 qos-monitor/src/test/resources/certificates/provider.pem create mode 100644 qos-monitor/src/test/resources/certificates/valid.pem diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java index e3772c209..f68ba2513 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/QoSMonitorControllerTest.java @@ -223,7 +223,7 @@ public void getManagementPingMeasurementBySystemIdNoMeasurementInDBTest() throws } //================================================================================================= - // Test of getManagementPingMeasurementBySystemId + // Test of getPingMeasurementBySystemIdResponse //------------------------------------------------------------------------------------------------- @Test diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilterTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilterTest.java new file mode 100644 index 000000000..cb69aae17 --- /dev/null +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/security/QosMonitorAccessControlFilterTest.java @@ -0,0 +1,143 @@ +package eu.arrowhead.core.qos.security; + +import static org.junit.Assume.assumeTrue; +import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.x509; +import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.ApplicationContext; +import org.springframework.http.MediaType; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.web.context.WebApplicationContext; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; + +/** +* IMPORTANT: These tests may fail if the certificates are changed in the src/main/resources folder. +* +*/ +@RunWith(SpringRunner.class) +@SpringBootTest +@ContextConfiguration +@AutoConfigureMockMvc +public class QosMonitorAccessControlFilterTest { + + //================================================================================================= + // members + + private static final String QOS_MONITOR_ECHO_URI = CommonConstants.QOS_MONITOR_URI + CommonConstants.ECHO_URI; + + private static final String PING_MEASUREMENTS = "/ping/measurements"; + private static final String QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI = CommonConstants.QOS_MONITOR_URI + CoreCommonConstants.MGMT_URI + PING_MEASUREMENTS; + + @Autowired + private ApplicationContext appContext; + + @Value(CommonConstants.$SERVER_SSL_ENABLED_WD) + private boolean secure; + + @Autowired + private WebApplicationContext wac; + + private MockMvc mockMvc; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Before + public void setup() { + assumeTrue(secure); + + final QosMonitorAccessControlFilter qoSFilter = appContext.getBean(QosMonitorAccessControlFilter.class); + this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac) + .apply(springSecurity()) + .addFilters(qoSFilter) + .build(); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testEchoCertificateSameCloud() throws Exception { + this.mockMvc.perform(get(QOS_MONITOR_ECHO_URI) + .secure(true) + .with(x509("certificates/provider.pem")) + .accept(MediaType.TEXT_PLAIN)) + .andExpect(status().isOk()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testEchoCertificateOtherCloud() throws Exception { + this.mockMvc.perform(get(QOS_MONITOR_ECHO_URI) + .secure(true) + .with(x509("certificates/other_cloud.pem")) + .accept(MediaType.TEXT_PLAIN)) + .andExpect(status().isUnauthorized()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testMgmtGetPingMeasurementsCertificateSysop() throws Exception { + this.mockMvc.perform(get(QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI) + .secure(true) + .with(x509("certificates/valid.pem")) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testMgmtGetPingMeasurementsCertificateNotSysop() throws Exception { + this.mockMvc.perform(get(QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI) + .secure(true) + .with(x509("certificates/provider.pem")) + .accept(MediaType.TEXT_PLAIN)) + .andExpect(status().isUnauthorized()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testOPGetPingMeasurementsCertificateSysop() throws Exception { + + this.mockMvc.perform(get(CommonConstants.QOS_MONITOR_URI + CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT) + .secure(true) + .with(x509("certificates/valid.pem")) + .accept(MediaType.TEXT_PLAIN)) + .andExpect(status().isUnauthorized()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testOPGetPingMeasurementsCertificateNotSysop() throws Exception { + + this.mockMvc.perform(get(CommonConstants.QOS_MONITOR_URI + CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT) + .secure(true) + .with(x509("certificates/provider.pem")) + .accept(MediaType.TEXT_PLAIN)) + .andExpect(status().isUnauthorized()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testOPGetPingMeasurementsCertificateOrchestrator() throws Exception { + + this.mockMvc.perform(get(CommonConstants.QOS_MONITOR_URI + CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT + "/1") + .secure(true) + .with(x509("certificates/orchestrator.pem")) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()); + } +} diff --git a/qos-monitor/src/test/resources/certificates/notvalid.pem b/qos-monitor/src/test/resources/certificates/notvalid.pem new file mode 100644 index 000000000..a70c46837 --- /dev/null +++ b/qos-monitor/src/test/resources/certificates/notvalid.pem @@ -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dLlXq5 +MIgOK1ds2BekemekJ3VnW/TDj8fY6sxWl8aWFYJ1RhmVWTODiN9xu9XPyzAO5ryk +zG4AOQa5rQ== +-----END CERTIFICATE----- diff --git a/qos-monitor/src/test/resources/certificates/orchestrator.pem b/qos-monitor/src/test/resources/certificates/orchestrator.pem new file mode 100644 index 000000000..4792c5c6a --- /dev/null +++ b/qos-monitor/src/test/resources/certificates/orchestrator.pem @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDNjCCAh6gAwIBAgIEXOu9NTANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB10 +ZXN0Y2xvdWQyLmFpdGlhLmFycm93aGVhZC5ldTAeFw0xOTA1MjcxMDM0MjlaFw0y +OTA1MjcxMDM0MjlaMDUxMzAxBgNVBAMMKm9yY2hlc3RyYXRvci50ZXN0Y2xvdWQy +LmFpdGlhLmFycm93aGVhZC5ldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAK/alOuozKOwjr7UoXbtTTo1Lsf8y+3C3fEmUngB9I7k1rYq/1DvmMFf1Xdu +JXV98BL8AHIutsKpShSmNKtP8Kr8cAZyNby68J6/O78HUtJXoHgl0Eitws67m2No +NJh/ufXrPChDFThd44yZ7fouZgoiBThXN4DNixHrV/ANgdO+tv94H0sqFrFBzbis +xB55T9Kiy5arFuUq5QYpGEQqHiJUSavqk6T5DlYwasmet+tTksdYLn+cTpYcdmwW +8KVHU0whAECGbwoyW2o3GG/qpxopXJuGK3a9bT6jCgku1vQcAyYqbm0TWMJJnXzw +Q00IZx5mrfuBODbp1oruVDph1r8CAwEAAaNbMFkwDwYDVR0RBAgwBocEfwAAATAn +BgNVHSMEIDAegBQEME0II5M93mY9Flqn0cleI6aXT6EAggRc2WIZMB0GA1UdDgQW +BBRrbKDs28ZltCmzZyblUqx8itHUOzANBgkqhkiG9w0BAQsFAAOCAQEAVnFKZ8aw +TcFJEWFTrvnmbvgC7aICelOzSMcbRmyrLqAT0gpVB4sQqFqFNPmIhJo/ylHih+E0 +YZNqAUmso5ITX5xKcHb1j2LdBg29KZbXk0o5beK3eaDULKQpiyqyy4fT8MEEJ7Hu +AjCusxr5dQ7tiKZ9fhnXDa4XItKBp22j4B5LXppeuOUyASJ/B13erEPG9Dl7OVp1 +MXI0uHq4nj+mAqYpEZuY9vpW8gWuidfB3q9MDDwEtp8lWNnzGhhcQ2FitzmsepJz +qX4hnTYMr5zF1IJ5g3AuPxneAz0LL02jdh4HXYBXqm4SQEAb7y0ePCF9Zz+YfHf3 +JDHA7BSnLfNj/g== +-----END CERTIFICATE----- diff --git a/qos-monitor/src/test/resources/certificates/other_cloud.pem b/qos-monitor/src/test/resources/certificates/other_cloud.pem new file mode 100644 index 000000000..df59b780f --- /dev/null +++ b/qos-monitor/src/test/resources/certificates/other_cloud.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDJjCCAg6gAwIBAgIEXNlxczANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB10 +ZXN0Y2xvdWQxLmFpdGlhLmFycm93aGVhZC5ldTAeFw0xOTA1MTMxMzMwMjdaFw0y +OTA1MTMxMzMwMjdaMDYxNDAyBgNVBAMMK2F1dGhvcml6YXRpb24udGVzdGNsb3Vk +MS5haXRpYS5hcnJvd2hlYWQuZXUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQC28nZZkdduX5SN7SLI8e6ZLSxDSWxVJo9D05jw5xK33lDLvlcAXRvWUf4o +liKwEdiFWd7HK8Qe0xOXUCw9FJjyG48i2FxqoBm6JZEbR93YQqCJcdRnc+F7Yutx +74yvJ+8W2j665QuyyU8lp6/lixKdllYyEhYoUTr88RB0cNEWJ6ZhVJCwRcqGTztm +RRW0AITYClOVqoNjrbeTmKjLihJ/HntpBwxLxBkU+BMWrxF7fSkgz5sJbIDn01T7 +e2vuVkQz55ik95KBm9UZr9lAYs5EI4tayb5QBiUmySoHnRlBo6VHreoUONptoc00 +aOg8oQX3y+AcXd6JHmAsYaxF+Np3AgMBAAGjSjBIMCcGA1UdIwQgMB6AFPSMD0gI +GB689KvzqgS9Uny4NqYloQCCBFzZcN8wHQYDVR0OBBYEFKuCJTxiQGnrChpQMplZ +LtqpXr5GMA0GCSqGSIb3DQEBCwUAA4IBAQBsF+ysFxscz5jZPRP9Y1xdpI1C2EJ4 +6CliDzRhpbjEGiRGbPR72HohJyRLZ4AiZPnD0n5kKJ7B75VyRH+bOM7jmEgKiqLV +uJNneY0jywWXGdUhtZMw40MGAi9KLSlISyyZ4ID/bHi6IjBFDiYR0e49AGqxvHlK +yL97ZJkC/u4WO16CLjcKtW94SpDP9Y4J27VEWNuSLSrEOJjexxWWxOoj+pcxGeip ++xfz1CE2nDSLyyomZwv/XwFDQZoRsPte0Cj9x+kA0P9Yiqs/nTfgxzMgpeNk7G5u +tYaehDT5o9+oLTA6cx+T4nuzN3ZvM59m4cOuHwJxCTgaK10c7e0+IvQ+ +-----END CERTIFICATE----- diff --git a/qos-monitor/src/test/resources/certificates/provider.p12 b/qos-monitor/src/test/resources/certificates/provider.p12 new file mode 100644 index 0000000000000000000000000000000000000000..02d928fae043c634951730c5530b42e630988b8b GIT binary patch literal 6288 zcmY*)Ra6|nmTluSgy0_B-95MyT!Mt)jT788xJx6!A-KB)2=4Cg(nxT(28KK9y_q#1 zr_Nqms{VGd2NFcX!oaZy5=bKg8AIhl@6lk8U~&Tqc;N#HINxbj_CSQ5|05yP!v`W% zztiRKQ;dlE|56`NU|@3t;h)(9;qTcQ5K;a={eC$yJkGgUCHhsR&qwq4LkJ)7y3YCj zpbsn@pjQ<>5PpdN8JyTalGSNxAjfaBM$!U^v$>F*iWZ2wKv9MoFS)u|*$6K3i%}G~$17pU@$9Wx%R8XnX&v9Z{^X zOhZhJ=dDi{K8*fFg#-}Y=(2z1LKZ7zyQAKAD6$bz5i^99U{f3h_%uI2JOmk!*QhZ1 zV1*Ap^#7%76x+Kq)mFf99H2Ze;@Nz2xj}SAt*%C+yv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%6*CY)i(I3!Hw;9A-yQue&2ygw>v6lvkKwrPEj=&F@n zgq?yNh={=S5e}9J0RWE!R=E|8XAWM>go#i17JQQe@2}PZkK^+F58?3M$EcQbqA`^K Q*sLtQjvH7wn9$t+0%`LIcK`qY literal 0 HcmV?d00001 diff --git a/qos-monitor/src/test/resources/certificates/provider.pem b/qos-monitor/src/test/resources/certificates/provider.pem new file mode 100644 index 000000000..5b9199f67 --- /dev/null +++ b/qos-monitor/src/test/resources/certificates/provider.pem @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDLTCCAhWgAwIBAgIEXNlkcjANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB10 +ZXN0Y2xvdWQyLmFpdGlhLmFycm93aGVhZC5ldTAeFw0xOTA1MTMxMjM0NThaFw0y +OTA1MTMxMjM0NThaMD0xOzA5BgNVBAMMMmNsaWVudC1kZW1vLXByb3ZpZGVyLnRl +c3RjbG91ZDIuYWl0aWEuYXJyb3doZWFkLmV1MIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA1aaeuv1I4bF5dxMIvUvLMxjRn309kdJewIIH08DfL17/LSss +D70ZaLz0yxNfbPPQpFK8LMK+HQHDiGZH5yp4qJDuEgfmUrqWibnBIBc/K3Ob45lQ +y0zdFVtFsVJYBFVymQwgxJT6th0hI3RGLbCJMzbmpDzT7g0IDsN+64tMyi08ZCPr +qk99uzYgioSSWNb9bhG2Z9646b3oiY5utQWRhP/2z/t6vVJHtRYeyaXPl6Z2M/5K +njpSvpSeZQhNrw+Is1DEE5DHiEjfQFWrLwDOqPKDrvmFyIlJ7P7OCMax6dIlSB7G +EQSSP+j4eIxDWgjm+Pv/c02UVDc0x3xX/UGtNwIDAQABo0owSDAnBgNVHSMEIDAe +gBQEME0II5M93mY9Flqn0cleI6aXT6EAggRc2WIZMB0GA1UdDgQWBBR1hYLJm0+k ++C7QJqQ6rCtDwdHT1DANBgkqhkiG9w0BAQsFAAOCAQEAFJYhz2/SP4GKp3RyOIXF +3KUeITfcEmFOI0gDkbG91T1RIt5R7zesWuiBuHkzj8Dqx5D5Hx4cu8wUV67Xyao1 +O13HaplbAQ0JY6+KPw6NjBUnCAybv0W1lgFvwtRA0HYkP55dkfGz3h8F7GV0hIpX +EX6lQiXxpwrdsdDYag1J/DCoYRG26Pw+pgraYYctIlBfO/E/gZiM7iYPcuj1TgUQ +ovIDOyZbnL/h0em4kLuPFFmtYr0k6gDljkNerROC5AIaMCAjhXMxgujtfeJuts6X +Sglgm11S0K86ZVwQ/pc+eCmXXj+3/tMV401g1ptKltdS8eC2pAeWV4D7HuJUNpcH +cw== +-----END CERTIFICATE----- diff --git a/qos-monitor/src/test/resources/certificates/valid.pem b/qos-monitor/src/test/resources/certificates/valid.pem new file mode 100644 index 000000000..56eae293d --- /dev/null +++ b/qos-monitor/src/test/resources/certificates/valid.pem @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDLzCCAhegAwIBAgIEXPYrATANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB10 +ZXN0Y2xvdWQyLmFpdGlhLmFycm93aGVhZC5ldTAeFw0xOTA2MDQwODI1MzdaFw0y +MDA2MDMwODI1MzdaMC4xLDAqBgNVBAMMI3N5c29wLnRlc3RjbG91ZDIuYWl0aWEu +YXJyb3doZWFkLmV1MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoCoC +WTjB+UIi8WC8+mynAwDpC74ddxCFRt1ugnTSaW2HGJY57mZRmft/APhy7C+HyXyz +j77K6TCkr9jXxAykrkGhybdJ3ITNulolZImH2Vz8WHbmcvcKotdOvVexNou72LKi +RMrboIxIRJPtTta7RbhmVyIrTVElAVDWFjZHP7K98AhoGa3ADp0xbh0qK1BpuCnP +Km64DbY52zwr58mSaeyL7MgE+dWwWHx9r4X/WI7/2qQIio8DTvx36PHGKurtwpxa +V0o+gQ+Q1YcD1mfSHp3xtYQAnZXRLIjaDd7LGWMG7j3HbqukkjThyKrUCKfrKXQF +ItBUJ58PJJq8sTxoLwIDAQABo1swWTAPBgNVHREECDAGhwR/AAABMCcGA1UdIwQg +MB6AFAQwTQgjkz3eZj0WWqfRyV4jppdPoQCCBFzZYhkwHQYDVR0OBBYEFAVG6MVZ +FFyHQXW6qlQWA4EfXWSIMA0GCSqGSIb3DQEBCwUAA4IBAQBUEExzkf2bH4fF/tyP +r7DxO94aqQOySGJq/25DzfZQOpuK5Ud3MPpXSlxYw+MB5rRDJu0NzGUX+ha4mG3T +dXxd3X2QaDFR0SYUD4J0hTtmYp9TzgCXnU+J7t6sku/LYFJrCl5m4o124ShZXBgR +Dj/gDVd4C6InTPhpIPHaD6D97wKyObbC3V1dGiVs5Z5/+wUJdUFUmnfAb1rbX0nV +0TTKluWTtRT4cjBeIFs7MZiThMx8bgSE4mZIC1ry4PikjAap/oEIQVxbBTbl+5q8 +xhPbPn+JhZwQp39a1oPMEQog0wQhtKvZrYx//H1o3mzRo1ZFzL+R/LCKKElMPMXx +UHKC +-----END CERTIFICATE----- From ff6982b02bfde97c17a037090cea7681b142ca44 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Tue, 11 Feb 2020 11:28:35 +0100 Subject: [PATCH 173/301] reformat, refactor --- .../core/authorization/AuthorizationController.java | 1 - .../database/service/AuthorizationDBService.java | 4 ++-- .../authorization/security/AuthSecurityConfig.java | 1 - .../authorization/token/TokenGenerationService.java | 7 ++++--- .../src/main/resources/application.properties | 4 ++-- .../AuthorizationControllerInterCloudTest.java | 4 ++-- .../AuthorizationControllerIntraCloudTest.java | 2 +- .../StandaloneModeInAuthorizationTests.java | 1 - .../AuthorizationDBServiceInterCloudTest.java | 10 +++++----- .../AuthorizationDBServiceIntraCloudTest.java | 8 ++++---- .../eu/arrowhead/common/ApplicationInitListener.java | 2 +- .../orchestrator/service/OrchestratorService.java | 12 ++++++++++++ 12 files changed, 33 insertions(+), 23 deletions(-) diff --git a/authorization/src/main/java/eu/arrowhead/core/authorization/AuthorizationController.java b/authorization/src/main/java/eu/arrowhead/core/authorization/AuthorizationController.java index 63c15435d..9d4b49e5e 100644 --- a/authorization/src/main/java/eu/arrowhead/core/authorization/AuthorizationController.java +++ b/authorization/src/main/java/eu/arrowhead/core/authorization/AuthorizationController.java @@ -669,7 +669,6 @@ private void checkTokenGenerationProviderDTO(final TokenGenerationProviderDTO pr if (provider.getTokenDuration() <= 0) { provider.setTokenDuration(-1); } - } //------------------------------------------------------------------------------------------------- diff --git a/authorization/src/main/java/eu/arrowhead/core/authorization/database/service/AuthorizationDBService.java b/authorization/src/main/java/eu/arrowhead/core/authorization/database/service/AuthorizationDBService.java index 81ea655b3..85ccbcd41 100644 --- a/authorization/src/main/java/eu/arrowhead/core/authorization/database/service/AuthorizationDBService.java +++ b/authorization/src/main/java/eu/arrowhead/core/authorization/database/service/AuthorizationDBService.java @@ -629,7 +629,7 @@ private List createBulkAuthorizationIntraCloudWithOnePr checkConstraintsOfAuthorizationIntraCloudTable(consumer, provider, service); toBeSaved.add(new AuthorizationIntraCloud(consumer, provider, service)); } catch (final InvalidParameterException ex) { - //not throwing towards as in this bulk operation case should be only a warning + // not throwing towards as in this bulk operation case should be only a warning logger.debug(ex.getMessage()); } } else { @@ -784,7 +784,7 @@ private List createBulkAuthorizationInterCloudWithOneSe checkConstraintsOfAuthorizationInterCloudTable(cloud, provider, service); toBeSaved.add(new AuthorizationInterCloud(cloud, provider, service)); } catch (final InvalidParameterException ex) { - //not throwing towards as in this bulk operation case should be only a warning + // not throwing towards as in this bulk operation case should be only a warning logger.debug(ex.getMessage()); } } else { diff --git a/authorization/src/main/java/eu/arrowhead/core/authorization/security/AuthSecurityConfig.java b/authorization/src/main/java/eu/arrowhead/core/authorization/security/AuthSecurityConfig.java index 9cfe85970..a82654572 100644 --- a/authorization/src/main/java/eu/arrowhead/core/authorization/security/AuthSecurityConfig.java +++ b/authorization/src/main/java/eu/arrowhead/core/authorization/security/AuthSecurityConfig.java @@ -8,5 +8,4 @@ @Configuration @EnableWebSecurity public class AuthSecurityConfig extends DefaultSecurityConfig { - } \ No newline at end of file diff --git a/authorization/src/main/java/eu/arrowhead/core/authorization/token/TokenGenerationService.java b/authorization/src/main/java/eu/arrowhead/core/authorization/token/TokenGenerationService.java index ac4215250..5a510b81a 100644 --- a/authorization/src/main/java/eu/arrowhead/core/authorization/token/TokenGenerationService.java +++ b/authorization/src/main/java/eu/arrowhead/core/authorization/token/TokenGenerationService.java @@ -44,6 +44,7 @@ public class TokenGenerationService { private final Logger logger = LogManager.getLogger(TokenGenerationService.class); + private static final String DOT = "."; private static final String JWT_CONTENT_TYPE = "JWT"; @Value(CommonConstants.$SERVER_SSL_ENABLED_WD) @@ -170,7 +171,7 @@ private void checkTokenGeneratorionProviderDTO(final TokenGenerationProviderDTO for (final String intf : provider.getServiceInterfaces()) { if (!interfaceNameVerifier.isValid(intf)) { - throw new InvalidParameterException("Specified interface name is not valid: " + intf + "."); + throw new InvalidParameterException("Specified interface name is not valid: " + intf + DOT); } } } @@ -190,14 +191,14 @@ private String generateConsumerInfo(final SystemRequestDTO consumer, final Cloud final StringBuilder sb = new StringBuilder(consumer.getSystemName()); if (consumerCloud != null) { - sb.append(".").append(consumerCloud.getName().trim()).append(".").append(consumerCloud.getOperator().trim()); + sb.append(DOT).append(consumerCloud.getName().trim()).append(DOT).append(consumerCloud.getOperator().trim()); } else { // need to use own cloud information if (Utilities.isEmpty(ownCloudName)) { initOwnCloudInfo(); } - sb.append(".").append(ownCloudName).append(".").append(ownCloudOperator); + sb.append(DOT).append(ownCloudName).append(DOT).append(ownCloudOperator); } return sb.toString().toLowerCase(); diff --git a/authorization/src/main/resources/application.properties b/authorization/src/main/resources/application.properties index e5921426f..ae4c9157c 100644 --- a/authorization/src/main/resources/application.properties +++ b/authorization/src/main/resources/application.properties @@ -61,6 +61,6 @@ server.ssl.trust-store-type=PKCS12 server.ssl.trust-store=classpath:certificates/truststore.p12 server.ssl.trust-store-password=123456 -#If true, http client does not check whether the hostname is match one of the server's SAN in its certificate -#Just for testing, DO NOT USE this feature in production environment +# If true, http client does not check whether the hostname is match one of the server's SAN in its certificate +# Just for testing, DO NOT USE this feature in production environment disable.hostname.verifier=false \ No newline at end of file diff --git a/authorization/src/test/java/eu/arrowhead/core/authorization/AuthorizationControllerInterCloudTest.java b/authorization/src/test/java/eu/arrowhead/core/authorization/AuthorizationControllerInterCloudTest.java index 41ac703e7..18e58e886 100644 --- a/authorization/src/test/java/eu/arrowhead/core/authorization/AuthorizationControllerInterCloudTest.java +++ b/authorization/src/test/java/eu/arrowhead/core/authorization/AuthorizationControllerInterCloudTest.java @@ -435,7 +435,7 @@ public void testCheckAuthorizationInterCloudRequestDBCall() throws Exception { //------------------------------------------------------------------------------------------------- private List createIdList(final int firstNum, final int lastNum) { - final List idList = new ArrayList<>(lastNum); + final List idList = new ArrayList<>(lastNum - firstNum + 1); for (int i = firstNum; i <= lastNum; ++i) { idList.add((long) i); } @@ -449,7 +449,7 @@ private Page createPageForMockingAuthorizationDBService final Cloud cloud = getValidTestCloud(); final System provider = new System("testSystem", "testAddr", 2000, "TOKEN"); for (int i = 1; i <= numberOfRequestedEntry; ++i) { - final ServiceDefinition serviceDefinition = new ServiceDefinition("testService"+i); + final ServiceDefinition serviceDefinition = new ServiceDefinition("testService" + i); serviceDefinition.setId(i); serviceDefinition.setCreatedAt(zdTime); serviceDefinition.setUpdatedAt(zdTime); diff --git a/authorization/src/test/java/eu/arrowhead/core/authorization/AuthorizationControllerIntraCloudTest.java b/authorization/src/test/java/eu/arrowhead/core/authorization/AuthorizationControllerIntraCloudTest.java index e4fe7b858..cc36f6f22 100644 --- a/authorization/src/test/java/eu/arrowhead/core/authorization/AuthorizationControllerIntraCloudTest.java +++ b/authorization/src/test/java/eu/arrowhead/core/authorization/AuthorizationControllerIntraCloudTest.java @@ -511,7 +511,7 @@ private Page createPageForMockingAuthorizationDBService //------------------------------------------------------------------------------------------------- private List createIdList(final int firstNum, final int lastNum) { - final List idList = new ArrayList<>(lastNum); + final List idList = new ArrayList<>(lastNum - firstNum + 1); for (int i = firstNum; i <= lastNum; ++i) { idList.add((long) i); } diff --git a/authorization/src/test/java/eu/arrowhead/core/authorization/StandaloneModeInAuthorizationTests.java b/authorization/src/test/java/eu/arrowhead/core/authorization/StandaloneModeInAuthorizationTests.java index 3f9dfa70e..6b0cdf6ff 100644 --- a/authorization/src/test/java/eu/arrowhead/core/authorization/StandaloneModeInAuthorizationTests.java +++ b/authorization/src/test/java/eu/arrowhead/core/authorization/StandaloneModeInAuthorizationTests.java @@ -6,5 +6,4 @@ @Component public class StandaloneModeInAuthorizationTests extends StandaloneModeInTests { - } \ No newline at end of file diff --git a/authorization/src/test/java/eu/arrowhead/core/authorization/database/service/AuthorizationDBServiceInterCloudTest.java b/authorization/src/test/java/eu/arrowhead/core/authorization/database/service/AuthorizationDBServiceInterCloudTest.java index 31a889dad..08f953943 100644 --- a/authorization/src/test/java/eu/arrowhead/core/authorization/database/service/AuthorizationDBServiceInterCloudTest.java +++ b/authorization/src/test/java/eu/arrowhead/core/authorization/database/service/AuthorizationDBServiceInterCloudTest.java @@ -73,7 +73,7 @@ public class AuthorizationDBServiceInterCloudTest { // methods //================================================================================================= - //Tests of getAuthorizationInterCloudEntries + // Tests of getAuthorizationInterCloudEntries //------------------------------------------------------------------------------------------------- @Test @@ -90,7 +90,7 @@ public void testGetAuthorizationInterCloudEntriesWithNotValidSortField() { } //================================================================================================= - //Tests of getAuthorizationInterCloudEntryById + // Tests of getAuthorizationInterCloudEntryById //------------------------------------------------------------------------------------------------- @Test(expected = InvalidParameterException.class) @@ -100,7 +100,7 @@ public void testGetAuthorizationInterCloudEntryByIdWithNotExistingId() { } //================================================================================================= - //Tests of removeAuthorizationInterCloudEntryById + // Tests of removeAuthorizationInterCloudEntryById //------------------------------------------------------------------------------------------------- @Test(expected = InvalidParameterException.class) @@ -110,7 +110,7 @@ public void testRemoveAuthorizationInterCloudEntryByIdWithNotExistingId() { } //================================================================================================= - //Tests of createBulkAuthorizationInterCloud + // Tests of createBulkAuthorizationInterCloud //------------------------------------------------------------------------------------------------- @Test(expected = InvalidParameterException.class) @@ -224,7 +224,7 @@ public void testCreateBulkAuthorizationInterCloudDBCall() { } //================================================================================================= - //Tests of checkAuthorizationInterCloudResponse + // Tests of checkAuthorizationInterCloudResponse //------------------------------------------------------------------------------------------------- @Test(expected = InvalidParameterException.class) diff --git a/authorization/src/test/java/eu/arrowhead/core/authorization/database/service/AuthorizationDBServiceIntraCloudTest.java b/authorization/src/test/java/eu/arrowhead/core/authorization/database/service/AuthorizationDBServiceIntraCloudTest.java index ce14de33c..71760a404 100644 --- a/authorization/src/test/java/eu/arrowhead/core/authorization/database/service/AuthorizationDBServiceIntraCloudTest.java +++ b/authorization/src/test/java/eu/arrowhead/core/authorization/database/service/AuthorizationDBServiceIntraCloudTest.java @@ -65,7 +65,7 @@ public class AuthorizationDBServiceIntraCloudTest { // methods //================================================================================================= - //Tests of getAuthorizationIntraCloudEntries + // Tests of getAuthorizationIntraCloudEntries //------------------------------------------------------------------------------------------------- @Test @@ -82,7 +82,7 @@ public void testGetAuthorizationIntraCloudEntriesWithNotValidSortField() { } //================================================================================================= - //Tests of getAuthorizationIntraCloudEntryById + // Tests of getAuthorizationIntraCloudEntryById //------------------------------------------------------------------------------------------------- @Test(expected = InvalidParameterException.class) @@ -92,7 +92,7 @@ public void testGetAuthorizationIntraCloudEntryByIdWithNotExistingId() { } //================================================================================================= - //Tests of removeAuthorizationIntraCloudEntryById + // Tests of removeAuthorizationIntraCloudEntryById //------------------------------------------------------------------------------------------------- @Test(expected = InvalidParameterException.class) @@ -102,7 +102,7 @@ public void testRemoveAuthorizationIntraCloudEntryByIdWithNotExistingId() { } //================================================================================================= - //Tests of createBulkAuthorizationIntraCloud + // Tests of createBulkAuthorizationIntraCloud //------------------------------------------------------------------------------------------------- @Test(expected = InvalidParameterException.class) diff --git a/core-common/src/main/java/eu/arrowhead/common/ApplicationInitListener.java b/core-common/src/main/java/eu/arrowhead/common/ApplicationInitListener.java index be8b61a76..d1ecee8d7 100644 --- a/core-common/src/main/java/eu/arrowhead/common/ApplicationInitListener.java +++ b/core-common/src/main/java/eu/arrowhead/common/ApplicationInitListener.java @@ -219,7 +219,7 @@ private void registerCoreSystemServicesToServiceRegistry(final ApplicationContex final ServiceQueryFormDTO queryForm = new ServiceQueryFormDTO.Builder(coreService.getServiceDefinition()).build(); final ResponseEntity queryResponse = httpService.sendRequest(queryUri, HttpMethod.POST, ServiceQueryResultDTO.class, queryForm); - for (final ServiceRegistryResponseDTO result : queryResponse.getBody().getServiceQueryData()) { // stucked entries + for (final ServiceRegistryResponseDTO result : queryResponse.getBody().getServiceQueryData()) { // old, possibly obsolete entries final UriComponents unregisterUri = createUnregisterUri(scheme, coreService, result.getProvider().getAddress(), result.getProvider().getPort()); httpService.sendRequest(unregisterUri, HttpMethod.DELETE, Void.class); } diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java index 4372510ed..edb497728 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java @@ -291,6 +291,9 @@ public OrchestrationResponseDTO dynamicOrchestration(final OrchestrationFormRequ List orList = compileOrchestrationResponse(queryData, request); orList = qosManager.filterReservedProviders(orList, request.getRequesterSystem()); + if (orList.isEmpty()) { + return new OrchestrationResponseDTO(); + } final boolean needReservation = qosEnabled && flags.get(Flag.ENABLE_QOS) && request.getCommands().containsKey(OrchestrationFormRequestDTO.QOS_COMMAND_EXCLUSIVITY); @@ -300,10 +303,16 @@ public OrchestrationResponseDTO dynamicOrchestration(final OrchestrationFormRequ if (flags.get(Flag.ENABLE_QOS)) { orList = qosManager.verifyServices(orList, request); + if (orList.isEmpty()) { + return new OrchestrationResponseDTO(); + } } if (!needReservation) { orList = qosManager.filterReservedProviders(orList, request.getRequesterSystem()); + if (orList.isEmpty()) { + return new OrchestrationResponseDTO(); + } } if (qosEnabled) { @@ -311,6 +320,9 @@ public OrchestrationResponseDTO dynamicOrchestration(final OrchestrationFormRequ orList = orchestratorDriver.generateAuthTokens(request, orList); if (!needReservation) { orList = qosManager.filterReservedProviders(orList, request.getRequesterSystem()); + if (orList.isEmpty()) { + return new OrchestrationResponseDTO(); + } } } From 8751b3cbdf3753a140efc1d9b036bab5ef8fd8c4 Mon Sep 17 00:00:00 2001 From: Emanuel Palm Date: Tue, 11 Feb 2020 12:25:40 +0100 Subject: [PATCH 174/301] Update Docker documentation --- README.md | 40 ++++++++++++++++++++++++---------------- docker/README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 16 deletions(-) create mode 100644 docker/README.md diff --git a/README.md b/README.md index e8d3c42b1..3a957666d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,10 @@ Please be aware, that 4.1.3 is __NOT__ backwards compatible with 4.1.2. If you h ## Table of Contents 1. [Quick Start Guide](#quickstart) 1. [Docker](#quickstart_docker) - * [Handy Docker Commands](#quickstart_dockercommands) + * [System Requirements](#quickstart_dockersysreqs) + * [Examples](#quickstart_examples) + * [Guide](#quickstart_dockerguide) + * [Cheat-Sheet](#quickstart_dockercommands) * [Troubleshooting](#quickstart_dockertroubleshooting) 2. [Debian Installer](#quickstart_debian) 3. [Compile Code](#quickstart_compile) @@ -53,7 +56,13 @@ Please be aware, that 4.1.3 is __NOT__ backwards compatible with 4.1.2. If you h ### Docker -#### Requirements +[Docker](https://docs.docker.com/) is a container platform that can be used to package and deploy applications in server environments, among other. +In particular, the [`docker-compose`](https://docs.docker.com/compose/) utility may with advantage be used during application development to test integration with the Arrowhead Core systems. +Here, we provide brief instructions on how to install and run both Docker and container images for the Arrowhead Core systems. + + + +#### System Requirements > **Note:** A system with 4GB of RAM is advised. @@ -64,22 +73,21 @@ Please be aware, that 4.1.3 is __NOT__ backwards compatible with 4.1.2. If you h * [Windows](https://docs.docker.com/docker-for-windows/install/) * [Docker Compose](https://docs.docker.com/compose/install/) -Don't forget to create a volume for mysql: `docker volume create --name=mysql`
-Don't forget to copy the SQL init script next to the docker-compose file! On the first run it initializes the Database!
-Example copy command which does this for you, execute from the project root directory. -``` -cp scripts/create_empty_arrowhead_db.sql docker/ -``` +
-Inside the `docker` folder an example is provided. +#### Examples -##### Core System Config +We provide two examples of how Docker containers can be used to host Arrowhead Core systems in this repository. +The first one is located in the [`docker`](docker) folder and the second one in the [`docker-all`](docker-all) folder. +The former example shows how some prebuilt Docker images can be used to bring up networks, while the second describes how a Docker image can be constructed that contains all Arrowhead Core systems. +Please refer to those folders for more information. +In particular, each folder contains its own `README.md` file with more instructions. -Example Core System Configuration files are available in this folder. + -##### Docker Compose +#### Docker Guide -Example Docker Compose file is located here. The interesting part is the volumes section. +Example Docker Compose file is located [here](docker/docker-compose.yml). The interesting part is the volumes section. Format is /path/on/your/local/machine:/path/inside/docker/container You may want to copy the config files elsewhere with the compose file too. If you copy them, please don't forget to change the volume mounting point, but DON'T change the volume mounting point inside the container, otherwise it will start up with default config. @@ -99,9 +107,9 @@ If you change your config you have to restart the appropriate container `docker restart ` -` + -##### Handy Docker Commands +#### Docker Cheat-Sheet | Command | Description | | ------- | ----------- | @@ -109,6 +117,7 @@ If you change your config you have to restart the appropriate container | `docker images` | List all images | | `docker-compose up -d` | Starts the Docker containers | | `docker-compose down` | Destroys the Docker containers | +| `docker restart ` | Restarts a container, making it re-read its configuration files | | `docker logs ` | Shows logs for the container | | `docker volume create --name=` | Creates a named volume | | `docker volume rm ` | Removes the specified named volume | @@ -120,7 +129,6 @@ If you change your config you have to restart the appropriate container Q: MySQL won't start. What did went wrong?
A: Probably you missed to copy the init SQL script next to the compose file, or you have a typo in its name. Solution: [https://github.com/arrowhead-f/core-java-spring/issues/105](https://github.com/arrowhead-f/core-java-spring/issues/105) -
### Debian Installers diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 000000000..3b9d52afa --- /dev/null +++ b/docker/README.md @@ -0,0 +1,45 @@ +# Docker Compose Example Files + +This folder contains various files for setting up a network of Arrowhead Core systems, each located in its own Docker container. +Using the files requires you to follow the below steps: + +## Create Container Volumes + +In order for data to persist after shutting down your containers, you must use a so-called _Docker Volume_. +The one needed by the [`docker-compose.yml`](docker-compose.yml) file in this folder requires one to exist with the name `mysql`. +The following terminal command may be used to create such a volume: + +```sh +$ docker volume create --name=mysql +``` + +## Copy Initialization Scripts for the MySQL Database + +When the database container of the [`docker-compose.yml`](docker-compose.yml) starts, its database will be empty. +As the Arrowhead Core systems do not attempt to create the database tables themselves if they do not exist, you must make sure that they are created by the database container when it is started for the first time. +The following terminal command may be used, given that the root directory of this repository is the current working directory, to copy database initialization scripts to a location from which they will be read by the [`docker-compose.yml`](docker-compose.yml) file: + +```sh +$ cp scripts/create_empty_arrowhead_db.sql docker/ +``` + +## Configuring the Core Systems + +The [`core_system_config`](core_system_config) folder contains a collection of `.properties` files, each of which is passed to an Arrowhead Core system when the network described in [`docker-compose.yml`](docker-compose.yml) is brought up. +You may want to look at, or perhaps even edit, some of those files to get a better understanding of how the Arrowhead Core systems can be configured. +Editing them is not required, however, for the example network to run. + +## Running the Compose Script + +Having completed the above steps, you are ready to execute the following command from this directory: + +```sh +$ docker-compose up --build +``` + +To shut down the `docker_default` network you just started, use `CTRL-C`, or whatever keyboard combination is used to send the interrupt signal to Docker. +Afterwards, you may use the following command to clean up any remaining resources: + +```sh +$ docker-compose down +``` From d6864358c2924df6cb3fe614f37830d143d10a91 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Tue, 11 Feb 2020 12:55:32 +0100 Subject: [PATCH 175/301] reformat, refactor --- .../java/eu/arrowhead/common/core/CoreSystemService.java | 3 ++- .../common/database/entity/AuthorizationInterCloud.java | 4 ++-- .../common/database/entity/QoSIntraPingMeasurement.java | 6 +++--- .../eu/arrowhead/common/database/entity/Subscription.java | 3 +-- .../database/entity/SubscriptionPublisherConnection.java | 3 ++- ...uthorizationInterCloudInterfaceConnectionRepository.java | 1 - ...uthorizationIntraCloudInterfaceConnectionRepository.java | 1 - .../repository/AuthorizationIntraCloudRepository.java | 2 -- .../ChoreographerActionActionStepConnectionRepository.java | 1 - .../ChoreographerActionPlanActionConnectionRepository.java | 1 - ...pherActionStepServiceDefinitionConnectionRepository.java | 1 - .../repository/ChoreographerNextActionStepRepository.java | 1 - .../database/repository/CloudGatekeeperRelayRepository.java | 1 - .../database/repository/CloudGatewayRelayRepository.java | 1 - .../common/database/repository/EventTypeRepository.java | 2 +- .../ServiceRegistryInterfaceConnectionRepository.java | 1 - 16 files changed, 11 insertions(+), 21 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java index 1a8c3b100..a0008d51b 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java @@ -60,7 +60,8 @@ public enum CoreSystemService { //------------------------------------------------------------------------------------------------- private CoreSystemService(final String serviceDefinition, final String serviceUri) { - Assert.isTrue(!Utilities.isEmpty(serviceDefinition), serviceUri); + Assert.isTrue(!Utilities.isEmpty(serviceDefinition), "Service definition is null or blank"); + Assert.isTrue(!Utilities.isEmpty(serviceUri), "Service URI is null or blank"); this.serviceDefinition = serviceDefinition; this.serviceUri = serviceUri; diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/AuthorizationInterCloud.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/AuthorizationInterCloud.java index c54e1dbc1..b448cff6c 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/AuthorizationInterCloud.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/AuthorizationInterCloud.java @@ -25,12 +25,12 @@ @Entity @Table(uniqueConstraints = @UniqueConstraint(columnNames = {"consumerCloudId", "providerSystemId", "serviceId"})) public class AuthorizationInterCloud { - - public static final List SORTABLE_FIELDS_BY = List.of("id", "updatedAt", "createdAt"); //NOSONAR //================================================================================================= // members + public static final List SORTABLE_FIELDS_BY = List.of("id", "updatedAt", "createdAt"); //NOSONAR + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java index 47c581a58..49128a2b2 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/QoSIntraPingMeasurement.java @@ -125,9 +125,9 @@ public void onUpdate() { public void setMaxResponseTime(final Integer maxResponseTime) { this.maxResponseTime = maxResponseTime; } public void setMeanResponseTimeWithoutTimeout(final Integer meanResponseTimeWithoutTimeout) { this.meanResponseTimeWithoutTimeout = meanResponseTimeWithoutTimeout; } public void setMeanResponseTimeWithTimeout(final Integer meanResponseTimeWithTimeout) { this.meanResponseTimeWithTimeout = meanResponseTimeWithTimeout; } - public void setJitterWithTimeout(Integer jitterWithTimeout) { this.jitterWithTimeout = jitterWithTimeout; } - public void setJitterWithoutTimeout(Integer jitterWithoutTimeout) { this.jitterWithoutTimeout = jitterWithoutTimeout; } - public void setLostPerMeasurementPercent(Integer lostPerMeasurementPercent) { this.lostPerMeasurementPercent = lostPerMeasurementPercent; } + public void setJitterWithTimeout(final Integer jitterWithTimeout) { this.jitterWithTimeout = jitterWithTimeout; } + public void setJitterWithoutTimeout(final Integer jitterWithoutTimeout) { this.jitterWithoutTimeout = jitterWithoutTimeout; } + public void setLostPerMeasurementPercent(final Integer lostPerMeasurementPercent) { this.lostPerMeasurementPercent = lostPerMeasurementPercent; } public void setSent(final long sent) { this.sent = sent; } public void setReceived(final long received) { this.received = received; } public void setCountStartedAt(final ZonedDateTime countStartedAt) { this.countStartedAt = countStartedAt; } diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/Subscription.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/Subscription.java index 36c80d176..2f1e53ff1 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/Subscription.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/Subscription.java @@ -71,7 +71,6 @@ public class Subscription { @OneToMany(mappedBy = "subscriptionEntry", fetch = FetchType.EAGER, orphanRemoval = true) @OnDelete(action = OnDeleteAction.CASCADE) private Set publisherConnections = new HashSet<>(); - //================================================================================================= // methods @@ -126,7 +125,7 @@ public void onUpdate() { public void setFilterMetaData(final String filterMetaData) { this.filterMetaData = filterMetaData; } public void setNotifyUri(final String notifyUri) { this.notifyUri = notifyUri; } public void setMatchMetaData(final boolean matchMetaData) { this.matchMetaData = matchMetaData; } - public void setOnlyPredefinedPublishers( final boolean onlyPredefinedPublishers) { this.onlyPredefinedPublishers = onlyPredefinedPublishers; } + public void setOnlyPredefinedPublishers(final boolean onlyPredefinedPublishers) { this.onlyPredefinedPublishers = onlyPredefinedPublishers; } public void setStartDate(final ZonedDateTime startDate) { this.startDate = startDate; } public void setEndDate(final ZonedDateTime endDate) { this.endDate = endDate; } public void setCreatedAt(final ZonedDateTime createdAt) { this.createdAt = createdAt; } diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/SubscriptionPublisherConnection.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/SubscriptionPublisherConnection.java index 0ed4d6a45..a980828e8 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/SubscriptionPublisherConnection.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/SubscriptionPublisherConnection.java @@ -18,6 +18,7 @@ @Entity @Table(uniqueConstraints = @UniqueConstraint(columnNames = { "subscriptionId", "systemId" })) public class SubscriptionPublisherConnection { + //================================================================================================= // members @@ -33,7 +34,7 @@ public class SubscriptionPublisherConnection { @JoinColumn(name = "systemId", referencedColumnName = "id", nullable = false) private System system; - @Column(nullable = false ) + @Column(nullable = false) private boolean authorized = false; @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/AuthorizationInterCloudInterfaceConnectionRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/AuthorizationInterCloudInterfaceConnectionRepository.java index 8f411aebb..eb201a31d 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/AuthorizationInterCloudInterfaceConnectionRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/AuthorizationInterCloudInterfaceConnectionRepository.java @@ -6,5 +6,4 @@ @Repository public interface AuthorizationInterCloudInterfaceConnectionRepository extends RefreshableRepository { - } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/AuthorizationIntraCloudInterfaceConnectionRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/AuthorizationIntraCloudInterfaceConnectionRepository.java index baa3155ab..39042da56 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/AuthorizationIntraCloudInterfaceConnectionRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/AuthorizationIntraCloudInterfaceConnectionRepository.java @@ -6,5 +6,4 @@ @Repository public interface AuthorizationIntraCloudInterfaceConnectionRepository extends RefreshableRepository { - } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/AuthorizationIntraCloudRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/AuthorizationIntraCloudRepository.java index 35f9832c6..b18b93326 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/AuthorizationIntraCloudRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/AuthorizationIntraCloudRepository.java @@ -22,7 +22,5 @@ public interface AuthorizationIntraCloudRepository extends RefreshableRepository //------------------------------------------------------------------------------------------------- public Optional findByConsumerSystemAndProviderSystemAndServiceDefinition(final System consumer, final System provider, final ServiceDefinition serviceDefinition); - - //------------------------------------------------------------------------------------------------- public List findAllByConsumerSystem(final System consumer); } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/ChoreographerActionActionStepConnectionRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/ChoreographerActionActionStepConnectionRepository.java index 71e03f334..8b4f9b20b 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/ChoreographerActionActionStepConnectionRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/ChoreographerActionActionStepConnectionRepository.java @@ -5,5 +5,4 @@ @Repository public interface ChoreographerActionActionStepConnectionRepository extends RefreshableRepository { - } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/ChoreographerActionPlanActionConnectionRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/ChoreographerActionPlanActionConnectionRepository.java index bc26c4406..85047832d 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/ChoreographerActionPlanActionConnectionRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/ChoreographerActionPlanActionConnectionRepository.java @@ -6,5 +6,4 @@ @Repository public interface ChoreographerActionPlanActionConnectionRepository extends RefreshableRepository { - } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/ChoreographerActionStepServiceDefinitionConnectionRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/ChoreographerActionStepServiceDefinitionConnectionRepository.java index 34309477d..6710b9825 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/ChoreographerActionStepServiceDefinitionConnectionRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/ChoreographerActionStepServiceDefinitionConnectionRepository.java @@ -5,5 +5,4 @@ @Repository public interface ChoreographerActionStepServiceDefinitionConnectionRepository extends RefreshableRepository { - } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/ChoreographerNextActionStepRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/ChoreographerNextActionStepRepository.java index 8c6ae64df..4ff71485d 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/ChoreographerNextActionStepRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/ChoreographerNextActionStepRepository.java @@ -5,5 +5,4 @@ @Repository public interface ChoreographerNextActionStepRepository extends RefreshableRepository { - } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/CloudGatekeeperRelayRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/CloudGatekeeperRelayRepository.java index 9143b59fa..e4636f140 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/CloudGatekeeperRelayRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/CloudGatekeeperRelayRepository.java @@ -6,5 +6,4 @@ @Repository public interface CloudGatekeeperRelayRepository extends RefreshableRepository { - } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/CloudGatewayRelayRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/CloudGatewayRelayRepository.java index b9bf21e08..b1f980798 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/CloudGatewayRelayRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/CloudGatewayRelayRepository.java @@ -6,5 +6,4 @@ @Repository public interface CloudGatewayRelayRepository extends RefreshableRepository { - } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/EventTypeRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/EventTypeRepository.java index 4c6455222..7fb619237 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/EventTypeRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/EventTypeRepository.java @@ -14,4 +14,4 @@ public interface EventTypeRepository extends RefreshableRepository findByEventTypeName(final String eventTypeName); -} +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/ServiceRegistryInterfaceConnectionRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/ServiceRegistryInterfaceConnectionRepository.java index 0876b9051..f7382af49 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/ServiceRegistryInterfaceConnectionRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/ServiceRegistryInterfaceConnectionRepository.java @@ -6,5 +6,4 @@ @Repository public interface ServiceRegistryInterfaceConnectionRepository extends RefreshableRepository { - } \ No newline at end of file From bccda022ba826a1b10396511f3af10603a0bbce7 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Tue, 11 Feb 2020 13:32:44 +0100 Subject: [PATCH 176/301] refactor & reformat --- .../eu/arrowhead/common/dto/internal/CloudResponseDTO.java | 3 +++ .../arrowhead/common/dto/internal/ICNProposalRequestDTO.java | 2 +- .../common/dto/internal/QoSIntraMeasurementResponseDTO.java | 4 ++-- .../java/eu/arrowhead/common/dto/shared/CloudRequestDTO.java | 3 +++ .../arrowhead/common/dto/shared/PreferredProviderDataDTO.java | 4 ++-- .../common/dto/shared/ServiceRegistryRequestDTO.java | 2 +- .../arrowhead/common/dto/shared/SubscriptionResponseDTO.java | 4 ++-- .../java/eu/arrowhead/common/dto/shared/SystemRequestDTO.java | 3 +++ .../eu/arrowhead/common/dto/shared/SystemResponseDTO.java | 3 +++ 9 files changed, 20 insertions(+), 8 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/CloudResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/CloudResponseDTO.java index 6d966922a..d8e1baa66 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/CloudResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/CloudResponseDTO.java @@ -74,12 +74,15 @@ public boolean equals(final Object obj) { if (this == obj) { return true; } + if (obj == null) { return false; } + if (getClass() != obj.getClass()) { return false; } + final CloudResponseDTO other = (CloudResponseDTO) obj; return id == other.id; diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/ICNProposalRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/ICNProposalRequestDTO.java index b718e92b7..2e9d8747a 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/ICNProposalRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/ICNProposalRequestDTO.java @@ -80,7 +80,7 @@ public ICNProposalRequestDTO(final ServiceQueryFormDTO requestedService, final C public void setRequesterCloud(final CloudRequestDTO requesterCloud) { this.requesterCloud = requesterCloud; } public void setRequesterSystem(final SystemRequestDTO requesterSystem) { this.requesterSystem = requesterSystem; } public void setGatewayIsPresent(final boolean gatewayIsPresent) { this.gatewayIsPresent = gatewayIsPresent; } - public void setConsumerGatewayPublicKey(String consumerGatewayPublicKey) { this.consumerGatewayPublicKey = consumerGatewayPublicKey; } + public void setConsumerGatewayPublicKey(final String consumerGatewayPublicKey) { this.consumerGatewayPublicKey = consumerGatewayPublicKey; } //------------------------------------------------------------------------------------------------- public void setPreferredSystems(final List preferredSystems) { diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/QoSIntraMeasurementResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/QoSIntraMeasurementResponseDTO.java index 6641dc2e2..39c22e7be 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/QoSIntraMeasurementResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/QoSIntraMeasurementResponseDTO.java @@ -27,8 +27,8 @@ public class QoSIntraMeasurementResponseDTO implements Serializable { public QoSIntraMeasurementResponseDTO() {} //------------------------------------------------------------------------------------------------- - public QoSIntraMeasurementResponseDTO(final long id, final SystemResponseDTO system, final QoSMeasurementType measurementType, - final ZonedDateTime lastMeasurementAt, final ZonedDateTime createdAt, final ZonedDateTime updatedAt) { + public QoSIntraMeasurementResponseDTO(final long id, final SystemResponseDTO system, final QoSMeasurementType measurementType, final ZonedDateTime lastMeasurementAt, + final ZonedDateTime createdAt, final ZonedDateTime updatedAt) { this.id = id; this.system = system; diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CloudRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CloudRequestDTO.java index 798646856..877d0c55c 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CloudRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CloudRequestDTO.java @@ -52,12 +52,15 @@ public boolean equals(final Object obj) { if (this == obj) { return true; } + if (obj == null) { return false; } + if (getClass() != obj.getClass()) { return false; } + final CloudRequestDTO other = (CloudRequestDTO) obj; return Objects.equals(name, other.name) && Objects.equals(operator, other.operator); diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/PreferredProviderDataDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/PreferredProviderDataDTO.java index 7d0e3309c..cd659c94c 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/PreferredProviderDataDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/PreferredProviderDataDTO.java @@ -22,8 +22,8 @@ public class PreferredProviderDataDTO implements Serializable { public CloudRequestDTO getProviderCloud() { return providerCloud; } //------------------------------------------------------------------------------------------------- - public void setProviderSystem(SystemRequestDTO providerSystem) { this.providerSystem = providerSystem; } - public void setProviderCloud(CloudRequestDTO providerCloud) { this.providerCloud = providerCloud; } + public void setProviderSystem(final SystemRequestDTO providerSystem) { this.providerSystem = providerSystem; } + public void setProviderCloud(final CloudRequestDTO providerCloud) { this.providerCloud = providerCloud; } //------------------------------------------------------------------------------------------------- @JsonIgnore diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceRegistryRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceRegistryRequestDTO.java index 549df5cc8..a3900b0ff 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceRegistryRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceRegistryRequestDTO.java @@ -41,7 +41,7 @@ public class ServiceRegistryRequestDTO implements Serializable { public void setServiceUri(final String serviceUri) { this.serviceUri = serviceUri; } public void setEndOfValidity(final String endOfValidity) { this.endOfValidity = endOfValidity; } public void setSecure(final String secure) { this.secure = secure; } - public void setMetadata(Map metadata) { this.metadata = metadata; } + public void setMetadata(final Map metadata) { this.metadata = metadata; } public void setVersion(final Integer version) { this.version = version; } public void setInterfaces(final List interfaces) { this.interfaces = interfaces; } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SubscriptionResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SubscriptionResponseDTO.java index cfd5d964f..82e67caca 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SubscriptionResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SubscriptionResponseDTO.java @@ -68,6 +68,6 @@ public SubscriptionResponseDTO(final long id, final EventTypeResponseDTO eventTy public void setStartDate(final String startDate) { this.startDate = startDate; } public void setEndDate(final String endDate) { this.endDate = endDate; } public void setSources(final Set sources) { this.sources = sources; } - public void setCreatedAt( final String createdAt ) { this.createdAt = createdAt; } - public void setUpdatedAt( final String updatedAt ) { this.updatedAt = updatedAt; } + public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } + public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRequestDTO.java index 75b9e99b2..41c85de62 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRequestDTO.java @@ -42,12 +42,15 @@ public boolean equals(final Object obj) { if (this == obj) { return true; } + if (obj == null) { return false; } + if (getClass() != obj.getClass()) { return false; } + final SystemRequestDTO other = (SystemRequestDTO) obj; return Objects.equals(address, other.address) && Objects.equals(port, other.port) && Objects.equals(systemName, other.systemName); diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemResponseDTO.java index 2e6e037de..9528fa15d 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemResponseDTO.java @@ -69,12 +69,15 @@ public boolean equals(final Object obj) { if (this == obj) { return true; } + if (obj == null) { return false; } + if (getClass() != obj.getClass()) { return false; } + final SystemResponseDTO other = (SystemResponseDTO) obj; return Objects.equals(address, other.address) && Objects.equals(port, other.port) && Objects.equals(systemName, other.systemName); From f45263faf6ca1c063f4b26f2c6e1ff683f4d0726 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Tue, 11 Feb 2020 14:00:29 +0100 Subject: [PATCH 177/301] refactor --- .../arrowhead/common/log4j2/JDBCConnectionFactoryForLog4J2.java | 2 +- .../eu/arrowhead/common/quartz/uricrawler/UriCrawlerTask.java | 2 +- .../src/main/java/eu/arrowhead/common/token/TokenUtilities.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/log4j2/JDBCConnectionFactoryForLog4J2.java b/core-common/src/main/java/eu/arrowhead/common/log4j2/JDBCConnectionFactoryForLog4J2.java index 8252cde94..1ff7e0b01 100644 --- a/core-common/src/main/java/eu/arrowhead/common/log4j2/JDBCConnectionFactoryForLog4J2.java +++ b/core-common/src/main/java/eu/arrowhead/common/log4j2/JDBCConnectionFactoryForLog4J2.java @@ -57,7 +57,7 @@ public static Connection getConnection() throws SQLException { //------------------------------------------------------------------------------------------------- private static void init() throws IOException { InputStream propStream = null; - File propertiesFile = new File(CoreCommonConstants.APPLICATION_PROPERTIES); + final File propertiesFile = new File(CoreCommonConstants.APPLICATION_PROPERTIES); if (!propertiesFile.exists()) { propStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(CoreCommonConstants.APPLICATION_PROPERTIES); } else { diff --git a/core-common/src/main/java/eu/arrowhead/common/quartz/uricrawler/UriCrawlerTask.java b/core-common/src/main/java/eu/arrowhead/common/quartz/uricrawler/UriCrawlerTask.java index 32b001593..ac93c9db9 100644 --- a/core-common/src/main/java/eu/arrowhead/common/quartz/uricrawler/UriCrawlerTask.java +++ b/core-common/src/main/java/eu/arrowhead/common/quartz/uricrawler/UriCrawlerTask.java @@ -168,7 +168,7 @@ private boolean findCoreSystemServiceUri(final CoreSystemService coreSystemServi final ResponseEntity response = httpService.sendRequest(queryUri, HttpMethod.POST, ServiceQueryResultDTO.class, form); final ServiceQueryResultDTO result = response.getBody(); if (!result.getServiceQueryData().isEmpty()) { - final int lastIdx = result.getServiceQueryData().size() - 1; // to make sure we use the newest one if some entries stucked in the DB + final int lastIdx = result.getServiceQueryData().size() - 1; // to make sure we use the newest one if some old entries are in the DB final ServiceRegistryResponseDTO entry = result.getServiceQueryData().get(lastIdx); final String scheme = entry.getSecure() == ServiceSecurityType.NOT_SECURE ? CommonConstants.HTTP : CommonConstants.HTTPS; final UriComponents uri = Utilities.createURI(scheme, entry.getProvider().getAddress(), entry.getProvider().getPort(), entry.getServiceUri()); diff --git a/core-common/src/main/java/eu/arrowhead/common/token/TokenUtilities.java b/core-common/src/main/java/eu/arrowhead/common/token/TokenUtilities.java index 506f1f982..601875a92 100644 --- a/core-common/src/main/java/eu/arrowhead/common/token/TokenUtilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/token/TokenUtilities.java @@ -38,7 +38,7 @@ public class TokenUtilities { public static TokenInfo validateTokenAndExtractTokenInfo(final String token, final PublicKey authorizationPublicKey, final PrivateKey privateKey) { logger.debug("validateTokenAndExtractTokenInfo started..."); Assert.notNull(authorizationPublicKey, "Authorization public key is null."); - Assert.notNull(privateKey, "Caller's private key is null."); + Assert.notNull(privateKey, "Private key is null."); if (Utilities.isEmpty(token)) { throw new InvalidParameterException("No token is provided."); From 1b6721ac00543b7a586e64404fa553522ad3d9d1 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Tue, 11 Feb 2020 15:35:06 +0100 Subject: [PATCH 178/301] refactor --- .../database/service/EventHandlerDBService.java | 10 +++++----- .../service/EventHandlerDBServiceTest.java | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/database/service/EventHandlerDBService.java b/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/database/service/EventHandlerDBService.java index d5af25cea..ccedc3a96 100644 --- a/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/database/service/EventHandlerDBService.java +++ b/eventhandler/src/main/java/eu/arrowhead/core/eventhandler/database/service/EventHandlerDBService.java @@ -44,11 +44,11 @@ public class EventHandlerDBService { // members private static final String LESS_THAN_ONE_ERROR_MESSAGE= " must be greater than zero."; - private static final String NOT_AVAILABLE_SORTABLE_FIELD_ERROR_MESSAGE = " sortable field is not available."; + private static final String NOT_AVAILABLE_SORTABLE_FIELD_ERROR_MESSAGE = " sortable field is not available."; private static final String NOT_IN_DB_ERROR_MESSAGE = " is not available in database"; private static final String EMPTY_OR_NULL_ERROR_MESSAGE = " is empty or null"; private static final String NULL_ERROR_MESSAGE = " is null"; - private static final String VIOLATES_UNIQUE_CONSTRAINT = " violates uniqueConstraint rules"; + private static final String VIOLATES_UNIQUE_CONSTRAINT = " violates unique constraint rules"; private static final String IS_BEFORE_TOLERATED_DIFF_ERROR_MESSAGE = " is further in the past than the tolerated time difference"; private static final String INVALID_TYPE_ERROR_MESSAGE = " is not valid."; @@ -144,7 +144,7 @@ public Subscription getSubscriptionBySubscriptionRequestDTO(final SubscriptionRe try { final Optional subcriptionOptional = subscriptionRepository.findByEventTypeAndSubscriberSystem(subscription.getEventType(), subscription.getSubscriberSystem()); if (subcriptionOptional.isPresent()) { - return subcriptionOptional.get(); + return subcriptionOptional.get(); } else { throw new InvalidParameterException("Subscription with name '" + subscription.getSubscriberSystem().getSystemName() + "' and eventType '" + subscription.getEventType().getEventTypeName() + "' not exists"); @@ -357,7 +357,7 @@ private Subscription validateSubscriptionRequestDTO(final SubscriptionRequestDTO subscription.setOnlyPredefinedPublishers(request.getSources() != null && !request.getSources().isEmpty()); subscription.setMatchMetaData(request.getMatchMetaData()); if (subscription.isMatchMetaData() && (subscription.getFilterMetaData() == null || subscription.getFilterMetaData().isEmpty())) { - throw new InvalidParameterException("If MatchMetaData is true filterMetaData sould not be null or empty"); + throw new InvalidParameterException("If MatchMetaData is true filterMetaData should not be null or empty"); } if (request.getStartDate() != null) { @@ -408,7 +408,7 @@ private void validateDateLimits(final Subscription subscription) { if (start != null && end != null) { if (end.isBefore(start) || !end.isAfter(start)) { - throw new InvalidParameterException("Start Date sould be before End Date"); + throw new InvalidParameterException("Start Date should be before End Date"); } } } diff --git a/eventhandler/src/test/java/eu/arrowhead/core/eventhandler/database/service/EventHandlerDBServiceTest.java b/eventhandler/src/test/java/eu/arrowhead/core/eventhandler/database/service/EventHandlerDBServiceTest.java index 4c5d08e30..e42526736 100644 --- a/eventhandler/src/test/java/eu/arrowhead/core/eventhandler/database/service/EventHandlerDBServiceTest.java +++ b/eventhandler/src/test/java/eu/arrowhead/core/eventhandler/database/service/EventHandlerDBServiceTest.java @@ -260,7 +260,7 @@ public void testGetSubscriptionsResponseInvalidParameterSortField() { eventHandlerDBService.getSubscriptionsResponse(page, size, direction, sortField); } catch (final Exception ex) { verify(subscriptionRepository, never()).findAll(any(PageRequest.class)); - Assert.assertTrue(ex.getMessage().contains(" sortable field is not available." )); + Assert.assertTrue(ex.getMessage().contains(" sortable field is not available." )); throw ex; } } @@ -365,7 +365,7 @@ public void testGetSubscriptionsInvalidParameterSortField() { eventHandlerDBService.getSubscriptions(page, size, direction, sortField); } catch (final Exception ex) { verify(subscriptionRepository, never()).findAll(any(PageRequest.class)); - Assert.assertTrue(ex.getMessage().contains(" sortable field is not available.")); + Assert.assertTrue(ex.getMessage().contains(" sortable field is not available.")); throw ex; } } @@ -877,7 +877,7 @@ public void testGetSubscriptionBySubscriptionRequestDTOInvalidParameterEndDateIs verify(eventTypeRepository, times(1)).findByEventTypeName(any()); verify(eventTypeRepository, times(1)).saveAndFlush(any()); verify(subscriptionRepository, never()).findByEventTypeAndSubscriberSystem(any(), any()); - Assert.assertTrue(ex.getMessage().contains("Start Date sould be before End Date")); + Assert.assertTrue(ex.getMessage().contains("Start Date should be before End Date")); throw ex; } } @@ -907,7 +907,7 @@ public void testGetSubscriptionBySubscriptionRequestDTOInvalidParameterStartDate verify(eventTypeRepository, times(1)).findByEventTypeName(any()); verify(eventTypeRepository, times(1)).saveAndFlush(any()); verify(subscriptionRepository, times(0)).findByEventTypeAndSubscriberSystem(any(), any()); - Assert.assertTrue(ex.getMessage().contains("Start Date sould be before End Date")); + Assert.assertTrue(ex.getMessage().contains("Start Date should be before End Date")); throw ex; } } @@ -935,7 +935,7 @@ public void testGetSubscriptionBySubscriptionRequestDTOInvalidParameterMatchMeta verify(eventTypeRepository, times(1)).findByEventTypeName(any()); verify(eventTypeRepository, times(1)).saveAndFlush(any()); verify(subscriptionRepository, never()).findByEventTypeAndSubscriberSystem(any(), any()); - Assert.assertTrue(ex.getMessage().contains("If MatchMetaData is true filterMetaData sould not be null or empty")); + Assert.assertTrue(ex.getMessage().contains("If MatchMetaData is true filterMetaData should not be null or empty")); throw ex; } } @@ -963,7 +963,7 @@ public void testGetSubscriptionBySubscriptionRequestDTOInvalidParameterMatchMeta verify(eventTypeRepository, times(1)).findByEventTypeName(any()); verify(eventTypeRepository, times(1)).saveAndFlush(any()); verify(subscriptionRepository, never()).findByEventTypeAndSubscriberSystem(any(), any()); - Assert.assertTrue(ex.getMessage().contains("If MatchMetaData is true filterMetaData sould not be null or empty")); + Assert.assertTrue(ex.getMessage().contains("If MatchMetaData is true filterMetaData should not be null or empty")); throw ex; } } @@ -1132,7 +1132,7 @@ public void testRegisterSubscriptionInvalidParameterSubscriptionAllreadyInDB() { verify(subscriptionPublisherConnectionRepository, never()).saveAll(any()); verify(subscriptionPublisherConnectionRepository, never()).flush(); verify(subscriptionRepository, never()).saveAndFlush(any()); - Assert.assertTrue(ex.getMessage().contains("Subscription violates uniqueConstraint rules")); + Assert.assertTrue(ex.getMessage().contains("Subscription violates unique constraint rules")); throw ex; } } From ccbe3535a8a6a6c10aaaacd4fcfae3677350e951 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 12 Feb 2020 11:47:17 +0100 Subject: [PATCH 179/301] implemented ping properties validation and corrected available calculation --- .../properties/PingMeasurementProperties.java | 14 ++++++++++++++ .../arrowhead/core/qos/quartz/task/PingTask.java | 2 +- .../src/main/resources/application.properties | 9 +++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java index 2547901c5..ca71557a3 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java @@ -1,7 +1,10 @@ package eu.arrowhead.core.qos.measurement.properties; +import javax.annotation.PostConstruct; + import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; +import org.springframework.util.Assert; @Configuration @ConfigurationProperties(prefix = "ping") @@ -45,4 +48,15 @@ public PingMeasurementProperties(final int timeToRepeat, final int timeout, fina public void setRest(final int rest) { this.rest = rest; } public void setAvailableFromSuccessPercet(final int availableFromSuccessPercet) { this.availableFromSuccessPercet = availableFromSuccessPercet; } + //------------------------------------------------------------------------------------------------- + @PostConstruct + private void validateFields() { + + Assert.isTrue(timeToRepeat > 0 && timeToRepeat <= 100, "Time to repeat must be greater than 0 and not greater than 100"); + Assert.isTrue(timeout >= 0 && timeout < 10000, "timeout must be greater than or equal 0 and not greater than 10 000"); + Assert.isTrue((packetSize == 32 || packetSize == 56 || packetSize == 64), "packetSize has to be 32 or 56 or 64"); + Assert.isTrue(rest >= 0 && rest <= 10000, "rest must be greater than 0 and not greater than 10 000"); + Assert.isTrue(availableFromSuccessPercet > 0 && availableFromSuccessPercet <= 100, "availableFromSuccessPercet must be greater than 0 and not greater than 100"); + + } } diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 672cd6698..97ef01a7f 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -300,7 +300,7 @@ private boolean calculateAvailable(final int sentInThisPing, final int available final int availableFromSuccessPercent = pingMeasurementProperties.getAvailableFromSuccessPercet(); final double availablePercent = 100 - ((sentInThisPing - availableCount) / (double)sentInThisPing) * 100 ; - if (availableFromSuccessPercent < Math.round(availablePercent)) { + if (availableFromSuccessPercent <= Math.round(availablePercent)) { available = true; }else { diff --git a/qos-monitor/src/main/resources/application.properties b/qos-monitor/src/main/resources/application.properties index 48d61170d..277ccf577 100644 --- a/qos-monitor/src/main/resources/application.properties +++ b/qos-monitor/src/main/resources/application.properties @@ -47,20 +47,25 @@ ping_ttl_interval_minutes=2 ### PING MEASUREMENT PARAMETERS ### ############################################ -# Set times to repeat the ping per measurement +# Set times to repeat the ping per measurement +# must be greater than 0 and not greater than 100 ping.time_to_repeat=35 # Set timeout of ping +# must be greater than or equal 0 and not greater than 10 000 ping.timeout=5000 # Set pocket size of ping +# must be 32 or 56 or 64 ping.packet_size=32 # Set millsec to sleep between single pings in a measurement +# must be greater than 999 and not greater than 10 000 ping.rest=1000 # Set succes percentage of individual pings to accept measurement as available -ping.available_from_success_percet=100 +# must be greater than 0 and not greater than 100 +ping.available_from_success_percet=1 ############################################ ### SECURE MODE ### From 9c70107a4841ebc1e0286502b2e48871fdf2d682 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 12 Feb 2020 13:24:45 +0100 Subject: [PATCH 180/301] implemented further AvailableCalculation tests --- .../core/qos/quartz/task/PingTaskTest.java | 346 ++++++++++++++++++ 1 file changed, 346 insertions(+) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index 9f678c5fe..cd3090cd2 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -1039,6 +1039,286 @@ public void testExecuteAvailableCalculation() { verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); } + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteAvailableCalculationWith100PercentNotOK() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = get100LongResponseListWithIncementingResponseTimeAnd10PercentLossForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + when(pingMeasurementProperties.getAvailableFromSuccessPercet()).thenReturn(100); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), calculationsValueCapture.capture(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + final PingMeasurementCalculationsDTO calculations = calculationsValueCapture.getValue(); + assertNotNull(calculations); + assertTrue(!calculations.isAvailable()); + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(1)).getTimeout(); + verify(pingService, atLeastOnce()).getPingResponseList(anyString()); + verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + + verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteAvailableCalculationWith100PercentOK() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = get100LongResponseListWithIncementingResponseTimeAnd0PercentLossForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + when(pingMeasurementProperties.getAvailableFromSuccessPercet()).thenReturn(100); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), calculationsValueCapture.capture(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + final PingMeasurementCalculationsDTO calculations = calculationsValueCapture.getValue(); + assertNotNull(calculations); + assertTrue(calculations.isAvailable()); + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(1)).getTimeout(); + verify(pingService, atLeastOnce()).getPingResponseList(anyString()); + verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + + verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteAvailableCalculationWith1PercentOK() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = get100LongResponseListWith99PercentLossForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + when(pingMeasurementProperties.getAvailableFromSuccessPercet()).thenReturn(1); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), calculationsValueCapture.capture(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + final PingMeasurementCalculationsDTO calculations = calculationsValueCapture.getValue(); + assertNotNull(calculations); + assertTrue(calculations.isAvailable()); + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(1)).getTimeout(); + verify(pingService, atLeastOnce()).getPingResponseList(anyString()); + verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + + verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteAvailableCalculationWith1PercentNotOK() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = get100LongResponseListWith99Point9PercentLossForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + + final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + when(pingMeasurementProperties.getAvailableFromSuccessPercet()).thenReturn(1); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), calculationsValueCapture.capture(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + final PingMeasurementCalculationsDTO calculations = calculationsValueCapture.getValue(); + assertNotNull(calculations); + assertTrue(calculations.isAvailable()); + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(1)).getTimeout(); + verify(pingService, atLeastOnce()).getPingResponseList(anyString()); + verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + + verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); + } + //------------------------------------------------------------------------------------------------- @Test public void testExecuteAvailableCalculationWithNotAvailable() { @@ -1906,6 +2186,72 @@ private List get100LongResponseListWithIncementingResponseTime return responseList; } + //------------------------------------------------------------------------------------------------- + private List get100LongResponseListWith99PercentLossForTest() { + + final List responseList = new ArrayList<>(); + + final IcmpPingResponse pingResponse = getIcmpPingResponse(); + pingResponse.setSuccessFlag(true); + pingResponse.setTimeoutFlag(false); + pingResponse.setRtt(1); + pingResponse.setDuration(1); + + responseList.add(pingResponse); + + for (int i = 0; i < 100; i++) { + + final IcmpPingResponse pingResponseInLoop= getIcmpPingResponse(); + pingResponse.setSuccessFlag(false); + pingResponse.setTimeoutFlag(true); + + responseList.add(pingResponseInLoop); + } + + return responseList; + } + + //------------------------------------------------------------------------------------------------- + private List get100LongResponseListWith99Point9PercentLossForTest() { + + final List responseList = new ArrayList<>(); + + final IcmpPingResponse pingResponse = getIcmpPingResponse(); + pingResponse.setSuccessFlag(true); + pingResponse.setTimeoutFlag(false); + pingResponse.setRtt(1); + pingResponse.setDuration(1); + + responseList.add(pingResponse); + + for (int i = 0; i < 200; i++) { + + final IcmpPingResponse pingResponseInLoop= getIcmpPingResponse(); + pingResponse.setSuccessFlag(false); + pingResponse.setTimeoutFlag(true); + + responseList.add(pingResponseInLoop); + } + + return responseList; + } + //------------------------------------------------------------------------------------------------- + private List get100LongResponseListWithIncementingResponseTimeAnd0PercentLossForTest() { + + final List responseList = new ArrayList<>(); + for (int i = 1; i < 101; i++) { + + final IcmpPingResponse pingResponse = getIcmpPingResponse(); + pingResponse.setSuccessFlag(true); + pingResponse.setTimeoutFlag(false); + pingResponse.setRtt(i); + pingResponse.setDuration(i); + + responseList.add(pingResponse); + } + + return responseList; + } //------------------------------------------------------------------------------------------------- private List getEmptyResponseListForTest() { From 6722009551a8221115e2048035e8fec781d1c870 Mon Sep 17 00:00:00 2001 From: Svetlin Tanyi Date: Wed, 12 Feb 2020 13:37:24 +0100 Subject: [PATCH 181/301] Docker compose typo fix. --- docker/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 09a7cd25b..5748354fa 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -30,7 +30,7 @@ services: depends_on: - mysql volumes: - - ./core_system_config/authorizaton.properties:/authorization/application.properties + - ./core_system_config/authorization.properties:/authorization/application.properties ports: - 8445:8445 From a003511b37c02049261c4b43c8d8e810e69e345f Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 12 Feb 2020 16:26:28 +0100 Subject: [PATCH 182/301] started qos_monitor documentation --- documentation/qos_monitor/overview.png | Bin 0 -> 30210 bytes documentation/qos_monitor/overview.uxf | 39 +++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 documentation/qos_monitor/overview.png create mode 100644 documentation/qos_monitor/overview.uxf diff --git a/documentation/qos_monitor/overview.png b/documentation/qos_monitor/overview.png new file mode 100644 index 0000000000000000000000000000000000000000..2142cfac093b1b412325529674ab5c55c4c554bd GIT binary patch literal 30210 zcmeFabyU^O+b;|V(k&o@bVvvSA|WX#N_R*~s+53qgNPuFbSfZ7cXv04q;zaL_oid> z&febl@A*B?I`2B?kLRp)-uK-8;a+_Ad}pqi`CK{ITsufvQ3fC94h{+m3jT}d(yAyZ zH`q~7(44Stf+xjLr)v}xI+PdElIku7+q2m9W20jy2LUfliDd0^wF`m;HBniKI5DJe zjmqQ;E=UwCd$>!@wxt^b~(= zz5h;V&3tW}>9Nk)>`->vi7Ru@AiS_)SLiw^Iocc_{A(pd!=m#+`TM^JMqhLE7-|iF zHAxgybRvmA|M^Pzq_;l#>ks5(-x+Kob$cxmMXdj5g^G^Fp8xNE5_PAbNHRM!FMjyD zBgD6$t2_UVT`98_TTSsMJhD#gPvn;~aDk8|2zWQvHyQa}ZY_tKO+_(7%OV*ei>Sm#bl%QXuPzI;PLY!gNDqfpUELNjgJF} z>2hv;S5M9fZEiT3Yww=@^}hQ#BtXg!%e!{N?nE^{Jh3t4e1w0su5Nx!n?t{aY{+5+(+Zx9Hk7sHm@ z`{*T<*<@12hV1*}dF&60yqF8T_HRrXuPaa4&wH93J+dAhO2TG9?iP{E!sm|9kcxw4 zv%#IJzNnMA=rScyjgN%1G;2gwpC!!E&|~^@DDUC>);O&7Mt0G1UtdDyHpJ{Rt!A>7 z?zFv=|FgTJ*!^k38s;H)n71C(Lg3;y5{yzP}A1n-|Q5&#^^CiWBG>`RyHTUzq&h5 zZN=(hv1J+JqaXpw#B9{s+a^OzUuNFF@TfRbStu+TMY1C(JjE01aL$BK$8$ozX0{Jg z%mleYIphzjd_50Nm!T^e;kl`-(HtL9B(rWiE^%IS7&XprO*qf7Nu|1=k^Y79=aLJB zjh>Jdf5O%2X4PUy!~uZwLH*?KvgS@*D|*kux-i=ls2=7=83a!ZgFf)BHcPsCFNGWq z6{8Z!p7^Aze&V%@de$t`f8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tw&p$yjdpqje6+@c~`TSrGxzjRzO?M9^u58GyR z*sUoAOsnRBwu3^+Ss6xh?%6MIOYW%M?&xuVOCnUp9kS;c?=KaKU-A$4q|Z1bw5V~v z?znOmK=;Et0j;X5B=_s?SL%dtUVf>e@d;9r^m literal 0 HcmV?d00001 diff --git a/documentation/qos_monitor/overview.uxf b/documentation/qos_monitor/overview.uxf new file mode 100644 index 000000000..f3ccb7f31 --- /dev/null +++ b/documentation/qos_monitor/overview.uxf @@ -0,0 +1,39 @@ +10UMLState620530190110Provider +fontsize=24 +bg=grayUMLState38030480110ARROWHEAD FW +fontsize=24 +bg=cyanRelation6201503050lt=-()10;10;10;30Relation6201303060lt=[]- +bg=blue10;10;10;40Relation7001303060lt=[]- +bg=red10;10;10;40Relation7901303070lt=[]- +bg=green10;10;10;50Relation7901403060lt=-()10;10;10;40Relation7001403060lt=-()10;10;10;40Relation340370180140lt=-( +bg=#ac3300 +fg=#ac330010;10;150;10;150;110Relation650370250140lt=-( +bg=#ac3300 +fg=#ac330010;10;220;10;220;110Relation4701303080lt=[]- +bg=#ac3300 + +10;10;10;60Relation4701804030lt=-()20;10;10;10Relation42040430180lt=-( +bg=green +fg=green380;120;410;120;410;10;10;10;10;150;40;150Relation270160290350lt=-( +bg=#ac3300 +fg=#ac3300210;10;270;10;270;220;20;220;20;320Relation480370210140lt=-( +bg=#ac3300 +fg=#ac330010;10;180;10;180;110Relation8604903060lt=-()10;40;10;10Relation8605203030lt=[]- +bg=gray10;10;10;10Relation2804903060lt=[]- +bg=gray +group=210;40;10;10Relation2804903040lt=-() +group=210;20;10;10UMLState220530190110Provider +fontsize=24 +bg=gray +group=2Relation6505203030lt=[]- +bg=gray10;10;10;10Relation6504903050lt=-()10;30;10;10UMLState420530190110Provider +fontsize=24 +bg=gray +group=3Relation4804903040lt=-() +group=310;20;10;10Relation4805003050lt=[]- +bg=gray +group=310;30;10;10UMLState820530190110Provider +fontsize=24 +bg=grayRelation47015017060lt=-( +bg=#ac3300 +fg=#ac330010;10;100;10;100;30;140;30 \ No newline at end of file From 01c4c09c495d09b118a5dd7d8400a8be782c38ed Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 12 Feb 2020 16:29:09 +0100 Subject: [PATCH 183/301] Create qos_monitor_sdd.md --- documentation/qos_monitor/qos_monitor_sdd.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 documentation/qos_monitor/qos_monitor_sdd.md diff --git a/documentation/qos_monitor/qos_monitor_sdd.md b/documentation/qos_monitor/qos_monitor_sdd.md new file mode 100644 index 000000000..bfdb75b50 --- /dev/null +++ b/documentation/qos_monitor/qos_monitor_sdd.md @@ -0,0 +1,15 @@ + + +# QOS MONITOR + + + +## System Design Description Overview + +The purpose of QoS Monitor supporting core system is providing qos measurements to the QoS Manager. + +![#1589F0](https://placehold.it/15/1589F0/000000?text=+) `AH Service Registry` +![#f03c15](https://placehold.it/15/f03c15/000000?text=+) `AH Authorization` +![#c5f015](https://placehold.it/15/c5f015/000000?text=+) `AH Orchestrator / QoS Manager` +![#ffcc44](https://placehold.it/15/a33c00/000000?text=+) `AH QoS Monitor` +![Alt text](/documentation/qos_monitor/overview.png) From 99b914d1894b21adf9c56340c084974815045ff6 Mon Sep 17 00:00:00 2001 From: mzsilak Date: Wed, 12 Feb 2020 17:54:18 +0100 Subject: [PATCH 184/301] added device registry filter and tests --- .../security/DRSecurityConfig.java | 11 + .../DeviceRegistryAccessControlFilter.java | 30 ++ .../swagger/SRSwaggerConfig.java | 27 + .../certificates/device_registry.p12 | Bin 0 -> 5369 bytes .../resources/certificates/deviceregistry.p12 | Bin 4686 -> 0 bytes ...eRegistryControllerDeviceRegistryTest.java | 109 ++++ .../DeviceRegistryControllerDeviceTest.java | 470 ++++++++++++++++++ .../DeviceRegistryTestContext.java | 42 ++ .../StandaloneModeInDeviceRegistryTests.java | 9 + deviceregistry/src/test/resources/log4j2.xml | 31 ++ 10 files changed, 729 insertions(+) create mode 100644 deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DRSecurityConfig.java create mode 100644 deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DeviceRegistryAccessControlFilter.java create mode 100644 deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/swagger/SRSwaggerConfig.java create mode 100644 deviceregistry/src/main/resources/certificates/device_registry.p12 delete mode 100644 deviceregistry/src/main/resources/certificates/deviceregistry.p12 create mode 100644 deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryControllerDeviceRegistryTest.java create mode 100644 deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryControllerDeviceTest.java create mode 100644 deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryTestContext.java create mode 100644 deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/StandaloneModeInDeviceRegistryTests.java create mode 100644 deviceregistry/src/test/resources/log4j2.xml diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DRSecurityConfig.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DRSecurityConfig.java new file mode 100644 index 000000000..1d757d3b3 --- /dev/null +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DRSecurityConfig.java @@ -0,0 +1,11 @@ +package eu.arrowhead.core.deviceregistry.security; + +import eu.arrowhead.common.security.DefaultSecurityConfig; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; + +@Configuration +@EnableWebSecurity +public class DRSecurityConfig extends DefaultSecurityConfig { + +} \ No newline at end of file diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DeviceRegistryAccessControlFilter.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DeviceRegistryAccessControlFilter.java new file mode 100644 index 000000000..077371c2d --- /dev/null +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DeviceRegistryAccessControlFilter.java @@ -0,0 +1,30 @@ +package eu.arrowhead.core.deviceregistry.security; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.security.CoreSystemAccessControlFilter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.stereotype.Component; + +import java.util.Map; + +@Component +@ConditionalOnProperty(name = CommonConstants.SERVER_SSL_ENABLED, matchIfMissing = true) +public class DeviceRegistryAccessControlFilter extends CoreSystemAccessControlFilter { + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + @Override + protected void checkClientAuthorized(final String clientCN, final String method, final String requestTarget, final String requestJSON, final Map queryParams) { + super.checkClientAuthorized(clientCN, method, requestTarget, requestJSON, queryParams); + + final String cloudCN = getServerCloudCN(); + if (requestTarget.contains(CoreCommonConstants.MGMT_URI)) { + // Only the local System Operator can use these methods + checkIfLocalSystemOperator(clientCN, cloudCN, requestTarget); + } + } + +} \ No newline at end of file diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/swagger/SRSwaggerConfig.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/swagger/SRSwaggerConfig.java new file mode 100644 index 000000000..946f8d98e --- /dev/null +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/swagger/SRSwaggerConfig.java @@ -0,0 +1,27 @@ +package eu.arrowhead.core.deviceregistry.swagger; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.swagger.DefaultSwaggerConfig; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@EnableSwagger2 +@Configuration +public class SRSwaggerConfig extends DefaultSwaggerConfig { + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public SRSwaggerConfig() { + super(CommonConstants.CORE_SYSTEM_DEVICE_REGISTRY); + } + + //------------------------------------------------------------------------------------------------- + @Bean + public Docket customizeSwagger() { + return configureSwaggerForCoreSystem(this.getClass().getPackageName()); + } +} \ No newline at end of file diff --git a/deviceregistry/src/main/resources/certificates/device_registry.p12 b/deviceregistry/src/main/resources/certificates/device_registry.p12 new file mode 100644 index 0000000000000000000000000000000000000000..dcd55a15036630c3ee3511938989360eb13d8803 GIT binary patch literal 5369 zcmY*cWmFW5wjH{p8-`(q{OB1P=@L-7K}tf9lFmV4=nz3#LIzY|=n^DHVrZn17(fJR z>8|U0>%Du|{c&pVea_Fl)`24EPH}PYpa{AuLK6NM&6sm?93q@T1lmaLz#Sh!;PMxC{2O+JWdFDIfD{L}5P^RUMc|)9`3On>AO3rs6`!vCOKr!b|H1L> z5u++O#7~wCHxq%22k6$vN8tCnG*L+5ycDd%hU3-E;htrbk`CK5YGwq?uTh=IZR#Nz8jS)+U0TOSz93NlLz3Tv!{Ldfxeimku?K25v zt3s^v-Nr^5x_2e3sAN!0M2sN+vWrCH#;nhi(M))VVpQ{2N!-$$A&f&Y8JeV}vT}h% zIb3+VM8tafpSd}6PQNw(1veYPHV&C#sKjajbR|&;H&wAR%Mw!vXwb(f ztyTACWNF9$wQC0b#oE-kOX_Ax$SA8!xw`PwfZGJ!CzHyj&$u@BCBKDVde5Iz0+F9e zFv{d?Q5_YooS^f$8N`@%&)=XL4XOVK&sL)H!skzvX;H??q*6p`F5GMNx_8~zo_cq6;9H4aaQ+uoQ_b}W z$yV9em@bTqW8ye^S)}V+ixSt$G9q3fVhfR6R^-5NvkiLXzn*ov!CE9??TA{sb5uKk z2=x5KMrZZM4dY2pN=>-gJ~Iou-Nfpw9skT?>1a|N9jHV3Wls$6ydrRU4XXNfI1=8K zHSa{Bo^jHtZZi?xhOQT1O4)gLPruddzA*8&S0S6H83NqnlC^udLpBUF6Z=vf1@6Y0 zxUY;AU;a7#)h@w~_Ky+ij;=X&ZABraj>NS_*t;i3t8FEE?sBHyS`v7K^5&+b`(JiC zW`2)df>^sxw+sfIxTKvnQIr|f6qP(OE(sZK2>Gd+lb}koWVx*G(AbmR9q7R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z5=t)&#&X6igDaaZ zEadUO^ZO8@HJaW7*O@;qs&rJJygKHsrlBS7!#Dm)qe@cb^(+szy4)bxP95x)yDS(l z!W+}kP&Nkr zb2WU$@?0%5Xz;WqcQuAzujqXa1*@$?myYfo^eXv`Pphjb#^L3O z#XU@LDOvMg%kulUrRc!>J`#j?4AX(v>lPlC_A&YQL8FxBA#55R46)sKWCTocSMI08 zhkD37ji*_^T8%97`Syu&@wrj9b?dcOQ8g7Dd;+rEPe)0m&NSxNCjUWy5v6T*;xwWa z@}IHWnxUrNb3T7}_Ecg^k|lqkpG@~*fIt%PIOcp7y{~v4CiVCA!F^$pQiF3GVTRI)XuQ{TcNAjh$D57zA{VDt*h4Jar%posaaUY%SGNN33>4U84e&XWc H#1#Gu3{yTC literal 0 HcmV?d00001 diff --git a/deviceregistry/src/main/resources/certificates/deviceregistry.p12 b/deviceregistry/src/main/resources/certificates/deviceregistry.p12 deleted file mode 100644 index 92301d3d5fbc200b61d2228ecccf7f9419a29d66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4686 zcmY+EXE+;f+s0$>meAUJ#*CtZh}39pYSgAi?Y(Q2P(_K7)K=7Fj_VGgbI%YFBd^`NQj`>10!g* zzzCwI|5*{05+aBSZ|%I>$|k1x*DXqNJp5b);RP5$cmf6ylmFYkeVmz)P99V-k`I&Z zUq`zzXauHzadM#Rz$XB7>k=Xe`_I}y%H$nlK_bT$RJewizE+$2S<+u?Vv%b)eieyV z1`Oj^u5|lwHV}ATG6UN53nN0V^9c+8*kfvTn2=O;WZpey>U~DI`TLJ{*^>-sot8%* zdr4uyfFD4JZc>GayT-Yo^nYq42b>sJ`7~Dm6 zA=fJU42}Pd1S6^w)sXhRmQa!}G| zJ=&$3g@A)}Z6|EH`E3P;;j`8e(Kl)Z32ebb&O0r4pq?}tzCCIO@2&YuMt%`u3UBP; z!KG+^o*Rj`8Ywn3Y$Gvo-9nvt!=Lj;Pk!aMBu-sr$EjnRgy!2`9(SZZ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lChPYQtyJXu~*9i{3kv$+U=Pi1s)rkEjY}jvoy(O@CYN z-PCX&WyT>?{Hee7B&o~*72>}fDE`A?LgZ}gBd42+pflypwm%jBNiP4kt#SE8m&9L- zyJcDMqeMm?26ap1FD01Xo{H|B^!#$Itp~%;3uZqNJ+R~MM>F#_5SApWE@2?;RmEbS z`%Pt+s7ewWcBEWnWKomD{)1S^jOy%isjccs`{A}ZLi5Bk6)*L^4sp1^`#b~)SM(D? zpVKc>$m@>_z;@c@cz?gTayBTnEQ$G4$W`gp)1xKvvTXrXY6b~rUyS|Nd#okd=QS7n7X%!ZGZjfmo5zIxdVgL%qMRiB>U=P5G& zBJ}0`%cK~*(Zen~y8aYolOewR_{PlBxR>{p9VrZxb0hI+4SX;ZWuwpWt7r#$QExmD z5)+2;xTZYWR@prA2NKx9{Ta>vHn-&$+mBaFygG%uc!rhxouJcvHeUN9Pd0hwsO4y- zwv@w>`_#LyI~=asPZ{`)^o(?vTwC4n6959tn^=EQ$#Iit59bB1WTj10~u5gv1Cos z`n7aZ?vZx1qn#)>!(6BnO1kgiWRCV|5g>W}%#?UcJSsqmYelM_<`soU)L`q}TU&Lh zkvxKDuI%dVuD@Zr`4+;YRl|oJHeX^N;r(b>EC2OD zw~ + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex + + OFF + + + + + + + + ${LOG_PATTERN} + + + + + + + + + + + + + + + + \ No newline at end of file From e925cb5110f72cf22ad54ce510207f234921b760 Mon Sep 17 00:00:00 2001 From: Svetlin Tanyi Date: Thu, 13 Feb 2020 08:45:15 +0100 Subject: [PATCH 185/301] Documentation typo fix. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 236b95b95..a4c9e3ef8 100644 --- a/README.md +++ b/README.md @@ -3316,7 +3316,7 @@ __ServiceRequestForm__ is the input "string" ], "securityRequirements": [ - "NOT_SECURE", "CEERTIFICATE", "TOKEN" + "NOT_SECURE", "CERTIFICATE", "TOKEN" ], "metadataRequirements": { "additionalProp1": "string", From c8fc92d6b024e62e47fbcd91ec21da6f6dfc051b Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 13 Feb 2020 09:58:05 +0100 Subject: [PATCH 186/301] added system design overview --- .../qos_monitor/{ => sdd}/overview.png | Bin .../qos_monitor/{ => sdd}/overview.uxf | 0 .../qos_monitor/{ => sdd}/qos_monitor_sdd.md | 7 +- .../qos_monitor/sysd/qos_monitor_sys_d.jpg | Bin 0 -> 119817 bytes .../qos_monitor/sysd/qos_monitor_sys_d.ucls | 150 ++++++++++++++++++ 5 files changed, 156 insertions(+), 1 deletion(-) rename documentation/qos_monitor/{ => sdd}/overview.png (100%) rename documentation/qos_monitor/{ => sdd}/overview.uxf (100%) rename documentation/qos_monitor/{ => sdd}/qos_monitor_sdd.md (74%) create mode 100644 documentation/qos_monitor/sysd/qos_monitor_sys_d.jpg create mode 100644 documentation/qos_monitor/sysd/qos_monitor_sys_d.ucls diff --git a/documentation/qos_monitor/overview.png b/documentation/qos_monitor/sdd/overview.png similarity index 100% rename from documentation/qos_monitor/overview.png rename to documentation/qos_monitor/sdd/overview.png diff --git a/documentation/qos_monitor/overview.uxf b/documentation/qos_monitor/sdd/overview.uxf similarity index 100% rename from documentation/qos_monitor/overview.uxf rename to documentation/qos_monitor/sdd/overview.uxf diff --git a/documentation/qos_monitor/qos_monitor_sdd.md b/documentation/qos_monitor/sdd/qos_monitor_sdd.md similarity index 74% rename from documentation/qos_monitor/qos_monitor_sdd.md rename to documentation/qos_monitor/sdd/qos_monitor_sdd.md index bfdb75b50..df515a911 100644 --- a/documentation/qos_monitor/qos_monitor_sdd.md +++ b/documentation/qos_monitor/sdd/qos_monitor_sdd.md @@ -12,4 +12,9 @@ The purpose of QoS Monitor supporting core system is providing qos measurements ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) `AH Authorization` ![#c5f015](https://placehold.it/15/c5f015/000000?text=+) `AH Orchestrator / QoS Manager` ![#ffcc44](https://placehold.it/15/a33c00/000000?text=+) `AH QoS Monitor` -![Alt text](/documentation/qos_monitor/overview.png) +![Alt text](/documentation/qos_monitor/sdd/overview.png) + + + +## System Design Overview +![Alt text](/documentation/qos_monitor/sysd/qos_monitor_sys_d.jpg) \ No newline at end of file diff --git a/documentation/qos_monitor/sysd/qos_monitor_sys_d.jpg b/documentation/qos_monitor/sysd/qos_monitor_sys_d.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e4756d40605c112edfcdc4da8f5c4759e6bef2c0 GIT binary patch literal 119817 zcmc$`1yo#Hvo6}W26qqc9$XVNSRhDncXy|e1b26W1%kT=cMUF$1$TF8ZtrvNdG}BL zH}*c`-E+rl#$?g->a}XttorJkHEXVyg_m^z#(ODQDF74{000H~0la_!?*NGKaEPcl zMC9=B2*|HU$w&|oAa6;jNDz=v(21Do$&pa7Nho=_=}@sqC>Xf;SqUlVn7M_8xTsm# zIruoaIsdu{6cQ3D0Vm{zg!1b3Uq{qeB!3+^3I5~VfBgBkzg{{4n269Du<TtrmtFulL{2!U|9AoZ*9!_71{Mw;0TBrq<*yT<05JdabI9-idB*Q2)MEgkp&#HQp7 zK*V_)ms{P1M8&0YhHK5WX=0H4hPIq7QQF{TrLkR9TgVqPj z=dFR?a=ifN>x;mNt8>Q=bEQm=HCGH&C`av#FM!;j9{oEgwif`c@{K+&@MqVr$|pd| z3m}2XEqnwdcOPQ>&*ur(b)+&I`lj^hU$J{wzW@LYeDNXu!Vau0>&f)8w%`(dBzT1HWWr)ua2VVf6s-&5o zRvNl{9(&O&OQ!bOXsSL1{k`~%iK{Hl?=aAdQZwNb^ccbNivv$yW!jyWVN1Nr{Z3Lp zpI<4+^=Xh9+M_Si^xu6=PzXz`N~)kq-4Qf8j~pT*|G{h=tsVLCCIM_u(Rg2L{P(wG zBAOU*uaQKu_SWZd5ijybBYGOgz4hPSj{3w0HPk7}aj0(VqwO=lsu~N*kh(OiOTtE& zr~ze;PHi1i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MolJDm|;3V}|>=a~yW!e(jDMYOUseANmWwtaNPwW>R>kQtE6DibJ z3!S1$!}_cDFNwYmcy!>47i*YFIN);tQoeuvH-A)3f!~4$E0)SrdlvLx3nV;h;RxEY zJARWA#F6q+ml+}rw(O=6F&`FBR*y9Z1;q>z*(Tre%$1hqDvryLXN^^+ZJ3Ga#*E^N z_rbqnth@D7uytzQ`B@OHI?!A$R}t`G1b;{r^ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 39070104dff9feba2dc660c42c15fbe1af320d81 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 13 Feb 2020 11:57:49 +0100 Subject: [PATCH 187/301] temporal commit - started to implement use case documentation --- .../qos_monitor/sdd/qos_monitor_sdd.md | 51 +++++++++++++++++- .../qos_monitor/use_cases/GetMeaurements.png | Bin 0 -> 51825 bytes .../qos_monitor/use_cases/PingMeasurement.png | Bin 0 -> 51825 bytes .../qos_monitor/use_cases/PingMeasurement.uxf | 26 +++++++++ .../use_cases/QoSMonitor_use_case_1.md | 3 ++ .../use_cases/QoSMonitor_use_case_2.md | 3 ++ .../use_cases/QoSMonitor_use_case_3.md | 3 ++ .../qos_monitor/use_cases/Reset_Counter.png | Bin 0 -> 51825 bytes 8 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 documentation/qos_monitor/use_cases/GetMeaurements.png create mode 100644 documentation/qos_monitor/use_cases/PingMeasurement.png create mode 100644 documentation/qos_monitor/use_cases/PingMeasurement.uxf create mode 100644 documentation/qos_monitor/use_cases/QoSMonitor_use_case_1.md create mode 100644 documentation/qos_monitor/use_cases/QoSMonitor_use_case_2.md create mode 100644 documentation/qos_monitor/use_cases/QoSMonitor_use_case_3.md create mode 100644 documentation/qos_monitor/use_cases/Reset_Counter.png diff --git a/documentation/qos_monitor/sdd/qos_monitor_sdd.md b/documentation/qos_monitor/sdd/qos_monitor_sdd.md index df515a911..434eda3bb 100644 --- a/documentation/qos_monitor/sdd/qos_monitor_sdd.md +++ b/documentation/qos_monitor/sdd/qos_monitor_sdd.md @@ -17,4 +17,53 @@ The purpose of QoS Monitor supporting core system is providing qos measurements ## System Design Overview -![Alt text](/documentation/qos_monitor/sysd/qos_monitor_sys_d.jpg) \ No newline at end of file +![Alt text](/documentation/qos_monitor/sysd/qos_monitor_sys_d.jpg) + + + +## Provided services + +The QoS Monitor provides the following services: +* [Echo](#qos_monitor_endpoints_get_echo) +* [Ping Measurement](#qos_monitor_endpoints_ping_measurement_by_system_id) + + + +## Consumed services + +The QoS Monitor consumes the following service: +* QueryAll private service from the ServiceRegistry core system + + + +## Use cases + +The QoS Monitor has the following use cases: +* [Ping Measurement](documentation/qos_monitor/use_cases/QoSMonitor_use_case_1.md) +![Alt text](/documentation/qos_monitor/use_cases/PingMeasurement.png) +* [Reset Counter](documentation/qos_monitor/use_cases/QoSMonitor_use_case_2.md) +![Alt text](/documentation/qos_monitor/use_cases/Reset_Counter.png) +* [Get Measurements](documentation/qos_monitor/use_cases/QoSMonitor_use_case_3.md) +![Alt text](/documentation/qos_monitor/use_cases/GetMeaurements.png) + + + +## Endpoints + + + +### Client endpoint description
+ +| Function | URL subpath | Method | Input | Output | +| -------- | ----------- | ------ | ----- | ------ | +| [Echo](#qos_monitor_endpoints_get_echo) | /echo | GET | - | OK | + +
+ +### Echo +``` +GET /qos_monitor/echo +``` + +Returns a "Got it" message with the purpose of testing the core service availability. + diff --git a/documentation/qos_monitor/use_cases/GetMeaurements.png b/documentation/qos_monitor/use_cases/GetMeaurements.png new file mode 100644 index 0000000000000000000000000000000000000000..89f40a9038e6de138f621b035864d5d132f67c5a GIT binary patch literal 51825 zcmd?Rby$?$_BRg007J%#lq_ui}5XRWoL-qcX0B0oz`KtMosRsif`9*kq09dLSNMmDLJ0yfip_F4f3b4{WTfbSo`(R!K;swnA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VB-l!u~df%lzg_0S{s+I_;nI z8ysZ7sktJMMdJE#GU@Xw(}0UI*37wkn-df^BDx#i@B4jBb2)gyux8bKGk1`~fci2f zgX{q=6i%M(Yt{+8U-$dJmyiXAHq%j08)}12Km#W=JQB`0?u&Z=;V^$ca0QFby^nq6 zDp7IZ^93Zr8qWhyl`Q=Eboz1N{cUDz+)MO8_5kY?2W2MUQ3liFsxs#QkIgJRYkJ*e zQ)D-28quMeg%7y(-2%957PK}v(5Y613rvl`0}@`@ARijE{XxYx;DQoHCSMNV z*{3S^{=O?e4&1PO^T?-b&?#sRo~;LVH2+!T+WqKJw|-xK&0}e2-p2(XcNi3+oDNhW z*bmbq5V0JnsU~#kFW`=F^UU}4|9@`;PjWV!Y@6eY=&t-U4`2QFVUZb4cKYpr8M<5S&~=L7pNoBVfY%Z-IYfe*#Y-HQ4uQ>UxgP zl2VIRfReY=P|o_m?YsbBH5iDVra;b2C`uhqL_rPOc zRX=WBU#t7=UiJGM#pi94pU*AtlQd2{;vN6%QpLsYIFaCGJ{S2wiAEy^bT-*XU^+Vv zyg%yl4&ar=kDtxX?*ks?rx>;-LJ+j}=*(<${XUCF9f$lAt6|nX6!wsN^4o>T!*}HE z0@Z;_%MJ)|El~6F9WxrzufrsTJ&+?>SYPw8gKVAb1aS3{O8%QEH8oY ztF~s{#QL+W=!PjcF9B0BB;+)JYaH}<+n2#I8B}5(aF$-01LQHdN`(tbz|{z@XE%kS k3L`D)fEY;=g^mAt&)?8nwUX(22?G##y85}Sb4q9e0AocIUjP6A literal 0 HcmV?d00001 diff --git a/documentation/qos_monitor/use_cases/PingMeasurement.png b/documentation/qos_monitor/use_cases/PingMeasurement.png new file mode 100644 index 0000000000000000000000000000000000000000..89f40a9038e6de138f621b035864d5d132f67c5a GIT binary patch literal 51825 zcmd?Rby$?$_BRg007J%#lq_ui}5XRWoL-qcX0B0oz`KtMosRsif`9*kq09dLSNMmDLJ0yfip_F4f3b4{WTfbSo`(R!K;swnA?G%X{@?cu z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zg_0S{s+I_;nI z8ysZ7sktJMMdJE#GU@Xw(}0UI*37wkn-df^BDx#i@B4jBb2)gyux8bKGk1`~fci2f zgX{q=6i%M(Yt{+8U-$dJmyiXAHq%j08)}12Km#W=JQB`0?u&Z=;V^$ca0QFby^nq6 zDp7IZ^93Zr8qWhyl`Q=Eboz1N{cUDz+)MO8_5kY?2W2MUQ3liFsxs#QkIgJRYkJ*e zQ)D-28quMeg%7y(-2%957PK}v(5Y613rvl`0}@`@ARijE{XxYx;DQoHCSMNV z*{3S^{=O?e4&1PO^T?-b&?#sRo~;LVH2+!T+WqKJw|-xK&0}e2-p2(XcNi3+oDNhW z*bmbq5V0JnsU~#kFW`=F^UU}4|9@`;PjWV!Y@6eY=&t-U4`2QFVUZb4cKYpr8M<5S&~=L7pNoBVfY%Z-IYfe*#Y-HQ4uQ>UxgP zl2VIRfReY=P|o_m?YsbBH5iDVra;b2C`uhqL_rPOc zRX=WBU#t7=UiJGM#pi94pU*AtlQd2{;vN6%QpLsYIFaCGJ{S2wiAEy^bT-*XU^+Vv zyg%yl4&ar=kDtxX?*ks?rx>;-LJ+j}=*(<${XUCF9f$lAt6|nX6!wsN^4o>T!*}HE z0@Z;_%MJ)|El~6F9WxrzufrsTJ&+?>SYPw8gKVAb1aS3{O8%QEH8oY ztF~s{#QL+W=!PjcF9B0BB;+)JYaH}<+n2#I8B}5(aF$-01LQHdN`(tbz|{z@XE%kS k3L`D)fEY;=g^mAt&)?8nwUX(22?G##y85}Sb4q9e0AocIUjP6A literal 0 HcmV?d00001 diff --git a/documentation/qos_monitor/use_cases/PingMeasurement.uxf b/documentation/qos_monitor/use_cases/PingMeasurement.uxf new file mode 100644 index 000000000..e4c8646a6 --- /dev/null +++ b/documentation/qos_monitor/use_cases/PingMeasurement.uxf @@ -0,0 +1,26 @@ +10SERVICE REGISTRY DTOUMLSpecialState170402020type=initialRelation1705030100lt=<-10;80;10;10UMLSpecialState1601604040bg=orange +type=decisionRelation19070170140lt=<- +m2=[Ping Task Still running]30;60;30;10;100;10;100;110;10;110UMLState110240190220getSystemsToMeasure +valign=top +bg=blue +bg=blueUMLSpecialState1605104040bg=orange +type=decisionRelation1704503080lt=<-10;60;10;10UMLState2010400850Ping Task +valign=topRelation1701203060lt=<-10;40;10;10UMLState12027017040call queryAll +bg=yellow +type=senderRelation280120300190lt=<- +280;10;160;10;160;170;10;170Relation8017010030lt=<-80;10;10;10UMLSyncBarHorizontal13012010020{joinSpec= +date is on or +after July 1st +and the exam +is passed}UMLTimer3016012090Ping Task +Config Sequence +bg=blackUMLState49010420330ServiceRegistry +valign=topUMLState5609022040queryAll called +bg=yellow +type=receiverUMLState59026027040queryAll answer produced +bg=yellow +type=senderUMLSpecialState670502020type=initialRelation670603050lt=<-10;30;10;10Relation6701203070lt=<-10;50;10;10Relation260270750140lt=<- +10;120;10;90;730;90;730;10;600;10UMLState12039017040queryAll returned +bg=yellow +type=receiverRelation6702003080lt=<-10;60;10;10UMLState59017019040getServiceRegistryEntries +bg=blueRelation1701903070lt=<-10;50;10;10 \ No newline at end of file diff --git a/documentation/qos_monitor/use_cases/QoSMonitor_use_case_1.md b/documentation/qos_monitor/use_cases/QoSMonitor_use_case_1.md new file mode 100644 index 000000000..46b92da5c --- /dev/null +++ b/documentation/qos_monitor/use_cases/QoSMonitor_use_case_1.md @@ -0,0 +1,3 @@ + + +## Use case: Ping Measurement \ No newline at end of file diff --git a/documentation/qos_monitor/use_cases/QoSMonitor_use_case_2.md b/documentation/qos_monitor/use_cases/QoSMonitor_use_case_2.md new file mode 100644 index 000000000..ad1fd05b7 --- /dev/null +++ b/documentation/qos_monitor/use_cases/QoSMonitor_use_case_2.md @@ -0,0 +1,3 @@ + + +## Use case: Reset Counter \ No newline at end of file diff --git a/documentation/qos_monitor/use_cases/QoSMonitor_use_case_3.md b/documentation/qos_monitor/use_cases/QoSMonitor_use_case_3.md new file mode 100644 index 000000000..89c671aa7 --- /dev/null +++ b/documentation/qos_monitor/use_cases/QoSMonitor_use_case_3.md @@ -0,0 +1,3 @@ + + +## Use case: Get Measurements \ No newline at end of file diff --git a/documentation/qos_monitor/use_cases/Reset_Counter.png b/documentation/qos_monitor/use_cases/Reset_Counter.png new file mode 100644 index 0000000000000000000000000000000000000000..89f40a9038e6de138f621b035864d5d132f67c5a GIT binary patch literal 51825 zcmd?Rby$?$_BRg007J%#lq_ui}5XRWoL-qcX0B0oz`KtMosRsif`9*kq09dLSNMmDLJ0yfip_F4f3b4{WTfbSo`(R!K;swnA?G%X{@?cu zP9aB!o$X4^<};j>+-Pu zHw8WXLC4|#n$ozyuWfDfyX#ZVbKS_{QY-3%^+?}0V+Sj4ebsIbXRkhD+gcqPOAqf* zBR4hxS1`}!x1SdM=iPL_gKbJEYwG2g^vIi0GNkzg?4LNwRBWu zK4!o=)E$T(tcA$D>5|@SPvTFFi?d=PYN9xnttd|aZ{KeHp4aqMi8JxIbg(}wlf772 zC#|Y_RSk}+dscBm*0g6}qq^riN@HT8jyfECO-v!l?*rZ!n5GUp$zg_N^D*qm0Tl?I2)qJrUv7M1tS*?|RO-nd!+%%gChK z*B!X3Ws4QOhQaW%w@EiX?wK$%Q@=LFJRq;cWzw_B*W9`6dWb9jG}pZ@h-9} ze-0}VSuI6(+^&9g%Soqcg+O~)1UM&^~x*OC8p49cgxq0g23IoAYj3SKhER8XO?kxf=7_39Q|XJD6}%foa8O1v_srOm zcRESTLE~th^~k?}o*n_2X+W}xdoV1^T~C#8i(v8DHDA5*G$C|RjooXrN4aKX$U&6J zp0*@C_^ujzeg5>}V%=f>P7$SHKeW3rBPjklYBTkxK9F(1sr$bCz582J5}Qqv#dGCxe^KKJdl0nPR4P-M)y{MeRhM3q3=~ z{_0E21y9Rc9jDDaTOwJztY0Fb7(p_KE^Xyhgv8t@Qr0(z2YUfJ?v;`18sey+`q^mLm9A0WBk#i0U(2L2yRwrLALjxJKh7ko zaA5bHdRU(&*iKIDJt3x$l$e~&{p}Vpu{P28lyn|zdktMCty|YA-K17?r`!fjeHgTQ zz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}Sb4q9e0AocIUjP6A literal 0 HcmV?d00001 From fc00dfc27562327f271ea2b21a2dc7ff5202fb8f Mon Sep 17 00:00:00 2001 From: Svetlin Tanyi Date: Thu, 13 Feb 2020 13:18:13 +0100 Subject: [PATCH 188/301] Removed extra apostrophe --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 236b95b95..43d3a1b52 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ If you change your config you have to restart the appropriate container `docker restart ` -` + ##### Handy Docker Commands From e5641e8b4ed5c383a5f1632bb6d041cd54596a62 Mon Sep 17 00:00:00 2001 From: Svetlin Tanyi Date: Thu, 13 Feb 2020 14:33:29 +0100 Subject: [PATCH 189/301] Docker certificate guide --- README.md | 14 ++- .../certificates/docker_certificate_guide.md | 81 ++++++++++++++++++ .../step01.png | Bin 0 -> 33117 bytes .../step02.png | Bin 0 -> 47998 bytes .../step03.png | Bin 0 -> 60517 bytes .../step04.png | Bin 0 -> 10825 bytes .../step05.png | Bin 0 -> 112009 bytes 7 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 documentation/certificates/docker_certificate_guide.md create mode 100644 documentation/images/images_docker_certificate_guide/step01.png create mode 100644 documentation/images/images_docker_certificate_guide/step02.png create mode 100644 documentation/images/images_docker_certificate_guide/step03.png create mode 100644 documentation/images/images_docker_certificate_guide/step04.png create mode 100644 documentation/images/images_docker_certificate_guide/step05.png diff --git a/README.md b/README.md index 43d3a1b52..d48f511d1 100644 --- a/README.md +++ b/README.md @@ -403,7 +403,7 @@ Arrowhead Framework's security is relying on SSL Certificate Trust Chains. The A 1) Master certificate: `arrowhead.eu` 2) Cloud certificate: `my_cloud.my_company.arrowhead.eu` 3) Client certificate: `my_client.my_cloud.my_company.arrowhead.eu` -The certificate naming convetion have strict rules: +The certificate naming convention have strict rules: * The different parts are delimited by dots, therefore parts are not allowed to contain any of them. * A cloud certificate name has to consist of four part and the last two part have to be 'arrowhead' and 'eu'. * A client certificate name has to consist of five part and the last two part have to be 'arrowhead' and 'eu'. @@ -429,8 +429,16 @@ Currently Arrowhead community have the possibility to create only "self signed" ### System Operator Certificate The System Operator Certificate is a special client certificate with the naming convention of `sysop.my_cloud.my_company.arrowhead.eu`. -SysOp certificate allows the client to use the management endpoints of the Arrowhed Core Systems. Typical usage of SysOp certificate is by front end applications running in a web browser. -* [Import SysOp Certificate (Windows 10)](https://github.com/arrowhead-f/core-java-spring/blob/documentation/documentation/certificates/import_sysop_certificate_win10.pdf) +SysOp certificate allows the client to use the management endpoints of the Arrowhead Core Systems. Typical usage of SysOp certificate is by front end applications running in a web browser. +* [Import SysOp Certificate (Windows 10)](documentation/certificates/import_sysop_certificate_win10.pdf) + +### Include certificate in Docker container + +The following guide describes step by step, how to include your own certificates into a Docker container. + +* [How to include certificate in Docker](documentation/certificates/docker_certificate_guide.md) + + diff --git a/documentation/certificates/docker_certificate_guide.md b/documentation/certificates/docker_certificate_guide.md new file mode 100644 index 000000000..2eeb857f5 --- /dev/null +++ b/documentation/certificates/docker_certificate_guide.md @@ -0,0 +1,81 @@ +# How to include certificate into docker + +## Prerequisites +1. You have certificates for **all** your core systems. If not, follow the [Certificate guide](/README.md#certificates) first. + + +##Steps +1. [Check you have all the necessary certificates](#step01) +2. [Edit your property file](#step02) +3. [Overwrite the Secure Mode properties](#step03) +4. [Edit your docker-compose.yml](#step04) +5. [Mount the certificates as a volume to the containers](#step04) + + + +## 1. Check you have all the necessary certificates + +Please make sure, you have already generated the certificates you wish to use. + +![Step 1](/documentation/images/images_docker_certificate_guide/step01.png) + + + + +## 2. Edit your property file + +Open the Core Systems `application.properties` file with your favorite editor. + +![Step 2](/documentation/images/images_docker_certificate_guide/step02.png) + + + +## 3. Overwrite the Secure Mode properties + +Scroll down to the **Secure Mode** part of the properties file and edit: + * `server.ssl-key-store` property + + By default its value is: `classpath:certificates/service_registry.p12`, it means it will search for the certificate **inside** the JAR file, we have to change it to `file: + +## 4. Edit your docker-compose.yml + +Open the `docker-compose.yml` file with your favorite editor. + +![Step 4](/documentation/images/images_docker_certificate_guide/step04.png) + + + +## 5. Mount the certificates as a volume to the containers + +Mount the certificate file as a volume inside the container. + +The syntax is: - outside_path/outside_certificate.name:inside_path/inside_certificate.name + +![Step 5](/documentation/images/images_docker_certificate_guide/step05.png) + +In the image you can see two examples. I'll explain the first one. + +`- ./tmit_certs/service_registry.p12:/serviceregistry/service_registry.p12` + +In [Step 1](#step1) we saw that our certificates were inside a folder called `tmit_certs`. We are mounting the `service_registry.p12` file from the `tmit_certs` folder to the host machine inside the Docker Container into the `serviceregistry` folder under the name of `service_registry.p12` + +> **Note:** The certificate name you specified in [Step 3](#step03) **MUST** match the `inside_certificate.name` specified in [Step 5](#step05), otherwise it won't work. + + +## Congratulations, you are all set! You can start your containers :) + + diff --git a/documentation/images/images_docker_certificate_guide/step01.png b/documentation/images/images_docker_certificate_guide/step01.png new file mode 100644 index 0000000000000000000000000000000000000000..ae74a487d1b518fd0564a5724e442c947d623fc0 GIT binary patch literal 33117 zcmZU3by!`!vNsfWin~j3cP;Mj?yzxpcPZ}f&PF$0ym)cnxKq3o*RSun=iGaq=UacQ zCo7rBB(svt%x@B-q9l!iNPq|d0f8bbBcTQX@rmefnFk*B?^_x%wFm+N851Bbt|BWg zPNw4OWCgIdgn*EVNza7SQ6I+%KF;7IE2h$*E9RM-%}tvX&qU=G!;twxP6G+k-P{q% z5E~8ug`tc7UX!jF=SOHnE5kj^=a;UISd?@ggp;nTfS0WYrC!s(X`$nvKRb`7d7vPG zkqpTPB?J%$F^BUVvk+EtwgjoS5MhS%XmC38(6Vdt?; zXv*b=cZiOyLy*S;M_Eu5S?m{F|rv`!3IZ)-yb4$`j3508a+NdWYGDv zMzf#Gs~Z%T{hNy>GxsiCdZh%*HA#kM{1E4@@YmyZN~Zp`B{IY6V)%R`uO!+ZPfA)5 zu>txd(rAtn^O0K?3IFmQv5&7h=o#?Yun@6-EJ6V0b;HN7lHb5Z3NDVIJ)w2cwn?lA zXQ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iS=6b_D3_F2ci)s>`n01b+su{~-r`N3 zEz`ZO=FQKwLtO%+y#KMPRNDKb>RnaG(|R`2?)$T7!&qnP8)dAmo+saLZTo(4Jqdo$ z9c@ed(k31AL6|K|8}TSK()Dq`85zl2wpYGj9bd=%kzLBBjy&IV-*351cweOdb`Jax X9#iLIp#mF!00000NkvXXu0mjfG1=4k literal 0 HcmV?d00001 diff --git a/documentation/images/images_docker_certificate_guide/step02.png b/documentation/images/images_docker_certificate_guide/step02.png new file mode 100644 index 0000000000000000000000000000000000000000..ce54d97c934380af6a039dcf9c9a41c05c16fbd4 GIT binary patch literal 47998 zcmZVkWmH^2(=H4{fMCHb!QCYg+#Q0u24`@0cLIUn?he6i7~CC#`wZ?dxI1s|`+2@| z&RXC8u~+ZzlCE0SySw_TUn)v6XefjzFfcG^-(@A$U|>FA{%gx2ef;-6j9GHxLcv_ zMTJr>1`5B|7LF2(c)^g@$A5d^FeKfDgE7AL#x5s@2|=CDno5+%&Hj)<5snj9^*JJe zYYY`Hn|(}EE-S1>bOZuJUg_LA%MA19E3Gm9Rf93{vE~RfyAk!rpq~;T*r zf{22~al@UYck-Pn`RKNyJ4Nw{F}`S_^BZK6@o?iaP9}eB7`_?&QSS2N<8DJpw&Y#< z`Nx8wqDbYijz*pIc)_7(6shksW?l9T*$fa*Uk$e^5%|8Nqq-=tC6AbO?|;oAA{EHwQ9zl6 zAs7*59YNf-kUrSAwXxr2<%>k*BPT)%!rcv)wNi!8!j*(cP|HG%N*E=V+k)eAS(Z;B z#YnkhSIL5{b}`0*6EPx^-13Rh&Ixf9^?q2lWr{}`&-Sf3!Q_)LwNx>sRS`Ls-=wJZwPerVV{5u1FLjO_V8O77k6abSd9-IwxHw`(jX&$=b3>6&`#KQjzy)@QR8# z&F93~yoEvV0RPCbiIAoJM^V;v7HwQ@Yg#M;x~Nc<`kJHL4iu*D0jUQTyH-?>w?f@cI|zp9 zJ4t}%Q_tu0{@Qt1URa(@w3n^y{w;lFm~!K`tJnQryu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t|dOfW{@e?Lbxm)C-UA5{N)Nu}V^9g$=DT=Ra8WB}J${HKZo=PK+x z?ein)v8Q}a`9@?-Phd`U9my^o{+*!m3wJG20Id=n+*2W9`0QU+B^>{Xr^0n9d?Ch+ zl)$(>6b1SSg*8(u6H2WB4~)^sp52MbrU{3R{Lz71wNVWPl8b{M%=bcr0nF8jK%I76 zy7*N_mp3`4{peqQ?V)nF7vGZEqfG*C4nBp}iH)Sf$vAast|p6&!O)gl8EgbYfRh%o z`_w&;C9Ov1PC)zO*w^l0NNMet_0c681p%^tR9>0=6k#29k&*0gzf{4|!tAm@a|K}8-1eh)v@r2(8D3{0ozgh%C4S-dlCBL_a z+1w?7W03V`45g>{UH15&{r{_#`M-Bb?3E;B|2zP1*6AejRyX(ik<8iiLQKh5RU4{g|-N4xayq>r~=G)L%IdcwgqvpAZmgMn!q4tLP|~E4_OEKd!4A Ax&QzG literal 0 HcmV?d00001 From 4a6d7daebfdf1297989bef36126486b5766589ef Mon Sep 17 00:00:00 2001 From: Svetlin Tanyi Date: Thu, 13 Feb 2020 14:37:21 +0100 Subject: [PATCH 190/301] Format and language improvements. --- documentation/certificates/docker_certificate_guide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/certificates/docker_certificate_guide.md b/documentation/certificates/docker_certificate_guide.md index 2eeb857f5..a0a31a7dc 100644 --- a/documentation/certificates/docker_certificate_guide.md +++ b/documentation/certificates/docker_certificate_guide.md @@ -4,7 +4,7 @@ 1. You have certificates for **all** your core systems. If not, follow the [Certificate guide](/README.md#certificates) first. -##Steps +## Steps 1. [Check you have all the necessary certificates](#step01) 2. [Edit your property file](#step02) 3. [Overwrite the Secure Mode properties](#step03) @@ -71,7 +71,7 @@ In the image you can see two examples. I'll explain the first one. `- ./tmit_certs/service_registry.p12:/serviceregistry/service_registry.p12` -In [Step 1](#step1) we saw that our certificates were inside a folder called `tmit_certs`. We are mounting the `service_registry.p12` file from the `tmit_certs` folder to the host machine inside the Docker Container into the `serviceregistry` folder under the name of `service_registry.p12` +In [Step 1](#step1) we saw that our certificates were inside a folder called `tmit_certs`. We are mounting the `service_registry.p12` file from the `tmit_certs` folder on the host machine inside the Docker Container into the `serviceregistry` folder under the name of `service_registry.p12` > **Note:** The certificate name you specified in [Step 3](#step03) **MUST** match the `inside_certificate.name` specified in [Step 5](#step05), otherwise it won't work. From 9458b5fd27c8ce756d0f9cba8b13efd3c8145888 Mon Sep 17 00:00:00 2001 From: Svetlin Tanyi Date: Thu, 13 Feb 2020 15:17:20 +0100 Subject: [PATCH 191/301] Added a breakline for format improvement --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5d7302fbf..3960b3768 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ Here, we provide brief instructions on how to install and run both Docker and co * [Docker Compose](https://docs.docker.com/compose/install/) + Don't forget to create a volume for mysql: `docker volume create --name=mysql`
Don't forget to copy the `initSQL.sh` script next to the docker-compose file and execute it! On the first run it initializes the Database!
Example copy command which does this for you, execute from the project root directory. From bcbe49e40080f69747dcfcb8925d5fc7e7d2d184 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 13 Feb 2020 15:28:42 +0100 Subject: [PATCH 192/301] implemented use case diagramms --- .../qos_monitor/use_cases/GetMeaurements.png | Bin 51825 -> 56745 bytes .../qos_monitor/use_cases/GetMeaurements.uxf | 32 ++++++++++ .../qos_monitor/use_cases/PingMeasurement.png | Bin 51825 -> 80313 bytes .../qos_monitor/use_cases/PingMeasurement.uxf | 59 +++++++++++++----- .../qos_monitor/use_cases/Reset_Counter.png | Bin 51825 -> 57910 bytes .../qos_monitor/use_cases/Reset_Counter.uxf | 44 +++++++++++++ 6 files changed, 119 insertions(+), 16 deletions(-) create mode 100644 documentation/qos_monitor/use_cases/GetMeaurements.uxf create mode 100644 documentation/qos_monitor/use_cases/Reset_Counter.uxf diff --git a/documentation/qos_monitor/use_cases/GetMeaurements.png b/documentation/qos_monitor/use_cases/G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?PmjZFREUV{p?~>s$3pgJ7^axAAQ~)?V z4t=UXa4>pkJF5)V+B28$pp?sE%k9hb9v9o3oF@1mpSc{TL9@07#Fu*bcivlytF%qWDS`#k8<%}>8~4u{fkyDd=O6crCHfgE zQPP{-dOrVoBx_+3^MXVCd=%T1g27!8mCk6Rb7!m!5Cb7mzpJHA1>hz`mOJFORG8+!O~)$B6gkNP}$exqjli~5F)f1hN^PWJ13es0Gdu!!u3lO{|C z@Y~NV#s~c=H@qcW!J73Gyr6~cBY}q?=5>nic~I846>NXKEN*Ms&LGSjdyQkx4vx~gzSE}v;wLv5vQ_l(j0G=iZJ1zB0716>ivLJ{WW~w%TWxPzN|407FST?6K};_ zURit9rMcfX7)>6r?OIn#8R(78-J`AE7`mZ0}~6E2qoct z1OqdXSXIyD8#@+5gqY9F%uK?j9j6?{s2A>OrW0A^N>eubkC6pgFD3W-;94{Vb3_$Hnfo*I{0=``_4GKBvDEahNLJ|V~1dCuMAGbV0{s;>&~ zY*IF2!)C+bC$=;)X3){l9UtjhKNoo!_we`dU=OLPUY42VIiDQjJdJ!iukRkEVaO0y0P@Z zQEB_+s!B0;UGtX)GINK-!on3u@E*^2b5cnUbCo==_Sg9C?9SVqL>P%ySApBmcBU#`w9 z%(pUdIX9v4Y6Gc&tKM-A4+@c#7)Z;72_rzlp%kK*A9Jg#3}w(koH=_$%~UD?X) z|82>Xs*&0pd|!WlarJ{};P{=PZlR5lR-x71r|e#;!`z&ko100U4FUf;CL(#(CzbNw z%+4Ru;(#a-8Q$ZJvU-_#2i$+iawc#-CSDq(|Kefv(m3D%t~H)d`iG?ZfBfI|@;yv) XlXGI~N63hez<&y|$}-QT41NC(wi5Pp diff --git a/documentation/qos_monitor/use_cases/GetMeaurements.uxf b/documentation/qos_monitor/use_cases/GetMeaurements.uxf index 704fd9726..abea3fd0c 100644 --- a/documentation/qos_monitor/use_cases/GetMeaurements.uxf +++ b/documentation/qos_monitor/use_cases/GetMeaurements.uxf @@ -1,32 +1,42 @@ -10SERVICE REGISTRY DTOUMLSpecialState330402020type=initialRelation330503080lt=<-10;60;10;10Relation34045030140lt=<-10;120;10;10UMLState18010400530QoS Monitor Controller -valign=topUMLState27036017040call getPingMeasurements +10SERVICE REGISTRY DTOUMLSpecialState330402020type=initialRelation330503080lt=<-10;60;10;10Relation34056030110lt=<-10;90;10;10UMLState14020400610QoS Monitor Controller +valign=topUMLState27047017040call getPingMeasurements bg=yellow -type=senderRelation430120360280lt=<. +type=senderRelation350250430180lt=<- -340;10;170;10;170;260;10;260UMLState65020420350QoS DB Service -valign=topUMLState7709022040getPingMeasurements called +410;10;240;10;240;160;10;160UMLState640150420350QoS DB Service +valign=topUMLState76022022040getPingMeasurements called bg=yellow -type=receiverUMLState80027020040getPingMeasurements +type=receiverUMLState79040020040getPingMeasurements answer produced bg=yellow -type=senderUMLSpecialState850502020type=initialRelation850603050lt=<-10;30;10;10Relation8501203080lt=<-10;60;10;10Relation430280700180lt=<. -10;160;680;160;680;10;570;10UMLState25011017050received +type=senderUMLSpecialState8401802020type=initialRelation8401903050lt=<-10;30;10;10Relation8402503080lt=<-10;60;10;10Relation430410700160lt=<- +10;140;680;140;680;10;560;10UMLState25011017050received getPingMeasurements request bg=yellow -type=receiverUMLState79018019040getAllMeasurement -bg=blueRelation3302303070lt=<- -10;50;10;10UMLSpecialState3305705050type=final +type=receiverUMLState78031019040getAllMeasurement +bg=blueRelation3303503060lt=<- +10;40;10;10UMLSpecialState3206506060type=final bg=green -UMLState26020019040validate +UMLState26032019040validate request parameters -bg=blueRelation8502103080lt=<-10;60;10;10Relation3301503070lt=<-10;50;10;10UMLSpecialState3202804040type=decision +bg=blueRelation8403403080lt=<-10;60;10;10Relation3301503050lt=<-10;30;10;10UMLSpecialState3203904040type=decision bg=orange -Relation33031018070lt=<- -request parameters are valid10;50;10;10UMLState27042017040getPingMeasurements +Relation33042018070lt=<- +request parameters are valid10;50;10;10UMLState27053017040getPingMeasurements returned bg=yellow -type=receiverRelation12028022040lt=<- -request parameters are invalid10;20;200;20UMLSpecialState802805050type=final +type=receiverRelation12039022040lt=<- +request parameters are invalid10;20;200;20UMLSpecialState3202404040type=decision +bg=orange +Relation33027017070lt=<- +request sender is the +Orchestrator Core System10;50;10;10Relation12024022050lt=<- +request sender is not the +Orchestrator Core System10;20;200;20UMLState25018019040validate +request parameters +bg=blueRelation3302103050lt=<-10;30;10;10UMLSpecialState703806060type=final +bg=red +UMLSpecialState702306060type=final bg=red \ No newline at end of file diff --git a/documentation/qos_monitor/use_cases/PingMeasurement.png b/documentation/qos_monitor/use_cases/PingMeasurement.png index d42af9a06df9fca526d8f2132bcf2bf288d89680..710cdda31db0f6f3698c3b78d30291e497ad556c 100644 GIT binary patch delta 24375 zcmbTecRbbM-#>1Zqijl&aqJO_q{v>`*_(zDvRCGtkdSP$Wp5&TkLnN{jlX!<*Ppwir?b zKbYvG>%8rG-;gp8Um)>g_ee;5ywhN5 z^dxw`0Xe6w#H6!+Fg&9|W}$_#<+z3V!_t}&ubLn%)8RSK6c?xB?IouLGHwQ%=JHw$@d{87o0hROZU4Q?B~A6lC%?%t=&tyxBEAT#B0(`jEBrCT#amNzsS~JKOeNfJX3QKvb&M@!NPG5%`Zyl#GZ48?UK8 zMGWO2HfAt}c=GEoJj{c1h38T%oZ`X)ADbd{VURIBiZ?FYg#on`AMSE#Kb%2E*L~Ml zS1u)pl?uM*Jm!=qs*$!+vy>b*Vg%*Ll}zkpG~CFsl14809+Sc~5Q0YZIYRqlQ37=Bq7& z_Hv>LmAXT&^A+#>_}mVILut|5%VTOtk4?qoLSk4_)0kNb=X~O(kWS_5aqm)=IE)o* zs@5ffe>&s1@A@Q(D57?jyj&f&pCg6i-cO2A>vZuRuNCg1 zxjFjqqh`oc-DD9L8LIF+7Nm8J>{eRa0)( zx|_Y~Q@Q(jB6}FOx&V2VJR z(PnF*m1cEGyl6Q@w!6v)(-uf=_b7YfRjTPm(#iefhX&1$62dBbuG@~McjT@3V~Nwi zjYfE*rw?UBh309YBfE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c8X>RHodLhGd6XSZ_Hr^@elx0)-Px7U2nPPj9li{Oe#cFEIS8H zXYIX8s>H);q`Eq;zxm;B12W{0$9|ayF*AYA-i>z_4T^L+vjchsk1-qe1TR>n^nn(6 z5T(XUHP!lb8|2{upDT@fY;u=R@zJ*oQ0m~axC@wBLbs1Ou0Ntkv%7w21t4zZyfEi_ zi;JNu{b)T!I};FQ3jEI6vjG2h_pS1pu&K{kQ=^Fme3d8KIu-o{3eRD|C4jBYX;ihwqIhZJObqEq4(a{h*#337lwhD+8cPEV2s+O!9}Tw7TjXbg$fW zOtObK@C`WJpF|7A^ZX5q_9UNTW=@X2u|MY=nQixd70sNE-+uk ztoBNuq%1}WCS4E$-Bo~|yKF;`TFO;JPZe#Kyvu+busb`yTMqROGN^FwF`src$d6Zq zmhGL@&i_$szsg|c9g@aQLC^-CA>!H3HE;uNs;HRr6aU}AOHft1?(17|KC^zzvxOdK zbMFHOP(}WE-Z=#LDFG-g{9|O!hzdI0&FukTU=Ua4V02JM;c8#D_Eg5uV&0xem4pkF z`MuID7~SADmY94dq?aA!eFl_}Ps%Cjsj?hpo@~Z`8jPd6DL%Mvz7?Er9vOd#BHY#H zfUlv?SC=&eZoN~pUi9n*jli`AMZ{UQX40YZ5S{g>O)8wfIe<==8U( z`C!$;x~JtHg7<$jc!(dbULtW{q$&JCKPS|Xi($r zZ+&&B%1l-?p4I;!d`JNgCOBcx2)77Hgntjeioq=7&wQ+b!0g%$)JRN1b2%LP0-hKg z-azH?WDfu7pTM_CQO&gc%M(gBJW0$|RiEV&e^oPxK?Hzrh2=GVem^K1JehdW$duuU zW)2PQ#vr9n3Cidfz`v)v`zl2Lq9KETe$X1g**3e;eh^xL;vxjlI1xX7;xp$Y>SP-G zulVbe1MuX!v8n%DMx%T-1=9tL{&yMte-gpQ|4Ibx8IjJlk< measurements and logs bg=yellow type=senderUMLState78067015040save to DB -bg=blueRelation550620240110lt=<.220;10;60;10;60;90;10;90Relation550760620130lt=<.10;10;80;10;80;110;600;110;600;20;390;20Relation8406203070lt=<-10;50;10;10Relation8407003070lt=<-10;50;10;10 \ No newline at end of file +bg=blueRelation550620240110lt=<-220;10;60;10;60;90;10;90Relation550760620130lt=<-10;10;80;10;80;110;600;110;600;20;390;20Relation8406203070lt=<-10;50;10;10Relation8407003070lt=<-10;50;10;10 \ No newline at end of file diff --git a/documentation/qos_monitor/use_cases/Reset_Counter.png b/documentation/qos_monitor/use_cases/Reset_Counter.png index 0e25c349ed411d0e7d95ea478c61886a92d3bc73..2e6d8efad95ed8d84026ec6a8c37632f0ee75865 100644 GIT binary patch literal 58497 zcmc%xbySpV-v$g5qYNT2fPgfJgfM^tQqo8$Qqqm+0MgykA=1*)pn!x(w;+hfP$D4R z9nzieIm6!fz3=C_pKq=2k9WOmvDRM8J#$^>`OD+@#e^s;%Hm(6yoP~+f&WPE;ZqC@ zY$OH-7BloJ_?OT$2R951dW=U8CDdFE)*A3)Nn0B>E*KvMOlRPB)({=xnX5Hr&>xCF z`zevoiEp3ikCc*WAg_;lJ$(zu^!me_O$?oKO@YQ(MAg@*F$1x$3Hr-Z7}1NmhE8V& zEK1K$U}m$zLXs|yE2^09D;!KTxM*(Ve>(e9q1E(cu-L0n=`7#E+eM^S!ph2uV;Tz+ zhVj4tY@xh9$}-G87|{Ru*CYlNXJw=k$AJ9LKk-`_nPHCq`&k&6P{iE-eh>!Km82<* zn;ZLoJqQDGH#>~_zdfjvl@aHEz7`yW{thO*LGcZg|9>791Nwpl6FP5cZuRXN7Cpv) z{zb)#zmPmy8!jt<)^c^E6oGfPtmK`AjYIG=H{I(oi&EPAzFeigVy`{+cLH|CPjT$9 z(ZUd4z~!|Zin6!2&vV;Z=r2Xc*KQ-(ms!M)aK~L|!~3&k3C+iA>XqvRJkOAAF zTwmmRgm>d*Yg=|SNiYheDM_I(E98XK`ZiDNq7q) zvi*Z`nL_H$zYXJVl(<>u=~f$EAD7n_o{-CWN?D4KnAl{~-D%=Wsoa3%=jSgi=cec2 zaaQ}Jd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5v6MJ(0i_2`zgF0>a}0{ zcv|h`SxN}tfq0E*SK$Ly&|dHo!1V4tols~Px0GogB{dgqdo=DN*5Or5*F~^S&U9O* zlK?NOaY^;tzwXFg##gV@MykEUhar;Vn>(^uIxqPyC|SUp1|dlq5&c~6o6BgV_!JDV*FI|k6EjUBz^<>)lp z-92W{MT3Ebi-5C&G17^OhNfX{?ePbIbJ9t8qoKq9G^f^tKDF<#ST&ritgI~i{Fx-; zf&F^m6$$SeXY8<7?zXlFLPElk7!gB#Rfd!ITw!1Sl_+wq>4#UFimEDAZT#}sLpg6W z9}8mnmj*_+Z=YMt>l+@9d*9I|b@CaAi%42+H5Et2mv<9lV`ZvGLkkOeOYeq?VBo{Z zxIbh3Sm^1tygoHO{cCl#!)~shDyjgQ}D z=ivBKjT07%hK8PbOGZ))hKuGCj8`A+$+tOGy%?@Cp5Dk{7VgbNk)i6|x%ywfOe(6X zZdMwG!k_Kk-9Vje(&0x=wn}@z0S diff --git a/documentation/qos_monitor/use_cases/Reset_Counter.uxf b/documentation/qos_monitor/use_cases/Reset_Counter.uxf index 30e9c9988..ab0d6948a 100644 --- a/documentation/qos_monitor/use_cases/Reset_Counter.uxf +++ b/documentation/qos_monitor/use_cases/Reset_Counter.uxf @@ -6,7 +6,7 @@ bg=blue bg=blueRelation3304403070lt=<-10;50;10;10UMLState18010400530Reset Counter Task valign=topRelation3301203060lt=<-10;40;10;10UMLState28029017040call update measurement bg=yellow -type=senderRelation440120350210lt=<. +type=senderRelation440120350210lt=<- 330;10;160;10;160;190;10;190Relation24017010030lt=<-80;10;10;10UMLSyncBarHorizontal29012010020{joinSpec= date is on or @@ -19,7 +19,7 @@ valign=topUMLState76044019040queryAll answer produced bg=yellow -type=senderUMLSpecialState850502020type=initialRelation850603050lt=<-10;30;10;10Relation8001203070lt=<-10;50;10;10Relation420340710200lt=<. +type=senderUMLSpecialState850502020type=initialRelation850603050lt=<-10;30;10;10Relation8001203070lt=<-10;50;10;10Relation420340710200lt=<- 10;30;10;10;210;10;210;180;690;180;690;120;530;120UMLState28037017040update measurement returned bg=yellow From bfe6aaaf23de742cb7a49d76e9462f3e5bbd8e14 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 14 Feb 2020 14:47:06 +0100 Subject: [PATCH 201/301] Updated README.md --- README.md | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/README.md b/README.md index 6128af178..426dbf9f1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ + # Arrowhead Framework 4.1.3 [Arrowhead](http://www.arrowhead.eu/) (and its continuation, [Productive4.0](https://productive40.eu/)) is an ambitious holistic innovation project, @@ -6393,6 +6394,40 @@ __PingMeasurement list response__ the output : } ``` +| Field | Description | +| ----- | ----------- | +| `count` | Number of record found | +| `data` | Array of data | +| `id` | ID of the ping measurement | +| `measurement.id` | ID of the measurement | +| `measurement.system.id` | ID of the measured system | +| `measurement.system.systemName` | Name of the measured system | +| `measurement.system.address` | Address of the measured system | +| `measurement.system.port` | Port of the measured system | +| `measurement.system.createdAt` | Date of creation of the measured system | +| `measurement.system.updatedAt` | Date of update of the measured system | +| `measurement.measurementType` | Type of the measurement | +| `measurement.lastMeasurementAt` | Time of the last measurement | +| `measurement.createdAt` | Date of creation of the measurement | +| `measurement.updatedAt` | Date of update of the measurement | +| `available` | Boolean value of the systems calculated availability| +| `lastAccessAt` | TimeStamp value of the systems last known availability| +| `minResponseTime` | Integer value of milliseconds of the fastest returned ping| +| `maxResponseTime` | Integer value of milliseconds of the slowest returned ping| +| `meanResponseTimeWithTimeout` | Integer value of milliseconds of the calculated average of pings including timeouts| +| `meanResponseTimeWithoutTimeout` | Integer value of milliseconds of the calculated average of pings not including timeouts| +| `jitterWithTimeout` | Integer value of milliseconds of the calculated standard deviation of pings including timeouts| +| `jitterWithoutTimeout` | Integer value of milliseconds of the calculated standard deviation of pings not including timeouts| +| `lostPerMeasurementPercent` | Integer value of calculated lost ping percentage| +| `sent` | Integer value of sent pings in measurement| +| `received` | Integer value of received pings in measurement| +| `countStartedAt` | TimeSatmp value of the last reset of sent and received fields| +| `countStartedAt` | TimeSatmp value of the last reset of sent and received fields| +| `sentAll` | Integer value of sent pings since ping measurement created| +| `receivedAll` | Integer value of received pings since ping measurement created| +| `createdAt` | Date of creation of the ping measurement | +| `updatedAt` | Date of update of the ping measurement | + ### Get ping measurements by system id mgmt @@ -6453,6 +6488,38 @@ __Ping Measurment response by system id__ the output : } ``` +| Field | Description | +| ----- | ----------- | +| `id` | ID of the ping measurement | +| `measurement.id` | ID of the measurement | +| `measurement.system.id` | ID of the measured system | +| `measurement.system.systemName` | Name of the measured system | +| `measurement.system.address` | Address of the measured system | +| `measurement.system.port` | Port of the measured system | +| `measurement.system.createdAt` | Date of creation of the measured system | +| `measurement.system.updatedAt` | Date of update of the measured system | +| `measurement.measurementType` | Type of the measurement | +| `measurement.lastMeasurementAt` | Time of the last measurement | +| `measurement.createdAt` | Date of creation of the measurement | +| `measurement.updatedAt` | Date of update of the measurement | +| `available` | Boolean value of the systems calculated availability| +| `lastAccessAt` | TimeStamp value of the systems last known availability| +| `minResponseTime` | Integer value of milliseconds of the fastest returned ping| +| `maxResponseTime` | Integer value of milliseconds of the slowest returned ping| +| `meanResponseTimeWithTimeout` | Integer value of milliseconds of the calculated average of pings including timeouts| +| `meanResponseTimeWithoutTimeout` | Integer value of milliseconds of the calculated average of pings not including timeouts| +| `jitterWithTimeout` | Integer value of milliseconds of the calculated standard deviation of pings including timeouts| +| `jitterWithoutTimeout` | Integer value of milliseconds of the calculated standard deviation of pings not including timeouts| +| `lostPerMeasurementPercent` | Integer value of calculated lost ping percentage| +| `sent` | Integer value of sent pings in measurement| +| `received` | Integer value of received pings in measurement| +| `countStartedAt` | TimeSatmp value of the last reset of sent and received fields| +| `countStartedAt` | TimeSatmp value of the last reset of sent and received fields| +| `sentAll` | Integer value of sent pings since ping measurement created| +| `receivedAll` | Integer value of received pings since ping measurement created| +| `createdAt` | Date of creation of the ping measurement | +| `updatedAt` | Date of update of the ping measurement | + ### Get ping measurements by system id From 4a2e8f1b4f82f4b17a450a3f160945857a8bbf83 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 14 Feb 2020 14:58:43 +0100 Subject: [PATCH 202/301] Updated README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 426dbf9f1..9de2e4227 100644 --- a/README.md +++ b/README.md @@ -6302,7 +6302,7 @@ The QoS Monitor has the following use cases: | -------- | ----------- | ------ | ----- | ------ | | [Echo](#qos_monitor_endpoints_get_echo) | /echo | GET | - | OK | - + ### Management endpoint description
From a1a4de6c004489f271f889582699efdccfaceec2 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 14 Feb 2020 15:01:11 +0100 Subject: [PATCH 203/301] Updated README.md - corrected intendation --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 9de2e4227..c25a647c1 100644 --- a/README.md +++ b/README.md @@ -6360,12 +6360,12 @@ __PingMeasurement list response__ the output : "measurement": { "id": 1, "system": { - "id": 5, - "systemName": "testsystem", - "address": "testsystem.ai", - "port": 12345, - "createdAt": "2020-02-04 09:38:56", - "updatedAt": "2020-02-04 09:38:56" + "id": 5, + "systemName": "testsystem", + "address": "testsystem.ai", + "port": 12345, + "createdAt": "2020-02-04 09:38:56", + "updatedAt": "2020-02-04 09:38:56" }, "measurementType": "PING", "lastMeasurementAt": "2020-02-14T10:48:10+01:00", @@ -6457,12 +6457,12 @@ __Ping Measurment response by system id__ the output : "measurement": { "id": 1, "system": { - "id": 5, - "systemName": "testsystem", - "address": "testsystem.ai", - "port": 12345, - "createdAt": "2020-02-04 09:38:56", - "updatedAt": "2020-02-04 09:38:56" + "id": 5, + "systemName": "testsystem", + "address": "testsystem.ai", + "port": 12345, + "createdAt": "2020-02-04 09:38:56", + "updatedAt": "2020-02-04 09:38:56" }, "measurementType": "PING", "lastMeasurementAt": "2020-02-14T10:48:10+01:00", From 1f6880fc98e039abe7cb7bf2d64668449f9fdb5f Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 14 Feb 2020 15:03:10 +0100 Subject: [PATCH 204/301] Updated README.md - corrected intendation --- README.md | 62 +++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index c25a647c1..109690b7c 100644 --- a/README.md +++ b/README.md @@ -6452,40 +6452,40 @@ __Get ping measurements by system id mgmt path parameter__ the input : __Ping Measurment response by system id__ the output : ```json - { +{ + "id": 1, + "measurement": { "id": 1, - "measurement": { - "id": 1, - "system": { - "id": 5, - "systemName": "testsystem", - "address": "testsystem.ai", - "port": 12345, - "createdAt": "2020-02-04 09:38:56", - "updatedAt": "2020-02-04 09:38:56" - }, - "measurementType": "PING", - "lastMeasurementAt": "2020-02-14T10:48:10+01:00", - "createdAt": "2020-02-04T10:42:04+01:00", - "updatedAt": "2020-02-14T10:48:47+01:00" + "system": { + "id": 5, + "systemName": "testsystem", + "address": "testsystem.ai", + "port": 12345, + "createdAt": "2020-02-04 09:38:56", + "updatedAt": "2020-02-04 09:38:56" }, - "available": true, - "lastAccessAt": "2020-02-14T10:48:10+01:00", - "minResponseTime": 15, - "maxResponseTime": 26, - "meanResponseTimeWithTimeout": 18, - "meanResponseTimeWithoutTimeout": 18, - "jitterWithTimeout": 3, - "jitterWithoutTimeout": 3, - "lostPerMeasurementPercent": 0, - "sent": 12075, - "received": 12070, - "countStartedAt": "2020-02-07T00:00:00+01:00", - "sentAll": 63175, - "receivedAll": 56721, - "createdAt": "2020-02-14T10:48:47+01:00", + "measurementType": "PING", + "lastMeasurementAt": "2020-02-14T10:48:10+01:00", + "createdAt": "2020-02-04T10:42:04+01:00", "updatedAt": "2020-02-14T10:48:47+01:00" - } + }, + "available": true, + "lastAccessAt": "2020-02-14T10:48:10+01:00", + "minResponseTime": 15, + "maxResponseTime": 26, + "meanResponseTimeWithTimeout": 18, + "meanResponseTimeWithoutTimeout": 18, + "jitterWithTimeout": 3, + "jitterWithoutTimeout": 3, + "lostPerMeasurementPercent": 0, + "sent": 12075, + "received": 12070, + "countStartedAt": "2020-02-07T00:00:00+01:00", + "sentAll": 63175, + "receivedAll": 56721, + "createdAt": "2020-02-14T10:48:47+01:00", + "updatedAt": "2020-02-14T10:48:47+01:00" +} ``` | Field | Description | From 8d2b571f339ef0b62f2ceeabc0ecbe5029806d81 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Mon, 17 Feb 2020 08:18:04 +0100 Subject: [PATCH 205/301] synchronizing files --- .../common/database/entity/Device.java | 4 +- .../common/database/entity/System.java | 2 +- deviceregistry/pom.xml | 15 ++++ ...java => DeviceRegistrySecurityConfig.java} | 2 +- ....java => DeviceRegistrySwaggerConfig.java} | 4 +- .../certificates/device_registry.p12 | Bin 5369 -> 0 bytes .../database/service/DatabaseTestContext.java | 14 ++++ .../service/DeviceRepositoryTest.java | 66 ++++++++++++++++ .../DeviceRegistryControllerDeviceTest.java | 4 - deviceregistry/src/test/resources/banner.txt | 0 .../src/test/resources/sql/devices.sql | 7 ++ .../src/test/resources/sql/systems.sql | 7 ++ .../OnboardingAccessControlFilter.java | 30 ++++++++ .../security/OnboardingSecurityConfig.java | 11 +++ .../swagger/OnboardingSwaggerConfig.java | 27 +++++++ systemregistry/pom.xml | 17 ++++- .../SystemRegistryAccessControlFilter.java | 30 ++++++++ .../SystemRegistrySecurityConfig.java | 11 +++ .../swagger/SystemRegistrySwaggerConfig.java | 27 +++++++ .../java/eu/arrowhead/TestConfiguration.java | 14 ++++ .../service/SystemRepositoryTest.java | 71 ++++++++++++++++++ systemregistry/src/test/resources/banner.txt | 0 systemregistry/src/test/resources/log4j2.xml | 45 +++++++++++ .../src/test/resources/sql/device.sql | 7 ++ .../src/test/resources/sql/systems.sql | 7 ++ 25 files changed, 411 insertions(+), 11 deletions(-) rename deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/{DRSecurityConfig.java => DeviceRegistrySecurityConfig.java} (80%) rename deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/swagger/{SRSwaggerConfig.java => DeviceRegistrySwaggerConfig.java} (89%) create mode 100644 deviceregistry/src/test/java/eu/arrowhead/common/database/service/DatabaseTestContext.java create mode 100644 deviceregistry/src/test/java/eu/arrowhead/common/database/service/DeviceRepositoryTest.java create mode 100644 deviceregistry/src/test/resources/banner.txt create mode 100644 deviceregistry/src/test/resources/sql/devices.sql create mode 100644 deviceregistry/src/test/resources/sql/systems.sql create mode 100644 onboarding/src/main/java/eu/arrowhead/core/onboarding/security/OnboardingAccessControlFilter.java create mode 100644 onboarding/src/main/java/eu/arrowhead/core/onboarding/security/OnboardingSecurityConfig.java create mode 100644 onboarding/src/main/java/eu/arrowhead/core/onboarding/swagger/OnboardingSwaggerConfig.java create mode 100644 systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistryAccessControlFilter.java create mode 100644 systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistrySecurityConfig.java create mode 100644 systemregistry/src/main/java/eu/arrowhead/core/systemregistry/swagger/SystemRegistrySwaggerConfig.java create mode 100644 systemregistry/src/test/java/eu/arrowhead/TestConfiguration.java create mode 100644 systemregistry/src/test/java/eu/arrowhead/common/database/service/SystemRepositoryTest.java create mode 100644 systemregistry/src/test/resources/banner.txt create mode 100644 systemregistry/src/test/resources/log4j2.xml create mode 100644 systemregistry/src/test/resources/sql/device.sql create mode 100644 systemregistry/src/test/resources/sql/systems.sql diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java index 3e2b588d8..d52527be6 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java @@ -46,10 +46,10 @@ public class Device @Column(nullable = false, length = CoreDefaults.VARCHAR_BASIC) private String address; - @Column(nullable = false, length = CoreDefaults.VARCHAR_BASIC) + @Column(nullable = false, unique = true, length = CoreDefaults.VARCHAR_BASIC) private String macAddress; - @Column(nullable = false, length = CoreDefaults.VARCHAR_EXTENDED) + @Column(nullable = true, length = CoreDefaults.VARCHAR_EXTENDED) private String authenticationInfo; @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/System.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/System.java index 1e61799b1..95cf04048 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/System.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/System.java @@ -59,7 +59,7 @@ public class System { @Column(nullable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") private ZonedDateTime updatedAt; - @OneToMany(mappedBy = "system_", fetch = FetchType.LAZY, orphanRemoval = true) + @OneToMany(mappedBy = "system", fetch = FetchType.LAZY, orphanRemoval = true) @OnDelete(action = OnDeleteAction.CASCADE) private Set serviceRegistryEntries = new HashSet<>(); diff --git a/deviceregistry/pom.xml b/deviceregistry/pom.xml index 932f9a97c..1b089d82d 100644 --- a/deviceregistry/pom.xml +++ b/deviceregistry/pom.xml @@ -17,6 +17,21 @@ arrowhead-core-common ${revision} + + org.springframework.boot + spring-boot-starter-test + test + + + com.h2database + h2 + test + + + org.springframework + spring-test + test + diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DRSecurityConfig.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DeviceRegistrySecurityConfig.java similarity index 80% rename from deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DRSecurityConfig.java rename to deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DeviceRegistrySecurityConfig.java index 1d757d3b3..749ca524f 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DRSecurityConfig.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DeviceRegistrySecurityConfig.java @@ -6,6 +6,6 @@ @Configuration @EnableWebSecurity -public class DRSecurityConfig extends DefaultSecurityConfig { +public class DeviceRegistrySecurityConfig extends DefaultSecurityConfig { } \ No newline at end of file diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/swagger/SRSwaggerConfig.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/swagger/DeviceRegistrySwaggerConfig.java similarity index 89% rename from deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/swagger/SRSwaggerConfig.java rename to deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/swagger/DeviceRegistrySwaggerConfig.java index 946f8d98e..2470296e9 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/swagger/SRSwaggerConfig.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/swagger/DeviceRegistrySwaggerConfig.java @@ -9,13 +9,13 @@ @EnableSwagger2 @Configuration -public class SRSwaggerConfig extends DefaultSwaggerConfig { +public class DeviceRegistrySwaggerConfig extends DefaultSwaggerConfig { //================================================================================================= // methods //------------------------------------------------------------------------------------------------- - public SRSwaggerConfig() { + public DeviceRegistrySwaggerConfig() { super(CommonConstants.CORE_SYSTEM_DEVICE_REGISTRY); } diff --git a/deviceregistry/src/main/resources/certificates/device_registry.p12 b/deviceregistry/src/main/resources/certificates/device_registry.p12 index dcd55a15036630c3ee3511938989360eb13d8803..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 5369 zcmY*cWmFW5wjH{p8-`(q{OB1P=@L-7K}tf9lFmV4=nz3#LIzY|=n^DHVrZn17(fJR z>8|U0>%Du|{c&pVea_Fl)`24EPH}PYpa{AuLK6NM&6sm?93q@T1lmaLz#Sh!;PMxC{2O+JWdFDIfD{L}5P^RUMc|)9`3On>AO3rs6`!vCOKr!b|H1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VTRI)XuQ{TcNAjh$D57zA{VDt*h4Jar%posaaUY%SGNN33>4U84e&XWc H#1#Gu3{yTC diff --git a/deviceregistry/src/test/java/eu/arrowhead/common/database/service/DatabaseTestContext.java b/deviceregistry/src/test/java/eu/arrowhead/common/database/service/DatabaseTestContext.java new file mode 100644 index 000000000..e8c11b927 --- /dev/null +++ b/deviceregistry/src/test/java/eu/arrowhead/common/database/service/DatabaseTestContext.java @@ -0,0 +1,14 @@ +package eu.arrowhead.common.database.service; + +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.database.repository.RefreshableRepositoryImpl; +import org.springframework.boot.SpringBootConfiguration; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; + +@SpringBootConfiguration +@EntityScan(basePackages = CoreCommonConstants.DATABASE_ENTITY_PACKAGE) +@EnableJpaRepositories(basePackages = CoreCommonConstants.DATABASE_REPOSITORY_PACKAGE, repositoryBaseClass = RefreshableRepositoryImpl.class) +public class DatabaseTestContext { + public DatabaseTestContext() { super(); } +} diff --git a/deviceregistry/src/test/java/eu/arrowhead/common/database/service/DeviceRepositoryTest.java b/deviceregistry/src/test/java/eu/arrowhead/common/database/service/DeviceRepositoryTest.java new file mode 100644 index 000000000..ddf647dc1 --- /dev/null +++ b/deviceregistry/src/test/java/eu/arrowhead/common/database/service/DeviceRepositoryTest.java @@ -0,0 +1,66 @@ +package eu.arrowhead.common.database.service; + +import eu.arrowhead.common.database.entity.Device; +import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.database.repository.DeviceRepository; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.jdbc.Sql; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.List; +import java.util.Optional; + +@RunWith(SpringRunner.class) +@DataJpaTest +@TestPropertySource(properties = { + "spring.jpa.hibernate.ddl-auto=create" +}) +@Sql(scripts = "classpath:/sql/devices.sql") +public class DeviceRepositoryTest { + + @Autowired + private DeviceRepository deviceRepository; + + @Test + public void injectedComponentsAreNotNull() { + Assert.assertNotNull(deviceRepository); + } + + @Test + public void findByDeviceNameAndMacAddress() { + final Optional device1 = deviceRepository.findByDeviceNameAndMacAddress("device1", "01:23:45:67:89:AB"); + Assert.assertTrue(device1.isPresent()); + } + + @Test + public void findByDeviceNameAndMacAddress_nonExistentName() { + final Optional device1 = deviceRepository.findByDeviceNameAndMacAddress("device", "01:23:45:67:89:AB"); + Assert.assertFalse(device1.isPresent()); + } + + @Test + public void findByDeviceNameAndMacAddress_nonExistentMacAddress() { + final Optional device1 = deviceRepository.findByDeviceNameAndMacAddress("device1", "FF:FF:FF:FF:FF:FF"); + Assert.assertFalse(device1.isPresent()); + } + + @Test + public void findByDeviceName() { + final List device2 = deviceRepository.findByDeviceName("device2"); + Assert.assertEquals(2, device2.size()); + + final List device3 = deviceRepository.findByDeviceName("device3"); + Assert.assertEquals(2, device3.size()); + } + + @Test + public void findByDeviceName_nonExistent() { + final List devices = deviceRepository.findByDeviceName("device"); + Assert.assertEquals(0, devices.size()); + } +} \ No newline at end of file diff --git a/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryControllerDeviceTest.java b/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryControllerDeviceTest.java index 452f51ff4..3346b3e27 100644 --- a/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryControllerDeviceTest.java +++ b/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryControllerDeviceTest.java @@ -256,10 +256,6 @@ public void createDeviceRequestEmptyMacAddress() throws Exception { .andReturn(); } - @Test - public void updateDevice() { - } - @Test public void updateDeviceRequest() throws Exception { final DeviceRequestDTO dto = new DeviceRequestDTO("device", "address", "macAddress", "authenticationInfo"); diff --git a/deviceregistry/src/test/resources/banner.txt b/deviceregistry/src/test/resources/banner.txt new file mode 100644 index 000000000..e69de29bb diff --git a/deviceregistry/src/test/resources/sql/devices.sql b/deviceregistry/src/test/resources/sql/devices.sql new file mode 100644 index 000000000..e6ab7fa20 --- /dev/null +++ b/deviceregistry/src/test/resources/sql/devices.sql @@ -0,0 +1,7 @@ +insert into device (id, device_name, address, mac_address, authentication_info, created_at, updated_at) +values (1, 'device1', '192.168.1.1', '01:23:45:67:89:AB', null, '2020-01-01 00:00:00', '2020-01-01 00:00:00'), + (2, 'device1', '192.168.1.2', '02:23:45:67:89:AB', null, '2020-01-02 00:00:00', '2020-01-02 00:00:00'), + (3, 'device2', '192.168.2.3', '03:23:45:67:89:AB', null, '2020-01-03 00:00:00', '2020-01-03 00:00:00'), + (4, 'device2', '192.168.2.4', '04:23:45:67:89:AB', null, '2020-01-04 00:00:00', '2020-01-04 00:00:00'), + (5, 'device3', '192.168.3.5', '05:23:45:67:89:AB', null, '2020-01-05 00:00:00', '2020-01-05 00:00:00'), + (6, 'device3', '192.168.3.6', '06:23:45:67:89:AB', null, '2020-01-06 00:00:00', '2020-01-06 00:00:00'); \ No newline at end of file diff --git a/deviceregistry/src/test/resources/sql/systems.sql b/deviceregistry/src/test/resources/sql/systems.sql new file mode 100644 index 000000000..a4d351902 --- /dev/null +++ b/deviceregistry/src/test/resources/sql/systems.sql @@ -0,0 +1,7 @@ +insert into system_ (id, address, authentication_info, created_at, port, system_name, updated_at) +values (1, '192.168.1.1', null, '2020-01-01 00:00:00', 1, 'system1', '2020-01-01 00:00:00'), + (2, '192.168.1.2', null, '2020-01-02 00:00:00', 2, 'system2', '2020-01-02 00:00:00'), + (3, '192.168.2.2', null, '2020-01-03 00:00:00', 2, 'system2', '2020-01-03 00:00:00'), + (4, '192.168.1.3', null, '2020-01-04 00:00:00', 3, 'system3', '2020-01-04 00:00:00'), + (5, '192.168.2.3', null, '2020-01-05 00:00:00', 3, 'system3', '2020-01-05 00:00:00'), + (6, '192.168.3.3', null, '2020-01-06 00:00:00', 3, 'system3', '2020-01-06 00:00:00'); \ No newline at end of file diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/security/OnboardingAccessControlFilter.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/security/OnboardingAccessControlFilter.java new file mode 100644 index 000000000..832c5045e --- /dev/null +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/security/OnboardingAccessControlFilter.java @@ -0,0 +1,30 @@ +package eu.arrowhead.core.onboarding.security; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.security.CoreSystemAccessControlFilter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.stereotype.Component; + +import java.util.Map; + +@Component +@ConditionalOnProperty(name = CommonConstants.SERVER_SSL_ENABLED, matchIfMissing = true) +public class OnboardingAccessControlFilter extends CoreSystemAccessControlFilter { + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + @Override + protected void checkClientAuthorized(final String clientCN, final String method, final String requestTarget, final String requestJSON, final Map queryParams) { + super.checkClientAuthorized(clientCN, method, requestTarget, requestJSON, queryParams); + + final String cloudCN = getServerCloudCN(); + if (requestTarget.contains(CoreCommonConstants.MGMT_URI)) { + // Only the local System Operator can use these methods + checkIfLocalSystemOperator(clientCN, cloudCN, requestTarget); + } + } + +} \ No newline at end of file diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/security/OnboardingSecurityConfig.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/security/OnboardingSecurityConfig.java new file mode 100644 index 000000000..21eb5d4d1 --- /dev/null +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/security/OnboardingSecurityConfig.java @@ -0,0 +1,11 @@ +package eu.arrowhead.core.onboarding.security; + +import eu.arrowhead.common.security.DefaultSecurityConfig; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; + +@Configuration +@EnableWebSecurity +public class OnboardingSecurityConfig extends DefaultSecurityConfig { + +} \ No newline at end of file diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/swagger/OnboardingSwaggerConfig.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/swagger/OnboardingSwaggerConfig.java new file mode 100644 index 000000000..b642cb974 --- /dev/null +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/swagger/OnboardingSwaggerConfig.java @@ -0,0 +1,27 @@ +package eu.arrowhead.core.onboarding.swagger; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.swagger.DefaultSwaggerConfig; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@EnableSwagger2 +@Configuration +public class OnboardingSwaggerConfig extends DefaultSwaggerConfig { + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public OnboardingSwaggerConfig() { + super(CommonConstants.CORE_SYSTEM_ONBOARDING); + } + + //------------------------------------------------------------------------------------------------- + @Bean + public Docket customizeSwagger() { + return configureSwaggerForCoreSystem(this.getClass().getPackageName()); + } +} \ No newline at end of file diff --git a/systemregistry/pom.xml b/systemregistry/pom.xml index d04c4d318..d55df90f6 100644 --- a/systemregistry/pom.xml +++ b/systemregistry/pom.xml @@ -17,7 +17,22 @@ arrowhead-core-common ${revision} - + + org.springframework.boot + spring-boot-starter-test + test + + + com.h2database + h2 + test + + + org.springframework + spring-test + test + + diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistryAccessControlFilter.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistryAccessControlFilter.java new file mode 100644 index 000000000..50ff83f4f --- /dev/null +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistryAccessControlFilter.java @@ -0,0 +1,30 @@ +package eu.arrowhead.core.systemregistry.security; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.security.CoreSystemAccessControlFilter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.stereotype.Component; + +import java.util.Map; + +@Component +@ConditionalOnProperty(name = CommonConstants.SERVER_SSL_ENABLED, matchIfMissing = true) +public class SystemRegistryAccessControlFilter extends CoreSystemAccessControlFilter { + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + @Override + protected void checkClientAuthorized(final String clientCN, final String method, final String requestTarget, final String requestJSON, final Map queryParams) { + super.checkClientAuthorized(clientCN, method, requestTarget, requestJSON, queryParams); + + final String cloudCN = getServerCloudCN(); + if (requestTarget.contains(CoreCommonConstants.MGMT_URI)) { + // Only the local System Operator can use these methods + checkIfLocalSystemOperator(clientCN, cloudCN, requestTarget); + } + } + +} \ No newline at end of file diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistrySecurityConfig.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistrySecurityConfig.java new file mode 100644 index 000000000..e54cc7a62 --- /dev/null +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistrySecurityConfig.java @@ -0,0 +1,11 @@ +package eu.arrowhead.core.systemregistry.security; + +import eu.arrowhead.common.security.DefaultSecurityConfig; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; + +@Configuration +@EnableWebSecurity +public class SystemRegistrySecurityConfig extends DefaultSecurityConfig { + +} \ No newline at end of file diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/swagger/SystemRegistrySwaggerConfig.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/swagger/SystemRegistrySwaggerConfig.java new file mode 100644 index 000000000..4fed8dab9 --- /dev/null +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/swagger/SystemRegistrySwaggerConfig.java @@ -0,0 +1,27 @@ +package eu.arrowhead.core.systemregistry.swagger; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.swagger.DefaultSwaggerConfig; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@EnableSwagger2 +@Configuration +public class SystemRegistrySwaggerConfig extends DefaultSwaggerConfig { + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public SystemRegistrySwaggerConfig() { + super(CommonConstants.CORE_SYSTEM_SYSTEM_REGISTRY); + } + + //------------------------------------------------------------------------------------------------- + @Bean + public Docket customizeSwagger() { + return configureSwaggerForCoreSystem(this.getClass().getPackageName()); + } +} \ No newline at end of file diff --git a/systemregistry/src/test/java/eu/arrowhead/TestConfiguration.java b/systemregistry/src/test/java/eu/arrowhead/TestConfiguration.java new file mode 100644 index 000000000..bd213c332 --- /dev/null +++ b/systemregistry/src/test/java/eu/arrowhead/TestConfiguration.java @@ -0,0 +1,14 @@ +package eu.arrowhead; + +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.database.repository.RefreshableRepositoryImpl; +import org.springframework.boot.SpringBootConfiguration; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; + +@SpringBootConfiguration +@EntityScan(basePackages = CoreCommonConstants.DATABASE_ENTITY_PACKAGE) +@EnableJpaRepositories(basePackages = CoreCommonConstants.DATABASE_REPOSITORY_PACKAGE, repositoryBaseClass = RefreshableRepositoryImpl.class) +public class TestConfiguration { + public TestConfiguration() { super(); } +} diff --git a/systemregistry/src/test/java/eu/arrowhead/common/database/service/SystemRepositoryTest.java b/systemregistry/src/test/java/eu/arrowhead/common/database/service/SystemRepositoryTest.java new file mode 100644 index 000000000..3a60f6ef9 --- /dev/null +++ b/systemregistry/src/test/java/eu/arrowhead/common/database/service/SystemRepositoryTest.java @@ -0,0 +1,71 @@ +package eu.arrowhead.common.database.service; + +import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.database.repository.SystemRepository; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.jdbc.Sql; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.List; +import java.util.Optional; + +@RunWith(SpringRunner.class) +@DataJpaTest +@TestPropertySource(properties = { + "spring.jpa.hibernate.ddl-auto=create" +}) +@Sql(scripts = "classpath:/sql/systems.sql") +public class SystemRepositoryTest { + + @Autowired + private SystemRepository systemRepository; + + @Test + public void injectedComponentsAreNotNull() { + Assert.assertNotNull(systemRepository); + } + + @Test + public void findBySystemNameAndAddressAndPort() { + final Optional system1 = systemRepository.findBySystemNameAndAddressAndPort("system1", "192.168.1.1", 1); + Assert.assertTrue(system1.isPresent()); + } + + @Test + public void findBySystemNameAndAddressAndPort_nonExistentName() { + final Optional system1 = systemRepository.findBySystemNameAndAddressAndPort("system", "192.168.1.1", 1); + Assert.assertFalse(system1.isPresent()); + } + + @Test + public void findBySystemNameAndAddressAndPort_nonExistentAddress() { + final Optional system1 = systemRepository.findBySystemNameAndAddressAndPort("system1", "192.168.1.10", 1); + Assert.assertFalse(system1.isPresent()); + } + + @Test + public void findBySystemNameAndAddressAndPort_nonExistentPort() { + final Optional system1 = systemRepository.findBySystemNameAndAddressAndPort("system1", "192.168.1.1", 10); + Assert.assertFalse(system1.isPresent()); + } + + @Test + public void findBySystemName() { + final List systems2 = systemRepository.findBySystemName("system2"); + Assert.assertEquals(2, systems2.size()); + + final List systems3 = systemRepository.findBySystemName("system3"); + Assert.assertEquals(3, systems3.size()); + } + + @Test + public void findBySystemName_nonExistent() { + final List systems2 = systemRepository.findBySystemName("system"); + Assert.assertEquals(0, systems2.size()); + } +} \ No newline at end of file diff --git a/systemregistry/src/test/resources/banner.txt b/systemregistry/src/test/resources/banner.txt new file mode 100644 index 000000000..e69de29bb diff --git a/systemregistry/src/test/resources/log4j2.xml b/systemregistry/src/test/resources/log4j2.xml new file mode 100644 index 000000000..ec4482ce9 --- /dev/null +++ b/systemregistry/src/test/resources/log4j2.xml @@ -0,0 +1,45 @@ + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex + + OFF + OFF + + + + + + + + ${LOG_PATTERN} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/systemregistry/src/test/resources/sql/device.sql b/systemregistry/src/test/resources/sql/device.sql new file mode 100644 index 000000000..e6ab7fa20 --- /dev/null +++ b/systemregistry/src/test/resources/sql/device.sql @@ -0,0 +1,7 @@ +insert into device (id, device_name, address, mac_address, authentication_info, created_at, updated_at) +values (1, 'device1', '192.168.1.1', '01:23:45:67:89:AB', null, '2020-01-01 00:00:00', '2020-01-01 00:00:00'), + (2, 'device1', '192.168.1.2', '02:23:45:67:89:AB', null, '2020-01-02 00:00:00', '2020-01-02 00:00:00'), + (3, 'device2', '192.168.2.3', '03:23:45:67:89:AB', null, '2020-01-03 00:00:00', '2020-01-03 00:00:00'), + (4, 'device2', '192.168.2.4', '04:23:45:67:89:AB', null, '2020-01-04 00:00:00', '2020-01-04 00:00:00'), + (5, 'device3', '192.168.3.5', '05:23:45:67:89:AB', null, '2020-01-05 00:00:00', '2020-01-05 00:00:00'), + (6, 'device3', '192.168.3.6', '06:23:45:67:89:AB', null, '2020-01-06 00:00:00', '2020-01-06 00:00:00'); \ No newline at end of file diff --git a/systemregistry/src/test/resources/sql/systems.sql b/systemregistry/src/test/resources/sql/systems.sql new file mode 100644 index 000000000..a4d351902 --- /dev/null +++ b/systemregistry/src/test/resources/sql/systems.sql @@ -0,0 +1,7 @@ +insert into system_ (id, address, authentication_info, created_at, port, system_name, updated_at) +values (1, '192.168.1.1', null, '2020-01-01 00:00:00', 1, 'system1', '2020-01-01 00:00:00'), + (2, '192.168.1.2', null, '2020-01-02 00:00:00', 2, 'system2', '2020-01-02 00:00:00'), + (3, '192.168.2.2', null, '2020-01-03 00:00:00', 2, 'system2', '2020-01-03 00:00:00'), + (4, '192.168.1.3', null, '2020-01-04 00:00:00', 3, 'system3', '2020-01-04 00:00:00'), + (5, '192.168.2.3', null, '2020-01-05 00:00:00', 3, 'system3', '2020-01-05 00:00:00'), + (6, '192.168.3.3', null, '2020-01-06 00:00:00', 3, 'system3', '2020-01-06 00:00:00'); \ No newline at end of file From 4aac00acdc4067b923c209baee5507f2d8fbd583 Mon Sep 17 00:00:00 2001 From: mzsilak Date: Mon, 17 Feb 2020 09:34:30 +0100 Subject: [PATCH 206/301] merge changes --- certificates/testcloud2/device_registry.p12 | Bin 0 -> 5369 bytes certificates/testcloud2/onboarding.p12 | Bin 0 -> 5343 bytes certificates/testcloud2/system_registry.p12 | Bin 0 -> 5369 bytes .../eu/arrowhead/common/CommonConstants.java | 2 +- .../java/eu/arrowhead/common/Defaults.java | 68 +++++++-------- .../core/onboarding/OnboardingController.java | 2 +- .../onboarding/swagger/SRSwaggerConfig.java | 27 ++++++ .../src/main/resources/application.properties | 2 +- .../resources/certificates/onboarding.p12 | Bin 6556 -> 5343 bytes .../onboarding/OnboardingControllerTest.java | 81 ++++++++++++++++++ .../onboarding/OnboardingTestContext.java | 42 +++++++++ .../StandaloneModeInOnboardingTests.java | 9 ++ onboarding/src/test/resources/log4j2.xml | 31 +++++++ scripts/create_empty_arrowhead_db.sql | 2 +- scripts/device_registry_privileges.sql | 20 +++++ scripts/initSQL.sh | 5 +- scripts/onboarding_controller_privileges.sql | 24 +++++- scripts/system_registry_privileges.sql | 20 +++++ .../SystemRegistryController.java | 2 +- .../SystemRegistryAccessControlFilter.java | 9 ++ .../certificates/system_registry.p12 | Bin 4686 -> 5369 bytes systemregistry/src/main/resources/log4j2.xml | 2 +- 22 files changed, 306 insertions(+), 42 deletions(-) create mode 100644 certificates/testcloud2/device_registry.p12 create mode 100644 certificates/testcloud2/onboarding.p12 create mode 100644 certificates/testcloud2/system_registry.p12 create mode 100644 onboarding/src/main/java/eu/arrowhead/core/onboarding/swagger/SRSwaggerConfig.java create mode 100644 onboarding/src/test/java/eu/arrowhead/core/onboarding/OnboardingControllerTest.java create mode 100644 onboarding/src/test/java/eu/arrowhead/core/onboarding/OnboardingTestContext.java create mode 100644 onboarding/src/test/java/eu/arrowhead/core/onboarding/StandaloneModeInOnboardingTests.java create mode 100644 onboarding/src/test/resources/log4j2.xml diff --git a/certificates/testcloud2/device_registry.p12 b/certificates/testcloud2/device_registry.p12 new file mode 100644 index 0000000000000000000000000000000000000000..dcd55a15036630c3ee3511938989360eb13d8803 GIT binary patch literal 5369 zcmY*cWmFW5wjH{p8-`(q{OB1P=@L-7K}tf9lFmV4=nz3#LIzY|=n^DHVrZn17(fJR z>8|U0>%Du|{c&pVea_Fl)`24EPH}PYpa{AuLK6NM&6sm?93q@T1lmaLz#Sh!;PMxC{2O+JWdFDIfD{L}5P^RUMc|)9`3On>AO3rs6`!vCOKr!b|H1L> z5u++O#7~wCHxq%22k6$vN8tCnG*L+5ycDd%hU3-E;htrbk`CK5YGwq?uTh=IZR#Nz8jS)+U0TOSz93NlLz3Tv!{Ldfxeimku?K25v zt3s^v-Nr^5x_2e3sAN!0M2sN+vWrCH#;nhi(M))VVpQ{2N!-$$A&f&Y8JeV}vT}h% zIb3+VM8tafpSd}6PQNw(1veYPHV&C#sKjajbR|&;H&wAR%Mw!vXwb(f ztyTACWNF9$wQC0b#oE-kOX_Ax$SA8!xw`PwfZGJ!CzHyj&$u@BCBKDVde5Iz0+F9e zFv{d?Q5_YooS^f$8N`@%&)=XL4XOVK&sL)H!skzvX;H??q*6p`F5GMNx_8~zo_cq6;9H4aaQ+uoQ_b}W z$yV9em@bTqW8ye^S)}V+ixSt$G9q3fVhfR6R^-5NvkiLXzn*ov!CE9??TA{sb5uKk z2=x5KMrZZM4dY2pN=>-gJ~Iou-Nfpw9skT?>1a|N9jHV3Wls$6ydrRU4X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Pd za)9NANUOP1aPm0#oG=MK51bn%Kf2u$muj|eZp|`pQ|1+~=okImNnx)1h|yz2ADd34 zhn6stVG7WSUoOQVF2(zq0&Qc|m8cCYrfn<$Xd}2}w*=ziw+gCqEu3Wm9L*h8fkOhx zk{TX-4J?fNhDp8c4d@Xjsh(+1nQb>sR4f%n2TQJgs*mn@N%5J|8>L%O1Jg-?N`Z5=t)&#&X6igDaaZ zEadUO^ZO8@HJaW7*O@;qs&rJJygKHsrlBS7!#Dm)qe@cb^(+szy4)bxP95x)yDS(l z!W+}kP&Nkr zb2WU$@?0%5Xz;WqcQuAzujqXa1*@$?myYfo^eXv`Pphjb#^L3O z#XU@LDOvMg%kulUrRc!>J`#j?4AX(v>lPlC_A&YQL8FxBA#55R46)sKWCTocSMI08 zhkD37ji*_^T8%97`Syu&@wrj9b?dcOQ8g7Dd;+rEPe)0m&NSxNCjUWy5v6T*;xwWa z@}IHWnxUrNb3T7}_Ecg^k|lqkpG@~*fIt%PIOcp7y{~v4CiVCA!F^$pQiF3GVTRI)XuQ{TcNAjh$D57zA{VDt*h4Jar%posaaUY%SGNN33>4U84e&XWc H#1#Gu3{yTC literal 0 HcmV?d00001 diff --git a/certificates/testcloud2/onboarding.p12 b/certificates/testcloud2/onboarding.p12 new file mode 100644 index 0000000000000000000000000000000000000000..a7ed58077d9e52e421ca33cdceb923d1a47dd199 GIT binary patch literal 5343 zcmY+FRa6uJu!e~Rq#L9=7nUw*q=corkz86zx|S4>SP2mp5ZI*~1O$;5Bo*oI?gnA6 z_nsT)KFrLSfBu=rZv>$f3mE8_f>4SKY+T+r^|%{CbR6_TC`Bv)N)h!>4iki8dH=r= zmK^|!W&KY!{};yC`2W2{fQODz2n9R{LIF2|JlJ^uBmX;22cQ727C)6@=00(OqQFRL zdeyO3j3W$8v|e2R6flSmR`AJh%>KT?sW#{4`XZ%0RfHnB#w~IxAtt0;@nTN-NyK(S zCtf%t%yU=Ci9L%w(&Kd~WlQ-`{<=)+si#-vTLa=pz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M`Aw8P|%df4l?VwG1i;yn11o+6fA$Oo5>ODu1?U!oiD zq4$wN`%>F1_YJLCF+Uot-wv8w9B&+}4b-oXJxZ;$sW7j*+t(rHJ(f~NPF%;|7cl++ zXKn!1l}7j+#qTMCE13+wh!7wQ`Gr)``oWOBNwM#^=6uQ!ke + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex + + OFF + + + + + + + + ${LOG_PATTERN} + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/scripts/create_empty_arrowhead_db.sql b/scripts/create_empty_arrowhead_db.sql index 304932f1b..7142303a6 100644 --- a/scripts/create_empty_arrowhead_db.sql +++ b/scripts/create_empty_arrowhead_db.sql @@ -25,7 +25,7 @@ source device_registry_privileges.sql -- Onboarding controller CREATE USER IF NOT EXISTS 'onboarding'@'localhost' IDENTIFIED BY 'JKgh1as5f6oi7aV'; CREATE USER IF NOT EXISTS 'onboarding'@'%' IDENTIFIED BY 'JKgh1as5f6oi7aV'; -source onboarding_privileges.sql +source onboarding_controller_privileges.sql -- Authorization CREATE USER IF NOT EXISTS 'authorization'@'localhost' IDENTIFIED BY 'hqZFUkuHxhekio3'; diff --git a/scripts/device_registry_privileges.sql b/scripts/device_registry_privileges.sql index 7a027cba8..c24db11d1 100644 --- a/scripts/device_registry_privileges.sql +++ b/scripts/device_registry_privileges.sql @@ -9,6 +9,16 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'device_registry'@'l GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'device_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'device_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'device_registry'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'device_registry'@'%'; @@ -19,5 +29,15 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'device_registry'@'% GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'device_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'device_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'device_registry'@'%'; FLUSH PRIVILEGES; \ No newline at end of file diff --git a/scripts/initSQL.sh b/scripts/initSQL.sh index 6c00fb65f..96893d599 100644 --- a/scripts/initSQL.sh +++ b/scripts/initSQL.sh @@ -15,4 +15,7 @@ wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scrip wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/event_handler_privileges.sql wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/choreographer_privileges.sql wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/gatekeeper_privileges.sql -wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/gateway_privileges.sql \ No newline at end of file +wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/gateway_privileges.sql +wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/system_registry_privileges.sql +wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/device_registry_privileges.sql +wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/onboarding_controller_privileges.sql \ No newline at end of file diff --git a/scripts/onboarding_controller_privileges.sql b/scripts/onboarding_controller_privileges.sql index 919153f77..202b60ef9 100644 --- a/scripts/onboarding_controller_privileges.sql +++ b/scripts/onboarding_controller_privileges.sql @@ -1,8 +1,30 @@ USE `arrowhead`; REVOKE ALL, GRANT OPTION FROM 'onboarding'@'localhost'; - +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'onboarding'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'onboarding'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'onboarding'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'onboarding'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'onboarding'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'onboarding'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'onboarding'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'onboarding'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'onboarding'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'onboarding'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'onboarding'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'onboarding'@'localhost'; + REVOKE ALL, GRANT OPTION FROM 'onboarding'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'onboarding'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'onboarding'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'onboarding'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'onboarding'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'onboarding'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'onboarding'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'onboarding'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'onboarding'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'onboarding'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'onboarding'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'onboarding'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'onboarding'@'%'; FLUSH PRIVILEGES; \ No newline at end of file diff --git a/scripts/system_registry_privileges.sql b/scripts/system_registry_privileges.sql index 0092def34..0bb17f855 100644 --- a/scripts/system_registry_privileges.sql +++ b/scripts/system_registry_privileges.sql @@ -9,6 +9,16 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'system_registry'@'l GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'system_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'system_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'system_registry'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'service_registry'@'%'; @@ -19,5 +29,15 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'system_registry'@'% GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'system_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'system_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'system_registry'@'%'; FLUSH PRIVILEGES; \ No newline at end of file diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java index c9aac42e6..6cd20cf47 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java @@ -466,7 +466,7 @@ public void removeSystemRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_REGISTER_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) + @ApiOperation(value = SYSTEM_REGISTRY_REGISTER_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_CREATED, message = SYSTEM_REGISTRY_REGISTER_201_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_REGISTER_400_MESSAGE), diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistryAccessControlFilter.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistryAccessControlFilter.java index 50ff83f4f..3a046f09d 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistryAccessControlFilter.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistryAccessControlFilter.java @@ -2,8 +2,17 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; + +import eu.arrowhead.common.security.CoreSystemAccessControlFilter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.core.CoreSystem; +import eu.arrowhead.common.dto.shared.OrchestrationFlags; +import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; +import eu.arrowhead.common.exception.AuthException; import eu.arrowhead.common.security.CoreSystemAccessControlFilter; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; import java.util.Map; diff --git a/systemregistry/src/main/resources/certificates/system_registry.p12 b/systemregistry/src/main/resources/certificates/system_registry.p12 index 5bdae086f701d39bb0a26fb136ab3cae1b72f2ee..1e913c7ae214ff6d48fc762650b7730f98fbcec8 100644 GIT binary patch delta 5330 zcmV;@6fNt{B>5>pFoG2I0s#Xsf)uU>2`Yw2hW8Bt2LYgh6rTiw6q_)D6qhi91$zbw zDuzgg_YDCD0ic2fYy^S@XfT2WWH5pSV39#5f27M{-?uj^jKK6XTwNXXSsI>_Dgpxl z!%zf*1juzp6q8AwE_@T@roHHC$tgkGnD;sUdM^F0w|55F(g@2fj&LIn+8f_toK3t; zZf>}6!cl^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_1zrwLO0QN;%X`2f6gummS!9^`>M*K`=frAutIB1uG5% z0vZJX1QZv2lLL}=%?NgWYk3AqYA~vs!g2%@9TWUIZ~Va8e(2Abj-9=ZaF$C30s{et EpqjhAUjP6A diff --git a/systemregistry/src/main/resources/log4j2.xml b/systemregistry/src/main/resources/log4j2.xml index 1309f0e14..de3e42cf3 100644 --- a/systemregistry/src/main/resources/log4j2.xml +++ b/systemregistry/src/main/resources/log4j2.xml @@ -5,7 +5,7 @@ %d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex INFO - INFO + DEBUG . From 657dc6e82192db6cb3f8a5ee82a795c54bbab35a Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 17 Feb 2020 12:10:51 +0100 Subject: [PATCH 207/301] eliminate null metadata --- .../core/orchestrator/service/OrchestratorService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java index edb497728..82dd5424b 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java @@ -491,7 +491,10 @@ private List compileOrchestrationResponse(final List()); + } if (request.getOrchestrationFlags().get(Flag.OVERRIDE_STORE)) { final List warnings = calculateOrchestratorWarnings(entry); result.setWarnings(warnings); From 9b24709e8f4c331c471e024ab53ddb5e4f507865 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 17 Feb 2020 13:23:37 +0100 Subject: [PATCH 208/301] modified packetLoss verification --- .../core/qos/manager/impl/PingRequirementsVerifier.java | 4 ++-- .../core/qos/manager/impl/PingRequirementsVerifierTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifier.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifier.java index 99f2a9a45..71c7d2b56 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifier.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifier.java @@ -85,7 +85,7 @@ public boolean verify(final OrchestrationResultDTO result, final Map threshold) { logger.debug("Provider '{}' (id: {}) removed because of recent packet loss threshold", result.getProvider().getSystemName(), result.getProvider().getId()); return false; @@ -94,7 +94,7 @@ public boolean verify(final OrchestrationResultDTO result, final Map threshold) { logger.debug("Provider '{}' (id: {}) removed because of packet loss threshold", result.getProvider().getSystemName(), result.getProvider().getId()); return false; diff --git a/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifierTest.java b/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifierTest.java index 7fc025f94..1103cd3b5 100644 --- a/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifierTest.java +++ b/orchestrator/src/test/java/eu/arrowhead/core/qos/manager/impl/PingRequirementsVerifierTest.java @@ -563,7 +563,7 @@ public void testVerifyRecentPacketLossRequirementVerified() { // measurement com provider.setId(2); result.setProvider(provider); final Map qosRequirements = new HashMap<>(); - qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RECENT_PACKET_LOSS, "30"); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_RECENT_PACKET_LOSS, "85"); final boolean verified = verifier.verify(result, qosRequirements, null); Assert.assertTrue(verified); @@ -661,7 +661,7 @@ public void testVerifyPacketLossRequirementVerified() { // measurement comes fro provider.setId(2); result.setProvider(provider); final Map qosRequirements = new HashMap<>(); - qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_PACKET_LOSS, "30"); + qosRequirements.put(OrchestrationFormRequestDTO.QOS_REQUIREMENT_MAXIMUM_PACKET_LOSS, "85"); final boolean verified = verifier.verify(result, qosRequirements, null); Assert.assertTrue(verified); From f2b34bf09c0b7c2b0f50e1de6c7b849963a7d839 Mon Sep 17 00:00:00 2001 From: Svetlin Tanyi Date: Mon, 17 Feb 2020 13:57:16 +0100 Subject: [PATCH 209/301] Added some info about the scrips to the README --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3960b3768..e24fa0932 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ In particular, each folder contains its own `README.md` file with more instructi
#### Docker Guide -======= + > **Note:** Don't forget to set `domain.name` and `domain.port` properties! Example Docker Compose file is located [here](docker/docker-compose.yml). The interesting part is the volumes section. @@ -438,6 +438,14 @@ Currently Arrowhead community have the possibility to create only "self signed" * [Create Arrowhead Client Self Signed Certificate](documentation/certificates/create_client_certificate.pdf) * [Create Trust Store](documentation/certificates/create_trust_store.pdf) +If you wish to generate all Certificates by a script, you can use the scripts in the [scripts/certificate_generation](scripts/certificate_generation) folder. + +> **Note:** Basic scripting knowledge is required! + +* lib_certs.sh - Certificate generation code +* mk_certs.sh - Usage example +* rm_certs.sh - Delete generated certs + ### System Operator Certificate The System Operator Certificate is a special client certificate with the naming convention of `sysop.my_cloud.my_company.arrowhead.eu`. From 881d38931f1cf8d0ef912c36e0310653b9f5d2fe Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Mon, 17 Feb 2020 14:44:21 +0100 Subject: [PATCH 210/301] updated confirmReservation condition --- .../eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java index c390fe51d..82a461738 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/qos/manager/impl/QoSManagerImpl.java @@ -117,7 +117,8 @@ public void confirmReservation(final OrchestrationResultDTO selected, final List Assert.notNull(requester.getPort(), "Requester system's port is null."); for (final OrchestrationResultDTO dto : orList) { - if (dto.getProvider().getId() == selected.getProvider().getId() && dto.getService().getId() == selected.getProvider().getId()) { + + if (dto.getProvider().getId() == selected.getProvider().getId() && dto.getService().getId() == selected.getService().getId()) { qosReservationDBService.extendReservation(selected, requester); } else { qosReservationDBService.removeTemporaryLock(dto); From 1b74b2a9afdb4d1e36a6fba550ff26cc3d578f4f Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 18 Feb 2020 14:43:35 +0100 Subject: [PATCH 211/301] implemented debian installer --- core-common/src/deb/control/templates | 5 + qos-monitor/pom.xml | 83 ++++++++++++++ .../src/deb/arrowhead-qos-monitor.service | 14 +++ qos-monitor/src/deb/control/config | 19 ++++ qos-monitor/src/deb/control/control | 10 ++ qos-monitor/src/deb/control/postinst | 103 ++++++++++++++++++ qos-monitor/src/deb/control/postrm | 54 +++++++++ qos-monitor/src/deb/control/preinst | 35 ++++++ qos-monitor/src/deb/control/prerm | 45 ++++++++ 9 files changed, 368 insertions(+) create mode 100644 qos-monitor/src/deb/arrowhead-qos-monitor.service create mode 100644 qos-monitor/src/deb/control/config create mode 100644 qos-monitor/src/deb/control/control create mode 100644 qos-monitor/src/deb/control/postinst create mode 100644 qos-monitor/src/deb/control/postrm create mode 100644 qos-monitor/src/deb/control/preinst create mode 100644 qos-monitor/src/deb/control/prerm diff --git a/core-common/src/deb/control/templates b/core-common/src/deb/control/templates index 83b24eab3..aa40e56b8 100644 --- a/core-common/src/deb/control/templates +++ b/core-common/src/deb/control/templates @@ -76,6 +76,11 @@ Type: password Default: Description: MySQL password for Event Handler system (leave empty for random). +Template: arrowhead-core-common/mysql_password_qos +Type: password +Default: +Description: MySQL password for Qos Monitor system (leave empty for random). + Template: arrowhead-core-common/mysql_password_gk Type: password Default: diff --git a/qos-monitor/pom.xml b/qos-monitor/pom.xml index 15dd7c0ee..99eb000d0 100644 --- a/qos-monitor/pom.xml +++ b/qos-monitor/pom.xml @@ -47,6 +47,89 @@ + + + jdeb + org.vafer + 1.8 + + + package + + jdeb + + + true + [YYMMddHHmm].${git.commit.id.abbrev} + target/${project.artifactId}_${revision}.deb + true + ${basedir}/src/deb/control + + + file + ${project.build.directory}/${project.build.finalName}.jar + + perm + /usr/share/arrowhead/qos_monitor + 755 + + + + + link + /usr/share/arrowhead/qos_monitor/${project.artifactId}.jar + /usr/share/arrowhead/qos_monitor/${project.build.finalName}.jar + + + + file + ${project.build.directory}/log4j2.xml + + perm + /etc/arrowhead/systems/qos_monitor + 644 + + + + + file + ${project.build.directory}/application.properties + + perm + /etc/arrowhead/systems/qos_monitor + 644 + + + + + link + /usr/share/arrowhead/qos_monitor/application.properties + /etc/arrowhead/systems/qos_monitor/application.properties + + + + file + ${project.basedir}/src/deb/arrowhead-qos-monitor.service + + perm + /etc/systemd/system + 644 + + + + + file + ${project.basedir}/../scripts/qos_monitor_privileges.sql + + perm + /usr/share/arrowhead/conf + + + + + + + \ No newline at end of file diff --git a/qos-monitor/src/deb/arrowhead-qos-monitor.service b/qos-monitor/src/deb/arrowhead-qos-monitor.service new file mode 100644 index 000000000..6be5ed4b8 --- /dev/null +++ b/qos-monitor/src/deb/arrowhead-qos-monitor.service @@ -0,0 +1,14 @@ +[Unit] +Description=arrowhead-qos-monitor +After=network.target mysql.target + +[Service] +WorkingDirectory=/etc/arrowhead/systems/qos_monitor +ExecStart=/usr/bin/java -Dlog4j.configurationFile=file:/etc/arrowhead/systems/qos_monitor/log4j2.xml -jar /usr/share/arrowhead/qos_monitor/arrowhead-qos-monitor.jar +TimeoutStopSec=5 +Type=simple +User=arrowhead +Group=arrowhead + +[Install] +WantedBy=default.target \ No newline at end of file diff --git a/qos-monitor/src/deb/control/config b/qos-monitor/src/deb/control/config new file mode 100644 index 000000000..90d57e988 --- /dev/null +++ b/qos-monitor/src/deb/control/config @@ -0,0 +1,19 @@ +#!/bin/sh -e + +. /usr/share/debconf/confmodule + +if logname 2>/dev/null; then + USER=$(logname) + HOME=$(eval echo "~$USER") +else + USER="root" + HOME="/root" +fi + +# Get installation type +db_input high arrowhead-core-common/db_host || true +db_input high arrowhead-core-common/mysql_password_qos || true +db_input high arrowhead-core-common/sr_host || true + +# Run dialogs +db_go || true \ No newline at end of file diff --git a/qos-monitor/src/deb/control/control b/qos-monitor/src/deb/control/control new file mode 100644 index 000000000..9d4f850cd --- /dev/null +++ b/qos-monitor/src/deb/control/control @@ -0,0 +1,10 @@ +Package: arrowhead-qos-monitor +Version: [[version]] +Section: contrib/java +Priority: optional +Architecture: all +Maintainer: Rajmund Bocsi +Homepage: http://www.arrowhead.eu +Description: Arrowhead QoS Monitor System +Distribution: development +Depends: java-runtime-headless, virtual-mysql-server, arrowhead-core-common \ No newline at end of file diff --git a/qos-monitor/src/deb/control/postinst b/qos-monitor/src/deb/control/postinst new file mode 100644 index 000000000..a33a43110 --- /dev/null +++ b/qos-monitor/src/deb/control/postinst @@ -0,0 +1,103 @@ +#!/bin/sh +# postinst script for arrowhead-event-handler +# +# see: dh_installdeb(1) + +set -e + +. /usr/share/debconf/confmodule + +SYSTEM_NAME="qos_monitor" +PKG_NAME="arrowhead-qos-monitor" + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + configure) + + dos2unix -q /etc/systemd/system/${PKG_NAME}.service + + . /usr/share/arrowhead/conf/ahconf.sh + SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" + + db_get arrowhead-core-common/mysql_password_qos; system_passwd=$RET || true + db_unregister arrowhead-core-common/mysql_password_qos + + # Generate password (if required) + if [ -z "${system_passwd}" ]; then + system_passwd="$(openssl rand -base64 12)" + fi + + echo "Configuring MySQL database..." >&2 + ah_db_tables_and_user ${SYSTEM_NAME} ${SYSTEM_NAME}_privileges.sql ${system_passwd} + + if [ ! -d "${SYSTEM_DIR}" ]; then + mkdir -p ${SYSTEM_DIR} + fi + + domain_name=${AH_DOMAIN_NAME} + if [ -z ${domain_name} ]; then + domain_name=${OWN_IP} + fi + + ah_cert_signed_system ${SYSTEM_NAME} + + # modify log config and application.properties + + ah_transform_log_file ${SYSTEM_DIR} + + db_get arrowhead-core-common/sr_host; sr_host=$RET || true + + if [ -z ${sr_host} ]; then + sr_host=${OWN_IP} + fi + + db_get arrowhead-core-common/db_host; db_host=$RET || true + + mv ${SYSTEM_DIR}/application.properties ${SYSTEM_DIR}/application.properties.orig + cat ${SYSTEM_DIR}/application.properties.orig | \ + sed -r -e "\#^.*spring\.datasource\.url=#s#.*\$#spring.datasource.url=jdbc:mysql://"${db_host}":3306/arrowhead?serverTimezone=Europe/Budapest#" \ + -e "\#^.*spring\.datasource\.password=#s#.*\$#spring.datasource.password=${system_passwd}#" \ + -e "\#^.*domain\.name=#s#.*\$#domain.name=${domain_name}#" \ + -e "\#^.*sr_address=#s#.*\$#sr_address=${sr_host}#" \ + -e "\#^.*server\.ssl\.key-store=#s#.*\$#server.ssl.key-store=file:${SYSTEM_DIR}/${SYSTEM_NAME}.p12#" \ + -e "\#^.*server\.ssl\.key-store-password=#s#.*\$#server.ssl.key-store-password=${AH_PASS_CERT}#" \ + -e "\#^.*server\.ssl\.key-password=#s#.*\$#server.ssl.key-password=${AH_PASS_CERT}#" \ + -e "\#^.*server\.ssl\.trust-store=#s#.*\$#server.ssl.trust-store=file:${AH_CONF_DIR}/truststore.p12#" \ + -e "\#^.*server\.ssl\.trust-store-password=#s#.*\$#server.ssl.trust-store-password=${AH_PASS_CERT}#" > ${SYSTEM_DIR}/application.properties + + rm ${SYSTEM_DIR}/application.properties.orig + chown arrowhead:arrowhead ${SYSTEM_DIR}/application.properties + chmod 640 ${SYSTEM_DIR}/application.properties + + echo "Starting ${PKG_NAME}..." >&2 + systemctl daemon-reload + systemctl enable ${PKG_NAME}.service + systemctl start ${PKG_NAME}.service + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/qos-monitor/src/deb/control/postrm b/qos-monitor/src/deb/control/postrm new file mode 100644 index 000000000..d38c5c154 --- /dev/null +++ b/qos-monitor/src/deb/control/postrm @@ -0,0 +1,54 @@ +#!/bin/sh +# postrm script for arrowhead-qos-monitor +# +# see: dh_installdeb(1) + +set -e + +. /usr/share/debconf/confmodule + +SYSTEM_NAME="qos_monitor" + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge) + AH_CONF_DIR="/etc/arrowhead" + AH_SYSTEMS_DIR="${AH_CONF_DIR}/systems" + SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" + + rm -f \ + /var/log/arrowhead/${SYSTEM_NAME}*.log \ + ${SYSTEM_DIR}/log4j2.xml \ + ${SYSTEM_DIR}/application.properties \ + ${SYSTEM_DIR}/${SYSTEM_NAME}.p12 \ + rmdir ${SYSTEM_DIR} 2>/dev/null || true + db_purge + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/qos-monitor/src/deb/control/preinst b/qos-monitor/src/deb/control/preinst new file mode 100644 index 000000000..c0279957d --- /dev/null +++ b/qos-monitor/src/deb/control/preinst @@ -0,0 +1,35 @@ +#!/bin/sh +# preinst script for arrowhead-qos-monitor +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 \ No newline at end of file diff --git a/qos-monitor/src/deb/control/prerm b/qos-monitor/src/deb/control/prerm new file mode 100644 index 000000000..1d6c454fc --- /dev/null +++ b/qos-monitor/src/deb/control/prerm @@ -0,0 +1,45 @@ +#!/bin/sh +# prerm script for arrowhead-qos-monitor +# +# see: dh_installdeb(1) + +set -e + +PKG_NAME="arrowhead-qos-monitor" + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove) + systemctl stop ${PKG_NAME}.service + systemctl disable ${PKG_NAME}.service + ;; + + upgrade|deconfigure) + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 \ No newline at end of file From 16e64291f49a889115600d9b13ef0c4fc167ce2a Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 18 Feb 2020 14:44:52 +0100 Subject: [PATCH 212/301] corrected default null values --- scripts/create_arrowhead_tables.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/create_arrowhead_tables.sql b/scripts/create_arrowhead_tables.sql index 78677d895..3af851110 100644 --- a/scripts/create_arrowhead_tables.sql +++ b/scripts/create_arrowhead_tables.sql @@ -350,7 +350,7 @@ CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement` ( `id` bigint(20) PRIMARY KEY AUTO_INCREMENT, `measurement_id` bigint(20) NOT NULL, `available` int(1) NOT NULL DEFAULT 0, - `last_access_at` timestamp DEFAULT NULL, + `last_access_at` timestamp NULL DEFAULT NULL, `min_response_time` int(11) DEFAULT NULL, `max_response_time` int(11) DEFAULT NULL, `mean_response_time_with_timeout` int(11) NULL DEFAULT NULL, @@ -360,7 +360,7 @@ CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement` ( `lost_per_measurement_percent` int(3) NOT NULL DEFAULT 0, `sent` bigint(20) NOT NULL DEFAULT 0, `received` bigint(20) NOT NULL DEFAULT 0, - `count_started_at` timestamp, + `count_started_at` timestamp NULL, `sent_all` bigint(20) NOT NULL DEFAULT 0, `received_all` bigint(20) NOT NULL DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -395,8 +395,8 @@ CREATE TABLE IF NOT EXISTS `qos_intra_ping_measurement_log_details` ( `measurement_sequenece_number` int(3) NOT NULL, `success_flag` int(1) NOT NULL DEFAULT 0, `timeout_flag` int(1) NOT NULL DEFAULT 0, - `error_message` varchar(255) NOT NULL, - `throwable` varchar(255), + `error_message` varchar(255) NULL DEFAULT NULL, + `throwable` varchar(255) NULL DEFAULT NULL, `size_` int(11) NULL DEFAULT NULL, `rtt` int(11) NULL DEFAULT NULL, `ttl` int(3) NULL DEFAULT NULL, From 9ff3d1cf4dcfe33a4f921cd8e8c84e41ea30717f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Tue, 18 Feb 2020 14:46:45 +0100 Subject: [PATCH 213/301] Initial commit for Certificate Authority --- certificate-authority/pom.xml | 153 ++++++++++++++ .../arrowhead-certificate-authority.service | 15 ++ certificate-authority/src/deb/control/config | 20 ++ certificate-authority/src/deb/control/control | 10 + .../src/deb/control/postinst | 94 +++++++++ certificate-authority/src/deb/control/postrm | 56 ++++++ certificate-authority/src/deb/control/preinst | 35 ++++ certificate-authority/src/deb/control/prerm | 45 +++++ ...icateAuthorityApplicationInitListener.java | 69 +++++++ .../CertificateAuthorityController.java | 83 ++++++++ .../CertificateAuthorityMain.java | 28 +++ .../CertificateAuthorityService.java | 187 ++++++++++++++++++ .../security/CAAccessControlFilter.java | 41 ++++ .../security/CASecurityConfig.java | 12 ++ .../swagger/CASwaggerConfig.java | 28 +++ ...itional-spring-configuration-metadata.json | 47 +++++ .../src/main/resources/application.properties | 59 ++++++ .../certificates/certificate_authority.p12 | Bin 0 -> 7629 bytes .../resources/certificates/truststore.p12 | Bin 0 -> 1162 bytes .../src/main/resources/log4j2.xml | 46 +++++ .../main/resources/swagger/swagger-ui.html | 75 +++++++ .../common/ApplicationInitListener.java | 9 +- .../eu/arrowhead/common/CommonConstants.java | 10 +- .../java/eu/arrowhead/common/Utilities.java | 44 ++++- .../CertificateSigningRequestDTO.java | 24 +++ .../CertificateSigningResponseDTO.java | 24 +++ pom.xml | 4 +- scripts/certificate_authority_privileges.sql | 43 ++++ scripts/create_empty_arrowhead_db.sql | 7 +- scripts/start_coresystems_local.bat | 4 + scripts/stop_coresystems.bat | 2 + 31 files changed, 1266 insertions(+), 8 deletions(-) create mode 100644 certificate-authority/pom.xml create mode 100644 certificate-authority/src/deb/arrowhead-certificate-authority.service create mode 100644 certificate-authority/src/deb/control/config create mode 100644 certificate-authority/src/deb/control/control create mode 100644 certificate-authority/src/deb/control/postinst create mode 100644 certificate-authority/src/deb/control/postrm create mode 100644 certificate-authority/src/deb/control/preinst create mode 100644 certificate-authority/src/deb/control/prerm create mode 100644 certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityApplicationInitListener.java create mode 100644 certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityController.java create mode 100644 certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityMain.java create mode 100644 certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java create mode 100644 certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/security/CAAccessControlFilter.java create mode 100644 certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/security/CASecurityConfig.java create mode 100644 certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/swagger/CASwaggerConfig.java create mode 100644 certificate-authority/src/main/resources/META-INF/additional-spring-configuration-metadata.json create mode 100644 certificate-authority/src/main/resources/application.properties create mode 100644 certificate-authority/src/main/resources/certificates/certificate_authority.p12 create mode 100644 certificate-authority/src/main/resources/certificates/truststore.p12 create mode 100644 certificate-authority/src/main/resources/log4j2.xml create mode 100644 certificate-authority/src/main/resources/swagger/swagger-ui.html create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningRequestDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningResponseDTO.java create mode 100644 scripts/certificate_authority_privileges.sql diff --git a/certificate-authority/pom.xml b/certificate-authority/pom.xml new file mode 100644 index 000000000..257563a28 --- /dev/null +++ b/certificate-authority/pom.xml @@ -0,0 +1,153 @@ + + 4.0.0 + + eu.arrowhead + core + ${revision} + + + arrowhead-certificate-authority + jar + Arrowhead Certificate Authority + Certificate Authority core service + + + + eu.arrowhead + arrowhead-core-common + ${revision} + + + + org.bouncycastle + bcprov-jdk15on + ${bouncy.castle.version} + + + + org.bouncycastle + bcpkix-jdk15on + ${bouncy.castle.version} + + + org.jetbrains + annotations + 18.0.0 + compile + + + + + + + maven-resources-plugin + ${mvn.resources.version} + + + copy-resources + + validate + + copy-resources + + + ${basedir}/target + + + src/main/resources + + application.properties + log4j2.xml + + + + + + + + + + jdeb + org.vafer + 1.8 + + + package + + jdeb + + + true + [YYMMddHHmm].${git.commit.id.abbrev} + target/${project.artifactId}_${revision}.deb + true + ${basedir}/src/deb/control + + + file + ${project.build.directory}/${project.build.finalName}.jar + + perm + /usr/share/arrowhead/certificate_authority + 755 + + + + + link + /usr/share/arrowhead/certificate_authority/${project.artifactId}.jar + /usr/share/arrowhead/certificate_authority/${project.build.finalName}.jar + + + + file + ${project.build.directory}/log4j2.xml + + perm + /etc/arrowhead/systems/certificate_authority + 644 + + + + + file + ${project.build.directory}/application.properties + + perm + /etc/arrowhead/systems/certificate_authority + 644 + + + + + link + /usr/share/arrowhead/certificate_authority/application.properties + /etc/arrowhead/systems/certificate_authority/application.properties + + + + file + ${project.basedir}/src/deb/arrowhead-certificate-authority.service + + perm + /etc/systemd/system + 644 + + + + + file + ${project.basedir}/../scripts/certificate_authority_privileges.sql + + perm + /usr/share/arrowhead/conf + + + + + + + + + + diff --git a/certificate-authority/src/deb/arrowhead-certificate-authority.service b/certificate-authority/src/deb/arrowhead-certificate-authority.service new file mode 100644 index 000000000..31d62af19 --- /dev/null +++ b/certificate-authority/src/deb/arrowhead-certificate-authority.service @@ -0,0 +1,15 @@ +[Unit] +Description=arrowhead-certificate-authority +After=network.target mysql.target + +[Service] +WorkingDirectory=/etc/arrowhead/systems/certificate_authority +ExecStart=/usr/bin/java -Dlog4j.configurationFile=file:/etc/arrowhead/systems/certificate_authority/log4j2.xml -jar /usr/share/arrowhead/certificate_authority/arrowhead-certificate-authority.jar +ExecStartPost=/bin/bash -c 'sleep 10' +TimeoutStopSec=5 +Type=simple +User=arrowhead +Group=arrowhead + +[Install] +WantedBy=default.target diff --git a/certificate-authority/src/deb/control/config b/certificate-authority/src/deb/control/config new file mode 100644 index 000000000..1c83ed2f4 --- /dev/null +++ b/certificate-authority/src/deb/control/config @@ -0,0 +1,20 @@ +#!/bin/sh -e + +. /usr/share/debconf/confmodule + +if logname 2>/dev/null; then + USER=$(logname) + HOME=$(eval echo "~$USER") +else + USER="root" + HOME="/root" +fi + +# Get installation type +db_input high arrowhead-core-common/db_host || true +db_input high arrowhead-core-common/mysql_password_ca || true +db_input high arrowhead-core-common/sr_host || true + +# Run dialogs +db_go || true + diff --git a/certificate-authority/src/deb/control/control b/certificate-authority/src/deb/control/control new file mode 100644 index 000000000..1b7ccbf25 --- /dev/null +++ b/certificate-authority/src/deb/control/control @@ -0,0 +1,10 @@ +Package: arrowhead-certificate-authority +Version: [[version]] +Section: contrib/java +Priority: optional +Architecture: all +Maintainer: Rajmund Bocsi +Homepage: http://www.arrowhead.eu +Description: Arrowhead Certificate Authority +Distribution: development +Depends: java-runtime-headless, openssl, virtual-mysql-server, arrowhead-core-common diff --git a/certificate-authority/src/deb/control/postinst b/certificate-authority/src/deb/control/postinst new file mode 100644 index 000000000..79e93a8f3 --- /dev/null +++ b/certificate-authority/src/deb/control/postinst @@ -0,0 +1,94 @@ +#!/bin/sh +# postinst script for arrowhead-certificate-authority +# +# see: dh_installdeb(1) + +set -e + +. /usr/share/debconf/confmodule + +SYSTEM_NAME="certificate_authority" +PKG_NAME="arrowhead-certificate-authority" + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + configure) + . /usr/share/arrowhead/conf/ahconf.sh + SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" + + db_get arrowhead-core-common/mysql_password_ca; system_passwd=$RET || true + db_unregister arrowhead-core-common/mysql_password_ca + + # Generate password (if required) + if [ -z "${system_passwd}" ]; then + system_passwd="$(openssl rand -base64 12)" + fi + + echo "Configuring MySQL database..." >&2 + ah_db_tables_and_user ${SYSTEM_NAME} ${SYSTEM_NAME}_privileges.sql ${system_passwd} + + if [ ! -d "${SYSTEM_DIR}" ]; then + mkdir -p ${SYSTEM_DIR} + fi + + ah_cert_signed_system ${SYSTEM_NAME} + + if [ ! -d "${AH_SYSTEMS_DIR}/sysop" ]; then + mkdir -p ${AH_SYSTEMS_DIR}/sysop + fi + + ah_cert_signed_system sysop + + # modify log config and application.properties + + ah_transform_log_file ${SYSTEM_DIR} + + db_get arrowhead-core-common/db_host; db_host=$RET || true + + mv ${SYSTEM_DIR}/application.properties ${SYSTEM_DIR}/application.properties.orig + cat ${SYSTEM_DIR}/application.properties.orig | \ + sed -r -e "\#^.*spring\.datasource\.url=#s#.*\$#spring.datasource.url=jdbc:mysql://"${db_host}":3306/arrowhead?serverTimezone=Europe/Budapest#" \ + -e "\#^.*spring\.datasource\.password=#s#.*\$#spring.datasource.password=${system_passwd}#" \ + -e "\#^.*server\.address=#s#.*\$#server.address=${OWN_IP}#" \ + -e "\#^.*server\.ssl\.key-store=#s#.*\$#server.ssl.key-store=file:${SYSTEM_DIR}/${SYSTEM_NAME}.p12#" \ + -e "\#^.*server\.ssl\.key-store-password=#s#.*\$#server.ssl.key-store-password=${AH_PASS_CERT}#" \ + -e "\#^.*server\.ssl\.key-password=#s#.*\$#server.ssl.key-password=${AH_PASS_CERT}#" \ + -e "\#^.*server\.ssl\.trust-store=#s#.*\$#server.ssl.trust-store=file:${AH_CONF_DIR}/truststore.p12#" \ + -e "\#^.*server\.ssl\.trust-store-password=#s#.*\$#server.ssl.trust-store-password=${AH_PASS_CERT}#" > ${SYSTEM_DIR}/application.properties + + rm ${SYSTEM_DIR}/application.properties.orig + chown arrowhead:arrowhead ${SYSTEM_DIR}/application.properties + chmod 640 ${SYSTEM_DIR}/application.properties + + echo "Starting ${PKG_NAME}..." >&2 + systemctl daemon-reload + systemctl enable ${PKG_NAME}.service + systemctl start ${PKG_NAME}.service + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/certificate-authority/src/deb/control/postrm b/certificate-authority/src/deb/control/postrm new file mode 100644 index 000000000..1af2f066c --- /dev/null +++ b/certificate-authority/src/deb/control/postrm @@ -0,0 +1,56 @@ +#!/bin/sh +# postrm script for arrowhead-certificate-authority +# +# see: dh_installdeb(1) + +set -e + +. /usr/share/debconf/confmodule + +SYSTEM_NAME="certificate_authority" + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge) + AH_CONF_DIR="/etc/arrowhead" + AH_SYSTEMS_DIR="${AH_CONF_DIR}/systems" + SYSTEM_DIR="${AH_SYSTEMS_DIR}/${SYSTEM_NAME}" + + rm -f \ + /var/log/arrowhead/${SYSTEM_NAME}*.log \ + ${SYSTEM_DIR}/log4j2.xml \ + ${SYSTEM_DIR}/application.properties \ + ${SYSTEM_DIR}/${SYSTEM_NAME}.p12 \ + ${AH_SYSTEMS_DIR}/sysop/sysop.p12 + rmdir ${SYSTEM_DIR} 2>/dev/null || true + rmdir ${AH_SYSTEMS_DIR}/sysop 2>/dev/null || true + db_purge + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/certificate-authority/src/deb/control/preinst b/certificate-authority/src/deb/control/preinst new file mode 100644 index 000000000..a0a30f7d9 --- /dev/null +++ b/certificate-authority/src/deb/control/preinst @@ -0,0 +1,35 @@ +#!/bin/sh +# preinst script for arrowhead-certificate-authority +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/certificate-authority/src/deb/control/prerm b/certificate-authority/src/deb/control/prerm new file mode 100644 index 000000000..4c2d565a7 --- /dev/null +++ b/certificate-authority/src/deb/control/prerm @@ -0,0 +1,45 @@ +#!/bin/sh +# prerm script for arrowhead-certificate-authority +# +# see: dh_installdeb(1) + +set -e + +PKG_NAME="arrowhead-certificate-authority" + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove) + systemctl stop ${PKG_NAME}.service + systemctl disable ${PKG_NAME}.service + ;; + + upgrade|deconfigure) + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityApplicationInitListener.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityApplicationInitListener.java new file mode 100644 index 000000000..576e90843 --- /dev/null +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityApplicationInitListener.java @@ -0,0 +1,69 @@ +package eu.arrowhead.core.certificate_authority; + +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.context.event.ContextRefreshedEvent; +import org.springframework.stereotype.Component; + +import eu.arrowhead.common.ApplicationInitListener; +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreDefaults; +import eu.arrowhead.common.database.service.CommonDBService; +import eu.arrowhead.common.exception.DataNotFoundException; + +@Component +public class CertificateAuthorityApplicationInitListener extends ApplicationInitListener { + + //================================================================================================= + // members + + @Autowired + private CommonDBService commonDBService; + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + @Override + protected void customInit(final ContextRefreshedEvent event) { + logger.debug("customInit started..."); + if (!isOwnCloudRegistered()) { + registerOwnCloud(event.getApplicationContext()); + } + } + + //------------------------------------------------------------------------------------------------- + private boolean isOwnCloudRegistered() { + logger.debug("isOwnCloudRegistered started..."); + try { + commonDBService.getOwnCloud(sslProperties.isSslEnabled()); + return true; + } catch (final DataNotFoundException ex) { + return false; + } + } + + //------------------------------------------------------------------------------------------------- + private void registerOwnCloud(final ApplicationContext appContext) { + logger.debug("registerOwnCloud started..."); + + if (!standaloneMode) { + String name = CoreDefaults.DEFAULT_OWN_CLOUD_NAME; + String operator = CoreDefaults.DEFAULT_OWN_CLOUD_OPERATOR; + + if (sslProperties.isSslEnabled()) { + @SuppressWarnings("unchecked") + final Map context = appContext.getBean(CommonConstants.ARROWHEAD_CONTEXT, Map.class); + final String serverCN = (String) context.get(CommonConstants.SERVER_COMMON_NAME); + final String[] serverFields = serverCN.split("\\."); + name = serverFields[1]; + operator = serverFields[2]; + } + + commonDBService.insertOwnCloud(operator, name, sslProperties.isSslEnabled(), null); + logger.info("{}.{} own cloud is registered in {} mode.", name, operator, getModeString()); + } + } +} \ No newline at end of file diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityController.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityController.java new file mode 100644 index 000000000..c5d4c5787 --- /dev/null +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityController.java @@ -0,0 +1,83 @@ +package eu.arrowhead.core.certificate_authority; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.Defaults; +import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; +import eu.arrowhead.common.dto.internal.CertificateSigningResponseDTO; +import eu.arrowhead.common.exception.BadPayloadException; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.apache.http.HttpStatus; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; + +@Api(tags = { CoreCommonConstants.SWAGGER_TAG_ALL }) +@CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, + allowedHeaders = { HttpHeaders.ORIGIN, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT, HttpHeaders.AUTHORIZATION } +) +@RestController +@RequestMapping(CommonConstants.CERTIFICATE_AUTHRORITY_URI) +public class CertificateAuthorityController { + + //================================================================================================= + // members +// + private static final String GET_CLOUD_COMMON_NAME_HTTP_200_MESSAGE = "Cloud Common Name returned"; + private static final String SIGN_CERTIFICATE_HTTP_200_MESSAGE = "Successful certificate signing"; + private static final String SIGN_CERTIFICATE_HTTP_400_MESSAGE = "Invalid Certificate Signing Request"; + + private final Logger logger = LogManager.getLogger(CertificateAuthorityController.class); + + @Autowired + private CertificateAuthorityService certificateAuthorityService; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return an echo message with the purpose of testing the core service availability", response = String.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = CoreCommonConstants.SWAGGER_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CommonConstants.ECHO_URI) + public String echoService() { + return "Got it!"; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return the cloud's Common Name", response = String.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_CLOUD_COMMON_NAME_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CommonConstants.OP_CA_CLOUD_COMMON_NAME_URI) + public String getCloudCommonName() { + logger.debug("getCloudCommonName started ..."); + + return certificateAuthorityService.getCloudCommonName(); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return a signed certificate", response = CertificateSigningResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SIGN_CERTIFICATE_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SIGN_CERTIFICATE_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = CommonConstants.OP_CA_SIGN_CERTIFICATE_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody public CertificateSigningResponseDTO signCertificate(@RequestBody final CertificateSigningRequestDTO request) { + return certificateAuthorityService.signCertificate(request); + } +} diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityMain.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityMain.java new file mode 100644 index 000000000..a984109d5 --- /dev/null +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityMain.java @@ -0,0 +1,28 @@ +package eu.arrowhead.core.certificate_authority; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.database.repository.RefreshableRepositoryImpl; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@SpringBootApplication +@ComponentScan(CommonConstants.BASE_PACKAGE) +@EntityScan(CoreCommonConstants.DATABASE_ENTITY_PACKAGE) +@EnableJpaRepositories(basePackages = CoreCommonConstants.DATABASE_REPOSITORY_PACKAGE, repositoryBaseClass = RefreshableRepositoryImpl.class) +@EnableSwagger2 +public class CertificateAuthorityMain { + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public static void main(final String[] args) { + SpringApplication.run(CertificateAuthorityMain.class, args); + } +} \ No newline at end of file diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java new file mode 100644 index 000000000..ed37a5036 --- /dev/null +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java @@ -0,0 +1,187 @@ +package eu.arrowhead.core.certificate_authority; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.SSLProperties; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; +import eu.arrowhead.common.dto.internal.CertificateSigningResponseDTO; +import eu.arrowhead.common.exception.AuthException; +import eu.arrowhead.common.exception.BadPayloadException; +import eu.arrowhead.common.exception.DataNotFoundException; +import org.bouncycastle.asn1.x500.RDN; +import org.bouncycastle.asn1.x500.X500Name; +import org.bouncycastle.asn1.x500.style.BCStyle; +import org.bouncycastle.asn1.x500.style.IETFUtils; +import org.bouncycastle.asn1.x509.BasicConstraints; +import org.bouncycastle.asn1.x509.Extension; +import org.bouncycastle.cert.CertIOException; +import org.bouncycastle.cert.X509v3CertificateBuilder; +import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; +import org.bouncycastle.cert.jcajce.JcaX509CertificateHolder; +import org.bouncycastle.cert.jcajce.JcaX509ExtensionUtils; +import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder; +import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.bouncycastle.operator.ContentVerifierProvider; +import org.bouncycastle.operator.OperatorCreationException; +import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; +import org.bouncycastle.operator.jcajce.JcaContentVerifierProviderBuilder; +import org.bouncycastle.pkcs.PKCSException; +import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Service; + +import javax.annotation.PostConstruct; +import java.io.IOException; +import java.math.BigInteger; +import java.security.*; +import java.security.cert.CertificateEncodingException; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.Base64; +import java.util.Date; +import java.util.Map; +import java.util.ServiceConfigurationError; + +@Service +public class CertificateAuthorityService { + + @Autowired + private SSLProperties sslProperties; + + @Autowired + private ApplicationContext appContext; + + private SecureRandom random; + private KeyStore keyStore; + + @PostConstruct + private void init() { + random = new SecureRandom(); + random.reseed(); + keyStore = getKeyStore(); + } + + public String getCloudCommonName() { + try { + final X500Name issuer = new JcaX509CertificateHolder(getServerCertificate(appContext)).getIssuer(); + final RDN cn = issuer.getRDNs(BCStyle.CN)[0]; + return IETFUtils.valueToString(cn.getFirst().getValue()); + } catch (CertificateEncodingException e) { + throw new ServiceConfigurationError("Cannot get cloud common name from server cert.", e); + } + } + + public CertificateSigningResponseDTO signCertificate(CertificateSigningRequestDTO request) { + JcaPKCS10CertificationRequest csr = decodePKCS10CSR(request); + checkCommonName(csr, getCloudCommonName()); + checkCsrSignature(csr); + + final PrivateKey cloudPrivateKey = Utilities.getPrivateKey(keyStore, getCloudCommonName(), sslProperties.getKeyPassword()); + final X509Certificate serverCertificate = getServerCertificate(appContext); + final X509Certificate clientCertificate = buildCertificate(csr.getSubject(), getClientKey(csr), cloudPrivateKey, serverCertificate); + + final String encodedClientCertificate = encodeCertificate(clientCertificate); + final String encodedServerCertificate = encodeCertificate(serverCertificate); + + return new CertificateSigningResponseDTO(encodedClientCertificate + " " + encodedServerCertificate); + } + + private KeyStore getKeyStore() { + try { + final KeyStore keystore = KeyStore.getInstance(sslProperties.getKeyStoreType()); + keystore.load(sslProperties.getKeyStore().getInputStream(), sslProperties.getKeyStorePassword().toCharArray()); + return keystore; + } catch (KeyStoreException | IOException | CertificateException | NoSuchAlgorithmException e) { + throw new ServiceConfigurationError("Cannot open keystore: " + e.getMessage()); + } + } + + private JcaPKCS10CertificationRequest decodePKCS10CSR(CertificateSigningRequestDTO csr) { + try { + final byte[] csrBytes = Base64.getDecoder().decode(csr.getCertificatePem()); + return new JcaPKCS10CertificationRequest(csrBytes); + } catch (IOException ex) { + throw new BadPayloadException("Failed to parse request as a PKCS10 CSR", ex); + } + } + + private String encodeCertificate(X509Certificate certificate) { + try { + return Base64.getEncoder().encodeToString(certificate.getEncoded()); + } catch (CertificateEncodingException e) { + throw new AuthException("Certificate encoding failed! (" + e.getMessage() + ")", e); + } + } + + private void checkCommonName(JcaPKCS10CertificationRequest csr, String cloudCN) { + final String clientCN = Utilities.getCertCNFromSubject(csr.getSubject().toString()); + if (!Utilities.isKeyStoreCNArrowheadValid(clientCN, cloudCN)) { + throw new BadPayloadException("Certificate request does not have a valid common name! Valid common name: {systemName}." + cloudCN); + } + } + + private void checkCsrSignature(JcaPKCS10CertificationRequest csr) { + Security.addProvider(new BouncyCastleProvider()); + try { + ContentVerifierProvider verifierProvider = new JcaContentVerifierProviderBuilder().setProvider("BC").build(csr.getSubjectPublicKeyInfo()); + if (!csr.isSignatureValid(verifierProvider)) { + throw new AuthException("Certificate request has invalid signature! (key pair does not match)"); + } + } catch (OperatorCreationException | PKCSException e) { + throw new AuthException("Encapsulated " + e.getClass().getCanonicalName() + ": " + e.getMessage(), e); + } + } + + private PublicKey getClientKey(JcaPKCS10CertificationRequest csr) { + try { + return csr.getPublicKey(); + } catch (InvalidKeyException | NoSuchAlgorithmException e) { + //This should not be possible after a successful signature verification + throw new DataNotFoundException("Extracting the public key from the CSR failed (" + e.getMessage() + ")", e); + } + } + + private X509Certificate getServerCertificate(final ApplicationContext appContext) { + @SuppressWarnings("unchecked") final Map context = appContext.getBean(CommonConstants.ARROWHEAD_CONTEXT, Map.class); + return (X509Certificate) context.get(CommonConstants.SERVER_CERTIFICATE); + } + + private X509Certificate buildCertificate(X500Name csrSubject, PublicKey clientKey, PrivateKey cloudPrivateKey, X509Certificate serverCertificate) { + final ZonedDateTime now = LocalDateTime.now().atZone(ZoneId.systemDefault()); + final Date validFrom = Date.from(now.minusSeconds(5).toInstant()); + final Date validUntil = Date.from(now.plusYears(1).toInstant()); + + final BigInteger serial = BigInteger.valueOf(now.toInstant().toEpochMilli()).multiply(BigInteger.valueOf(random.nextLong())); + + X509v3CertificateBuilder builder = new JcaX509v3CertificateBuilder(serverCertificate, serial, validFrom, validUntil, csrSubject, clientKey); + + /* Adding the following extensions to the new certificate: + 1) The subject key identifier provides a hashed value that should uniquely identify the public key + 2) The authority key identifier provides a hashed value that should uniquely identify the issuer of the certificate + 3) And this basic constraint is for forbidding issuing other certificates under this certificate + */ + try { + JcaX509ExtensionUtils extUtils = new JcaX509ExtensionUtils(); + builder.addExtension(Extension.subjectKeyIdentifier, false, extUtils.createSubjectKeyIdentifier(clientKey)); + builder.addExtension(Extension.authorityKeyIdentifier, false, extUtils.createAuthorityKeyIdentifier(serverCertificate)); + builder.addExtension(Extension.basicConstraints, true, new BasicConstraints(false)); + } catch (NoSuchAlgorithmException | CertIOException | CertificateEncodingException e) { + throw new AuthException("Appending extensions to the certificate failed! (" + e.getMessage() + ")", e); + } + + + JcaContentSignerBuilder signerBuilder = new JcaContentSignerBuilder("SHA512withRSA").setProvider("BC"); + try { + return new JcaX509CertificateConverter().setProvider("BC") + .getCertificate(builder.build(signerBuilder.build(cloudPrivateKey))); + } catch (CertificateException e) { + throw new AuthException("Certificate encoding failed! (" + e.getMessage() + ")", e); + } catch (OperatorCreationException e) { + throw new AuthException("Certificate signing failed! (" + e.getMessage() + ")", e); + } + } +} diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/security/CAAccessControlFilter.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/security/CAAccessControlFilter.java new file mode 100644 index 000000000..5a147e1dc --- /dev/null +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/security/CAAccessControlFilter.java @@ -0,0 +1,41 @@ +package eu.arrowhead.core.certificate_authority.security; + +import java.util.Map; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Component; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.core.CoreSystem; +import eu.arrowhead.common.core.CoreSystemService; +import eu.arrowhead.common.dto.shared.ServiceQueryFormDTO; +import eu.arrowhead.common.dto.shared.ServiceRegistryRequestDTO; +import eu.arrowhead.common.exception.AuthException; +import eu.arrowhead.common.security.CoreSystemAccessControlFilter; + +@Component +@ConditionalOnProperty(name = CommonConstants.SERVER_SSL_ENABLED, matchIfMissing = true) +public class CAAccessControlFilter extends CoreSystemAccessControlFilter { + + //================================================================================================= + // members + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + @Override + protected void checkClientAuthorized(final String clientCN, final String method, final String requestTarget, final String requestJSON, final Map queryParams) { + super.checkClientAuthorized(clientCN, method, requestTarget, requestJSON, queryParams); + + final String cloudCN = getServerCloudCN(); + + if (requestTarget.contains(CoreCommonConstants.MGMT_URI)) { + // Only the local System Operator can use these methods + checkIfLocalSystemOperator(clientCN, cloudCN, requestTarget); + } + } +} \ No newline at end of file diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/security/CASecurityConfig.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/security/CASecurityConfig.java new file mode 100644 index 000000000..5f129c51d --- /dev/null +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/security/CASecurityConfig.java @@ -0,0 +1,12 @@ +package eu.arrowhead.core.certificate_authority.security; + +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; + +import eu.arrowhead.common.security.DefaultSecurityConfig; + +@Configuration +@EnableWebSecurity +public class CASecurityConfig extends DefaultSecurityConfig { + +} \ No newline at end of file diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/swagger/CASwaggerConfig.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/swagger/CASwaggerConfig.java new file mode 100644 index 000000000..ae0b4321e --- /dev/null +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/swagger/CASwaggerConfig.java @@ -0,0 +1,28 @@ +package eu.arrowhead.core.certificate_authority.swagger; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.swagger.DefaultSwaggerConfig; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@EnableSwagger2 +@Configuration +public class CASwaggerConfig extends DefaultSwaggerConfig { + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public CASwaggerConfig() { + super(CommonConstants.CORE_SYSTEM_CERTIFICATE_AUTHORITY); + } + + //------------------------------------------------------------------------------------------------- + @Bean + public Docket customizeSwagger() { + return configureSwaggerForCoreSystem(this.getClass().getPackageName()); + } +} \ No newline at end of file diff --git a/certificate-authority/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/certificate-authority/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 000000000..af4455de4 --- /dev/null +++ b/certificate-authority/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,47 @@ +{"properties": [ + { + "name": "ping_scheduled", + "type": "java.lang.Boolean", + "description": "A description for 'ping_scheduled'" + }, + { + "name": "ping_timeout", + "type": "java.lang.Long", + "description": "A description for 'ping_timeout'" + }, + { + "name": "ping_interval", + "type": "java.lang.Long", + "description": "A description for 'ping_interval'" + }, + { + "name": "ttl_scheduled", + "type": "java.lang.Boolean", + "description": "A description for 'ttl_scheduled'" + }, + { + "name": "ttl_interval", + "type": "java.lang.Long", + "description": "A description for 'ttl_interval'" + }, + { + "name": "disable.hostname.verifier", + "type": "java.lang.Boolean", + "description": "A description for 'disable.hostname.verifier'" + }, + { + "name": "log_all_request_and_response", + "type": "java.lang.Boolean", + "description": "A description for 'log_all_request_and_response'" + }, + { + "name": "use_strict_service_intf_name_verifier", + "type": "java.lang.Boolean", + "description": "A description for 'use_strict_service_intf_name_verifier'" + }, + { + "name": "core_system_name", + "type": "java.lang.String", + "description": "A description for 'core_system_name'" + } +]} \ No newline at end of file diff --git a/certificate-authority/src/main/resources/application.properties b/certificate-authority/src/main/resources/application.properties new file mode 100644 index 000000000..93f325bd4 --- /dev/null +++ b/certificate-authority/src/main/resources/application.properties @@ -0,0 +1,59 @@ +############################################ +### APPLICATION PARAMETERS ### +############################################ + +# Database connection (mandatory) +# Change the server timezone if neccessary +spring.datasource.url=jdbc:mysql://127.0.0.1:3306/arrowhead?serverTimezone=Europe/Budapest +spring.datasource.username=certificate_authority +spring.datasource.password=FsdG6Kgf9QpPfv2 +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +# use true only for debugging +spring.jpa.show-sql=false +spring.jpa.properties.hibernate.format_sql=true +spring.jpa.hibernate.ddl-auto=none + +# Certificate Authority web-server parameters +server.address=127.0.0.1 +server.port=8448 +domain.name=127.0.0.1 +domain.port=8448 + +############################################ +### CUSTOM PARAMETERS ### +############################################ + +# Name of the core system +core_system_name=certificate_authority + +# Show all request/response in debug log +log_all_request_and_response=false + +# Service Registry web-server parameters (to register the Certificate-Authority services) +sr_address=127.0.0.1 +sr_port=8443 + +############################################ +### SECURE MODE ### +############################################ + +# configure secure mode + +# Set this to false to disable https mode +server.ssl.enabled=true + +server.ssl.key-store-type=PKCS12 +server.ssl.key-store=classpath:certificates/certificate_authority.p12 +server.ssl.key-store-password=123456 +server.ssl.key-alias=certificate_authority +server.ssl.key-password=123456 +server.ssl.client-auth=need +server.ssl.trust-store-type=PKCS12 +server.ssl.trust-store=classpath:certificates/truststore.p12 +server.ssl.trust-store-password=123456 + +#If true, http client does not check whether the hostname is match one of the server's SAN in its certificate +#Just for testing, DO NOT USE this feature in production environment +disable.hostname.verifier=false diff --git a/certificate-authority/src/main/resources/certificates/certificate_authority.p12 b/certificate-authority/src/main/resources/certificates/certificate_authority.p12 new file mode 100644 index 0000000000000000000000000000000000000000..cdeb7cbbb57901241252ec8ca5b241aaca4298dc GIT binary patch literal 7629 zcma)=Wl$Y3n63}*?p9n6a&UKdcPQ@eesC+rin~LB;_mLQ1&X^BE3V7#+`Bvb|3NWAo9RfWn?4pn!GBU>wA>CF>+QH~eb2vcELwD{M4|Fc6icb?BaA#Vp zn6uRhx-8{lZWy64GNEp;z=FIPlg`py5ssTK=qY>0xQ^Y~Iw)cnQTSyA%%L8SrKRo; zjDHxk3HTxi)XUp3(IM>pQVP$1S#C3iBGaVCpmhvakN_lSC_@+BSX zxb(#3Wi+A?Dj3yESld;hM0Q>)4r_$1Y^T5?<&INRD7%&P-=BWWlvoR=H)b5msr)4X zrmhmrOm$!>JA61tr@~TK7m;rWDXsd(uurZQ{2*6chu3z@OcPSPH4zTW`zClao0Oa-A)X&$qe|ZvCbzNT3 z6?N+YoPlTPb$H%uZ!6!AyT%@d28ykQY}_n>n{^^X61=w9Y0lW)Xo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3c@j@J!E)Q+Jqqb2g0AB4vE;%k!nO#EWBVBvDL6K z%$ajYQmPg3AANl$aWFnGAutIB1uG5%0vZJX1Qe21ALl_dxi!Xc`r5F&M^_UR(|QCH c!IzHi@;Q3$Pa#3~8XCLIk6cGw0s{etp!w7j3jhEB literal 0 HcmV?d00001 diff --git a/certificate-authority/src/main/resources/log4j2.xml b/certificate-authority/src/main/resources/log4j2.xml new file mode 100644 index 000000000..fcce0981a --- /dev/null +++ b/certificate-authority/src/main/resources/log4j2.xml @@ -0,0 +1,46 @@ + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex + + INFO + INFO + . + + + + + + + + ${LOG_PATTERN} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/certificate-authority/src/main/resources/swagger/swagger-ui.html b/certificate-authority/src/main/resources/swagger/swagger-ui.html new file mode 100644 index 000000000..4dec726e9 --- /dev/null +++ b/certificate-authority/src/main/resources/swagger/swagger-ui.html @@ -0,0 +1,75 @@ + + + + + + Certificate Authority + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + + + + diff --git a/core-common/src/main/java/eu/arrowhead/common/ApplicationInitListener.java b/core-common/src/main/java/eu/arrowhead/common/ApplicationInitListener.java index be8b61a76..6cf626be8 100644 --- a/core-common/src/main/java/eu/arrowhead/common/ApplicationInitListener.java +++ b/core-common/src/main/java/eu/arrowhead/common/ApplicationInitListener.java @@ -187,12 +187,15 @@ private void obtainKeys(final KeyStore keyStore, final ApplicationContext appCon logger.debug("obtainKeys started..."); @SuppressWarnings("unchecked") final Map context = appContext.getBean(CommonConstants.ARROWHEAD_CONTEXT, Map.class); - - publicKey = Utilities.getFirstCertFromKeyStore(keyStore).getPublicKey(); + + final X509Certificate serverCertificate = Utilities.getFirstCertFromKeyStore(keyStore); + publicKey = serverCertificate.getPublicKey(); context.put(CommonConstants.SERVER_PUBLIC_KEY, publicKey); - + final PrivateKey privateKey = Utilities.getPrivateKey(keyStore, sslProperties.getKeyPassword()); context.put(CommonConstants.SERVER_PRIVATE_KEY, privateKey); + + context.put(CommonConstants.SERVER_CERTIFICATE, serverCertificate); } //------------------------------------------------------------------------------------------------- diff --git a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java index 7ef651842..457f71c82 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java @@ -14,8 +14,9 @@ public class CommonConstants { // members public static final String BASE_PACKAGE = "eu.arrowhead"; - + public static final String CORE_SYSTEM_AUTHORIZATION = "Authorization"; + public static final String CORE_SYSTEM_CERTIFICATE_AUTHORITY = "Certificate Authority"; public static final String CORE_SYSTEM_CHOREOGRAPHER = "Choreographer"; public static final String CORE_SYSTEM_EVENT_HANDLER = "Event Handler"; public static final String CORE_SYSTEM_GATEKEEPER = "Gatekeeper"; @@ -48,6 +49,7 @@ public class CommonConstants { public static final String SERVER_COMMON_NAME = "server.common.name"; public static final String SERVER_PUBLIC_KEY = "server.public.key"; public static final String SERVER_PRIVATE_KEY = "server.private.key"; + public static final String SERVER_CERTIFICATE = "server.certificate"; public static final String HTTPS = "https"; public static final String HTTP = "http"; @@ -77,7 +79,11 @@ public class CommonConstants { public static final String OP_AUTH_INTRA_CHECK_URI = "/intracloud/check"; public static final String OP_AUTH_INTER_CHECK_URI = "/intercloud/check"; public static final String OP_AUTH_SUBSCRIPTION_CHECK_URI = "/subscription/check"; - + + public static final String CERTIFICATE_AUTHRORITY_URI = "/certificate-authority"; + public static final String OP_CA_CLOUD_COMMON_NAME_URI = "/name"; + public static final String OP_CA_SIGN_CERTIFICATE_URI = "/sign"; + public static final String ORCHESTRATOR_URI = "/orchestrator"; public static final String OP_ORCH_PROCESS = "/orchestration"; public static final String ORCHESTRATON_FLAG_MATCHMAKING = "matchmaking"; diff --git a/core-common/src/main/java/eu/arrowhead/common/Utilities.java b/core-common/src/main/java/eu/arrowhead/common/Utilities.java index 790ea5832..e5a228bcd 100644 --- a/core-common/src/main/java/eu/arrowhead/common/Utilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/Utilities.java @@ -376,6 +376,30 @@ public static X509Certificate getFirstCertFromKeyStore(final KeyStore keystore) } } + //------------------------------------------------------------------------------------------------- + public static X509Certificate getCloudCertFromKeyStore(final KeyStore keystore) { + Assert.notNull(keystore, "Key store is not defined."); + + try { + final Enumeration enumeration = keystore.aliases(); + while (enumeration.hasMoreElements()) { + final String alias = enumeration.nextElement(); + final String[] aliasParts = alias.split("\\."); + if (aliasParts.length == 3 && aliasParts[1].equals(AH_MASTER_NAME) && aliasParts[2].equals(AH_MASTER_SUFFIX)) { + return (X509Certificate) keystore.getCertificate(alias); + } + } + + final String errorMsg = "Getting the cloud cert from keystore failed. " + + "Cannot find alias in the following format: {cloudname}." + AH_MASTER_NAME + "." + AH_MASTER_SUFFIX; + logger.error(errorMsg); + throw new ServiceConfigurationError(errorMsg); + } catch (final KeyStoreException | NoSuchElementException ex) { + logger.error("Getting the cloud cert from keystore failed...", ex); + throw new ServiceConfigurationError("Getting the cloud cert from keystore failed...", ex); + } + } + //------------------------------------------------------------------------------------------------- public static PrivateKey getPrivateKey(final KeyStore keystore, final String keyPass) { Assert.notNull(keystore, "Key store is not defined."); @@ -404,6 +428,24 @@ public static PrivateKey getPrivateKey(final KeyStore keystore, final String key return privateKey; } + //------------------------------------------------------------------------------------------------- + public static PrivateKey getPrivateKey(final KeyStore keystore, final String alias, final String keyPass) { + Assert.notNull(keystore, "Key store is not defined."); + Assert.notNull(keyPass, "Password is not defined."); + + try { + PrivateKey privateKey = (PrivateKey) keystore.getKey(alias, keyPass.toCharArray()); + if (privateKey != null) { + return privateKey; + } else { + throw new ServiceConfigurationError("Getting the private key failed, key store aliases do not identify a key."); + } + } catch (final KeyStoreException | UnrecoverableKeyException | NoSuchAlgorithmException ex) { + logger.error("Getting the private key from key store failed...", ex); + throw new ServiceConfigurationError("Getting the private key from key store failed...", ex); + } + } + //------------------------------------------------------------------------------------------------- public static PublicKey getPublicKeyFromBase64EncodedString(final String encodedKey) { Assert.isTrue(!isEmpty(encodedKey), "Encoded key is null or blank"); @@ -502,4 +544,4 @@ private static PublicKey generatePublicKeyFromByteArray(final byte[] keyBytes) { throw new AuthException("Public key decoding failed due wrong input key", ex); } } -} \ No newline at end of file +} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningRequestDTO.java new file mode 100644 index 000000000..078b9abaf --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningRequestDTO.java @@ -0,0 +1,24 @@ +package eu.arrowhead.common.dto.internal; + +import java.io.Serializable; + +public class CertificateSigningRequestDTO implements Serializable { + + private static final long serialVersionUID = -6810780579000655432L; + + private String certificatePem; + + public CertificateSigningRequestDTO() {} + + public CertificateSigningRequestDTO(String certificatePem) { + this.certificatePem = certificatePem; + } + + public String getCertificatePem() { + return certificatePem; + } + + public void setCertificatePem(String certificatePem) { + this.certificatePem = certificatePem; + } +} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningResponseDTO.java new file mode 100644 index 000000000..2a73e0619 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningResponseDTO.java @@ -0,0 +1,24 @@ +package eu.arrowhead.common.dto.internal; + +import java.io.Serializable; + +public class CertificateSigningResponseDTO implements Serializable { + + private static final long serialVersionUID = -6810780579000655432L; + + private String certificatePem; + + public CertificateSigningResponseDTO() {} + + public CertificateSigningResponseDTO(String certificatePem) { + this.certificatePem = certificatePem; + } + + public String getCertificatePem() { + return certificatePem; + } + + public void setCertificatePem(String certificatePem) { + this.certificatePem = certificatePem; + } +} diff --git a/pom.xml b/pom.xml index 185899f38..dc92e26db 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ ${revision} pom core-java-spring - Arrowhead Core Sevices using Spring Boot + Arrowhead Core Services using Spring Boot https://github.com/arrowhead-f/core-java-spring @@ -26,6 +26,7 @@ core-common serviceregistry authorization + certificate-authority orchestrator eventhandler gatekeeper @@ -54,6 +55,7 @@ 3.9 2.0.1 5.15.9 + 1.64 UTF-8 diff --git a/scripts/certificate_authority_privileges.sql b/scripts/certificate_authority_privileges.sql new file mode 100644 index 000000000..b09cc1cbb --- /dev/null +++ b/scripts/certificate_authority_privileges.sql @@ -0,0 +1,43 @@ +USE `arrowhead`; + +REVOKE ALL, GRANT OPTION FROM 'certificate_authority'@'localhost'; + +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`certificate_authority` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`certificate_authority_interface_connection` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'certificate_authority'@'localhost'; + +REVOKE ALL, GRANT OPTION FROM 'certificate_authority'@'%'; + +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`certificate_authority` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`certificate_authority_interface_connection` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'certificate_authority'@'%'; + +FLUSH PRIVILEGES; diff --git a/scripts/create_empty_arrowhead_db.sql b/scripts/create_empty_arrowhead_db.sql index 27a130088..c98a30316 100644 --- a/scripts/create_empty_arrowhead_db.sql +++ b/scripts/create_empty_arrowhead_db.sql @@ -40,4 +40,9 @@ source gatekeeper_privileges.sql -- Gateway CREATE USER IF NOT EXISTS 'gateway'@'localhost' IDENTIFIED BY 'LfiSM9DpGfDEP5g'; CREATE USER IF NOT EXISTS 'gateway'@'%' IDENTIFIED BY 'LfiSM9DpGfDEP5g'; -source gateway_privileges.sql \ No newline at end of file +source gateway_privileges.sql + +-- Certificate Authority +CREATE USER IF NOT EXISTS 'certificate_authority'@'localhost' IDENTIFIED BY 'FsdG6Kgf9QpPfv2'; +CREATE USER IF NOT EXISTS 'certificate_authority'@'%' IDENTIFIED BY 'FsdG6Kgf9QpPfv2'; +source certificate_authority_privileges.sql diff --git a/scripts/start_coresystems_local.bat b/scripts/start_coresystems_local.bat index 179670d0b..e812085fa 100644 --- a/scripts/start_coresystems_local.bat +++ b/scripts/start_coresystems_local.bat @@ -26,6 +26,10 @@ cd ..\..\orchestrator\target START "" /B "cmd /c javaw -jar arrowhead-orchestrator-4.1.3.jar > sout_orch.log 2>&1" echo Orchestrator started +cd ..\..\certificate-authority\target +START "" /B "cmd /c javaw -jar arrowhead-certificate-authority-4.1.3.jar > sout_ca.log 2>&1" +echo Certificate Authority started + cd %parent_path% ::Kill self diff --git a/scripts/stop_coresystems.bat b/scripts/stop_coresystems.bat index dc6f3a234..31ab118f0 100644 --- a/scripts/stop_coresystems.bat +++ b/scripts/stop_coresystems.bat @@ -10,6 +10,7 @@ FOR /F "tokens=1" %%p in ('"jps -v | find "gatekeeper""') DO taskkill /pid %%p > FOR /F "tokens=1" %%p in ('"jps -v | find "eventhandler""') DO taskkill /pid %%p > NUL 2>&1 FOR /F "tokens=1" %%p in ('"jps -v | find "gateway""') DO taskkill /pid %%p > NUL 2>&1 FOR /F "tokens=1" %%p in ('"jps -v | find "authorization""') DO taskkill /pid %%p > NUL 2>&1 +FOR /F "tokens=1" %%p in ('"jps -v | find "certificate""') DO taskkill /pid %%p > NUL 2>&1 timeout /t %time_to_sleep% /nobreak > NUL FOR /F "tokens=1" %%p in ('"jps -v | find "serviceregistry""') DO taskkill /pid %%p > NUL 2>&1 @@ -27,6 +28,7 @@ IF "%STILL_THERE%"=="""" ( FOR /F "tokens=1" %%p in ('"jps -v | find "eventhandler""') DO taskkill /F /pid %%p FOR /F "tokens=1" %%p in ('"jps -v | find "gateway""') DO taskkill /F /pid %%p FOR /F "tokens=1" %%p in ('"jps -v | find "authorization""') DO taskkill /F /pid %%p + FOR /F "tokens=1" %%p in ('"jps -v | find "certificate""') DO taskkill /F /pid %%p FOR /F "tokens=1" %%p in ('"jps -v | find "serviceregistry""') DO taskkill /F /pid %%p echo Core systems forcefully killed ) From b1051f7105897ec6a9805eba0ef66323ed27ccb8 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 18 Feb 2020 14:50:20 +0100 Subject: [PATCH 214/301] requested change: same field twice, delete one --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 109690b7c..66e512cc6 100644 --- a/README.md +++ b/README.md @@ -6422,7 +6422,6 @@ __PingMeasurement list response__ the output : | `sent` | Integer value of sent pings in measurement| | `received` | Integer value of received pings in measurement| | `countStartedAt` | TimeSatmp value of the last reset of sent and received fields| -| `countStartedAt` | TimeSatmp value of the last reset of sent and received fields| | `sentAll` | Integer value of sent pings since ping measurement created| | `receivedAll` | Integer value of received pings since ping measurement created| | `createdAt` | Date of creation of the ping measurement | @@ -6514,7 +6513,6 @@ __Ping Measurment response by system id__ the output : | `sent` | Integer value of sent pings in measurement| | `received` | Integer value of received pings in measurement| | `countStartedAt` | TimeSatmp value of the last reset of sent and received fields| -| `countStartedAt` | TimeSatmp value of the last reset of sent and received fields| | `sentAll` | Integer value of sent pings since ping measurement created| | `receivedAll` | Integer value of received pings since ping measurement created| | `createdAt` | Date of creation of the ping measurement | From 229ccb38f86a88aac8c9e3a47517735b94c0d778 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 18 Feb 2020 14:57:17 +0100 Subject: [PATCH 215/301] requested change: use diamond --- .../core/orchestrator/service/OrchestratorService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java index 82dd5424b..a5dba7eac 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java @@ -493,7 +493,7 @@ private List compileOrchestrationResponse(final List()); + result.setMetadata( new HashMap<>()); } if (request.getOrchestrationFlags().get(Flag.OVERRIDE_STORE)) { final List warnings = calculateOrchestratorWarnings(entry); From 45f276aaf8bb18d067e3e3dbe0e52ce7a3b30b64 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 18 Feb 2020 14:59:59 +0100 Subject: [PATCH 216/301] requested change: returns a PingMeasurementListResponseDTO --- .../main/java/eu/arrowhead/core/qos/QoSMonitorController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java index cab4aae5f..65b6113de 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java @@ -84,7 +84,7 @@ public String echoService() { } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = GET_QOS_MONITOR_PING_MEASUREMENTS_MGMT_DESCRIPTION, response = Page.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) + @ApiOperation(value = GET_QOS_MONITOR_PING_MEASUREMENTS_MGMT_DESCRIPTION, response = PingMeasurementListResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_MGMT }) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_OK, message = GET_QOS_MONITOR_PING_MEASUREMENTS_MGMT_HTTP_200_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_QOS_MONITOR_PING_MEASUREMENTS_MGMT_HTTP_400_MESSAGE), From 64caf9ef634b95121b3dd2652131662993b5d0f0 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 18 Feb 2020 15:08:14 +0100 Subject: [PATCH 217/301] requested change: rename to getOrCreate... --- .../core/qos/database/service/QoSDBService.java | 2 +- .../arrowhead/core/qos/quartz/task/PingTask.java | 2 +- .../qos/database/service/QoSDBServiceTest.java | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index 8e8760eda..5fbf347ae 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -110,7 +110,7 @@ public QoSIntraMeasurement createMeasurement(final System system, final QoSMeasu //------------------------------------------------------------------------------------------------- @Transactional (rollbackFor = ArrowheadException.class) - public QoSIntraMeasurement getMeasurement(final SystemResponseDTO systemResponseDTO) { + public QoSIntraMeasurement getOrCreateMeasurement(final SystemResponseDTO systemResponseDTO) { logger.debug("getMeasurement started..."); validateSystemResponseDTO(systemResponseDTO); diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 97ef01a7f..1e9c9fde4 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -210,7 +210,7 @@ private void pingSystem(final SystemResponseDTO systemResponseDTO ) { final List responseList = pingService.getPingResponseList(address); - final QoSIntraMeasurement measurement = qoSDBService.getMeasurement(systemResponseDTO); + final QoSIntraMeasurement measurement = qoSDBService.getOrCreateMeasurement(systemResponseDTO); handlePingMeasurement(measurement, responseList, aroundNow); qoSDBService.updateMeasurement(aroundNow, measurement); diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index d844bb650..5a29890b9 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -283,7 +283,7 @@ public void testGetMeasurement() { when(systemRepository.findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt())).thenReturn(Optional.of(system)); when(qoSIntraMeasurementRepository.findBySystemAndMeasurementType(any(), any())).thenReturn(Optional.of(measurement)); - qoSDBService.getMeasurement(systemResponseDTO); + qoSDBService.getOrCreateMeasurement(systemResponseDTO); verify(systemRepository, times(1)).findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt()); verify(qoSIntraMeasurementRepository, times(1)).findBySystemAndMeasurementType(any(), any()); @@ -302,7 +302,7 @@ public void testGetMeasurementRequestedSystemNotInDB() { try { - qoSDBService.getMeasurement(systemResponseDTO); + qoSDBService.getOrCreateMeasurement(systemResponseDTO); } catch (final Exception ex) { @@ -328,7 +328,7 @@ public void testGetMeasurementMeasurementNotInDB() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); when(qoSIntraMeasurementRepository.saveAndFlush(any())).thenReturn(measurement); - qoSDBService.getMeasurement(systemResponseDTO); + qoSDBService.getOrCreateMeasurement(systemResponseDTO); verify(systemRepository, times(1)).findBySystemNameAndAddressAndPort(anyString(), anyString(), anyInt()); verify(qoSIntraMeasurementRepository, times(1)).findBySystemAndMeasurementType(any(), any()); @@ -348,7 +348,7 @@ public void testGetMeasurementNullRequestParameter() { try { - qoSDBService.getMeasurement(systemResponseDTO); + qoSDBService.getOrCreateMeasurement(systemResponseDTO); } catch (final Exception ex) { @@ -375,7 +375,7 @@ public void testGetMeasurementSystemNameIsNullSystemResponseDTOParameter() { try { - qoSDBService.getMeasurement(systemResponseDTO); + qoSDBService.getOrCreateMeasurement(systemResponseDTO); } catch (final Exception ex) { @@ -402,7 +402,7 @@ public void testGetMeasurementSystemNameIsEmptySystemResponseDTOParameter() { try { - qoSDBService.getMeasurement(systemResponseDTO); + qoSDBService.getOrCreateMeasurement(systemResponseDTO); } catch (final Exception ex) { @@ -429,7 +429,7 @@ public void testGetMeasurementSystemAddressIsNullSystemResponseDTOParameter() { try { - qoSDBService.getMeasurement(systemResponseDTO); + qoSDBService.getOrCreateMeasurement(systemResponseDTO); } catch (final Exception ex) { @@ -456,7 +456,7 @@ public void testGetMeasurementSystemAddressIsEmptySystemResponseDTOParameter() { try { - qoSDBService.getMeasurement(systemResponseDTO); + qoSDBService.getOrCreateMeasurement(systemResponseDTO); } catch (final Exception ex) { From cf9fce5f9e462224c8e04320b0dd5ab6965b4c8c Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 18 Feb 2020 15:11:36 +0100 Subject: [PATCH 218/301] requested change: use InvalidParameterException here --- .../eu/arrowhead/core/qos/database/service/QoSDBService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index 5fbf347ae..e043b5921 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -123,7 +123,7 @@ public QoSIntraMeasurement getOrCreateMeasurement(final SystemResponseDTO system if (systemOptional.isPresent()) { system = systemOptional.get(); }else { - throw new ArrowheadException("Requested system" + NOT_IN_DB_ERROR_MESSAGE); + throw new InvalidParameterException("Requested system" + NOT_IN_DB_ERROR_MESSAGE); } final QoSIntraMeasurement measurement; From 2f74bef39677126d1edef05656ee75040b8f4ce2 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 18 Feb 2020 15:17:11 +0100 Subject: [PATCH 219/301] requested change: remove unused fields --- .../core/qos/quartz/task/CountRestarterTaskConfig.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java index 7106999d3..3f926d081 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java @@ -25,9 +25,6 @@ public class CountRestarterTaskConfig { @Autowired private ApplicationContext applicationContext; //NOSONAR - @Value(CoreCommonConstants.$PING_TTL_INTERVAL_WD) - private int ttlInterval; - private static final int SCHEDULER_DELAY = 7; private static final String CRON_EXPRESSION_MIDNIGHT_EVERY_DAY= "0 0 0 ? * * *"; private static final String NAME_OF_TRIGGER = "Counter_Restart_Task_Trigger"; @@ -49,7 +46,7 @@ public SchedulerFactoryBean counterRestarterTaskSheduler() { schedulerFactory.setTriggers(counterRestartTaskTrigger().getObject()); schedulerFactory.setStartupDelay(SCHEDULER_DELAY); - logger.info("CountRestarterTask task adjusted with ttl interval: {} minutes", ttlInterval); + logger.info("CountRestarterTask task adjusted."); return schedulerFactory; } From 6e6c4181e77993c2f23178f4330f84d6ec64d196 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 18 Feb 2020 15:23:25 +0100 Subject: [PATCH 220/301] requested change: typo --- .../properties/PingMeasurementProperties.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java index ca71557a3..925e9af08 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java @@ -17,7 +17,7 @@ public class PingMeasurementProperties { private int timeout; private int packetSize; private int rest; - private int availableFromSuccessPercet; + private int availableFromSuccessPercent; //================================================================================================= // methods @@ -31,7 +31,7 @@ public PingMeasurementProperties(final int timeToRepeat, final int timeout, fina this.timeout = timeout; this.packetSize = pocketSize; this.rest = rest; - this.availableFromSuccessPercet = availableFromSuccessPercet; + this.availableFromSuccessPercent = availableFromSuccessPercet; } //------------------------------------------------------------------------------------------------- @@ -39,14 +39,14 @@ public PingMeasurementProperties(final int timeToRepeat, final int timeout, fina public int getTimeout() { return timeout; } public int getPacketSize() { return packetSize; } public int getRest() { return rest; } - public int getAvailableFromSuccessPercet() { return availableFromSuccessPercet; } + public int getAvailableFromSuccessPercet() { return availableFromSuccessPercent; } //------------------------------------------------------------------------------------------------- public void setTimeToRepeat(final int timeToRepeat) { this.timeToRepeat = timeToRepeat; } public void setTimeout(final int timeout) { this.timeout = timeout; } public void setPacketSize(final int packetSize) { this.packetSize = packetSize; } public void setRest(final int rest) { this.rest = rest; } - public void setAvailableFromSuccessPercet(final int availableFromSuccessPercet) { this.availableFromSuccessPercet = availableFromSuccessPercet; } + public void setAvailableFromSuccessPercet(final int availableFromSuccessPercet) { this.availableFromSuccessPercent = availableFromSuccessPercet; } //------------------------------------------------------------------------------------------------- @PostConstruct @@ -56,7 +56,7 @@ private void validateFields() { Assert.isTrue(timeout >= 0 && timeout < 10000, "timeout must be greater than or equal 0 and not greater than 10 000"); Assert.isTrue((packetSize == 32 || packetSize == 56 || packetSize == 64), "packetSize has to be 32 or 56 or 64"); Assert.isTrue(rest >= 0 && rest <= 10000, "rest must be greater than 0 and not greater than 10 000"); - Assert.isTrue(availableFromSuccessPercet > 0 && availableFromSuccessPercet <= 100, "availableFromSuccessPercet must be greater than 0 and not greater than 100"); + Assert.isTrue(availableFromSuccessPercent > 0 && availableFromSuccessPercent <= 100, "availableFromSuccessPercent must be greater than 0 and not greater than 100"); } } From a54c941e5c8152b39ca2e7dc8e96c559227e8b4f Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Tue, 18 Feb 2020 15:23:51 +0100 Subject: [PATCH 221/301] requested change: update tests --- .../core/qos/quartz/task/PingTaskTest.java | 162 +++++++++--------- 1 file changed, 81 insertions(+), 81 deletions(-) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index cd3090cd2..51589b7cb 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -117,7 +117,7 @@ public void testExecuteMeasurementIsInDB() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); final QoSIntraPingMeasurement pingMeasurement = getQosIntraPingMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); doNothing().when(logger).debug( debugValueCapture.capture()); @@ -132,7 +132,7 @@ public void testExecuteMeasurementIsInDB() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.of(pingMeasurement)); @@ -159,7 +159,7 @@ public void testExecuteMeasurementIsInDB() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(1)).getTimeout(); verify(pingService, atLeastOnce()).getPingResponseList(anyString()); - verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + verify(qoSDBService, atLeastOnce()).getOrCreateMeasurement(any()); verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); verify(qoSDBService, atLeastOnce()).updatePingMeasurement(any(), any(), any(), any()); @@ -180,7 +180,7 @@ public void testExecuteMeasurementIsNotInDB() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); doNothing().when(logger).debug( debugValueCapture.capture()); @@ -195,7 +195,7 @@ public void testExecuteMeasurementIsNotInDB() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -222,7 +222,7 @@ public void testExecuteMeasurementIsNotInDB() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(1)).getTimeout(); verify(pingService, atLeastOnce()).getPingResponseList(anyString()); - verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + verify(qoSDBService, atLeastOnce()).getOrCreateMeasurement(any()); verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); @@ -243,7 +243,7 @@ public void testExecuteServerIsInStandalonMode() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); doNothing().when(logger).debug( debugValueCapture.capture()); @@ -258,7 +258,7 @@ public void testExecuteServerIsInStandalonMode() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -285,7 +285,7 @@ public void testExecuteServerIsInStandalonMode() { verify(httpService, times(0)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(0)).getTimeout(); verify(pingService, times(0)).getPingResponseList(anyString()); - verify(qoSDBService,times(0)).getMeasurement(any()); + verify(qoSDBService,times(0)).getOrCreateMeasurement(any()); verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); @@ -306,7 +306,7 @@ public void testExecuteNoSystemsToMeasure() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); doNothing().when(logger).debug( debugValueCapture.capture()); @@ -321,7 +321,7 @@ public void testExecuteNoSystemsToMeasure() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -348,7 +348,7 @@ public void testExecuteNoSystemsToMeasure() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(0)).getTimeout(); verify(pingService, times(0)).getPingResponseList(anyString()); - verify(qoSDBService,times(0)).getMeasurement(any()); + verify(qoSDBService,times(0)).getOrCreateMeasurement(any()); verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); @@ -367,7 +367,7 @@ public void testExecuteHttpServiceThrowsException() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); doNothing().when(logger).debug( debugValueCapture.capture()); @@ -382,7 +382,7 @@ public void testExecuteHttpServiceThrowsException() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -410,7 +410,7 @@ public void testExecuteHttpServiceThrowsException() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(0)).getTimeout(); verify(pingService, times(0)).getPingResponseList(anyString()); - verify(qoSDBService,times(0)).getMeasurement(any()); + verify(qoSDBService,times(0)).getOrCreateMeasurement(any()); verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); @@ -431,7 +431,7 @@ public void testExecuteServiceRegistryUriNotInContext() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); doNothing().when(logger).debug( debugValueCapture.capture()); @@ -446,7 +446,7 @@ public void testExecuteServiceRegistryUriNotInContext() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -475,7 +475,7 @@ public void testExecuteServiceRegistryUriNotInContext() { verify(httpService, times(0)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(0)).getTimeout(); verify(pingService, times(0)).getPingResponseList(anyString()); - verify(qoSDBService,times(0)).getMeasurement(any()); + verify(qoSDBService,times(0)).getOrCreateMeasurement(any()); verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); @@ -500,7 +500,7 @@ public void testExecuteServiceRegistryUriContextValueNotUriType() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); doNothing().when(logger).debug( debugValueCapture.capture()); @@ -515,7 +515,7 @@ public void testExecuteServiceRegistryUriContextValueNotUriType() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -544,7 +544,7 @@ public void testExecuteServiceRegistryUriContextValueNotUriType() { verify(httpService, times(0)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(0)).getTimeout(); verify(pingService, times(0)).getPingResponseList(anyString()); - verify(qoSDBService,times(0)).getMeasurement(any()); + verify(qoSDBService,times(0)).getOrCreateMeasurement(any()); verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); @@ -570,7 +570,7 @@ public void testExecuteSystemToMeasureHasNullAddressParameter() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); doNothing().when(logger).debug( debugValueCapture.capture()); @@ -585,7 +585,7 @@ public void testExecuteSystemToMeasureHasNullAddressParameter() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -614,7 +614,7 @@ public void testExecuteSystemToMeasureHasNullAddressParameter() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(0)).getTimeout(); verify(pingService, times(0)).getPingResponseList(anyString()); - verify(qoSDBService,times(0)).getMeasurement(any()); + verify(qoSDBService,times(0)).getOrCreateMeasurement(any()); verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); @@ -640,7 +640,7 @@ public void testExecuteSystemToMeasureHasEmptyAddressParameter() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); doNothing().when(logger).debug( debugValueCapture.capture()); @@ -655,7 +655,7 @@ public void testExecuteSystemToMeasureHasEmptyAddressParameter() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -684,7 +684,7 @@ public void testExecuteSystemToMeasureHasEmptyAddressParameter() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(0)).getTimeout(); verify(pingService, times(0)).getPingResponseList(anyString()); - verify(qoSDBService,times(0)).getMeasurement(any()); + verify(qoSDBService,times(0)).getOrCreateMeasurement(any()); verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); @@ -708,7 +708,7 @@ public void testExecuteGetPingResponseListThrowsException() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); doNothing().when(logger).debug( debugValueCapture.capture()); @@ -723,7 +723,7 @@ public void testExecuteGetPingResponseListThrowsException() { when(pingService.getPingResponseList(anyString())).thenThrow(ArrowheadException.class); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -750,7 +750,7 @@ public void testExecuteGetPingResponseListThrowsException() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingService, times(1)).getPingResponseList(anyString()); verify(pingMeasurementProperties, times(0)).getTimeout(); - verify(qoSDBService,times(0)).getMeasurement(any()); + verify(qoSDBService,times(0)).getOrCreateMeasurement(any()); verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); @@ -776,7 +776,7 @@ public void testExecuteGetMeasurementThrowsException() { //final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); doNothing().when(logger).debug( debugValueCapture.capture()); @@ -791,7 +791,7 @@ public void testExecuteGetMeasurementThrowsException() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenThrow(ArrowheadException.class); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenThrow(ArrowheadException.class); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -817,7 +817,7 @@ public void testExecuteGetMeasurementThrowsException() { verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingService, times(1)).getPingResponseList(anyString()); - verify(qoSDBService,times(1)).getMeasurement(any()); + verify(qoSDBService,times(1)).getOrCreateMeasurement(any()); verify(pingMeasurementProperties, times(0)).getTimeout(); verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); @@ -844,7 +844,7 @@ public void testExecuteWithEmptyResponseList() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); doNothing().when(logger).debug( debugValueCapture.capture()); @@ -859,7 +859,7 @@ public void testExecuteWithEmptyResponseList() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -887,7 +887,7 @@ public void testExecuteWithEmptyResponseList() { verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingService, times(1)).getPingResponseList(anyString()); - verify(qoSDBService,times(1)).getMeasurement(any()); + verify(qoSDBService,times(1)).getOrCreateMeasurement(any()); verify(pingMeasurementProperties, times(0)).getTimeout(); verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); @@ -913,7 +913,7 @@ public void testExecuteCalculationsDTOIsPresent() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); @@ -931,7 +931,7 @@ public void testExecuteCalculationsDTOIsPresent() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -961,7 +961,7 @@ public void testExecuteCalculationsDTOIsPresent() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(1)).getTimeout(); verify(pingService, atLeastOnce()).getPingResponseList(anyString()); - verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + verify(qoSDBService, atLeastOnce()).getOrCreateMeasurement(any()); verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); @@ -982,7 +982,7 @@ public void testExecuteAvailableCalculation() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); @@ -1000,7 +1000,7 @@ public void testExecuteAvailableCalculation() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -1031,7 +1031,7 @@ public void testExecuteAvailableCalculation() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(1)).getTimeout(); verify(pingService, atLeastOnce()).getPingResponseList(anyString()); - verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + verify(qoSDBService, atLeastOnce()).getOrCreateMeasurement(any()); verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); @@ -1052,7 +1052,7 @@ public void testExecuteAvailableCalculationWith100PercentNotOK() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); @@ -1070,7 +1070,7 @@ public void testExecuteAvailableCalculationWith100PercentNotOK() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -1101,7 +1101,7 @@ public void testExecuteAvailableCalculationWith100PercentNotOK() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(1)).getTimeout(); verify(pingService, atLeastOnce()).getPingResponseList(anyString()); - verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + verify(qoSDBService, atLeastOnce()).getOrCreateMeasurement(any()); verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); @@ -1122,7 +1122,7 @@ public void testExecuteAvailableCalculationWith100PercentOK() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); @@ -1140,7 +1140,7 @@ public void testExecuteAvailableCalculationWith100PercentOK() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -1171,7 +1171,7 @@ public void testExecuteAvailableCalculationWith100PercentOK() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(1)).getTimeout(); verify(pingService, atLeastOnce()).getPingResponseList(anyString()); - verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + verify(qoSDBService, atLeastOnce()).getOrCreateMeasurement(any()); verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); @@ -1192,7 +1192,7 @@ public void testExecuteAvailableCalculationWith1PercentOK() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); @@ -1210,7 +1210,7 @@ public void testExecuteAvailableCalculationWith1PercentOK() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -1241,7 +1241,7 @@ public void testExecuteAvailableCalculationWith1PercentOK() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(1)).getTimeout(); verify(pingService, atLeastOnce()).getPingResponseList(anyString()); - verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + verify(qoSDBService, atLeastOnce()).getOrCreateMeasurement(any()); verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); @@ -1262,7 +1262,7 @@ public void testExecuteAvailableCalculationWith1PercentNotOK() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); @@ -1280,7 +1280,7 @@ public void testExecuteAvailableCalculationWith1PercentNotOK() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -1311,7 +1311,7 @@ public void testExecuteAvailableCalculationWith1PercentNotOK() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(1)).getTimeout(); verify(pingService, atLeastOnce()).getPingResponseList(anyString()); - verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + verify(qoSDBService, atLeastOnce()).getOrCreateMeasurement(any()); verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); @@ -1332,7 +1332,7 @@ public void testExecuteAvailableCalculationWithNotAvailable() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); @@ -1350,7 +1350,7 @@ public void testExecuteAvailableCalculationWithNotAvailable() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -1381,7 +1381,7 @@ public void testExecuteAvailableCalculationWithNotAvailable() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(1)).getTimeout(); verify(pingService, atLeastOnce()).getPingResponseList(anyString()); - verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + verify(qoSDBService, atLeastOnce()).getOrCreateMeasurement(any()); verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); @@ -1402,7 +1402,7 @@ public void testExecuteMinResponseTime() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); @@ -1419,7 +1419,7 @@ public void testExecuteMinResponseTime() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -1450,7 +1450,7 @@ public void testExecuteMinResponseTime() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(1)).getTimeout(); verify(pingService, atLeastOnce()).getPingResponseList(anyString()); - verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + verify(qoSDBService, atLeastOnce()).getOrCreateMeasurement(any()); verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); @@ -1471,7 +1471,7 @@ public void testExecuteMaxResponseTime() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); @@ -1488,7 +1488,7 @@ public void testExecuteMaxResponseTime() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -1519,7 +1519,7 @@ public void testExecuteMaxResponseTime() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(1)).getTimeout(); verify(pingService, atLeastOnce()).getPingResponseList(anyString()); - verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + verify(qoSDBService, atLeastOnce()).getOrCreateMeasurement(any()); verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); @@ -1540,7 +1540,7 @@ public void testExecuteMeanResponseTimeCalculations() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); @@ -1557,7 +1557,7 @@ public void testExecuteMeanResponseTimeCalculations() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -1589,7 +1589,7 @@ public void testExecuteMeanResponseTimeCalculations() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(1)).getTimeout(); verify(pingService, atLeastOnce()).getPingResponseList(anyString()); - verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + verify(qoSDBService, atLeastOnce()).getOrCreateMeasurement(any()); verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); @@ -1610,7 +1610,7 @@ public void testExecuteJitterCalculations() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor calculationsValueCapture = ArgumentCaptor.forClass(PingMeasurementCalculationsDTO.class); @@ -1627,7 +1627,7 @@ public void testExecuteJitterCalculations() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -1659,7 +1659,7 @@ public void testExecuteJitterCalculations() { verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingMeasurementProperties, times(1)).getTimeout(); verify(pingService, atLeastOnce()).getPingResponseList(anyString()); - verify(qoSDBService, atLeastOnce()).getMeasurement(any()); + verify(qoSDBService, atLeastOnce()).getOrCreateMeasurement(any()); verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); @@ -1681,7 +1681,7 @@ public void testExecuteGetPingMeasurementByMeasurementThrowsException() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); doNothing().when(logger).debug( debugValueCapture.capture()); @@ -1696,7 +1696,7 @@ public void testExecuteGetPingMeasurementByMeasurementThrowsException() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenThrow(ArrowheadException.class); @@ -1722,7 +1722,7 @@ public void testExecuteGetPingMeasurementByMeasurementThrowsException() { verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingService, times(1)).getPingResponseList(anyString()); - verify(qoSDBService,times(1)).getMeasurement(any()); + verify(qoSDBService,times(1)).getOrCreateMeasurement(any()); verify(pingMeasurementProperties, atLeastOnce()).getTimeout(); verify(qoSDBService, times(1)).getPingMeasurementByMeasurement(any()); @@ -1749,7 +1749,7 @@ public void testExecuteCreatePingMeasurementThrowsException() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); doNothing().when(logger).debug( debugValueCapture.capture()); @@ -1764,7 +1764,7 @@ public void testExecuteCreatePingMeasurementThrowsException() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -1790,7 +1790,7 @@ public void testExecuteCreatePingMeasurementThrowsException() { verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingService, times(1)).getPingResponseList(anyString()); - verify(qoSDBService,times(1)).getMeasurement(any()); + verify(qoSDBService,times(1)).getOrCreateMeasurement(any()); verify(pingMeasurementProperties, atLeastOnce()).getTimeout(); verify(qoSDBService, times(1)).getPingMeasurementByMeasurement(any()); @@ -1830,7 +1830,7 @@ public void testExecuteLogMeasurementToDBThrowsException() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -1856,7 +1856,7 @@ public void testExecuteLogMeasurementToDBThrowsException() { verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingService, times(1)).getPingResponseList(anyString()); - verify(qoSDBService,times(1)).getMeasurement(any()); + verify(qoSDBService,times(1)).getOrCreateMeasurement(any()); verify(pingMeasurementProperties, atLeastOnce()).getTimeout(); verify(qoSDBService, times(1)).getPingMeasurementByMeasurement(any()); @@ -1884,7 +1884,7 @@ public void testExecuteLogMeasurementDetailsToDBThrowsException() { final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - final QoSIntraPingMeasurementLog measurementLog = getMeasurementLogForTest(); + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); doNothing().when(logger).debug( debugValueCapture.capture()); @@ -1899,7 +1899,7 @@ public void testExecuteLogMeasurementDetailsToDBThrowsException() { when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - when(qoSDBService.getMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); //in handleMeasurement when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); @@ -1925,7 +1925,7 @@ public void testExecuteLogMeasurementDetailsToDBThrowsException() { verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); verify(httpService, times(1)).sendRequest(any(), any(), any()); verify(pingService, times(1)).getPingResponseList(anyString()); - verify(qoSDBService,times(1)).getMeasurement(any()); + verify(qoSDBService,times(1)).getOrCreateMeasurement(any()); verify(pingMeasurementProperties, atLeastOnce()).getTimeout(); verify(qoSDBService, times(1)).getPingMeasurementByMeasurement(any()); @@ -2314,7 +2314,7 @@ private QoSIntraPingMeasurement getQosIntraPingMeasurementForTest() { } //------------------------------------------------------------------------------------------------- - private QoSIntraPingMeasurementLog getMeasurementLogForTest() { + private QoSIntraPingMeasurementLog getOrCreateMeasurementLogForTest() { final QoSIntraPingMeasurementLog measurementLog = new QoSIntraPingMeasurementLog(); measurementLog.setAvailable(true); From 9eeff37f9e1d85e26efd11c9f76a336413587497 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 19 Feb 2020 09:01:32 +0100 Subject: [PATCH 222/301] requested change: fix typo --- .../main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 1e9c9fde4..08387b912 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -102,7 +102,7 @@ public void execute(final JobExecutionContext context) throws JobExecutionExcept //------------------------------------------------------------------------------------------------- private Set getSystemsToMeasure() { - logger.debug("getSystemToMessure started..."); + logger.debug("getSystemToMeasure started..."); final ServiceRegistryListResponseDTO serviceRegistryListResponseDTO = queryServiceRegistryAll(); if(serviceRegistryListResponseDTO == null || serviceRegistryListResponseDTO.getData() == null || serviceRegistryListResponseDTO.getData().isEmpty()) { From 786438e548abdb2b0b6a80c8d5a19e934dec4f8f Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 19 Feb 2020 09:09:24 +0100 Subject: [PATCH 223/301] requested change: eliminate division by zero --- .../main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 08387b912..e61e5fbd1 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -160,8 +160,8 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(final List final boolean available = calculateAvailable(sentInThisPing, availableCount); final int lostPerMeasurementPercent = (int) (receivedInThisPing == 0 ? 100 : 100 - ((double)receivedInThisPing / sentInThisPing) * 100); - final double meanResponseTimeWithTimeout = sumOfDurationForMeanResponseTimeWithTimeout / responseList.size(); - final double meanResponseTimeWithoutTimeout = sumOfDurationForMeanResponseTimeWithoutTimeout / meanResponseTimeWithoutTimeoutMembersCount; + final double meanResponseTimeWithTimeout = responseList.size() < 1 ? 0 : sumOfDurationForMeanResponseTimeWithTimeout / responseList.size(); + final double meanResponseTimeWithoutTimeout = meanResponseTimeWithoutTimeoutMembersCount < 1 ? 0 : sumOfDurationForMeanResponseTimeWithoutTimeout / meanResponseTimeWithoutTimeoutMembersCount; double sumOfDiffsForJitterWithTimeout = 0; double sumOfDiffsForJitterWithoutTimeout =0; From ae44ca390d0b65ee836845094298056fe4ce8f13 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 19 Feb 2020 09:14:10 +0100 Subject: [PATCH 224/301] requested change: eliminate division by zero --- .../eu/arrowhead/core/qos/quartz/task/PingTask.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index e61e5fbd1..7bc993e38 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -48,6 +48,8 @@ public class PingTask implements Job { // members private static final String NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE = " is null or blank."; + private static final int INVALID_CALCULATION_VALUE = -1; + private static final boolean LOG_MEASUREMENT = true; private static final boolean LOG_MEASUREMENT_DETAILS = true; @@ -160,8 +162,8 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(final List final boolean available = calculateAvailable(sentInThisPing, availableCount); final int lostPerMeasurementPercent = (int) (receivedInThisPing == 0 ? 100 : 100 - ((double)receivedInThisPing / sentInThisPing) * 100); - final double meanResponseTimeWithTimeout = responseList.size() < 1 ? 0 : sumOfDurationForMeanResponseTimeWithTimeout / responseList.size(); - final double meanResponseTimeWithoutTimeout = meanResponseTimeWithoutTimeoutMembersCount < 1 ? 0 : sumOfDurationForMeanResponseTimeWithoutTimeout / meanResponseTimeWithoutTimeoutMembersCount; + final double meanResponseTimeWithTimeout = responseList.size() < 1 ? INVALID_CALCULATION_VALUE : sumOfDurationForMeanResponseTimeWithTimeout / responseList.size(); + final double meanResponseTimeWithoutTimeout = meanResponseTimeWithoutTimeoutMembersCount < 1 ? INVALID_CALCULATION_VALUE : sumOfDurationForMeanResponseTimeWithoutTimeout / meanResponseTimeWithoutTimeoutMembersCount; double sumOfDiffsForJitterWithTimeout = 0; double sumOfDiffsForJitterWithoutTimeout =0; @@ -178,8 +180,8 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(final List sumOfDiffsForJitterWithTimeout += Math.pow( (duration - meanResponseTimeWithTimeout), 2); } - final double jitterWithTimeout = Math.sqrt(sumOfDiffsForJitterWithTimeout / meanResponseTimeWithoutTimeoutMembersCount); - final double jitterWithoutTimeout = Math.sqrt(sumOfDiffsForJitterWithoutTimeout / responseList.size()); + final double jitterWithTimeout = meanResponseTimeWithoutTimeoutMembersCount < 1 ? INVALID_CALCULATION_VALUE : Math.sqrt(sumOfDiffsForJitterWithTimeout / meanResponseTimeWithoutTimeoutMembersCount); + final double jitterWithoutTimeout = responseList.size() < 1 ? INVALID_CALCULATION_VALUE : Math.sqrt(sumOfDiffsForJitterWithoutTimeout / responseList.size()); final PingMeasurementCalculationsDTO calculations = new PingMeasurementCalculationsDTO(); calculations.setAvailable(available); From 626c50219a7c376c666c3cd5a383b6bcffaf43d9 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 19 Feb 2020 10:02:57 +0100 Subject: [PATCH 225/301] requested change: removed unnecessary catch block --- .../core/qos/quartz/task/PingTask.java | 7 +-- .../core/qos/quartz/task/PingTaskTest.java | 62 ------------------- 2 files changed, 2 insertions(+), 67 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 7bc993e38..aa7bbb410 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -269,13 +269,10 @@ private ServiceRegistryListResponseDTO queryServiceRegistryAll() { } catch (final ArrowheadException ex) { + logger.debug("Exception: " + ex.getMessage()); throw ex; - } catch (final Throwable ex) { - - logger.debug("Exception:", ex.getMessage()); - return null; - } + } } diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index 51589b7cb..8a5bb9b34 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -356,68 +356,6 @@ public void testExecuteNoSystemsToMeasure() { verify(qoSDBService, times(0)).logMeasurementDetailsToDB(any(), any(), any()); } - - //------------------------------------------------------------------------------------------------- - @Test - public void testExecuteHttpServiceThrowsException() { - - final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); - - final List responseList = getResponseListForTest(); - - final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); - - final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); - - final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); - doNothing().when(logger).debug( debugValueCapture.capture()); - - when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); - when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); - when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); - - when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenThrow(NullPointerException.class); - - when(pingMeasurementProperties.getTimeout()).thenReturn(5000); - - when(pingService.getPingResponseList(anyString())).thenReturn(responseList); - - when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); - - //in handleMeasurement - when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); - doNothing().when(qoSDBService).createPingMeasurement(any(), any(), any()); - //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); - when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); - doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); - - try { - - pingTask.execute(jobExecutionContext); - - } catch (final JobExecutionException ex) { - - fail(); - } - - verify(logger, atLeastOnce()).debug(any(String.class)); - final List debugMessages = debugValueCapture.getAllValues(); - assertNotNull(debugMessages); - - verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); - verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); - verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); - verify(httpService, times(1)).sendRequest(any(), any(), any()); - verify(pingMeasurementProperties, times(0)).getTimeout(); - verify(pingService, times(0)).getPingResponseList(anyString()); - verify(qoSDBService,times(0)).getOrCreateMeasurement(any()); - - verify(qoSDBService, times(0)).getPingMeasurementByMeasurement(any()); - verify(qoSDBService, times(0)).createPingMeasurement(any(), any(), any()); - verify(qoSDBService, times(0)).logMeasurementToDB(any(), any(), any()); - verify(qoSDBService, times(0)).logMeasurementDetailsToDB(any(), any(), any()); - } - //------------------------------------------------------------------------------------------------- @Test(expected = ArrowheadException.class) public void testExecuteServiceRegistryUriNotInContext() { From bab02203de881dd73f500b18fbfcff3c345fe858 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 19 Feb 2020 10:05:31 +0100 Subject: [PATCH 226/301] requested change: remove unnecessary lines --- .../eu/arrowhead/core/qos/quartz/task/PingTask.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index aa7bbb410..3302862fb 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -295,18 +295,10 @@ private UriComponents getQueryAllUri() { private boolean calculateAvailable(final int sentInThisPing, final int availableCount) { logger.debug("calculateAvailable started..."); - final boolean available; final int availableFromSuccessPercent = pingMeasurementProperties.getAvailableFromSuccessPercet(); final double availablePercent = 100 - ((sentInThisPing - availableCount) / (double)sentInThisPing) * 100 ; - if (availableFromSuccessPercent <= Math.round(availablePercent)) { - - available = true; - }else { - available = false; - } - - return available; + return availableFromSuccessPercent <= Math.round(availablePercent); } } \ No newline at end of file From c8d58a5162a44d78847a5c610d1e07ceca5aa693 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 19 Feb 2020 10:07:22 +0100 Subject: [PATCH 227/301] requested change: typo --- .../META-INF/additional-spring-configuration-metadata.json | 4 ++-- qos-monitor/src/main/resources/application.properties | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 6182faeef..e992e1e73 100644 --- a/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -60,8 +60,8 @@ "description": "A description for 'ping_ttl_interval_minutes'" }, { - "name": "ping.available_from_success_percet", + "name": "ping.available_from_success_percent", "type": "java.lang.Integer", - "description": "A description for 'ping.available_from_success_percet'" + "description": "A description for 'ping.available_from_success_percent'" } ]} \ No newline at end of file diff --git a/qos-monitor/src/main/resources/application.properties b/qos-monitor/src/main/resources/application.properties index 277ccf577..6895fdc4f 100644 --- a/qos-monitor/src/main/resources/application.properties +++ b/qos-monitor/src/main/resources/application.properties @@ -65,7 +65,7 @@ ping.rest=1000 # Set succes percentage of individual pings to accept measurement as available # must be greater than 0 and not greater than 100 -ping.available_from_success_percet=1 +ping.available_from_success_percent=1 ############################################ ### SECURE MODE ### From de2586da714120e3f11c18a70bef8e9ddb74cb4a Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 19 Feb 2020 10:10:16 +0100 Subject: [PATCH 228/301] requested change: remove unnecessary space --- .../eu/arrowhead/core/qos/database/service/QoSDBService.java | 2 +- .../arrowhead/core/qos/database/service/QoSDBServiceTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index e043b5921..d1d96b32f 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -44,7 +44,7 @@ public class QoSDBService { // members private static final String LESS_THAN_ONE_ERROR_MESSAGE= " must be greater than zero."; - private static final String NOT_AVAILABLE_SORTABLE_FIELD_ERROR_MESSAGE = " sortable field is not available."; + private static final String NOT_AVAILABLE_SORTABLE_FIELD_ERROR_MESSAGE = " sortable field is not available."; private static final String NOT_IN_DB_ERROR_MESSAGE = " is not available in database"; private static final String EMPTY_OR_NULL_ERROR_MESSAGE = " is empty or null"; private static final String NULL_ERROR_MESSAGE = " is null"; diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index 5a29890b9..d421fc8d3 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -75,7 +75,7 @@ public class QoSDBServiceTest { private SystemRepository systemRepository; private static final String LESS_THAN_ONE_ERROR_MESSAGE= " must be greater than zero."; - private static final String NOT_AVAILABLE_SORTABLE_FIELD_ERROR_MESSAGE = " sortable field is not available."; + private static final String NOT_AVAILABLE_SORTABLE_FIELD_ERROR_MESSAGE = " sortable field is not available."; private static final String NOT_IN_DB_ERROR_MESSAGE = " is not available in database"; private static final String EMPTY_OR_NULL_ERROR_MESSAGE = " is empty or null"; private static final String NULL_ERROR_MESSAGE = " is null"; From ec18c4d858158bc50338b7a075a0c0ac7091050b Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 19 Feb 2020 15:26:06 +0100 Subject: [PATCH 229/301] corrected typo --- .../measurement/properties/PingMeasurementProperties.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java index 925e9af08..89b71ffd9 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java @@ -25,13 +25,13 @@ public class PingMeasurementProperties { public PingMeasurementProperties() {} //------------------------------------------------------------------------------------------------- - public PingMeasurementProperties(final int timeToRepeat, final int timeout, final int pocketSize, final int rest, final int availableFromSuccessPercet) { + public PingMeasurementProperties(final int timeToRepeat, final int timeout, final int pocketSize, final int rest, final int availableFromSuccessPercent) { this.timeToRepeat = timeToRepeat; this.timeout = timeout; this.packetSize = pocketSize; this.rest = rest; - this.availableFromSuccessPercent = availableFromSuccessPercet; + this.availableFromSuccessPercent = availableFromSuccessPercent; } //------------------------------------------------------------------------------------------------- @@ -39,14 +39,14 @@ public PingMeasurementProperties(final int timeToRepeat, final int timeout, fina public int getTimeout() { return timeout; } public int getPacketSize() { return packetSize; } public int getRest() { return rest; } - public int getAvailableFromSuccessPercet() { return availableFromSuccessPercent; } + public int getAvailableFromSuccessPercent() { return availableFromSuccessPercent; } //------------------------------------------------------------------------------------------------- public void setTimeToRepeat(final int timeToRepeat) { this.timeToRepeat = timeToRepeat; } public void setTimeout(final int timeout) { this.timeout = timeout; } public void setPacketSize(final int packetSize) { this.packetSize = packetSize; } public void setRest(final int rest) { this.rest = rest; } - public void setAvailableFromSuccessPercet(final int availableFromSuccessPercet) { this.availableFromSuccessPercent = availableFromSuccessPercet; } + public void setAvailableFromSuccessPercent(final int availableFromSuccessPercent) { this.availableFromSuccessPercent = availableFromSuccessPercent; } //------------------------------------------------------------------------------------------------- @PostConstruct From ebef407033e5ccad2b8d4225f2a213688c990fd2 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 19 Feb 2020 15:29:11 +0100 Subject: [PATCH 230/301] implemented handle mupltiply system measurements per address --- .../dto/PingMeasurementCalculationsDTO.java | 8 +- .../core/qos/quartz/task/PingTask.java | 75 ++++++++++++++++--- .../database/service/QoSDBServiceTest.java | 3 +- .../core/qos/quartz/task/PingTaskTest.java | 14 ++-- 4 files changed, 79 insertions(+), 21 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/dto/PingMeasurementCalculationsDTO.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/dto/PingMeasurementCalculationsDTO.java index 4f0e76e80..fb8fe090a 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/dto/PingMeasurementCalculationsDTO.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/dto/PingMeasurementCalculationsDTO.java @@ -1,6 +1,7 @@ package eu.arrowhead.core.qos.dto; import java.io.Serializable; +import java.time.ZonedDateTime; public class PingMeasurementCalculationsDTO implements Serializable{ @@ -19,6 +20,7 @@ public class PingMeasurementCalculationsDTO implements Serializable{ private Integer sentInThisPing; private Integer receivedInThisPing; private Integer lostPerMeasurementPercent; + private ZonedDateTime measuredAt; //================================================================================================= // methods @@ -29,7 +31,8 @@ public PingMeasurementCalculationsDTO() {} //------------------------------------------------------------------------------------------------- public PingMeasurementCalculationsDTO(final boolean available, final Integer maxResponseTime, final Integer minResponseTime, final Integer meanResponseTimeWithTimeout, final Integer meanResponseTimeWithoutTimeout, final Integer jitterWithTimeout, - final Integer jitterWithoutTimeout, final Integer sentInThisPing, final Integer receivedInThisPing, final Integer lostPerMeasurementPercent) { + final Integer jitterWithoutTimeout, final Integer sentInThisPing, final Integer receivedInThisPing, final Integer lostPerMeasurementPercent, + final ZonedDateTime measuredAt) { this.available = available; this.maxResponseTime = maxResponseTime; @@ -41,6 +44,7 @@ public PingMeasurementCalculationsDTO(final boolean available, final Integer max this.sentInThisPing = sentInThisPing; this.receivedInThisPing = receivedInThisPing; this.lostPerMeasurementPercent = lostPerMeasurementPercent; + this.measuredAt = measuredAt; } //------------------------------------------------------------------------------------------------- @@ -54,6 +58,7 @@ public PingMeasurementCalculationsDTO(final boolean available, final Integer max public Integer getSentInThisPing() { return sentInThisPing; } public Integer getReceivedInThisPing() { return receivedInThisPing; } public Integer getLostPerMeasurementPercent() { return lostPerMeasurementPercent; } + public ZonedDateTime getMeasuredAt() { return measuredAt; } //------------------------------------------------------------------------------------------------- public void setAvailable(final boolean available) { this.available = available; } @@ -66,5 +71,6 @@ public PingMeasurementCalculationsDTO(final boolean available, final Integer max public void setSentInThisPing(final Integer sentInThisPing) { this.sentInThisPing = sentInThisPing; } public void setReceivedInThisPing(final Integer receivedInThisPing) { this.receivedInThisPing = receivedInThisPing; } public void setLostPerMeasurementPercent(final Integer lostPerMeasurementPercent) { this.lostPerMeasurementPercent = lostPerMeasurementPercent; } + public void setMeasuredAt(final ZonedDateTime measuredAt) { this.measuredAt = measuredAt; } } \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 3302862fb..df5ee57f0 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -1,10 +1,10 @@ package eu.arrowhead.core.qos.quartz.task; import java.time.ZonedDateTime; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.Set; import java.util.stream.Collectors; import javax.annotation.Resource; @@ -84,15 +84,26 @@ public void execute(final JobExecutionContext context) throws JobExecutionExcept return; } - final Set systems = getSystemsToMeasure(); - if (systems == null) { + final List systems = getSystemsToMeasure(); + if (systems == null || systems.isEmpty()) { return; } + final HashMap pingCache = new HashMap(systems.size()); for (final SystemResponseDTO systemResponseDTO : systems) { - pingSystem(systemResponseDTO); + final String address = systemResponseDTO.getAddress(); + if (pingCache.containsKey(address)) { + + pingSystem(systemResponseDTO, pingCache.get(address)); + + }else { + + final PingMeasurementCalculationsDTO calculations = pingSystem(systemResponseDTO); + pingCache.put(address, calculations); + + } } @@ -103,7 +114,7 @@ public void execute(final JobExecutionContext context) throws JobExecutionExcept // assistant methods //------------------------------------------------------------------------------------------------- - private Set getSystemsToMeasure() { + private List getSystemsToMeasure() { logger.debug("getSystemToMeasure started..."); final ServiceRegistryListResponseDTO serviceRegistryListResponseDTO = queryServiceRegistryAll(); @@ -111,13 +122,13 @@ private Set getSystemsToMeasure() { return null; } - final Set systemList = serviceRegistryListResponseDTO.getData().stream().map(ServiceRegistryResponseDTO::getProvider).collect(Collectors.toSet()); + final List systemList = serviceRegistryListResponseDTO.getData().stream().map(ServiceRegistryResponseDTO::getProvider).collect(Collectors.toList()); return systemList; } //------------------------------------------------------------------------------------------------- - private PingMeasurementCalculationsDTO calculatePingMeasurementValues(final List responseList) { + private PingMeasurementCalculationsDTO calculatePingMeasurementValues(final List responseList, final ZonedDateTime aroundNow) { logger.debug("calculatePingMeasurementValues started..."); final int sentInThisPing = responseList.size(); @@ -194,12 +205,13 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(final List calculations.setSentInThisPing(sentInThisPing); calculations.setReceivedInThisPing(receivedInThisPing); calculations.setLostPerMeasurementPercent(lostPerMeasurementPercent); + calculations.setMeasuredAt(aroundNow); return calculations; } //------------------------------------------------------------------------------------------------- - private void pingSystem(final SystemResponseDTO systemResponseDTO ) { + private PingMeasurementCalculationsDTO pingSystem(final SystemResponseDTO systemResponseDTO ) { logger.debug("pingSystem started..."); final ZonedDateTime aroundNow = ZonedDateTime.now(); @@ -213,18 +225,37 @@ private void pingSystem(final SystemResponseDTO systemResponseDTO ) { final List responseList = pingService.getPingResponseList(address); final QoSIntraMeasurement measurement = qoSDBService.getOrCreateMeasurement(systemResponseDTO); - handlePingMeasurement(measurement, responseList, aroundNow); + final PingMeasurementCalculationsDTO calculationsDTO = handlePingMeasurement(measurement, responseList, aroundNow); qoSDBService.updateMeasurement(aroundNow, measurement); + return calculationsDTO; + } //------------------------------------------------------------------------------------------------- - private void handlePingMeasurement(final QoSIntraMeasurement measurement, + private void pingSystem(final SystemResponseDTO systemResponseDTO, final PingMeasurementCalculationsDTO calculationsDTO) { + logger.debug("pingSystem started..."); + + final ZonedDateTime aroundNow = calculationsDTO.getMeasuredAt(); + + if (systemResponseDTO == null || Utilities.isEmpty(systemResponseDTO.getAddress())) { + throw new InvalidParameterException("System.address" + NULL_OR_BLANK_PARAMETER_ERROR_MESSAGE); + } + + final QoSIntraMeasurement measurement = qoSDBService.getOrCreateMeasurement(systemResponseDTO); + handlePingMeasurement(measurement, aroundNow, calculationsDTO); + + qoSDBService.updateMeasurement(aroundNow, measurement); + + } + + //------------------------------------------------------------------------------------------------- + private PingMeasurementCalculationsDTO handlePingMeasurement(final QoSIntraMeasurement measurement, final List responseList, final ZonedDateTime aroundNow) { logger.debug("handelPingMeasurement started..."); - final PingMeasurementCalculationsDTO calculationsDTO = calculatePingMeasurementValues(responseList); + final PingMeasurementCalculationsDTO calculationsDTO = calculatePingMeasurementValues(responseList, aroundNow); final Optional pingMeasurementOptional = qoSDBService.getPingMeasurementByMeasurement(measurement); if (pingMeasurementOptional.isEmpty()) { @@ -255,6 +286,26 @@ private void handlePingMeasurement(final QoSIntraMeasurement measurement, } } } + + return calculationsDTO; + } + + //------------------------------------------------------------------------------------------------- + private void handlePingMeasurement(final QoSIntraMeasurement measurement, final ZonedDateTime aroundNow, final PingMeasurementCalculationsDTO calculationsDTO) { + logger.debug("handelPingMeasurement started..."); + + final Optional pingMeasurementOptional = qoSDBService.getPingMeasurementByMeasurement(measurement); + + if (pingMeasurementOptional.isEmpty()) { + + qoSDBService.createPingMeasurement(measurement, calculationsDTO, aroundNow); + + }else { + + qoSDBService.updatePingMeasurement(measurement, calculationsDTO, pingMeasurementOptional.get(), aroundNow); + + } + } //------------------------------------------------------------------------------------------------- @@ -295,7 +346,7 @@ private UriComponents getQueryAllUri() { private boolean calculateAvailable(final int sentInThisPing, final int availableCount) { logger.debug("calculateAvailable started..."); - final int availableFromSuccessPercent = pingMeasurementProperties.getAvailableFromSuccessPercet(); + final int availableFromSuccessPercent = pingMeasurementProperties.getAvailableFromSuccessPercent(); final double availablePercent = 100 - ((sentInThisPing - availableCount) / (double)sentInThisPing) * 100 ; return availableFromSuccessPercent <= Math.round(availablePercent); diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index d421fc8d3..4facdd22a 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -1704,7 +1704,8 @@ private PingMeasurementCalculationsDTO getCalculationsForTest() { 1,//jitterWithoutTimeout, 35,//sentInThisPing, 35,//receivedInThisPing, - 0);//lostPerMeasurementPercent); + 0, + ZonedDateTime.now());//lostPerMeasurementPercent); return calculatiions; } diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index 8a5bb9b34..30fe34f5e 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -865,7 +865,7 @@ public void testExecuteCalculationsDTOIsPresent() { when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); when(pingMeasurementProperties.getTimeout()).thenReturn(5000); - when(pingMeasurementProperties.getAvailableFromSuccessPercet()).thenReturn(1); + when(pingMeasurementProperties.getAvailableFromSuccessPercent()).thenReturn(1); when(pingService.getPingResponseList(anyString())).thenReturn(responseList); @@ -934,7 +934,7 @@ public void testExecuteAvailableCalculation() { when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); when(pingMeasurementProperties.getTimeout()).thenReturn(5000); - when(pingMeasurementProperties.getAvailableFromSuccessPercet()).thenReturn(32); + when(pingMeasurementProperties.getAvailableFromSuccessPercent()).thenReturn(32); when(pingService.getPingResponseList(anyString())).thenReturn(responseList); @@ -1004,7 +1004,7 @@ public void testExecuteAvailableCalculationWith100PercentNotOK() { when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); when(pingMeasurementProperties.getTimeout()).thenReturn(5000); - when(pingMeasurementProperties.getAvailableFromSuccessPercet()).thenReturn(100); + when(pingMeasurementProperties.getAvailableFromSuccessPercent()).thenReturn(100); when(pingService.getPingResponseList(anyString())).thenReturn(responseList); @@ -1074,7 +1074,7 @@ public void testExecuteAvailableCalculationWith100PercentOK() { when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); when(pingMeasurementProperties.getTimeout()).thenReturn(5000); - when(pingMeasurementProperties.getAvailableFromSuccessPercet()).thenReturn(100); + when(pingMeasurementProperties.getAvailableFromSuccessPercent()).thenReturn(100); when(pingService.getPingResponseList(anyString())).thenReturn(responseList); @@ -1144,7 +1144,7 @@ public void testExecuteAvailableCalculationWith1PercentOK() { when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); when(pingMeasurementProperties.getTimeout()).thenReturn(5000); - when(pingMeasurementProperties.getAvailableFromSuccessPercet()).thenReturn(1); + when(pingMeasurementProperties.getAvailableFromSuccessPercent()).thenReturn(1); when(pingService.getPingResponseList(anyString())).thenReturn(responseList); @@ -1214,7 +1214,7 @@ public void testExecuteAvailableCalculationWith1PercentNotOK() { when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); when(pingMeasurementProperties.getTimeout()).thenReturn(5000); - when(pingMeasurementProperties.getAvailableFromSuccessPercet()).thenReturn(1); + when(pingMeasurementProperties.getAvailableFromSuccessPercent()).thenReturn(1); when(pingService.getPingResponseList(anyString())).thenReturn(responseList); @@ -1284,7 +1284,7 @@ public void testExecuteAvailableCalculationWithNotAvailable() { when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); when(pingMeasurementProperties.getTimeout()).thenReturn(5000); - when(pingMeasurementProperties.getAvailableFromSuccessPercet()).thenReturn(34); + when(pingMeasurementProperties.getAvailableFromSuccessPercent()).thenReturn(34); when(pingService.getPingResponseList(anyString())).thenReturn(responseList); From 3e99f293bd1576b5ac0dfa8a022c460e10f76f0a Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 19 Feb 2020 15:31:10 +0100 Subject: [PATCH 231/301] typo --- qos-monitor/src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qos-monitor/src/main/resources/application.properties b/qos-monitor/src/main/resources/application.properties index 6895fdc4f..d441adaeb 100644 --- a/qos-monitor/src/main/resources/application.properties +++ b/qos-monitor/src/main/resources/application.properties @@ -55,7 +55,7 @@ ping.time_to_repeat=35 # must be greater than or equal 0 and not greater than 10 000 ping.timeout=5000 -# Set pocket size of ping +# Set packet size of ping # must be 32 or 56 or 64 ping.packet_size=32 From e9e50403a0f1655b99e0cafe4932317da2cba370 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 19 Feb 2020 15:51:42 +0100 Subject: [PATCH 232/301] renamed method --- .../java/eu/arrowhead/core/qos/quartz/task/PingTask.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index df5ee57f0..663b49fb3 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -96,7 +96,7 @@ public void execute(final JobExecutionContext context) throws JobExecutionExcept final String address = systemResponseDTO.getAddress(); if (pingCache.containsKey(address)) { - pingSystem(systemResponseDTO, pingCache.get(address)); + copyCalculationsToPingMeasurement(systemResponseDTO, pingCache.get(address)); }else { @@ -234,8 +234,8 @@ private PingMeasurementCalculationsDTO pingSystem(final SystemResponseDTO system } //------------------------------------------------------------------------------------------------- - private void pingSystem(final SystemResponseDTO systemResponseDTO, final PingMeasurementCalculationsDTO calculationsDTO) { - logger.debug("pingSystem started..."); + private void copyCalculationsToPingMeasurement(final SystemResponseDTO systemResponseDTO, final PingMeasurementCalculationsDTO calculationsDTO) { + logger.debug("copyCalculationsToPingMeasurement started..."); final ZonedDateTime aroundNow = calculationsDTO.getMeasuredAt(); From eb1382d6cc32943443351c89bc07ffaa4b6358ac Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Wed, 19 Feb 2020 16:15:36 +0100 Subject: [PATCH 233/301] updated tests --- .../core/qos/quartz/task/PingTaskTest.java | 149 ++++++++++++++++++ 1 file changed, 149 insertions(+) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index 30fe34f5e..bf530b358 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -5,6 +5,7 @@ import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.atLeast; import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doThrow; @@ -230,6 +231,134 @@ public void testExecuteMeasurementIsNotInDB() { verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); } + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteWhenMultiplySystemHasSameAddressPingOnlyCalledOnce() { + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOForTest(); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), any(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(1)).getTimeout(); + verify(pingService, times(1)).getPingResponseList(anyString()); + verify(qoSDBService, atLeastOnce()).getOrCreateMeasurement(any()); + + verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); + } + + //------------------------------------------------------------------------------------------------- + @Test + public void testExecuteWhenMultiplySystemHasDifferentAddressPingCalledMultiplyTimes() { + + final int NUMBER_OF_PROVIDERS = 10; + + final UriComponents uri = Utilities.createURI("HTTPS", "localhost", 12345, "serviceregistry"); + + final ServiceRegistryListResponseDTO serviceRegistryResponse = getServiceRegistryListResponseDTOWithDifferentProviderAddressForTest(10); + final ResponseEntity httpResponse = new ResponseEntity(serviceRegistryResponse, HttpStatus.OK); + + final List responseList = getResponseListForTest(); + + final QoSIntraMeasurement measurement = getQoSIntraMeasurementForTest(); + + final QoSIntraPingMeasurementLog measurementLog = getOrCreateMeasurementLogForTest(); + + final ArgumentCaptor debugValueCapture = ArgumentCaptor.forClass(String.class); + doNothing().when(logger).debug( debugValueCapture.capture()); + + when(arrowheadContext.containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE)).thenReturn(false); + when(arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(true); + when(arrowheadContext.get(CoreCommonConstants.SR_QUERY_ALL)).thenReturn(uri); + + when(httpService.sendRequest(uri, HttpMethod.GET, ServiceRegistryListResponseDTO.class)).thenReturn(httpResponse); + + when(pingMeasurementProperties.getTimeout()).thenReturn(5000); + + when(pingService.getPingResponseList(anyString())).thenReturn(responseList); + + when(qoSDBService.getOrCreateMeasurement(any(SystemResponseDTO.class))).thenReturn(measurement); + + //in handleMeasurement + when(qoSDBService.getPingMeasurementByMeasurement(any(QoSIntraMeasurement.class))).thenReturn(Optional.ofNullable(null)); + doNothing().when(qoSDBService).createPingMeasurement(any(), any(), any()); + //doNothing().when(qoSDBService).updatePingMeasurement(any(), any(), any(), any()); + when(qoSDBService.logMeasurementToDB(any(), any(), any())).thenReturn(measurementLog); + doNothing().when(qoSDBService).logMeasurementDetailsToDB(any(), any(), any()); + + try { + + pingTask.execute(jobExecutionContext); + + } catch (final JobExecutionException ex) { + fail(); + } + + verify(logger, atLeastOnce()).debug(any(String.class)); + final List debugMessages = debugValueCapture.getAllValues(); + assertNotNull(debugMessages); + + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SERVER_STANDALONE_MODE); + verify(arrowheadContext, times(1)).containsKey(CoreCommonConstants.SR_QUERY_ALL); + verify(arrowheadContext, times(1)).get(CoreCommonConstants.SR_QUERY_ALL); + verify(httpService, times(1)).sendRequest(any(), any(), any()); + verify(pingMeasurementProperties, times(NUMBER_OF_PROVIDERS)).getTimeout(); + verify(pingService, times(NUMBER_OF_PROVIDERS)).getPingResponseList(anyString()); + verify(qoSDBService, atLeastOnce()).getOrCreateMeasurement(any()); + + verify(qoSDBService, atLeastOnce()).getPingMeasurementByMeasurement(any()); + verify(qoSDBService, atLeastOnce()).createPingMeasurement(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementToDB(any(), any(), any()); + verify(qoSDBService, atLeastOnce()).logMeasurementDetailsToDB(any(), any(), any()); + } + //------------------------------------------------------------------------------------------------- @Test public void testExecuteServerIsInStandalonMode() { @@ -1896,6 +2025,26 @@ public ServiceRegistryListResponseDTO getServiceRegistryListResponseDTOForTest() return serviceRegistryListResponseDTO; } + //------------------------------------------------------------------------------------------------- + public ServiceRegistryListResponseDTO getServiceRegistryListResponseDTOWithDifferentProviderAddressForTest(final int numberOfProviders) { + + final int sizeOfResponse = numberOfProviders; + final ServiceRegistryListResponseDTO serviceRegistryListResponseDTO = new ServiceRegistryListResponseDTO(); + final List responseList = new ArrayList<>(sizeOfResponse); + + for (int i = 0; i < sizeOfResponse; i++) { + final ServiceRegistryResponseDTO response = getServiceRegistryResponseDTOForTest(); + response.getProvider().setAddress("address" + i); + + responseList.add(response); + } + + serviceRegistryListResponseDTO.setCount(sizeOfResponse); + serviceRegistryListResponseDTO.setData(responseList); + + return serviceRegistryListResponseDTO; + } + //------------------------------------------------------------------------------------------------- public ServiceRegistryListResponseDTO getServiceRegistryListResponseDTOWithNullSystemAddressForTest() { From 0eb9b5e33034db444bc240bfeec0fc20d8c45dfa Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 20 Feb 2020 09:52:59 +0100 Subject: [PATCH 234/301] requested change: only diamond --- .../main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 663b49fb3..7247c4594 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -90,7 +90,7 @@ public void execute(final JobExecutionContext context) throws JobExecutionExcept return; } - final HashMap pingCache = new HashMap(systems.size()); + final HashMap pingCache = new HashMap<>(systems.size()); for (final SystemResponseDTO systemResponseDTO : systems) { final String address = systemResponseDTO.getAddress(); From 8ca7cfbd939e77218a83c94b663a4319fa67f1be Mon Sep 17 00:00:00 2001 From: rbocsi Date: Thu, 20 Feb 2020 10:23:24 +0100 Subject: [PATCH 235/301] handle warnings set log measurement details to false --- .../java/eu/arrowhead/core/qos/QoSMonitorController.java | 3 +-- .../arrowhead/core/qos/database/service/QoSDBService.java | 1 + .../core/qos/quartz/task/CountRestarterTaskConfig.java | 2 -- .../java/eu/arrowhead/core/qos/quartz/task/PingTask.java | 2 +- .../core/qos/database/service/QoSDBServiceTest.java | 6 +----- .../eu/arrowhead/core/qos/quartz/task/PingTaskTest.java | 1 - 6 files changed, 4 insertions(+), 11 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java index 65b6113de..1df663946 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java @@ -4,7 +4,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.CrossOrigin; @@ -21,8 +20,8 @@ import eu.arrowhead.common.CoreUtilities; import eu.arrowhead.common.CoreUtilities.ValidatedPageParams; import eu.arrowhead.common.Defaults; -import eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO; import eu.arrowhead.common.dto.internal.PingMeasurementListResponseDTO; +import eu.arrowhead.common.dto.internal.PingMeasurementResponseDTO; import eu.arrowhead.common.exception.BadPayloadException; import eu.arrowhead.core.qos.database.service.QoSDBService; import io.swagger.annotations.Api; diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index d1d96b32f..3617709a3 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -65,6 +65,7 @@ public class QoSDBService { private SystemRepository systemRepository; protected Logger logger = LogManager.getLogger(QoSDBService.class); + //================================================================================================= // methods diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java index 3f926d081..c650c1fdd 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/CountRestarterTaskConfig.java @@ -3,7 +3,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -11,7 +10,6 @@ import org.springframework.scheduling.quartz.JobDetailFactoryBean; import org.springframework.scheduling.quartz.SchedulerFactoryBean; -import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.quartz.AutoWiringSpringBeanQuartzTaskFactory; @Configuration diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index 7247c4594..ac89db43c 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -51,7 +51,7 @@ public class PingTask implements Job { private static final int INVALID_CALCULATION_VALUE = -1; private static final boolean LOG_MEASUREMENT = true; - private static final boolean LOG_MEASUREMENT_DETAILS = true; + private static final boolean LOG_MEASUREMENT_DETAILS = false; protected Logger logger = LogManager.getLogger(PingTask.class); diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java index 4facdd22a..c16ed51cf 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/database/service/QoSDBServiceTest.java @@ -196,7 +196,6 @@ public void testUpdateCountStartedAtSaveAllThrowDatabaseException() { } //------------------------------------------------------------------------------------------------- - @SuppressWarnings({ "unchecked", "rawtypes" }) @Test(expected = ArrowheadException.class) public void testUpdateCountStartedAtFindAllThrowDatabaseException() { @@ -836,7 +835,6 @@ public void testLogMeasurementDetailsToDB() { } //------------------------------------------------------------------------------------------------- - @SuppressWarnings({ "unchecked", "rawtypes" }) @Test(expected = InvalidParameterException.class) public void testLogMeasurementDetailsToDBWithNullResponseListParameter() { @@ -865,7 +863,6 @@ public void testLogMeasurementDetailsToDBWithNullResponseListParameter() { } //------------------------------------------------------------------------------------------------- - @SuppressWarnings({ "unchecked", "rawtypes" }) @Test(expected = InvalidParameterException.class) public void testLogMeasurementDetailsToDBWithEmptyResponseListParameter() { @@ -894,7 +891,6 @@ public void testLogMeasurementDetailsToDBWithEmptyResponseListParameter() { } //------------------------------------------------------------------------------------------------- - @SuppressWarnings({ "unchecked", "rawtypes" }) @Test(expected = InvalidParameterException.class) public void testLogMeasurementDetailsToDBWithNullMeasurementLogSavedParameter() { @@ -923,7 +919,6 @@ public void testLogMeasurementDetailsToDBWithNullMeasurementLogSavedParameter() } //------------------------------------------------------------------------------------------------- - @SuppressWarnings({ "unchecked", "rawtypes" }) @Test(expected = InvalidParameterException.class) public void testLogMeasurementDetailsToDBWithNullAroundNowParameter() { @@ -1711,6 +1706,7 @@ private PingMeasurementCalculationsDTO getCalculationsForTest() { } //------------------------------------------------------------------------------------------------- + @SuppressWarnings("unused") private PageImpl getPageOfMeasurementForTest() { final List meausrementList = List.of(getQoSIntraMeasurementForTest()); diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index bf530b358..defac1c44 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -5,7 +5,6 @@ import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.atLeast; import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doThrow; From 6e29b1bd4f3307b0443fe34e4cacd27d631c7abd Mon Sep 17 00:00:00 2001 From: rbocsi Date: Thu, 20 Feb 2020 10:27:40 +0100 Subject: [PATCH 236/301] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 66e512cc6..80fb702fa 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Please be aware, that 4.1.3 is __NOT__ backwards compatible with 4.1.2. If you h * [Client](#gateway_endpoints_client) * [Private](#gateway_endpoints_private) * [Management](#gateway_endpoints_mgmt) - 6. [QoS Monitor](#qos_monitor) + 6. [QoS Monitor (Quality of Service Monitor)](#qos_monitor) * [System Design Description Overview](#qos_monitor_sdd) * [Services and Use Cases](#qos_monitor_usecases) * [Endpoints](#qos_monitor_endpoints) @@ -6244,13 +6244,13 @@ __ActiveSession__ is the output. -# QOS MONITOR +# QOS MONITOR (QUALITY OF SERVICE MONITOR) ## System Design Description Overview -The purpose of QoS Monitor supporting core system is providing qos measurements to the QoS Manager. +The purpose of QoS Monitor supporting core system is providing QoS (Quality of Service) measurements to the QoS Manager (which is part of the Orchestrator core system). ![#1589F0](https://placehold.it/15/1589F0/000000?text=+) `AH Service Registry` ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) `AH Authorization` @@ -6522,4 +6522,4 @@ __Ping Measurment response by system id__ the output : ### Get ping measurements by system id -For private endpoints no detailed description available. \ No newline at end of file +For private endpoints no detailed description available. From 592bd57705d34c06f4cf4b8574b58c390c274574 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Thu, 20 Feb 2020 10:35:55 +0100 Subject: [PATCH 237/301] some format changes --- .../eu/arrowhead/core/qos/quartz/task/PingTask.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index ac89db43c..18ed1cc46 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -262,25 +262,25 @@ private PingMeasurementCalculationsDTO handlePingMeasurement(final QoSIntraMeasu qoSDBService.createPingMeasurement(measurement, calculationsDTO, aroundNow); - if(LOG_MEASUREMENT) { + if (LOG_MEASUREMENT) { final QoSIntraPingMeasurementLog measurementLogSaved = qoSDBService.logMeasurementToDB(measurement.getSystem().getAddress(), calculationsDTO, aroundNow); - if(LOG_MEASUREMENT_DETAILS && measurementLogSaved != null) { + if (LOG_MEASUREMENT_DETAILS && measurementLogSaved != null) { qoSDBService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); } } - }else { + } else { qoSDBService.updatePingMeasurement(measurement, calculationsDTO, pingMeasurementOptional.get(), aroundNow); - if(LOG_MEASUREMENT) { + if (LOG_MEASUREMENT) { final QoSIntraPingMeasurementLog measurementLogSaved = qoSDBService.logMeasurementToDB(measurement.getSystem().getAddress(), calculationsDTO, aroundNow); - if(LOG_MEASUREMENT_DETAILS && measurementLogSaved != null) { + if (LOG_MEASUREMENT_DETAILS && measurementLogSaved != null) { qoSDBService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); } From a7da3a9a2d41f2bcfac658ff401792ffc4a06a80 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 20 Feb 2020 10:59:24 +0100 Subject: [PATCH 238/301] added log conditionals to ping properties --- .../properties/PingMeasurementProperties.java | 13 +++++++++++-- .../eu/arrowhead/core/qos/quartz/task/PingTask.java | 11 ++++------- .../additional-spring-configuration-metadata.json | 10 ++++++++++ .../src/main/resources/application.properties | 6 ++++++ 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java index 89b71ffd9..780189bde 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java @@ -18,6 +18,8 @@ public class PingMeasurementProperties { private int packetSize; private int rest; private int availableFromSuccessPercent; + private boolean logMeasurementsToDB; + private boolean logMeasurementsDetailsToDB; //================================================================================================= // methods @@ -25,13 +27,17 @@ public class PingMeasurementProperties { public PingMeasurementProperties() {} //------------------------------------------------------------------------------------------------- - public PingMeasurementProperties(final int timeToRepeat, final int timeout, final int pocketSize, final int rest, final int availableFromSuccessPercent) { + public PingMeasurementProperties(final int timeToRepeat, final int timeout, final int pocketSize, + final int rest, final int availableFromSuccessPercent, final boolean logMeasurementsToDB, + final boolean logMeasurementsDetailsToDB) { this.timeToRepeat = timeToRepeat; this.timeout = timeout; this.packetSize = pocketSize; this.rest = rest; this.availableFromSuccessPercent = availableFromSuccessPercent; + this.logMeasurementsToDB = logMeasurementsToDB; + this.logMeasurementsDetailsToDB = logMeasurementsDetailsToDB; } //------------------------------------------------------------------------------------------------- @@ -40,13 +46,16 @@ public PingMeasurementProperties(final int timeToRepeat, final int timeout, fina public int getPacketSize() { return packetSize; } public int getRest() { return rest; } public int getAvailableFromSuccessPercent() { return availableFromSuccessPercent; } - + public boolean getLogMeasurementsToDB() { return logMeasurementsToDB; } + public boolean getLogMeasurementsDetailsToDB() {return logMeasurementsDetailsToDB; } //------------------------------------------------------------------------------------------------- public void setTimeToRepeat(final int timeToRepeat) { this.timeToRepeat = timeToRepeat; } public void setTimeout(final int timeout) { this.timeout = timeout; } public void setPacketSize(final int packetSize) { this.packetSize = packetSize; } public void setRest(final int rest) { this.rest = rest; } public void setAvailableFromSuccessPercent(final int availableFromSuccessPercent) { this.availableFromSuccessPercent = availableFromSuccessPercent; } + public void setLogMeasurementsToDB(final boolean logMeasurementsToDB) { this.logMeasurementsToDB = logMeasurementsToDB; } + public void setLogMeasurementsDetailsToDB(final boolean logMeasurementsDetailsToDB) { this.logMeasurementsDetailsToDB = logMeasurementsDetailsToDB; } //------------------------------------------------------------------------------------------------- @PostConstruct diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index ac89db43c..424791c22 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -50,9 +50,6 @@ public class PingTask implements Job { private static final int INVALID_CALCULATION_VALUE = -1; - private static final boolean LOG_MEASUREMENT = true; - private static final boolean LOG_MEASUREMENT_DETAILS = false; - protected Logger logger = LogManager.getLogger(PingTask.class); @Autowired @@ -262,11 +259,11 @@ private PingMeasurementCalculationsDTO handlePingMeasurement(final QoSIntraMeasu qoSDBService.createPingMeasurement(measurement, calculationsDTO, aroundNow); - if(LOG_MEASUREMENT) { + if(pingMeasurementProperties.getLogMeasurementsToDB()) { final QoSIntraPingMeasurementLog measurementLogSaved = qoSDBService.logMeasurementToDB(measurement.getSystem().getAddress(), calculationsDTO, aroundNow); - if(LOG_MEASUREMENT_DETAILS && measurementLogSaved != null) { + if(pingMeasurementProperties.getLogMeasurementsDetailsToDB() && measurementLogSaved != null) { qoSDBService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); } @@ -276,11 +273,11 @@ private PingMeasurementCalculationsDTO handlePingMeasurement(final QoSIntraMeasu qoSDBService.updatePingMeasurement(measurement, calculationsDTO, pingMeasurementOptional.get(), aroundNow); - if(LOG_MEASUREMENT) { + if(pingMeasurementProperties.getLogMeasurementsToDB()) { final QoSIntraPingMeasurementLog measurementLogSaved = qoSDBService.logMeasurementToDB(measurement.getSystem().getAddress(), calculationsDTO, aroundNow); - if(LOG_MEASUREMENT_DETAILS && measurementLogSaved != null) { + if(pingMeasurementProperties.getLogMeasurementsDetailsToDB() && measurementLogSaved != null) { qoSDBService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); } diff --git a/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json index e992e1e73..2ff6b2339 100644 --- a/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/qos-monitor/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -63,5 +63,15 @@ "name": "ping.available_from_success_percent", "type": "java.lang.Integer", "description": "A description for 'ping.available_from_success_percent'" + }, + { + "name": "ping.logMeasurementsToDB", + "type": "java.lang.Boolean", + "description": "A description for 'ping.logMeasurementsToDB'" + }, + { + "name": "ping.logMeasurementsDetailsToDB", + "type": "java.lang.Boolean", + "description": "A description for 'ping.logMeasurementsDetailsToDB'" } ]} \ No newline at end of file diff --git a/qos-monitor/src/main/resources/application.properties b/qos-monitor/src/main/resources/application.properties index d441adaeb..75a0539ca 100644 --- a/qos-monitor/src/main/resources/application.properties +++ b/qos-monitor/src/main/resources/application.properties @@ -67,6 +67,12 @@ ping.rest=1000 # must be greater than 0 and not greater than 100 ping.available_from_success_percent=1 +# Set to persist individual measurement to DB +ping.logMeasurementsToDB=true + +# Set to persist individual measurement details to DB +ping.logMeasurementsDetailsToDB=false + ############################################ ### SECURE MODE ### ############################################ From f55e48e6ba12b03fbdc788531b1ff60a94f4dbbc Mon Sep 17 00:00:00 2001 From: rbocsi Date: Thu, 20 Feb 2020 11:50:16 +0100 Subject: [PATCH 239/301] typo fixes --- .../eu/arrowhead/core/qos/QoSMonitorController.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java index 1df663946..1b754b16c 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java @@ -50,13 +50,13 @@ public class QoSMonitorController { private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_MGMT_HTTP_200_MESSAGE = "Ping-Measurement entries returned"; private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_MGMT_HTTP_400_MESSAGE = "Could not retrieve Ping-Measurement entries"; - private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_DESCRIPTION = "Return requested Ping-Measurements entries by system id."; - private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_HTTP_200_MESSAGE = "Ping-Measurement entrie returned"; - private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_HTTP_400_MESSAGE = "Could not retrieve Ping-Measurement entrie"; + private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_DESCRIPTION = "Return requested Ping-Measurement entry by system id."; + private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_HTTP_200_MESSAGE = "Ping-Measurement entry returned"; + private static final String GET_QOS_MONITOR_PING_MEASUREMENTS_BY_SYSTEM_ID_MGMT_HTTP_400_MESSAGE = "Could not retrieve Ping-Measurement entry"; - private static final String OP_GET_QOS_MONITOR_PING_MEASUREMENT_BY_SYSTEM_ID_DESCRIPTION = "Return requested Ping-Measurements entries by system id."; - private static final String OP_GET_QOS_MONITOR_PING_MEASUREMENT_BY_SYSTEM_ID_HTTP_200_MESSAGE = "Ping-Measurement entrie returned"; - private static final String OP_GET_QOS_MONITOR_PING_MEASUREMENT_BY_SYSTEM_ID_HTTP_400_MESSAGE = "Could not retrieve Ping-Measurement entrie"; + private static final String OP_GET_QOS_MONITOR_PING_MEASUREMENT_BY_SYSTEM_ID_DESCRIPTION = "Return requested Ping-Measurement entry by system id."; + private static final String OP_GET_QOS_MONITOR_PING_MEASUREMENT_BY_SYSTEM_ID_HTTP_200_MESSAGE = "Ping-Measurement entry returned"; + private static final String OP_GET_QOS_MONITOR_PING_MEASUREMENT_BY_SYSTEM_ID_HTTP_400_MESSAGE = "Could not retrieve Ping-Measurement entry"; private static final String ID_NOT_VALID_ERROR_MESSAGE = " Id must be greater than 0. "; From 14beba5d877a0767d7cee193b0fe32aaddc89e4e Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Thu, 20 Feb 2020 11:50:54 +0100 Subject: [PATCH 240/301] updated tests --- .../java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java index defac1c44..87caf0fe9 100644 --- a/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java +++ b/qos-monitor/src/test/java/eu/arrowhead/core/qos/quartz/task/PingTaskTest.java @@ -98,6 +98,9 @@ public class PingTaskTest { public void setUp() throws Exception { logger = mock(Logger.class); ReflectionTestUtils.setField(pingTask, "logger", logger); + + when(pingMeasurementProperties.getLogMeasurementsToDB()).thenReturn(true); + when(pingMeasurementProperties.getLogMeasurementsDetailsToDB()).thenReturn(true); } //================================================================================================= From 3180b0e58988eca11ca750abee51e37466d5c87f Mon Sep 17 00:00:00 2001 From: rbocsi Date: Thu, 20 Feb 2020 12:41:29 +0100 Subject: [PATCH 241/301] format fixing --- .../properties/PingMeasurementProperties.java | 5 +++-- .../eu/arrowhead/core/qos/service/PingService.java | 13 ++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java index 780189bde..09e3a28c6 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/measurement/properties/PingMeasurementProperties.java @@ -20,6 +20,7 @@ public class PingMeasurementProperties { private int availableFromSuccessPercent; private boolean logMeasurementsToDB; private boolean logMeasurementsDetailsToDB; + //================================================================================================= // methods @@ -48,6 +49,7 @@ public PingMeasurementProperties(final int timeToRepeat, final int timeout, fina public int getAvailableFromSuccessPercent() { return availableFromSuccessPercent; } public boolean getLogMeasurementsToDB() { return logMeasurementsToDB; } public boolean getLogMeasurementsDetailsToDB() {return logMeasurementsDetailsToDB; } + //------------------------------------------------------------------------------------------------- public void setTimeToRepeat(final int timeToRepeat) { this.timeToRepeat = timeToRepeat; } public void setTimeout(final int timeout) { this.timeout = timeout; } @@ -66,6 +68,5 @@ private void validateFields() { Assert.isTrue((packetSize == 32 || packetSize == 56 || packetSize == 64), "packetSize has to be 32 or 56 or 64"); Assert.isTrue(rest >= 0 && rest <= 10000, "rest must be greater than 0 and not greater than 10 000"); Assert.isTrue(availableFromSuccessPercent > 0 && availableFromSuccessPercent <= 100, "availableFromSuccessPercent must be greater than 0 and not greater than 100"); - } -} +} \ No newline at end of file diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/service/PingService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/service/PingService.java index 8ef4fadde..d8e746465 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/service/PingService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/service/PingService.java @@ -41,8 +41,8 @@ public List getPingResponseList(final String address) { final List responseList = new ArrayList<>(pingMeasurementProperties.getTimeToRepeat()); try { - final IcmpPingRequest request = IcmpPingUtil.createIcmpPingRequest (); - request.setHost (address); + final IcmpPingRequest request = IcmpPingUtil.createIcmpPingRequest(); + request.setHost(address); request.setTimeout(pingMeasurementProperties.getTimeout()); request.setPacketSize(pingMeasurementProperties.getPacketSize()); @@ -50,7 +50,7 @@ public List getPingResponseList(final String address) { IcmpPingResponse response; try { response = IcmpPingUtil.executePingRequest (request); - final String formattedResponse = IcmpPingUtil.formatResponse (response); + final String formattedResponse = IcmpPingUtil.formatResponse(response); logger.debug(formattedResponse); responseList.add(response); @@ -63,13 +63,12 @@ public List getPingResponseList(final String address) { responseList.add(response); } - Thread.sleep (pingMeasurementProperties.getRest()); + Thread.sleep(pingMeasurementProperties.getRest()); } - } catch ( final InterruptedException | IllegalArgumentException ex) { + } catch (final InterruptedException | IllegalArgumentException ex) { logger.debug("" + ex.getMessage()); } return responseList; } - -} +} \ No newline at end of file From e5c782ae61ecad399008772cbfb4f3a4fed09b0c Mon Sep 17 00:00:00 2001 From: rbocsi Date: Thu, 20 Feb 2020 15:00:13 +0100 Subject: [PATCH 242/301] format eliminate duplicated variable --- .../core/qos/quartz/task/PingTask.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java index b90a8c0a4..6712d2cff 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/quartz/task/PingTask.java @@ -139,14 +139,12 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(final List double sumOfDurationForMeanResponseTimeWithTimeout = 0; double sumOfDurationForMeanResponseTimeWithoutTimeout = 0; int meanResponseTimeWithoutTimeoutMembersCount = 0; - int availableCount = 0; for (final IcmpPingResponse icmpPingResponse : responseList) { final boolean successFlag = icmpPingResponse.getSuccessFlag(); if (successFlag) { - ++availableCount; ++receivedInThisPing; final long duration = icmpPingResponse.getDuration(); @@ -162,19 +160,19 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(final List sumOfDurationForMeanResponseTimeWithTimeout += duration; ++meanResponseTimeWithoutTimeoutMembersCount; - }else { + } else { sumOfDurationForMeanResponseTimeWithTimeout += timeout; } } - final boolean available = calculateAvailable(sentInThisPing, availableCount); + final boolean available = calculateAvailable(sentInThisPing, receivedInThisPing); final int lostPerMeasurementPercent = (int) (receivedInThisPing == 0 ? 100 : 100 - ((double)receivedInThisPing / sentInThisPing) * 100); final double meanResponseTimeWithTimeout = responseList.size() < 1 ? INVALID_CALCULATION_VALUE : sumOfDurationForMeanResponseTimeWithTimeout / responseList.size(); final double meanResponseTimeWithoutTimeout = meanResponseTimeWithoutTimeoutMembersCount < 1 ? INVALID_CALCULATION_VALUE : sumOfDurationForMeanResponseTimeWithoutTimeout / meanResponseTimeWithoutTimeoutMembersCount; double sumOfDiffsForJitterWithTimeout = 0; - double sumOfDiffsForJitterWithoutTimeout =0; + double sumOfDiffsForJitterWithoutTimeout = 0; for (final IcmpPingResponse icmpPingResponse : responseList) { final boolean successFlag = icmpPingResponse.getSuccessFlag(); @@ -182,7 +180,7 @@ private PingMeasurementCalculationsDTO calculatePingMeasurementValues(final List if (successFlag) { duration = icmpPingResponse.getDuration(); sumOfDiffsForJitterWithoutTimeout += Math.pow( (duration - meanResponseTimeWithoutTimeout), 2); - }else { + } else { duration = timeout; } @@ -259,11 +257,11 @@ private PingMeasurementCalculationsDTO handlePingMeasurement(final QoSIntraMeasu qoSDBService.createPingMeasurement(measurement, calculationsDTO, aroundNow); - if(pingMeasurementProperties.getLogMeasurementsToDB()) { + if (pingMeasurementProperties.getLogMeasurementsToDB()) { final QoSIntraPingMeasurementLog measurementLogSaved = qoSDBService.logMeasurementToDB(measurement.getSystem().getAddress(), calculationsDTO, aroundNow); - if(pingMeasurementProperties.getLogMeasurementsDetailsToDB() && measurementLogSaved != null) { + if (pingMeasurementProperties.getLogMeasurementsDetailsToDB() && measurementLogSaved != null) { qoSDBService.logMeasurementDetailsToDB(measurementLogSaved, responseList, aroundNow); } @@ -297,7 +295,7 @@ private void handlePingMeasurement(final QoSIntraMeasurement measurement, final qoSDBService.createPingMeasurement(measurement, calculationsDTO, aroundNow); - }else { + } else { qoSDBService.updatePingMeasurement(measurement, calculationsDTO, pingMeasurementOptional.get(), aroundNow); @@ -334,7 +332,7 @@ private UriComponents getQueryAllUri() { } catch (final ClassCastException ex) { throw new ArrowheadException("QoS Mointor can't find Service Registry Query All URI."); } - }else { + } else { throw new ArrowheadException("QoS Mointor can't find Service Registry Query All URI."); } } From fc88d724cdd59871ea53b1eb9d1e53289994a4c0 Mon Sep 17 00:00:00 2001 From: rbocsi Date: Thu, 20 Feb 2020 15:39:54 +0100 Subject: [PATCH 243/301] fixed debug message position formats --- .../core/orchestrator/service/OrchestratorService.java | 3 ++- .../arrowhead/core/qos/database/service/QoSDBService.java | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java index a5dba7eac..6ebda6249 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorService.java @@ -124,7 +124,6 @@ public OrchestrationResponseDTO externalServiceRequest(final OrchestrationFormRe queryData = removeNonPreferred(queryData, localProviders); } - logger.debug("externalServiceRequest finished with {} service providers.", queryData.size()); List orList = compileOrchestrationResponse(queryData, request); orList = qosManager.filterReservedProviders(orList, request.getRequesterSystem()); // to reduce the number of results before token generation @@ -133,6 +132,8 @@ public OrchestrationResponseDTO externalServiceRequest(final OrchestrationFormRe orList = orchestratorDriver.generateAuthTokens(request, orList); orList = qosManager.filterReservedProviders(orList, request.getRequesterSystem()); // token generation can be slow, so we have to check for new reservations + + logger.debug("externalServiceRequest finished with {} service providers.", orList.size()); return new OrchestrationResponseDTO(orList); } diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java index 3617709a3..7ee5fa246 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/database/service/QoSDBService.java @@ -123,7 +123,7 @@ public QoSIntraMeasurement getOrCreateMeasurement(final SystemResponseDTO system systemResponseDTO.getPort()); if (systemOptional.isPresent()) { system = systemOptional.get(); - }else { + } else { throw new InvalidParameterException("Requested system" + NOT_IN_DB_ERROR_MESSAGE); } @@ -401,7 +401,7 @@ public QoSIntraPingMeasurement getPingMeasurementBySystemId(final long id) { systemOptional = systemRepository.findById(id); if (systemOptional.isPresent()) { system = systemOptional.get(); - }else { + } else { throw new InvalidParameterException("Requested system" + NOT_IN_DB_ERROR_MESSAGE); } @@ -410,7 +410,7 @@ public QoSIntraPingMeasurement getPingMeasurementBySystemId(final long id) { if (qoSIntraMeasurementOptional.isEmpty()) { return null; - }else { + } else { measurement = qoSIntraMeasurementOptional.get(); } @@ -448,7 +448,5 @@ private void validateSystemResponseDTO(final SystemResponseDTO systemResponseDTO if (Utilities.isEmpty(systemResponseDTO.getAddress())) { throw new InvalidParameterException("System address" + EMPTY_OR_NULL_ERROR_MESSAGE); } - } - } \ No newline at end of file From 3225848db0f7b871d3cc4e6524043352df1bf8df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Tue, 25 Feb 2020 11:27:32 +0100 Subject: [PATCH 244/301] Sign CSR with the cloud cert instead of the server cert --- .../CertificateAuthorityController.java | 2 - .../CertificateAuthorityService.java | 62 ++++++++++-------- .../certificates/certificate_authority.p12 | Bin 7629 -> 8485 bytes .../java/eu/arrowhead/common/Utilities.java | 28 +++++++- .../CertificateSigningRequestDTO.java | 14 ++-- .../CertificateSigningResponseDTO.java | 18 ++--- 6 files changed, 77 insertions(+), 47 deletions(-) diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityController.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityController.java index c5d4c5787..a2275d366 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityController.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityController.java @@ -5,7 +5,6 @@ import eu.arrowhead.common.Defaults; import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; import eu.arrowhead.common.dto.internal.CertificateSigningResponseDTO; -import eu.arrowhead.common.exception.BadPayloadException; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; @@ -14,7 +13,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java index ed37a5036..b186ec08c 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java @@ -1,6 +1,5 @@ package eu.arrowhead.core.certificate_authority; -import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.SSLProperties; import eu.arrowhead.common.Utilities; import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; @@ -8,6 +7,9 @@ import eu.arrowhead.common.exception.AuthException; import eu.arrowhead.common.exception.BadPayloadException; import eu.arrowhead.common.exception.DataNotFoundException; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.bouncycastle.asn1.x500.RDN; import org.bouncycastle.asn1.x500.X500Name; import org.bouncycastle.asn1.x500.style.BCStyle; @@ -28,7 +30,6 @@ import org.bouncycastle.pkcs.PKCSException; import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; @@ -41,34 +42,36 @@ import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; -import java.util.Base64; -import java.util.Date; -import java.util.Map; -import java.util.ServiceConfigurationError; +import java.util.*; @Service public class CertificateAuthorityService { - @Autowired - private SSLProperties sslProperties; + private static final Logger logger = LogManager.getLogger(CertificateAuthorityService.class); @Autowired - private ApplicationContext appContext; + private SSLProperties sslProperties; private SecureRandom random; private KeyStore keyStore; + private X509Certificate rootCertificate; + private X509Certificate cloudCertificate; + @PostConstruct private void init() { random = new SecureRandom(); random.reseed(); keyStore = getKeyStore(); + + rootCertificate = Utilities.getRootCertFromKeyStore(keyStore); + cloudCertificate = Utilities.getCloudCertFromKeyStore(keyStore); } public String getCloudCommonName() { try { - final X500Name issuer = new JcaX509CertificateHolder(getServerCertificate(appContext)).getIssuer(); - final RDN cn = issuer.getRDNs(BCStyle.CN)[0]; + final X500Name subject = new JcaX509CertificateHolder(cloudCertificate).getSubject(); + final RDN cn = subject.getRDNs(BCStyle.CN)[0]; return IETFUtils.valueToString(cn.getFirst().getValue()); } catch (CertificateEncodingException e) { throw new ServiceConfigurationError("Cannot get cloud common name from server cert.", e); @@ -76,18 +79,18 @@ public String getCloudCommonName() { } public CertificateSigningResponseDTO signCertificate(CertificateSigningRequestDTO request) { - JcaPKCS10CertificationRequest csr = decodePKCS10CSR(request); + final JcaPKCS10CertificationRequest csr = decodePKCS10CSR(request); checkCommonName(csr, getCloudCommonName()); checkCsrSignature(csr); + logger.info("Signing certificate for " + csr.getSubject().toString() + "..."); + final PrivateKey cloudPrivateKey = Utilities.getPrivateKey(keyStore, getCloudCommonName(), sslProperties.getKeyPassword()); - final X509Certificate serverCertificate = getServerCertificate(appContext); - final X509Certificate clientCertificate = buildCertificate(csr.getSubject(), getClientKey(csr), cloudPrivateKey, serverCertificate); - final String encodedClientCertificate = encodeCertificate(clientCertificate); - final String encodedServerCertificate = encodeCertificate(serverCertificate); + final X509Certificate clientCertificate = buildCertificate(csr.getSubject(), getClientKey(csr), cloudPrivateKey, cloudCertificate); + final List encodedCertificateChain = buildEncodedCertificateChain(clientCertificate); - return new CertificateSigningResponseDTO(encodedClientCertificate + " " + encodedServerCertificate); + return new CertificateSigningResponseDTO(encodedCertificateChain); } private KeyStore getKeyStore() { @@ -102,9 +105,10 @@ private KeyStore getKeyStore() { private JcaPKCS10CertificationRequest decodePKCS10CSR(CertificateSigningRequestDTO csr) { try { - final byte[] csrBytes = Base64.getDecoder().decode(csr.getCertificatePem()); + final byte[] csrBytes = Base64.getDecoder().decode(csr.getEncodedCSR()); return new JcaPKCS10CertificationRequest(csrBytes); - } catch (IOException ex) { + } catch (Exception ex) { + logger.error("Failed to parse request as a PKCS10 CSR, because: " + ex.toString()); throw new BadPayloadException("Failed to parse request as a PKCS10 CSR", ex); } } @@ -117,6 +121,14 @@ private String encodeCertificate(X509Certificate certificate) { } } + private List buildEncodedCertificateChain(X509Certificate clientCertificate) { + final ArrayList encodedCertificateChain = new ArrayList<>(); + encodedCertificateChain.add(encodeCertificate(clientCertificate)); + encodedCertificateChain.add(encodeCertificate(cloudCertificate)); + encodedCertificateChain.add(encodeCertificate(rootCertificate)); + return encodedCertificateChain; + } + private void checkCommonName(JcaPKCS10CertificationRequest csr, String cloudCN) { final String clientCN = Utilities.getCertCNFromSubject(csr.getSubject().toString()); if (!Utilities.isKeyStoreCNArrowheadValid(clientCN, cloudCN)) { @@ -145,19 +157,14 @@ private PublicKey getClientKey(JcaPKCS10CertificationRequest csr) { } } - private X509Certificate getServerCertificate(final ApplicationContext appContext) { - @SuppressWarnings("unchecked") final Map context = appContext.getBean(CommonConstants.ARROWHEAD_CONTEXT, Map.class); - return (X509Certificate) context.get(CommonConstants.SERVER_CERTIFICATE); - } - - private X509Certificate buildCertificate(X500Name csrSubject, PublicKey clientKey, PrivateKey cloudPrivateKey, X509Certificate serverCertificate) { + private X509Certificate buildCertificate(X500Name csrSubject, PublicKey clientKey, PrivateKey cloudPrivateKey, X509Certificate cloudCertificate) { final ZonedDateTime now = LocalDateTime.now().atZone(ZoneId.systemDefault()); final Date validFrom = Date.from(now.minusSeconds(5).toInstant()); final Date validUntil = Date.from(now.plusYears(1).toInstant()); final BigInteger serial = BigInteger.valueOf(now.toInstant().toEpochMilli()).multiply(BigInteger.valueOf(random.nextLong())); - X509v3CertificateBuilder builder = new JcaX509v3CertificateBuilder(serverCertificate, serial, validFrom, validUntil, csrSubject, clientKey); + X509v3CertificateBuilder builder = new JcaX509v3CertificateBuilder(cloudCertificate, serial, validFrom, validUntil, csrSubject, clientKey); /* Adding the following extensions to the new certificate: 1) The subject key identifier provides a hashed value that should uniquely identify the public key @@ -167,13 +174,12 @@ private X509Certificate buildCertificate(X500Name csrSubject, PublicKey clientKe try { JcaX509ExtensionUtils extUtils = new JcaX509ExtensionUtils(); builder.addExtension(Extension.subjectKeyIdentifier, false, extUtils.createSubjectKeyIdentifier(clientKey)); - builder.addExtension(Extension.authorityKeyIdentifier, false, extUtils.createAuthorityKeyIdentifier(serverCertificate)); + builder.addExtension(Extension.authorityKeyIdentifier, false, extUtils.createAuthorityKeyIdentifier(cloudCertificate)); builder.addExtension(Extension.basicConstraints, true, new BasicConstraints(false)); } catch (NoSuchAlgorithmException | CertIOException | CertificateEncodingException e) { throw new AuthException("Appending extensions to the certificate failed! (" + e.getMessage() + ")", e); } - JcaContentSignerBuilder signerBuilder = new JcaContentSignerBuilder("SHA512withRSA").setProvider("BC"); try { return new JcaX509CertificateConverter().setProvider("BC") diff --git a/certificate-authority/src/main/resources/certificates/certificate_authority.p12 b/certificate-authority/src/main/resources/certificates/certificate_authority.p12 index cdeb7cbbb57901241252ec8ca5b241aaca4298dc..57fba65b49798f1e23f97587495bfe2d7d1abf60 100644 GIT binary patch delta 6981 zcmV-L8@lApJEcM*FoGc=0s#Xsf*{%k2`Yw2hW8Bt2LYghAj<@TAjdF*Aj7dDwgrEl zmpA&;ZF2mEY@&(~`oiV7U4Tde0|3KN1cC&}4r4h40}REsCIP4@2=06HY% ziaaF6l?X+S=rF!Q0tnjY*A4=aB{6@@3^_Dy@)wNO)3H6T>kmmZ^a3J1^;_CuyWatl zO4m{dX8)bcBbR(mkbhV0{3@C_e&fIUrQ>@1m;}?tAUe^40f)i(3XxZ>dfm@K(hoc+ z(}Rgw=HkwNU4E&&1ej>HC>EC9wl?LsNCw+@9YB@T11VT;=MwT)RD@!@k6V95Y_4(n z3qb4-!nXRkK2EW&j(Zm=TjSNX5sOB{HVc`o@LOkt@rxpydt0{B!;;bFUr3^}R95bK zC@s_=aApf<77bE>8ZoVbh`*Qx=f0l?GSgn7bjN|v~64pUizX0e2BA-*!exK4(z>Fc|RcD8I1^z`b>mYN^27K2g%rV8n0AhcN#`!+@!-ZU+ zP*3t*DPmU>;{)-_($yGJg?7nnM?de&%bV@#Cw-3;aA_@ue+M_fQ+51PpdJxiHgzE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ms+vbIUkZuFB+^M;Na3eeM!8WuTSC7&R z)zDg$+gY!+^rI9>p!kH5@49Ax+%wM$`tpMh4X0@D3vg0*+Zm$x_O%*Fpn9Ow<{QRq zR0V`Ea}@#-1KbEuNo?=;*P>8E_QNY|4epr}4YFi~)T7CFqFZ%;_1R_mOg6iB0coo{M?^O`yC@O^#V zZ^yVaR8_GiFcByLz1S*(XkX-8f_@1iMZwpcFIUiARHkOGcWJl=+YSwV!Xw zG=pwsxq|PF%FHdT1CYdjEGsciVcYwMXOIRAsII%IV|4c1d487&28l4D@S_GAZb^Ds zw2d4gxiXw{V6~|jtXwR0wGVz_QLG}i)uQ;&n~)yog8*y=4r)$pOvCy>_3tS80se? zaye~Kq+C!n>;THugnqsIcNRJw;fy658TETjm485fOi_6*CZxgv5*c!yO)X={YMAM` zqLkGHN&{w_KcmZlEELGOic!7(ZAuGMrQE+fGE8aV*z$a!16CA{b9+sfGR^67MUh>H z9Vup$;?OXIz1W(69CCVHn!=t%;mOO{BmQ^`cRQ5X+@m$BQc2bnT=`(^Nj@wfjDPtA5qc=leD|L$ zl~lMS4g|%jg*`^=w7p?9^y8Z+n{U?7`MO|_o&LLgv@c_YFb2^k!XJ;IwqX>ZDt_?2 zyuSQ{T0JX&QxYe}L3C!G>-bgy&JQbTxmbpN0)V5=01lgs;FJk|imLX7k5;+HvQ*FJ zh->G;l*P-&g}dn$vJcs2jsCwzK;mfdw(&SmBQQQNAutIB1uG5%0vZJX1Qe-00bKCm tdKpIu$Jaq?T!e?6h2jJhoOPtI()tVdEP2F`o=rsx36zaVhynuvhM-rSu~Ps5 diff --git a/core-common/src/main/java/eu/arrowhead/common/Utilities.java b/core-common/src/main/java/eu/arrowhead/common/Utilities.java index e5a228bcd..7e8c1398a 100644 --- a/core-common/src/main/java/eu/arrowhead/common/Utilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/Utilities.java @@ -385,13 +385,13 @@ public static X509Certificate getCloudCertFromKeyStore(final KeyStore keystore) while (enumeration.hasMoreElements()) { final String alias = enumeration.nextElement(); final String[] aliasParts = alias.split("\\."); - if (aliasParts.length == 3 && aliasParts[1].equals(AH_MASTER_NAME) && aliasParts[2].equals(AH_MASTER_SUFFIX)) { + if (aliasParts.length == 4 && aliasParts[2].equals(AH_MASTER_NAME) && aliasParts[3].equals(AH_MASTER_SUFFIX)) { return (X509Certificate) keystore.getCertificate(alias); } } final String errorMsg = "Getting the cloud cert from keystore failed. " + - "Cannot find alias in the following format: {cloudname}." + AH_MASTER_NAME + "." + AH_MASTER_SUFFIX; + "Cannot find alias in the following format: {cloudname}.{cloudoperator}." + AH_MASTER_NAME + "." + AH_MASTER_SUFFIX; logger.error(errorMsg); throw new ServiceConfigurationError(errorMsg); } catch (final KeyStoreException | NoSuchElementException ex) { @@ -400,6 +400,30 @@ public static X509Certificate getCloudCertFromKeyStore(final KeyStore keystore) } } + //------------------------------------------------------------------------------------------------- + public static X509Certificate getRootCertFromKeyStore(final KeyStore keystore) { + Assert.notNull(keystore, "Key store is not defined."); + + try { + final Enumeration enumeration = keystore.aliases(); + while (enumeration.hasMoreElements()) { + final String alias = enumeration.nextElement(); + final String[] aliasParts = alias.split("\\."); + if (aliasParts.length == 2 && aliasParts[0].equals(AH_MASTER_NAME) && aliasParts[1].equals(AH_MASTER_SUFFIX)) { + return (X509Certificate) keystore.getCertificate(alias); + } + } + + final String errorMsg = "Getting the root cert from keystore failed. " + + "Cannot find alias in the following format: " + AH_MASTER_NAME + "." + AH_MASTER_SUFFIX; + logger.error(errorMsg); + throw new ServiceConfigurationError(errorMsg); + } catch (final KeyStoreException | NoSuchElementException ex) { + logger.error("Getting the root cert from keystore failed...", ex); + throw new ServiceConfigurationError("Getting the root cert from keystore failed...", ex); + } + } + //------------------------------------------------------------------------------------------------- public static PrivateKey getPrivateKey(final KeyStore keystore, final String keyPass) { Assert.notNull(keystore, "Key store is not defined."); diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningRequestDTO.java index 078b9abaf..0231f9bcd 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningRequestDTO.java @@ -6,19 +6,19 @@ public class CertificateSigningRequestDTO implements Serializable { private static final long serialVersionUID = -6810780579000655432L; - private String certificatePem; + private String encodedCSR; public CertificateSigningRequestDTO() {} - public CertificateSigningRequestDTO(String certificatePem) { - this.certificatePem = certificatePem; + public CertificateSigningRequestDTO(String encodedCSR) { + this.encodedCSR = encodedCSR; } - public String getCertificatePem() { - return certificatePem; + public String getEncodedCSR() { + return encodedCSR; } - public void setCertificatePem(String certificatePem) { - this.certificatePem = certificatePem; + public void setEncodedCSR(String encodedCSR) { + this.encodedCSR = encodedCSR; } } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningResponseDTO.java index 2a73e0619..cb8726244 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningResponseDTO.java @@ -1,24 +1,26 @@ package eu.arrowhead.common.dto.internal; import java.io.Serializable; +import java.util.List; public class CertificateSigningResponseDTO implements Serializable { private static final long serialVersionUID = -6810780579000655432L; - private String certificatePem; + private List certificateChain; - public CertificateSigningResponseDTO() {} + public CertificateSigningResponseDTO() { + } - public CertificateSigningResponseDTO(String certificatePem) { - this.certificatePem = certificatePem; + public CertificateSigningResponseDTO(List certificateChain) { + this.certificateChain = certificateChain; } - public String getCertificatePem() { - return certificatePem; + public List getCertificateChain() { + return certificateChain; } - public void setCertificatePem(String certificatePem) { - this.certificatePem = certificatePem; + public void setCertificateChain(List certificateChain) { + this.certificateChain = certificateChain; } } From e4485c3db5a8bc9bcc5a1bc6f892fcc2d731b493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Tue, 25 Feb 2020 16:03:11 +0100 Subject: [PATCH 245/301] Refactor, code clean-up in CA --- ...icateAuthorityApplicationInitListener.java | 62 +------- .../CertificateAuthorityService.java | 115 ++------------ .../CertificateAuthorityUtils.java | 143 ++++++++++++++++++ .../security/CAAccessControlFilter.java | 6 - 4 files changed, 159 insertions(+), 167 deletions(-) create mode 100644 certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityApplicationInitListener.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityApplicationInitListener.java index 576e90843..159dd1c88 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityApplicationInitListener.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityApplicationInitListener.java @@ -1,69 +1,9 @@ package eu.arrowhead.core.certificate_authority; -import java.util.Map; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; -import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.stereotype.Component; - import eu.arrowhead.common.ApplicationInitListener; -import eu.arrowhead.common.CommonConstants; -import eu.arrowhead.common.CoreDefaults; -import eu.arrowhead.common.database.service.CommonDBService; -import eu.arrowhead.common.exception.DataNotFoundException; @Component public class CertificateAuthorityApplicationInitListener extends ApplicationInitListener { - //================================================================================================= - // members - - @Autowired - private CommonDBService commonDBService; - - //================================================================================================= - // assistant methods - - //------------------------------------------------------------------------------------------------- - @Override - protected void customInit(final ContextRefreshedEvent event) { - logger.debug("customInit started..."); - if (!isOwnCloudRegistered()) { - registerOwnCloud(event.getApplicationContext()); - } - } - - //------------------------------------------------------------------------------------------------- - private boolean isOwnCloudRegistered() { - logger.debug("isOwnCloudRegistered started..."); - try { - commonDBService.getOwnCloud(sslProperties.isSslEnabled()); - return true; - } catch (final DataNotFoundException ex) { - return false; - } - } - - //------------------------------------------------------------------------------------------------- - private void registerOwnCloud(final ApplicationContext appContext) { - logger.debug("registerOwnCloud started..."); - - if (!standaloneMode) { - String name = CoreDefaults.DEFAULT_OWN_CLOUD_NAME; - String operator = CoreDefaults.DEFAULT_OWN_CLOUD_OPERATOR; - - if (sslProperties.isSslEnabled()) { - @SuppressWarnings("unchecked") - final Map context = appContext.getBean(CommonConstants.ARROWHEAD_CONTEXT, Map.class); - final String serverCN = (String) context.get(CommonConstants.SERVER_COMMON_NAME); - final String[] serverFields = serverCN.split("\\."); - name = serverFields[1]; - operator = serverFields[2]; - } - - commonDBService.insertOwnCloud(operator, name, sslProperties.isSslEnabled(), null); - logger.info("{}.{} own cloud is registered in {} mode.", name, operator, getModeString()); - } - } -} \ No newline at end of file +} diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java index b186ec08c..1ff0e8b78 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java @@ -4,9 +4,6 @@ import eu.arrowhead.common.Utilities; import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; import eu.arrowhead.common.dto.internal.CertificateSigningResponseDTO; -import eu.arrowhead.common.exception.AuthException; -import eu.arrowhead.common.exception.BadPayloadException; -import eu.arrowhead.common.exception.DataNotFoundException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -14,27 +11,13 @@ import org.bouncycastle.asn1.x500.X500Name; import org.bouncycastle.asn1.x500.style.BCStyle; import org.bouncycastle.asn1.x500.style.IETFUtils; -import org.bouncycastle.asn1.x509.BasicConstraints; -import org.bouncycastle.asn1.x509.Extension; -import org.bouncycastle.cert.CertIOException; -import org.bouncycastle.cert.X509v3CertificateBuilder; -import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; import org.bouncycastle.cert.jcajce.JcaX509CertificateHolder; -import org.bouncycastle.cert.jcajce.JcaX509ExtensionUtils; -import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder; -import org.bouncycastle.jce.provider.BouncyCastleProvider; -import org.bouncycastle.operator.ContentVerifierProvider; -import org.bouncycastle.operator.OperatorCreationException; -import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; -import org.bouncycastle.operator.jcajce.JcaContentVerifierProviderBuilder; -import org.bouncycastle.pkcs.PKCSException; import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; import java.io.IOException; -import java.math.BigInteger; import java.security.*; import java.security.cert.CertificateEncodingException; import java.security.cert.CertificateException; @@ -79,15 +62,16 @@ public String getCloudCommonName() { } public CertificateSigningResponseDTO signCertificate(CertificateSigningRequestDTO request) { - final JcaPKCS10CertificationRequest csr = decodePKCS10CSR(request); - checkCommonName(csr, getCloudCommonName()); - checkCsrSignature(csr); + final JcaPKCS10CertificationRequest csr = CertificateAuthorityUtils.decodePKCS10CSR(request); + CertificateAuthorityUtils.checkCommonName(csr, getCloudCommonName()); + CertificateAuthorityUtils.checkCsrSignature(csr); logger.info("Signing certificate for " + csr.getSubject().toString() + "..."); - final PrivateKey cloudPrivateKey = Utilities.getPrivateKey(keyStore, getCloudCommonName(), sslProperties.getKeyPassword()); + final PrivateKey cloudPrivateKey = Utilities.getPrivateKey(keyStore, getCloudCommonName(), + sslProperties.getKeyPassword()); - final X509Certificate clientCertificate = buildCertificate(csr.getSubject(), getClientKey(csr), cloudPrivateKey, cloudCertificate); + final X509Certificate clientCertificate = buildCertificate(csr, cloudPrivateKey, cloudCertificate); final List encodedCertificateChain = buildEncodedCertificateChain(clientCertificate); return new CertificateSigningResponseDTO(encodedCertificateChain); @@ -96,98 +80,29 @@ public CertificateSigningResponseDTO signCertificate(CertificateSigningRequestDT private KeyStore getKeyStore() { try { final KeyStore keystore = KeyStore.getInstance(sslProperties.getKeyStoreType()); - keystore.load(sslProperties.getKeyStore().getInputStream(), sslProperties.getKeyStorePassword().toCharArray()); + keystore.load(sslProperties.getKeyStore().getInputStream(), + sslProperties.getKeyStorePassword().toCharArray()); return keystore; } catch (KeyStoreException | IOException | CertificateException | NoSuchAlgorithmException e) { throw new ServiceConfigurationError("Cannot open keystore: " + e.getMessage()); } } - private JcaPKCS10CertificationRequest decodePKCS10CSR(CertificateSigningRequestDTO csr) { - try { - final byte[] csrBytes = Base64.getDecoder().decode(csr.getEncodedCSR()); - return new JcaPKCS10CertificationRequest(csrBytes); - } catch (Exception ex) { - logger.error("Failed to parse request as a PKCS10 CSR, because: " + ex.toString()); - throw new BadPayloadException("Failed to parse request as a PKCS10 CSR", ex); - } - } - - private String encodeCertificate(X509Certificate certificate) { - try { - return Base64.getEncoder().encodeToString(certificate.getEncoded()); - } catch (CertificateEncodingException e) { - throw new AuthException("Certificate encoding failed! (" + e.getMessage() + ")", e); - } - } - private List buildEncodedCertificateChain(X509Certificate clientCertificate) { final ArrayList encodedCertificateChain = new ArrayList<>(); - encodedCertificateChain.add(encodeCertificate(clientCertificate)); - encodedCertificateChain.add(encodeCertificate(cloudCertificate)); - encodedCertificateChain.add(encodeCertificate(rootCertificate)); + encodedCertificateChain.add(CertificateAuthorityUtils.encodeCertificate(clientCertificate)); + encodedCertificateChain.add(CertificateAuthorityUtils.encodeCertificate(cloudCertificate)); + encodedCertificateChain.add(CertificateAuthorityUtils.encodeCertificate(rootCertificate)); return encodedCertificateChain; } - private void checkCommonName(JcaPKCS10CertificationRequest csr, String cloudCN) { - final String clientCN = Utilities.getCertCNFromSubject(csr.getSubject().toString()); - if (!Utilities.isKeyStoreCNArrowheadValid(clientCN, cloudCN)) { - throw new BadPayloadException("Certificate request does not have a valid common name! Valid common name: {systemName}." + cloudCN); - } - } - - private void checkCsrSignature(JcaPKCS10CertificationRequest csr) { - Security.addProvider(new BouncyCastleProvider()); - try { - ContentVerifierProvider verifierProvider = new JcaContentVerifierProviderBuilder().setProvider("BC").build(csr.getSubjectPublicKeyInfo()); - if (!csr.isSignatureValid(verifierProvider)) { - throw new AuthException("Certificate request has invalid signature! (key pair does not match)"); - } - } catch (OperatorCreationException | PKCSException e) { - throw new AuthException("Encapsulated " + e.getClass().getCanonicalName() + ": " + e.getMessage(), e); - } - } - - private PublicKey getClientKey(JcaPKCS10CertificationRequest csr) { - try { - return csr.getPublicKey(); - } catch (InvalidKeyException | NoSuchAlgorithmException e) { - //This should not be possible after a successful signature verification - throw new DataNotFoundException("Extracting the public key from the CSR failed (" + e.getMessage() + ")", e); - } - } - - private X509Certificate buildCertificate(X500Name csrSubject, PublicKey clientKey, PrivateKey cloudPrivateKey, X509Certificate cloudCertificate) { + private X509Certificate buildCertificate(JcaPKCS10CertificationRequest csr, PrivateKey cloudPrivateKey, + X509Certificate cloudCertificate) { final ZonedDateTime now = LocalDateTime.now().atZone(ZoneId.systemDefault()); final Date validFrom = Date.from(now.minusSeconds(5).toInstant()); final Date validUntil = Date.from(now.plusYears(1).toInstant()); - final BigInteger serial = BigInteger.valueOf(now.toInstant().toEpochMilli()).multiply(BigInteger.valueOf(random.nextLong())); - - X509v3CertificateBuilder builder = new JcaX509v3CertificateBuilder(cloudCertificate, serial, validFrom, validUntil, csrSubject, clientKey); - - /* Adding the following extensions to the new certificate: - 1) The subject key identifier provides a hashed value that should uniquely identify the public key - 2) The authority key identifier provides a hashed value that should uniquely identify the issuer of the certificate - 3) And this basic constraint is for forbidding issuing other certificates under this certificate - */ - try { - JcaX509ExtensionUtils extUtils = new JcaX509ExtensionUtils(); - builder.addExtension(Extension.subjectKeyIdentifier, false, extUtils.createSubjectKeyIdentifier(clientKey)); - builder.addExtension(Extension.authorityKeyIdentifier, false, extUtils.createAuthorityKeyIdentifier(cloudCertificate)); - builder.addExtension(Extension.basicConstraints, true, new BasicConstraints(false)); - } catch (NoSuchAlgorithmException | CertIOException | CertificateEncodingException e) { - throw new AuthException("Appending extensions to the certificate failed! (" + e.getMessage() + ")", e); - } - - JcaContentSignerBuilder signerBuilder = new JcaContentSignerBuilder("SHA512withRSA").setProvider("BC"); - try { - return new JcaX509CertificateConverter().setProvider("BC") - .getCertificate(builder.build(signerBuilder.build(cloudPrivateKey))); - } catch (CertificateException e) { - throw new AuthException("Certificate encoding failed! (" + e.getMessage() + ")", e); - } catch (OperatorCreationException e) { - throw new AuthException("Certificate signing failed! (" + e.getMessage() + ")", e); - } + return CertificateAuthorityUtils.buildCertificate(csr, cloudPrivateKey, cloudCertificate, validFrom, validUntil, + random); } } diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java new file mode 100644 index 000000000..54158a4de --- /dev/null +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java @@ -0,0 +1,143 @@ +package eu.arrowhead.core.certificate_authority; + +import java.math.BigInteger; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.SecureRandom; +import java.security.Security; +import java.security.cert.CertificateEncodingException; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.Base64; +import java.util.Date; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.bouncycastle.asn1.x509.BasicConstraints; +import org.bouncycastle.asn1.x509.Extension; +import org.bouncycastle.cert.CertIOException; +import org.bouncycastle.cert.X509v3CertificateBuilder; +import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; +import org.bouncycastle.cert.jcajce.JcaX509ExtensionUtils; +import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder; +import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.bouncycastle.operator.ContentVerifierProvider; +import org.bouncycastle.operator.OperatorCreationException; +import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; +import org.bouncycastle.operator.jcajce.JcaContentVerifierProviderBuilder; +import org.bouncycastle.pkcs.PKCSException; +import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest; + +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; +import eu.arrowhead.common.exception.AuthException; +import eu.arrowhead.common.exception.BadPayloadException; +import eu.arrowhead.common.exception.DataNotFoundException; + +class CertificateAuthorityUtils { + + private static final Logger logger = LogManager.getLogger(CertificateAuthorityService.class); + + static JcaPKCS10CertificationRequest decodePKCS10CSR(CertificateSigningRequestDTO csr) { + try { + final byte[] csrBytes = Base64.getDecoder().decode(csr.getEncodedCSR()); + return new JcaPKCS10CertificationRequest(csrBytes); + } catch (Exception ex) { + logger.error("Failed to parse request as a PKCS10 CSR, because: " + ex.getMessage()); + throw new BadPayloadException("Failed to parse request as a PKCS10 CSR", ex); + } + } + + static String encodeCertificate(X509Certificate certificate) { + try { + return Base64.getEncoder().encodeToString(certificate.getEncoded()); + } catch (CertificateEncodingException e) { + throw new AuthException("Certificate encoding failed! (" + e.getMessage() + ")", e); + } + } + + static void checkCommonName(JcaPKCS10CertificationRequest csr, String cloudCN) { + final String clientCN = Utilities.getCertCNFromSubject(csr.getSubject().toString()); + if (!Utilities.isKeyStoreCNArrowheadValid(clientCN, cloudCN)) { + throw new BadPayloadException( + "Certificate request does not have a valid common name! Valid common name: {systemName}." + + cloudCN); + } + } + + static void checkCsrSignature(JcaPKCS10CertificationRequest csr) { + Security.addProvider(new BouncyCastleProvider()); + try { + ContentVerifierProvider verifierProvider = new JcaContentVerifierProviderBuilder().setProvider("BC") + .build(csr.getSubjectPublicKeyInfo()); + if (!csr.isSignatureValid(verifierProvider)) { + throw new AuthException("Certificate request has invalid signature! (key pair does not match)"); + } + } catch (OperatorCreationException | PKCSException e) { + throw new AuthException("Encapsulated " + e.getClass().getCanonicalName() + ": " + e.getMessage(), e); + } + } + + static PublicKey getClientKey(JcaPKCS10CertificationRequest csr) { + try { + return csr.getPublicKey(); + } catch (InvalidKeyException | NoSuchAlgorithmException e) { + // This should not be possible after a successful signature verification + throw new DataNotFoundException("Extracting the public key from the CSR failed (" + e.getMessage() + ")", + e); + } + } + + static X509Certificate buildCertificate(JcaPKCS10CertificationRequest csr, PrivateKey cloudPrivateKey, + X509Certificate cloudCertificate, Date validFrom, Date validUntil, SecureRandom random) { + + final ZonedDateTime now = LocalDateTime.now().atZone(ZoneId.systemDefault()); + final BigInteger serial = BigInteger.valueOf(now.toInstant().toEpochMilli()) + .multiply(BigInteger.valueOf(random.nextLong())); + + final PublicKey clientKey = getClientKey(csr); + + X509v3CertificateBuilder builder = new JcaX509v3CertificateBuilder(cloudCertificate, serial, validFrom, + validUntil, csr.getSubject(), clientKey); + + /** + * Adding the following extensions to the new certificate: + * + * 1) The subject key identifier provides a hashed value that should uniquely + * identify the public key + * + * 2) The authority key identifier provides a hashed value that should uniquely + * identify the issuer of the certificate + * + * 3) And this basic constraint is for forbidding issuing other certificates + * under this certificate + */ + try { + JcaX509ExtensionUtils extUtils = new JcaX509ExtensionUtils(); + builder.addExtension(Extension.subjectKeyIdentifier, false, extUtils.createSubjectKeyIdentifier(clientKey)); + builder.addExtension(Extension.authorityKeyIdentifier, false, + extUtils.createAuthorityKeyIdentifier(cloudCertificate)); + builder.addExtension(Extension.basicConstraints, true, new BasicConstraints(false)); + } catch (NoSuchAlgorithmException | CertIOException | CertificateEncodingException e) { + throw new AuthException("Appending extensions to the certificate failed! (" + e.getMessage() + ")", e); + } + + JcaContentSignerBuilder signerBuilder = new JcaContentSignerBuilder("SHA512withRSA").setProvider("BC"); + try { + return new JcaX509CertificateConverter().setProvider("BC") + .getCertificate(builder.build(signerBuilder.build(cloudPrivateKey))); + } catch (CertificateException e) { + throw new AuthException("Certificate encoding failed! (" + e.getMessage() + ")", e); + } catch (OperatorCreationException e) { + throw new AuthException("Certificate signing failed! (" + e.getMessage() + ")", e); + } + } + + private CertificateAuthorityUtils() { + } +} diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/security/CAAccessControlFilter.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/security/CAAccessControlFilter.java index 5a147e1dc..475614cd6 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/security/CAAccessControlFilter.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/security/CAAccessControlFilter.java @@ -3,17 +3,11 @@ import java.util.Map; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; -import eu.arrowhead.common.Utilities; import eu.arrowhead.common.core.CoreSystem; -import eu.arrowhead.common.core.CoreSystemService; -import eu.arrowhead.common.dto.shared.ServiceQueryFormDTO; -import eu.arrowhead.common.dto.shared.ServiceRegistryRequestDTO; -import eu.arrowhead.common.exception.AuthException; import eu.arrowhead.common.security.CoreSystemAccessControlFilter; @Component From c9148f4870659cd77418b1245b47404e21664086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Tue, 25 Feb 2020 21:12:43 +0100 Subject: [PATCH 246/301] Add CA to Docker related files --- docker-all/example/docker-compose.yml | 2 + .../certificateauthority.properties | 59 +++++++++++++++++++ docker-all/example/sql/setup.sql | 43 +++++++++++++- .../certificateauthority.properties | 59 +++++++++++++++++++ docker/docker-compose.yml | 12 +++- 5 files changed, 173 insertions(+), 2 deletions(-) create mode 100644 docker-all/example/properties/certificateauthority.properties create mode 100644 docker/core_system_config/certificateauthority.properties diff --git a/docker-all/example/docker-compose.yml b/docker-all/example/docker-compose.yml index ab10fdf71..3e193d153 100644 --- a/docker-all/example/docker-compose.yml +++ b/docker-all/example/docker-compose.yml @@ -27,6 +27,7 @@ services: #- ./properties/eventhandler.properties:/opt/arrowhead-core/eventhandler/application.properties - ./properties/gatekeeper.properties:/opt/arrowhead-core/gatekeeper/application.properties - ./properties/gateway.properties:/opt/arrowhead-core/gateway/application.properties + - ./properties/certificateauthority.properties:/opt/arrowhead-core/certificate-authority/application.properties ports: - 8443:8443 # Service Registry - 8445:8445 # Authorization @@ -34,6 +35,7 @@ services: #- 8455:8455 # Event Handler - 8449:8449 # Gatekeeper - 8453:8453 # Gateway + - 8448:8448 # Certificate Authority volumes: arrowhead_core_mysql: diff --git a/docker-all/example/properties/certificateauthority.properties b/docker-all/example/properties/certificateauthority.properties new file mode 100644 index 000000000..93f325bd4 --- /dev/null +++ b/docker-all/example/properties/certificateauthority.properties @@ -0,0 +1,59 @@ +############################################ +### APPLICATION PARAMETERS ### +############################################ + +# Database connection (mandatory) +# Change the server timezone if neccessary +spring.datasource.url=jdbc:mysql://127.0.0.1:3306/arrowhead?serverTimezone=Europe/Budapest +spring.datasource.username=certificate_authority +spring.datasource.password=FsdG6Kgf9QpPfv2 +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +# use true only for debugging +spring.jpa.show-sql=false +spring.jpa.properties.hibernate.format_sql=true +spring.jpa.hibernate.ddl-auto=none + +# Certificate Authority web-server parameters +server.address=127.0.0.1 +server.port=8448 +domain.name=127.0.0.1 +domain.port=8448 + +############################################ +### CUSTOM PARAMETERS ### +############################################ + +# Name of the core system +core_system_name=certificate_authority + +# Show all request/response in debug log +log_all_request_and_response=false + +# Service Registry web-server parameters (to register the Certificate-Authority services) +sr_address=127.0.0.1 +sr_port=8443 + +############################################ +### SECURE MODE ### +############################################ + +# configure secure mode + +# Set this to false to disable https mode +server.ssl.enabled=true + +server.ssl.key-store-type=PKCS12 +server.ssl.key-store=classpath:certificates/certificate_authority.p12 +server.ssl.key-store-password=123456 +server.ssl.key-alias=certificate_authority +server.ssl.key-password=123456 +server.ssl.client-auth=need +server.ssl.trust-store-type=PKCS12 +server.ssl.trust-store=classpath:certificates/truststore.p12 +server.ssl.trust-store-password=123456 + +#If true, http client does not check whether the hostname is match one of the server's SAN in its certificate +#Just for testing, DO NOT USE this feature in production environment +disable.hostname.verifier=false diff --git a/docker-all/example/sql/setup.sql b/docker-all/example/sql/setup.sql index 755b9a6e5..1ad2be0ae 100644 --- a/docker-all/example/sql/setup.sql +++ b/docker-all/example/sql/setup.sql @@ -537,4 +537,45 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'gateway'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'gateway'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'gateway'@'%'; -FLUSH PRIVILEGES; \ No newline at end of file +-- Certificate Authority +DROP USER IF EXISTS 'certificate_authority'@'localhost'; +CREATE USER IF NOT EXISTS 'certificate_authority'@'localhost' IDENTIFIED BY 'FsdG6Kgf9QpPfv2'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`certificate_authority` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`certificate_authority_interface_connection` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'certificate_authority'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'certificate_authority'@'localhost'; + +DROP USER IF EXISTS 'certificate_authority'@'%'; +CREATE USER IF NOT EXISTS 'certificate_authority'@'%' IDENTIFIED BY 'FsdG6Kgf9QpPfv2'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`certificate_authority` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`certificate_authority_interface_connection` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'certificate_authority'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'certificate_authority'@'%'; + +FLUSH PRIVILEGES; diff --git a/docker/core_system_config/certificateauthority.properties b/docker/core_system_config/certificateauthority.properties new file mode 100644 index 000000000..93f325bd4 --- /dev/null +++ b/docker/core_system_config/certificateauthority.properties @@ -0,0 +1,59 @@ +############################################ +### APPLICATION PARAMETERS ### +############################################ + +# Database connection (mandatory) +# Change the server timezone if neccessary +spring.datasource.url=jdbc:mysql://127.0.0.1:3306/arrowhead?serverTimezone=Europe/Budapest +spring.datasource.username=certificate_authority +spring.datasource.password=FsdG6Kgf9QpPfv2 +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +# use true only for debugging +spring.jpa.show-sql=false +spring.jpa.properties.hibernate.format_sql=true +spring.jpa.hibernate.ddl-auto=none + +# Certificate Authority web-server parameters +server.address=127.0.0.1 +server.port=8448 +domain.name=127.0.0.1 +domain.port=8448 + +############################################ +### CUSTOM PARAMETERS ### +############################################ + +# Name of the core system +core_system_name=certificate_authority + +# Show all request/response in debug log +log_all_request_and_response=false + +# Service Registry web-server parameters (to register the Certificate-Authority services) +sr_address=127.0.0.1 +sr_port=8443 + +############################################ +### SECURE MODE ### +############################################ + +# configure secure mode + +# Set this to false to disable https mode +server.ssl.enabled=true + +server.ssl.key-store-type=PKCS12 +server.ssl.key-store=classpath:certificates/certificate_authority.p12 +server.ssl.key-store-password=123456 +server.ssl.key-alias=certificate_authority +server.ssl.key-password=123456 +server.ssl.client-auth=need +server.ssl.trust-store-type=PKCS12 +server.ssl.trust-store=classpath:certificates/truststore.p12 +server.ssl.trust-store-password=123456 + +#If true, http client does not check whether the hostname is match one of the server's SAN in its certificate +#Just for testing, DO NOT USE this feature in production environment +disable.hostname.verifier=false diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 5748354fa..ebeb3c0c3 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -72,7 +72,17 @@ services: volumes: - ./core_system_config/gateway.properties:/gateway/application.properties ports: - - 8453:8453 + - 8453:8453 + + certificateauthority: + container_name: certificateauthority + image: svetlint/certificateauthority:latest + depends_on: + - mysql + volumes: + - ./core_system_config/certificateauthority.properties:/certificateauthority/application.properties + ports: + - 8448:8448 volumes: mysql: From 83eda37f2c74919e0438646af83c7e01abc326af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Tue, 25 Feb 2020 21:18:50 +0100 Subject: [PATCH 247/301] Add CA to start/stop scripts --- scripts/initSQL.sh | 3 ++- scripts/start_coresystems.bat | 4 ++++ scripts/start_coresystems.sh | 5 +++++ scripts/start_coresystems_local.sh | 4 ++++ scripts/stop_coresystems.sh | 4 +++- 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/initSQL.sh b/scripts/initSQL.sh index 123f4d41e..4e84421d9 100644 --- a/scripts/initSQL.sh +++ b/scripts/initSQL.sh @@ -16,4 +16,5 @@ wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scrip wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/event_handler_privileges.sql wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/choreographer_privileges.sql wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/gatekeeper_privileges.sql -wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/gateway_privileges.sql \ No newline at end of file +wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/gateway_privileges.sql +wget https://raw.githubusercontent.com/arrowhead-f/core-java-spring/master/scripts/certificate_authority_privileges.sql diff --git a/scripts/start_coresystems.bat b/scripts/start_coresystems.bat index 3e96b0ad8..2f86c4be2 100644 --- a/scripts/start_coresystems.bat +++ b/scripts/start_coresystems.bat @@ -36,6 +36,10 @@ cd ..\..\choreographer\target START "" /B "cmd /c javaw -jar arrowhead-choreographer-4.1.3.jar > sout_choreographer.log 2>&1" echo Choreographer started +cd ..\..\certificate-authority\target +START "" /B "cmd /c javaw -jar arrowhead-certificate-authority-4.1.3.jar > sout_ca.log 2>&1" +echo Certificate Authority started + cd %parent_path% ::Kill self diff --git a/scripts/start_coresystems.sh b/scripts/start_coresystems.sh index 4d3c7044b..24dbf6fde 100644 --- a/scripts/start_coresystems.sh +++ b/scripts/start_coresystems.sh @@ -35,3 +35,8 @@ echo Orchestrator started cd ../../choreographer/target nohup java -jar $(find . -maxdepth 1 -name arrowhead-choreographer-\*.jar | sort | tail -n1) &> sout_choreographer.log & echo Choreographer started + +cd ../../certificate-authority/target +nohup java -jar $(find . -maxdepth 1 -name arrowhead-certificate-authority-\*.jar | sort | tail -n1) &> sout_ca.log & +echo Certificate Authority started + diff --git a/scripts/start_coresystems_local.sh b/scripts/start_coresystems_local.sh index 884b5cb5d..1d0f3e9a1 100644 --- a/scripts/start_coresystems_local.sh +++ b/scripts/start_coresystems_local.sh @@ -26,3 +26,7 @@ echo Authorization started cd ../../orchestrator/target nohup java -jar $(find . -maxdepth 1 -name arrowhead-orchestrator-\*.jar | sort | tail -n1) &> sout_orch.log & echo Orchestrator started + +cd ../../certificate-authority/target +nohup java -jar $(find . -maxdepth 1 -name arrowhead-certificate-authority-\*.jar | sort | tail -n1) &> sout_ca.log & +echo Certificate Authority started diff --git a/scripts/stop_coresystems.sh b/scripts/stop_coresystems.sh index b19816282..1540cc284 100644 --- a/scripts/stop_coresystems.sh +++ b/scripts/stop_coresystems.sh @@ -7,6 +7,7 @@ pkill -f gatekeeper pkill -f authorization pkill -f eventhandler pkill -f gateway +pkill -f certificate-authority sleep 5s pkill -f serviceregistry sleep 2s @@ -19,8 +20,9 @@ then kill -KILL $(ps aux | grep 'authorization' | awk '{print $2}') kill -KILL $(ps aux | grep 'eventhandler' | awk '{print $2}') kill -KILL $(ps aux | grep 'gateway' | awk '{print $2}') + kill -KILL $(ps aux | grep 'certificate-authority' | awk '{print $2}') kill -KILL $(ps aux | grep 'serviceregistry' | awk '{print $2}') echo Core systems forcefully killed else echo Core systems killed -fi \ No newline at end of file +fi From 07767e545b7d0743f543f198d4b74d590692ec9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Wed, 26 Feb 2020 14:13:22 +0100 Subject: [PATCH 248/301] Add tests for CA --- .../CertificateAuthorityControllerTest.java | 185 ++++++++++++++++++ .../src/test/resources/banner.txt | 0 .../test/resources/certificates/notvalid.pem | 20 ++ .../src/test/resources/certificates/valid.csr | 1 + .../src/test/resources/certificates/valid.pem | 20 ++ .../src/test/resources/log4j2.xml | 49 +++++ 6 files changed, 275 insertions(+) create mode 100644 certificate-authority/src/test/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityControllerTest.java create mode 100644 certificate-authority/src/test/resources/banner.txt create mode 100644 certificate-authority/src/test/resources/certificates/notvalid.pem create mode 100644 certificate-authority/src/test/resources/certificates/valid.csr create mode 100644 certificate-authority/src/test/resources/certificates/valid.pem create mode 100644 certificate-authority/src/test/resources/log4j2.xml diff --git a/certificate-authority/src/test/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityControllerTest.java b/certificate-authority/src/test/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityControllerTest.java new file mode 100644 index 000000000..6e426cf34 --- /dev/null +++ b/certificate-authority/src/test/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityControllerTest.java @@ -0,0 +1,185 @@ +package eu.arrowhead.core.certificate_authority; + +import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.x509; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.head; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.core.io.ClassPathResource; +import org.springframework.http.MediaType; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; + +import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = CertificateAuthorityMain.class) +@AutoConfigureMockMvc +public class CertificateAuthorityControllerTest { + + @Autowired + private MockMvc mockMvc; + + @Test + public void testEchoWithoutCert() throws Exception { + mockMvc.perform(get("/certificate-authority/echo") + .secure(true)) + .andExpect(status().isUnauthorized()); + } + + @Test + public void testEchoWithInvalidCert() throws Exception { + mockMvc.perform(get("/certificate-authority/echo") + .secure(true) + .with(x509("certificates/notvalid.pem"))) + .andExpect(status().isUnauthorized()); + } + + @Test + public void testEchoWithValidCert() throws Exception { + mockMvc.perform(get("/certificate-authority/echo") + .secure(true) + .with(x509("certificates/valid.pem"))) + .andExpect(status().isOk()); + } + + @Test + public void testGetCloudCommonNameWithoutCert() throws Exception { + mockMvc.perform(get("/certificate-authority/name") + .secure(true)) + .andExpect(status().isUnauthorized()); + } + + @Test + public void testGetCloudCommonNameWithInvalidCert() throws Exception { + mockMvc.perform(get("/certificate-authority/name") + .secure(true) + .with(x509("certificates/notvalid.pem"))) + .andExpect(status().isUnauthorized()); + } + + @Test + public void testGetCloudCommonNameWithValidCert() throws Exception { + mockMvc.perform(get("/certificate-authority/name") + .secure(true) + .with(x509("certificates/valid.pem"))) + .andExpect(status().isOk()) + .andExpect(content().contentTypeCompatibleWith(MediaType.TEXT_PLAIN)) + .andExpect(content().string("testcloud2.aitia.arrowhead.eu")); + } + + @Test + public void testSignWithoutCert() throws Exception { + mockMvc.perform(post("/certificate-authority/sign") + .secure(true)) + .andExpect(status().isUnauthorized()); + } + + @Test + public void testSignWithInvalidCert() throws Exception { + mockMvc.perform(post("/certificate-authority/sign") + .secure(true) + .with(x509("certificates/notvalid.pem"))) + .andExpect(status().isUnauthorized()); + } + + @Test + public void testSignGet() throws Exception { + mockMvc.perform(get("/certificate-authority/sign") + .secure(true) + .with(x509("certificates/valid.pem"))) + .andExpect(status().isMethodNotAllowed()); + } + + @Test + public void testSignPut() throws Exception { + mockMvc.perform(put("/certificate-authority/sign") + .secure(true) + .with(x509("certificates/valid.pem"))) + .andExpect(status().isMethodNotAllowed()); + } + + @Test + public void testSignPatch() throws Exception { + mockMvc.perform(patch("/certificate-authority/sign") + .secure(true) + .with(x509("certificates/valid.pem"))) + .andExpect(status().isMethodNotAllowed()); + } + + @Test + public void testSignDelete() throws Exception { + mockMvc.perform(delete("/certificate-authority/sign") + .secure(true) + .with(x509("certificates/valid.pem"))) + .andExpect(status().isMethodNotAllowed()); + } + + @Test + public void testSignHead() throws Exception { + mockMvc.perform(head("/certificate-authority/sign") + .secure(true) + .with(x509("certificates/valid.pem"))) + .andExpect(status().isMethodNotAllowed()); + } + + @Test + public void testSignOptions() throws Exception { + mockMvc.perform(options("/certificate-authority/sign") + .secure(true) + .with(x509("certificates/valid.pem"))) + .andExpect(status().isOk()); + } + + @Test + public void testSignPostInvalidContentType() throws Exception { + mockMvc.perform(post("/certificate-authority/sign") + .secure(true) + .with(x509("certificates/valid.pem"))) + .andExpect(status().isUnsupportedMediaType()); + } + + @Test + public void testSignPostWithValidCSR() throws Exception { + mockMvc.perform(post("/certificate-authority/sign") + .secure(true) + .with(x509("certificates/valid.pem")) + .contentType(MediaType.APPLICATION_JSON) + .accept(MediaType.APPLICATION_JSON) + .content(asJsonString(new CertificateSigningRequestDTO(getResourceContent("certificates/valid.csr"))))) + .andExpect(status().isOk()) + .andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON)) + .andExpect(jsonPath("$.certificateChain").isArray()); + } + + private static String asJsonString(final Object obj) { + try { + return new ObjectMapper().writeValueAsString(obj); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private static String getResourceContent(String resourcePath) throws IOException { + File resource = new ClassPathResource(resourcePath).getFile(); + return new String(Files.readAllBytes(resource.toPath())).trim(); + } +} diff --git a/certificate-authority/src/test/resources/banner.txt b/certificate-authority/src/test/resources/banner.txt new file mode 100644 index 000000000..e69de29bb diff --git a/certificate-authority/src/test/resources/certificates/notvalid.pem b/certificate-authority/src/test/resources/certificates/notvalid.pem new file mode 100644 index 000000000..a70c46837 --- /dev/null +++ b/certificate-authority/src/test/resources/certificates/notvalid.pem @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDMzCCAhugAwIBAgIEXNlw3zANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxh +cnJvd2hlYWQuZXUwHhcNMTkwNTEzMTMyNzU5WhcNMjkwNTEzMTMyNzU5WjAoMSYw +JAYDVQQDDB10ZXN0Y2xvdWQxLmFpdGlhLmFycm93aGVhZC5ldTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBANTIWrd0mcvxx6LfPG6RvviN5VY1n9uphoYm +CoRA47scc0duc6kIWsIydEsKD9xEd2WdClbQXVazLSF+OWGocxBuyPaAjgu4DdVY +pJLgAaeSzbcjqS+A6bB3B6i8A9RxCWwtDJ5EJsUuIOa9yqcfkmdXVOHpNlwycPeH +FEOIUdUcd+RAL0Fw4h39a3HmTDf4nb2Px/3CWvZk89woxDXURJfyDl2fJyB3kLbp +4HWBht9YZNw2ZuIT1fO5rfm2XGEaPiUseI4KEwDyhW36HWOxv3oP9lMWjCaeWFg1 +A4q6sbjm+fsEsZJavgPWANINCTxKyy/IclwmxKimS6aDBHHyW6UCAwEAAaN2MHQw +DwYDVR0TBAgwBgEB/wIBAjBCBgNVHSMEOzA5gBSaipkeMUwesuYttprtxx4xyt07 +/qEbpBkwFzEVMBMGA1UEAwwMYXJyb3doZWFkLmV1ggRc1T6tMB0GA1UdDgQWBBT0 +jA9ICBgevPSr86oEvVJ8uDamJTANBgkqhkiG9w0BAQsFAAOCAQEAiy1OVJulFL2V +HOYlERD2MJCgIaVKoN6GGxGXQ7mBAjGE+am+dKvbGZ9l5ADRKxKgd1T0hklfTZJU +j7CHBp1JJ7cj7OkFyountQcdTJ3WVLDMxfRRictRwuEUaKMry4nmcU2WpDTJ+DSV +H6qW3VlXxJKnGe1M3u14wUx5k0iXr4S2oYkq/WZ9TUkLWKmzVPDlU3x6iSsyZj/5 +1a5o2qNceezzpGhcvoiHwQ0MFm9OLDYrh61Zb4M7jhn2AocHV4f3Y0P0IfdLlXq5 +MIgOK1ds2BekemekJ3VnW/TDj8fY6sxWl8aWFYJ1RhmVWTODiN9xu9XPyzAO5ryk +zG4AOQa5rQ== +-----END CERTIFICATE----- diff --git a/certificate-authority/src/test/resources/certificates/valid.csr b/certificate-authority/src/test/resources/certificates/valid.csr new file mode 100644 index 000000000..d1d8fc393 --- /dev/null +++ b/certificate-authority/src/test/resources/certificates/valid.csr @@ -0,0 +1 @@ +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CyAn5TpJNzVjL diff --git a/certificate-authority/src/test/resources/certificates/valid.pem b/certificate-authority/src/test/resources/certificates/valid.pem new file mode 100644 index 000000000..56eae293d --- /dev/null +++ b/certificate-authority/src/test/resources/certificates/valid.pem @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDLzCCAhegAwIBAgIEXPYrATANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB10 +ZXN0Y2xvdWQyLmFpdGlhLmFycm93aGVhZC5ldTAeFw0xOTA2MDQwODI1MzdaFw0y +MDA2MDMwODI1MzdaMC4xLDAqBgNVBAMMI3N5c29wLnRlc3RjbG91ZDIuYWl0aWEu +YXJyb3doZWFkLmV1MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoCoC +WTjB+UIi8WC8+mynAwDpC74ddxCFRt1ugnTSaW2HGJY57mZRmft/APhy7C+HyXyz +j77K6TCkr9jXxAykrkGhybdJ3ITNulolZImH2Vz8WHbmcvcKotdOvVexNou72LKi +RMrboIxIRJPtTta7RbhmVyIrTVElAVDWFjZHP7K98AhoGa3ADp0xbh0qK1BpuCnP +Km64DbY52zwr58mSaeyL7MgE+dWwWHx9r4X/WI7/2qQIio8DTvx36PHGKurtwpxa +V0o+gQ+Q1YcD1mfSHp3xtYQAnZXRLIjaDd7LGWMG7j3HbqukkjThyKrUCKfrKXQF +ItBUJ58PJJq8sTxoLwIDAQABo1swWTAPBgNVHREECDAGhwR/AAABMCcGA1UdIwQg +MB6AFAQwTQgjkz3eZj0WWqfRyV4jppdPoQCCBFzZYhkwHQYDVR0OBBYEFAVG6MVZ +FFyHQXW6qlQWA4EfXWSIMA0GCSqGSIb3DQEBCwUAA4IBAQBUEExzkf2bH4fF/tyP +r7DxO94aqQOySGJq/25DzfZQOpuK5Ud3MPpXSlxYw+MB5rRDJu0NzGUX+ha4mG3T +dXxd3X2QaDFR0SYUD4J0hTtmYp9TzgCXnU+J7t6sku/LYFJrCl5m4o124ShZXBgR +Dj/gDVd4C6InTPhpIPHaD6D97wKyObbC3V1dGiVs5Z5/+wUJdUFUmnfAb1rbX0nV +0TTKluWTtRT4cjBeIFs7MZiThMx8bgSE4mZIC1ry4PikjAap/oEIQVxbBTbl+5q8 +xhPbPn+JhZwQp39a1oPMEQog0wQhtKvZrYx//H1o3mzRo1ZFzL+R/LCKKElMPMXx +UHKC +-----END CERTIFICATE----- diff --git a/certificate-authority/src/test/resources/log4j2.xml b/certificate-authority/src/test/resources/log4j2.xml new file mode 100644 index 000000000..0b21f3cce --- /dev/null +++ b/certificate-authority/src/test/resources/log4j2.xml @@ -0,0 +1,49 @@ + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex + + OFF + DEBUG + + + + + + + + ${LOG_PATTERN} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 8049b8efd51e4aa9f039badb11ebbf9b37e72333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Wed, 26 Feb 2020 14:25:29 +0100 Subject: [PATCH 249/301] Add configuration options to CA --- .../certificate_authority/CAProperties.java | 24 +++++++++++++++++++ .../CertificateAuthorityService.java | 10 ++++++-- .../eu/arrowhead/common/CommonConstants.java | 7 +++++- .../java/eu/arrowhead/common/Defaults.java | 9 ++++--- 4 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CAProperties.java diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CAProperties.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CAProperties.java new file mode 100644 index 000000000..a466f1fe3 --- /dev/null +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CAProperties.java @@ -0,0 +1,24 @@ +package eu.arrowhead.core.certificate_authority; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import eu.arrowhead.common.CommonConstants; + +@Component +public class CAProperties { + + @Value(CommonConstants.$CA_CERT_VALIDITY_NEG_OFFSET_MILLIS) + private long certValidityNegativeOffsetMillis; + + @Value(CommonConstants.$CA_CERT_VALIDITY_POS_OFFSET_MILLIS) + private long certValidityPositiveOffsetMillis; + + public long getCertValidityNegativeOffsetMillis() { + return certValidityNegativeOffsetMillis; + } + + public long getCertValidityPositiveOffsetMillis() { + return certValidityPositiveOffsetMillis; + } +} diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java index 1ff0e8b78..5478381c3 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java @@ -22,6 +22,7 @@ import java.security.cert.CertificateEncodingException; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; +import java.time.Duration; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; @@ -35,6 +36,9 @@ public class CertificateAuthorityService { @Autowired private SSLProperties sslProperties; + @Autowired + private CAProperties caProperties; + private SecureRandom random; private KeyStore keyStore; @@ -99,8 +103,10 @@ private List buildEncodedCertificateChain(X509Certificate clientCertific private X509Certificate buildCertificate(JcaPKCS10CertificationRequest csr, PrivateKey cloudPrivateKey, X509Certificate cloudCertificate) { final ZonedDateTime now = LocalDateTime.now().atZone(ZoneId.systemDefault()); - final Date validFrom = Date.from(now.minusSeconds(5).toInstant()); - final Date validUntil = Date.from(now.plusYears(1).toInstant()); + final Date validFrom = Date.from( + now.minus(Duration.ofMillis(caProperties.getCertValidityPositiveOffsetMillis())).toInstant()); + final Date validUntil = Date.from( + now.plus(Duration.ofMillis(caProperties.getCertValidityPositiveOffsetMillis())).toInstant()); return CertificateAuthorityUtils.buildCertificate(csr, cloudPrivateKey, cloudCertificate, validFrom, validUntil, random); diff --git a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java index 457f71c82..d80a91573 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java @@ -155,6 +155,11 @@ public class CommonConstants { public static final String DISABLE_HOSTNAME_VERIFIER = "disable.hostname.verifier"; public static final String $DISABLE_HOSTNAME_VERIFIER_WD = "${" + DISABLE_HOSTNAME_VERIFIER + ":" + Defaults.DEFAULT_DISABLE_HOSTNAME_VERIFIER + "}"; + public static final String CA_CERT_VALIDITY_NEG_OFFSET_MILLIS = "ca.validity.negative-offest-millis"; + public static final String $CA_CERT_VALIDITY_NEG_OFFSET_MILLIS = "${" + CA_CERT_VALIDITY_NEG_OFFSET_MILLIS + ":" + Defaults.DEFAULT_CA_CERT_VALIDITY_NEG_OFFSET_MILLIS + "}"; + public static final String CA_CERT_VALIDITY_POS_OFFSET_MILLIS = "ca.validity.positive-offest-millis"; + public static final String $CA_CERT_VALIDITY_POS_OFFSET_MILLIS = "${" + CA_CERT_VALIDITY_POS_OFFSET_MILLIS + ":" + Defaults.DEFAULT_CA_CERT_VALIDITY_POS_OFFSET_MILLIS + "}"; + public static final String JWT_CLAIM_CONSUMER_ID = "cid"; public static final String JWT_CLAIM_SERVICE_ID = "sid"; public static final String JWT_CLAIM_INTERFACE_ID = "iid"; @@ -202,4 +207,4 @@ public class CommonConstants { private CommonConstants() { throw new UnsupportedOperationException(); } -} \ No newline at end of file +} diff --git a/core-common/src/main/java/eu/arrowhead/common/Defaults.java b/core-common/src/main/java/eu/arrowhead/common/Defaults.java index e5db9ed31..20aa16ee1 100644 --- a/core-common/src/main/java/eu/arrowhead/common/Defaults.java +++ b/core-common/src/main/java/eu/arrowhead/common/Defaults.java @@ -19,7 +19,7 @@ public class Defaults { public static final int DEFAULT_GATEWAY_PORT = 8453; public static final int DEFAULT_EVENT_HANDLER_PORT = 8455; public static final int DEFAULT_CHOREOGRAPHER_PORT = 8457; - public static final int DEFAULT_CERTIFICATE_AUTHORITY_PORT = 8459; + public static final int DEFAULT_CERTIFICATE_AUTHORITY_PORT = 8448; // HTTP client defaults public static final int DEFAULT_CONNECTION_TIMEOUT = 30000; @@ -29,9 +29,12 @@ public class Defaults { // CORS defaults public static final long CORS_MAX_AGE = 600; public static final String CORS_ALLOW_CREDENTIALS = "true"; - + + // CA defaults + public static final long DEFAULT_CA_CERT_VALIDITY_NEG_OFFSET_MILLIS = 5000; + public static final long DEFAULT_CA_CERT_VALIDITY_POS_OFFSET_MILLIS = 1000 * 3600 * 24 * 365; //------------------------------------------------------------------------------------------------- private Defaults() { throw new UnsupportedOperationException(); } -} \ No newline at end of file +} From 7533efe090add13a411d7744619f643160c36d27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Wed, 26 Feb 2020 15:03:13 +0100 Subject: [PATCH 250/301] Disable logging in CA tests --- certificate-authority/src/test/resources/log4j2.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/certificate-authority/src/test/resources/log4j2.xml b/certificate-authority/src/test/resources/log4j2.xml index 0b21f3cce..931cbfebb 100644 --- a/certificate-authority/src/test/resources/log4j2.xml +++ b/certificate-authority/src/test/resources/log4j2.xml @@ -5,7 +5,7 @@ %d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex OFF - DEBUG + OFF From 153d03614cbe8615011a3a492cf93df3c4ae7fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Wed, 26 Feb 2020 15:35:43 +0100 Subject: [PATCH 251/301] Add CA to the CoreSystem's list --- .../src/main/java/eu/arrowhead/common/CommonConstants.java | 2 ++ .../src/main/java/eu/arrowhead/common/core/CoreSystem.java | 4 ++-- .../java/eu/arrowhead/common/core/CoreSystemService.java | 7 +++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java index d80a91573..f64ace8cc 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java @@ -42,6 +42,8 @@ public class CommonConstants { public static final String CORE_SERVICE_EVENT_HANDLER_SUBSCRIBE = "event-subscribe"; public static final String CORE_SERVICE_EVENT_HANDLER_UNSUBSCRIBE = "event-unsubscribe"; public static final String CORE_SERVICE_EVENT_HANDLER_PUBLISH_AUTH_UPDATE = "event-publish-auth-update"; + + public static final String CORE_SERVICE_CERTIFICATE_AUTHORITY_SIGN = "ca-sign"; public static final String COMMON_FIELD_NAME_ID = "id"; diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java index 4e39afa2a..5c9e053c2 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java @@ -23,7 +23,7 @@ public enum CoreSystem { , CoreSystemService.EVENT_UNSUBSCRIBE_SERVICE, CoreSystemService.EVENT_PUBLISH_AUTH_UPDATE_SERVICE)), GATEWAY(Defaults.DEFAULT_GATEWAY_PORT, List.of(CoreSystemService.GATEWAY_PUBLIC_KEY_SERVICE, CoreSystemService.GATEWAY_PROVIDER_SERVICE,CoreSystemService.GATEWAY_CONSUMER_SERVICE)), CHOREOGRAPHER(Defaults.DEFAULT_CHOREOGRAPHER_PORT, List.of()), // TODO: add services - CERTIFICATE_AUTHORITY(Defaults.DEFAULT_CERTIFICATE_AUTHORITY_PORT, List.of()); // TODO: add services + CERTIFICATE_AUTHORITY(Defaults.DEFAULT_CERTIFICATE_AUTHORITY_PORT, List.of(CoreSystemService.CERTIFICATE_AUTHORITY_SIGN_SERVICE)); //================================================================================================= // members @@ -47,4 +47,4 @@ private CoreSystem(final int defaultPort, final List services this.services = services != null ? Collections.unmodifiableList(services) : List.of(); this.defaultPort = defaultPort; } -} \ No newline at end of file +} diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java index 39f6db738..dcd649ae5 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java @@ -33,7 +33,10 @@ public enum CoreSystemService { EVENT_PUBLISH_SERVICE(CommonConstants.CORE_SERVICE_EVENT_HANDLER_PUBLISH, CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_PUBLISH), EVENT_SUBSCRIBE_SERVICE(CommonConstants.CORE_SERVICE_EVENT_HANDLER_SUBSCRIBE, CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_SUBSCRIBE), EVENT_UNSUBSCRIBE_SERVICE(CommonConstants.CORE_SERVICE_EVENT_HANDLER_UNSUBSCRIBE, CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_UNSUBSCRIBE), - EVENT_PUBLISH_AUTH_UPDATE_SERVICE(CommonConstants.CORE_SERVICE_EVENT_HANDLER_PUBLISH_AUTH_UPDATE, CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE); + EVENT_PUBLISH_AUTH_UPDATE_SERVICE(CommonConstants.CORE_SERVICE_EVENT_HANDLER_PUBLISH_AUTH_UPDATE, CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE), + + CERTIFICATE_AUTHORITY_SIGN_SERVICE(CommonConstants.CORE_SERVICE_CERTIFICATE_AUTHORITY_SIGN, CommonConstants.CERTIFICATE_AUTHRORITY_URI + CommonConstants.OP_CA_SIGN_CERTIFICATE_URI); + //TODO: additional services @@ -61,4 +64,4 @@ private CoreSystemService(final String serviceDefinition, final String serviceUr this.serviceDefinition = serviceDefinition; this.serviceUri = serviceUri; } -} \ No newline at end of file +} From 01879d7dc73c570f7bf8558b8540de6424fde174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Thu, 27 Feb 2020 10:34:37 +0100 Subject: [PATCH 252/301] Add missing CA project files to version control --- certificate-authority/.classpath | 55 ++++++++++++++++++++++++++++++++ certificate-authority/.project | 23 +++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 certificate-authority/.classpath create mode 100644 certificate-authority/.project diff --git a/certificate-authority/.classpath b/certificate-authority/.classpath new file mode 100644 index 000000000..6e0021feb --- /dev/null +++ b/certificate-authority/.classpath @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/certificate-authority/.project b/certificate-authority/.project new file mode 100644 index 000000000..9b4a8b591 --- /dev/null +++ b/certificate-authority/.project @@ -0,0 +1,23 @@ + + + arrowhead-certificate-authority + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + From cd799433c65dce541d1232c903aea9924e4b2f3e Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Sun, 1 Mar 2020 22:33:19 +0100 Subject: [PATCH 253/301] added controller tests --- .../dto/shared/DeviceRegistryRequestDTO.java | 13 +- .../dto/shared/DeviceRegistryResponseDTO.java | 38 +- .../dto/shared/SystemRegistryRequestDTO.java | 14 +- .../dto/shared/SystemRegistryResponseDTO.java | 37 +- .../common/dto/shared/SystemRequestDTO.java | 13 +- .../src/main/resources/application.properties | 4 +- .../certificates/device_registry.p12 | Bin 0 -> 5369 bytes ...eRegistryControllerDeviceRegistryTest.java | 369 ++++++++++++- .../DeviceRegistryControllerDeviceTest.java | 35 +- .../DeviceRegistryTestContext.java | 8 + .../SystemRegistryController.java | 2 +- .../service/SystemRegistryDBService.java | 76 +-- .../service/DatabaseTestContext.java} | 6 +- .../StandaloneModeInSystemRegistryTests.java | 9 + ...mRegistryControllerSystemRegistryTest.java | 434 +++++++++++++++ .../SystemRegistryControllerSystemTest.java | 496 ++++++++++++++++++ .../SystemRegistryTestContext.java | 50 ++ 17 files changed, 1525 insertions(+), 79 deletions(-) rename systemregistry/src/test/java/eu/arrowhead/{TestConfiguration.java => common/database/service/DatabaseTestContext.java} (81%) create mode 100644 systemregistry/src/test/java/eu/arrowhead/core/systemregistry/StandaloneModeInSystemRegistryTests.java create mode 100644 systemregistry/src/test/java/eu/arrowhead/core/systemregistry/SystemRegistryControllerSystemRegistryTest.java create mode 100644 systemregistry/src/test/java/eu/arrowhead/core/systemregistry/SystemRegistryControllerSystemTest.java create mode 100644 systemregistry/src/test/java/eu/arrowhead/core/systemregistry/SystemRegistryTestContext.java diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryRequestDTO.java index 800f90a97..cf8e7514b 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryRequestDTO.java @@ -21,7 +21,18 @@ public class DeviceRegistryRequestDTO implements Serializable { //================================================================================================= // methods - + + public DeviceRegistryRequestDTO() { + } + + //------------------------------------------------------------------------------------------------- + public DeviceRegistryRequestDTO(final DeviceRequestDTO device, final String endOfValidity, final Map metadata, final Integer version) { + this.device = device; + this.endOfValidity = endOfValidity; + this.metadata = metadata; + this.version = version; + } + //------------------------------------------------------------------------------------------------- public DeviceRequestDTO getDevice() { return device; } public String getEndOfValidity() { return endOfValidity; } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryResponseDTO.java index 8bde3da52..3c25edfa3 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryResponseDTO.java @@ -5,6 +5,7 @@ import java.io.Serializable; import java.util.Map; +import java.util.Objects; @JsonInclude(Include.NON_NULL) public class DeviceRegistryResponseDTO implements Serializable { @@ -24,7 +25,23 @@ public class DeviceRegistryResponseDTO implements Serializable { //================================================================================================= // methods - + + + public DeviceRegistryResponseDTO() { + } + + //------------------------------------------------------------------------------------------------- + public DeviceRegistryResponseDTO(final long id, final DeviceResponseDTO device, final String endOfValidity, + final Map metadata, final int version, final String createdAt, final String updatedAt) { + this.id = id; + this.device = device; + this.endOfValidity = endOfValidity; + this.metadata = metadata; + this.version = version; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + //------------------------------------------------------------------------------------------------- public long getId() { return id; } public DeviceResponseDTO getDevice() { return device; } @@ -42,4 +59,23 @@ public class DeviceRegistryResponseDTO implements Serializable { public void setVersion(final int version) { this.version = version; } public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } + + @Override + public boolean equals(final Object o) { + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } + final DeviceRegistryResponseDTO that = (DeviceRegistryResponseDTO) o; + return id == that.id && + version == that.version && + device.equals(that.device) && + Objects.equals(endOfValidity, that.endOfValidity) && + Objects.equals(metadata, that.metadata) && + createdAt.equals(that.createdAt) && + updatedAt.equals(that.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, device, endOfValidity, metadata, version, createdAt, updatedAt); + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java index e9d00893b..6150565bc 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java @@ -22,7 +22,19 @@ public class SystemRegistryRequestDTO implements Serializable { //================================================================================================= // methods - + + public SystemRegistryRequestDTO() { + } + + public SystemRegistryRequestDTO(final SystemRequestDTO system, final DeviceRequestDTO provider, final String endOfValidity, + final Map metadata, final Integer version) { + this.system = system; + this.provider = provider; + this.endOfValidity = endOfValidity; + this.metadata = metadata; + this.version = version; + } + //------------------------------------------------------------------------------------------------- public SystemRequestDTO getSystem() { return system; } public DeviceRequestDTO getProvider() { return provider; } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryResponseDTO.java index d853d0369..ce02c55ad 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryResponseDTO.java @@ -6,6 +6,7 @@ import java.io.Serializable; import java.util.List; import java.util.Map; +import java.util.Objects; @JsonInclude(Include.NON_NULL) public class SystemRegistryResponseDTO implements Serializable { @@ -26,7 +27,21 @@ public class SystemRegistryResponseDTO implements Serializable { //================================================================================================= // methods - + public SystemRegistryResponseDTO() { + } + + public SystemRegistryResponseDTO(final long id, final SystemResponseDTO system, final DeviceResponseDTO provider, final String endOfValidity, + final Map metadata, final int version, final String createdAt, final String updatedAt) { + this.id = id; + this.system = system; + this.provider = provider; + this.endOfValidity = endOfValidity; + this.metadata = metadata; + this.version = version; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + //------------------------------------------------------------------------------------------------- public long getId() { return id; } public SystemResponseDTO getSystem() { return system; } @@ -46,4 +61,24 @@ public class SystemRegistryResponseDTO implements Serializable { public void setVersion(final int version) { this.version = version; } public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } + + @Override + public boolean equals(final Object o) { + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } + final SystemRegistryResponseDTO that = (SystemRegistryResponseDTO) o; + return id == that.id && + version == that.version && + system.equals(that.system) && + provider.equals(that.provider) && + endOfValidity.equals(that.endOfValidity) && + Objects.equals(metadata, that.metadata) && + createdAt.equals(that.createdAt) && + updatedAt.equals(that.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, system, provider, endOfValidity, metadata, version, createdAt, updatedAt); + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRequestDTO.java index 75b9e99b2..03b2bbbd3 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRequestDTO.java @@ -17,7 +17,18 @@ public class SystemRequestDTO implements Serializable { //================================================================================================= // methods - + + + public SystemRequestDTO() { + } + + public SystemRequestDTO(final String systemName, final String address, final Integer port, final String authenticationInfo) { + this.systemName = systemName; + this.address = address; + this.port = port; + this.authenticationInfo = authenticationInfo; + } + //------------------------------------------------------------------------------------------------- public String getSystemName() { return systemName; } public String getAddress() { return address; } diff --git a/deviceregistry/src/main/resources/application.properties b/deviceregistry/src/main/resources/application.properties index a3896236e..74a7de960 100644 --- a/deviceregistry/src/main/resources/application.properties +++ b/deviceregistry/src/main/resources/application.properties @@ -40,13 +40,13 @@ log_all_request_and_response=false # Set this to false to disable https mode server.ssl.enabled=true -server.ssl.key-store-type=PKCS12 +server.ssl.key-store-type=JKS server.ssl.key-store=classpath:certificates/device_registry.p12 server.ssl.key-store-password=123456 server.ssl.key-alias=device_registry server.ssl.key-password=123456 server.ssl.client-auth=need -server.ssl.trust-store-type=PKCS12 +server.ssl.trust-store-type=JKS server.ssl.trust-store=classpath:certificates/truststore.p12 server.ssl.trust-store-password=123456 diff --git a/deviceregistry/src/main/resources/certificates/device_registry.p12 b/deviceregistry/src/main/resources/certificates/device_registry.p12 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..dcd55a15036630c3ee3511938989360eb13d8803 100644 GIT binary patch literal 5369 zcmY*cWmFW5wjH{p8-`(q{OB1P=@L-7K}tf9lFmV4=nz3#LIzY|=n^DHVrZn17(fJR z>8|U0>%Du|{c&pVea_Fl)`24EPH}PYpa{AuLK6NM&6sm?93q@T1lmaLz#Sh!;PMxC{2O+JWdFDIfD{L}5P^RUMc|)9`3On>AO3rs6`!vCOKr!b|H1L> z5u++O#7~wCHxq%22k6$vN8tCnG*L+5ycDd%hU3-E;htrbk`CK5YGwq?uTh=IZR#Nz8jS)+U0TOSz93NlLz3Tv!{Ldfxeimku?K25v zt3s^v-Nr^5x_2e3sAN!0M2sN+vWrCH#;nhi(M))VVpQ{2N!-$$A&f&Y8JeV}vT}h% zIb3+VM8tafpSd}6PQNw(1veYPHV&C#sKjajbR|&;H&wAR%Mw!vXwb(f ztyTACWNF9$wQC0b#oE-kOX_Ax$SA8!xw`PwfZGJ!CzHyj&$u@BCBKDVde5Iz0+F9e zFv{d?Q5_YooS^f$8N`@%&)=XL4XOVK&sL)H!skzvX;H??q*6p`F5GMNx_8~zo_cq6;9H4aaQ+uoQ_b}W z$yV9em@bTqW8ye^S)}V+ixSt$G9q3fVhfR6R^-5NvkiLXzn*ov!CE9??TA{sb5uKk z2=x5KMrZZM4dY2pN=>-gJ~Iou-Nfpw9skT?>1a|N9jHV3Wls$6ydrRU4XXNfI1=8K zHSa{Bo^jHtZZi?xhOQT1O4)gLPruddzA*8&S0S6H83NqnlC^udLpBUF6Z=vf1@6Y0 zxUY;AU;a7#)h@w~_Ky+ij;=X&ZABraj>NS_*t;i3t8FEE?sBHyS`v7K^5&+b`(JiC zW`2)df>^sxw+sfIxTKvnQIr|f6qP(OE(sZK2>Gd+lb}koWVx*G(AbmR9q7R179A zEhZ)(8pcF=$EAl*G6{=et z23V8{{$I}xM^K<=8L|R0#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srlBS7!#Dm)qe@cb^(+szy4)bxP95x)yDS(l z!W+}kP&Nkr zb2WU$@?0%5Xz;WqcQuAzujqXa1*@$?myYfo^eXv`Pphjb#^L3O z#XU@LDOvMg%kulUrRc!>J`#j?4AX(v>lPlC_A&YQL8FxBA#55R46)sKWCTocSMI08 zhkD37ji*_^T8%97`Syu&@wrj9b?dcOQ8g7Dd;+rEPe)0m&NSxNCjUWy5v6T*;xwWa z@}IHWnxUrNb3T7}_Ecg^k|lqkpG@~*fIt%PIOcp7y{~v4CiVCA!F^$pQiF3GVTRI)XuQ{TcNAjh$D57zA{VDt*h4Jar%posaaUY%SGNN33>4U84e&XWc H#1#Gu3{yTC literal 0 HcmV?d00001 diff --git a/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryControllerDeviceRegistryTest.java b/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryControllerDeviceRegistryTest.java index 9f1a23a1f..da4a5e69d 100644 --- a/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryControllerDeviceRegistryTest.java +++ b/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryControllerDeviceRegistryTest.java @@ -1,20 +1,13 @@ package eu.arrowhead.core.deviceregistry; -import static org.junit.Assert.assertEquals; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.ArgumentMatchers.anyLong; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - import com.fasterxml.jackson.databind.ObjectMapper; import eu.arrowhead.common.database.service.CommonDBService; +import eu.arrowhead.common.dto.internal.DeviceRegistryListResponseDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.DeviceRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceResponseDTO; +import eu.arrowhead.common.exception.InvalidParameterException; import eu.arrowhead.core.deviceregistry.database.service.DeviceRegistryDBService; import org.junit.Before; import org.junit.Test; @@ -30,8 +23,22 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; +import java.io.IOException; +import java.util.List; +import java.util.Map; + import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.reset; +import static org.mockito.Mockito.when; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @RunWith(SpringRunner.class) @@ -40,6 +47,31 @@ public class DeviceRegistryControllerDeviceRegistryTest { + //================================================================================================= + // test data + private final static String DATE_STRING = "2020-01-01T00:00:00"; + + private final static long VALID_DEVICE_ID = 1L; + + private final static long VALID_DEVICE_REGISTRY_ID = 1L; + private final static long UNKNOWN_DEVICE_REGISTRY_ID = 2L; + private final static long INVALID_DEVICE_REGISTRY_ID = -1L; + + private final static String VALID_DEVICE_NAME = "device"; + private final static String UNKNOWN_DEVICE_NAME = "unknown"; + private final static String INVALID_DEVICE_NAME = ""; + + private static final DeviceRequestDTO VALID_DEVICE_REQUEST = + new DeviceRequestDTO("device", "address", "macAddress", "authenticationInfo"); + private final static DeviceResponseDTO VALID_DEVICE = + new DeviceResponseDTO(VALID_DEVICE_ID, VALID_DEVICE_NAME, "address", "macAddress", + "authenticationInfo", DATE_STRING, DATE_STRING); + + private final static DeviceRegistryResponseDTO VALID_DEVICE_REGISTRY = + new DeviceRegistryResponseDTO(VALID_DEVICE_REGISTRY_ID, VALID_DEVICE, DATE_STRING, + null, 1, DATE_STRING, DATE_STRING); + + //================================================================================================= // members @@ -54,56 +86,341 @@ public class DeviceRegistryControllerDeviceRegistryTest { @MockBean(name = "mockDeviceRegistryDBService") private DeviceRegistryDBService deviceRegistryDBService; - @MockBean(name = "mockCommonDBService") - private CommonDBService commonDBService; - - //================================================================================================= // methods //------------------------------------------------------------------------------------------------- @Before public void setup() { + reset(deviceRegistryDBService); this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); } @Test - public void getDeviceRegistryEntries() { + public void getDeviceRegistryEntriesWithoutParameter() throws Exception { + final DeviceRegistryListResponseDTO deviceListResponseDTO = new DeviceRegistryListResponseDTO(List.of(VALID_DEVICE_REGISTRY), 1); + when(deviceRegistryDBService.getDeviceRegistryEntries(any(), any())).thenReturn(deviceListResponseDTO); + + final MvcResult response = this.mockMvc.perform(get("/deviceregistry/mgmt") + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final DeviceRegistryListResponseDTO responseBody = readResponse(response, DeviceRegistryListResponseDTO.class); + assertEquals(1, responseBody.getCount()); + } + + @Test + public void getDeviceRegistryEntriesWithPageAndSizeParameter() throws Exception { + final DeviceRegistryListResponseDTO deviceListResponseDTO = new DeviceRegistryListResponseDTO(List.of(VALID_DEVICE_REGISTRY), 1); + when(deviceRegistryDBService.getDeviceRegistryEntries(any(), any())).thenReturn(deviceListResponseDTO); + + final MvcResult response = this.mockMvc.perform(get("/deviceregistry/mgmt") + .param("page", "0") + .param("item_per_page", String.valueOf(5)) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final DeviceRegistryListResponseDTO responseBody = readResponse(response, DeviceRegistryListResponseDTO.class); + assertEquals(1, responseBody.getCount()); + } + + @Test + public void getDeviceRegistryEntryById() throws Exception { + when(deviceRegistryDBService.getDeviceRegistryById(VALID_DEVICE_REGISTRY_ID)).thenReturn(VALID_DEVICE_REGISTRY); + final MvcResult response = this.mockMvc.perform(get("/deviceregistry/mgmt/" + VALID_DEVICE_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final DeviceRegistryResponseDTO responseDTO = readResponse(response, DeviceRegistryResponseDTO.class); + assertEquals(VALID_DEVICE_REGISTRY, responseDTO); + } + + @Test + public void getDeviceRegistryEntryByIdUnknownId() throws Exception { + when(deviceRegistryDBService.getDeviceRegistryById(UNKNOWN_DEVICE_REGISTRY_ID)).thenThrow( + new InvalidParameterException("Device Registry with id " + UNKNOWN_DEVICE_REGISTRY_ID + " not found.")); + + this.mockMvc.perform(get("/deviceregistry/mgmt/" + UNKNOWN_DEVICE_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void getDeviceRegistryEntryByIdNegativeId() throws Exception { + this.mockMvc.perform(get("/deviceregistry/mgmt/" + INVALID_DEVICE_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void getDeviceRegistryEntriesByDeviceName() throws Exception { + final DeviceRegistryListResponseDTO deviceListResponseDTO = new DeviceRegistryListResponseDTO(List.of(VALID_DEVICE_REGISTRY), 1); + when(deviceRegistryDBService.getDeviceRegistryEntriesByDeviceName(eq(VALID_DEVICE_NAME), any(), any())) + .thenReturn(deviceListResponseDTO); + + final MvcResult response = this.mockMvc.perform(get("/deviceregistry/mgmt/devicename/" + VALID_DEVICE_NAME) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final DeviceRegistryListResponseDTO responseBody = readResponse(response, DeviceRegistryListResponseDTO.class); + assertEquals(1, responseBody.getCount()); + } + + @Test + public void getDeviceRegistryEntriesByUnknownDeviceName() throws Exception { + final DeviceRegistryListResponseDTO deviceListResponseDTO = new DeviceRegistryListResponseDTO(List.of(), 0); + when(deviceRegistryDBService.getDeviceRegistryEntriesByDeviceName(eq(UNKNOWN_DEVICE_NAME), any(), any())) + .thenReturn(deviceListResponseDTO); + + final MvcResult response = this.mockMvc.perform(get("/deviceregistry/mgmt/devicename/" + UNKNOWN_DEVICE_NAME) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final DeviceRegistryListResponseDTO responseBody = readResponse(response, DeviceRegistryListResponseDTO.class); + assertEquals(0, responseBody.getCount()); + } + + @Test + public void getDeviceRegistryEntriesByInvalidDeviceName() throws Exception { + this.mockMvc.perform(get("/deviceregistry/mgmt/devicename/" + INVALID_DEVICE_NAME) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void removeDeviceRegistryEntryByInvalidId() throws Exception { + this.mockMvc.perform(delete("/deviceregistry/mgmt/" + INVALID_DEVICE_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void removeDeviceRegistryEntryByUnknownId() throws Exception { + doThrow(new InvalidParameterException("No device registry with id : " + UNKNOWN_DEVICE_REGISTRY_ID)) + .when(deviceRegistryDBService) + .removeDeviceRegistryEntryById(eq(UNKNOWN_DEVICE_REGISTRY_ID)); + + this.mockMvc.perform(delete("/deviceregistry/mgmt/" + UNKNOWN_DEVICE_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void removeDeviceRegistryEntryById() throws Exception { + + this.mockMvc.perform(delete("/deviceregistry/mgmt/" + VALID_DEVICE_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + } + + @Test + public void updateDeviceRegistryRequest() throws Exception { + final DeviceRegistryRequestDTO dto = new DeviceRegistryRequestDTO(VALID_DEVICE_REQUEST,null, null, 1); + when(deviceRegistryDBService.updateDeviceRegistryById(eq(VALID_DEVICE_REGISTRY_ID), any())).thenReturn(VALID_DEVICE_REGISTRY); + + final MvcResult result = this.mockMvc.perform(put("/deviceregistry/mgmt/" + VALID_DEVICE_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isOk()) + .andReturn(); + assertEquals(VALID_DEVICE_REGISTRY, objectMapper.readValue(result.getResponse().getContentAsString(), DeviceRegistryResponseDTO.class)); } @Test - public void getDeviceRegistryEntryById() { + public void updateDeviceRegistryUnknownId() throws Exception { + final DeviceRegistryRequestDTO dto = new DeviceRegistryRequestDTO(VALID_DEVICE_REQUEST,null, null, 1); + when(deviceRegistryDBService.updateDeviceRegistryById(eq(UNKNOWN_DEVICE_REGISTRY_ID), any())) + .thenThrow(new InvalidParameterException("No device registry with id : " + UNKNOWN_DEVICE_REGISTRY_ID)); + + this.mockMvc.perform(put("/deviceregistry/mgmt/" + UNKNOWN_DEVICE_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); } @Test - public void getDeviceRegistryEntriesByDeviceName() { + public void updateDeviceRegistryInvalidId() throws Exception { + final DeviceRegistryRequestDTO dto = new DeviceRegistryRequestDTO(VALID_DEVICE_REQUEST,null, null, 1); + this.mockMvc.perform(put("/deviceregistry/mgmt/devices/" + INVALID_DEVICE_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); } @Test - public void removeDeviceRegistryEntryById() { + public void updateDeviceRegistryNullPayload() throws Exception { + when(deviceRegistryDBService.updateDeviceRegistryById(eq(VALID_DEVICE_REGISTRY_ID), any())).thenReturn(VALID_DEVICE_REGISTRY); + this.mockMvc.perform(put("/deviceregistry/mgmt/devices/" + VALID_DEVICE_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(null))) + .andExpect(status().isBadRequest()) + .andReturn(); } @Test - public void updateDeviceRegistry() { + public void mergeDeviceWithOneField() throws Exception { + DeviceRegistryRequestDTO dto = null; + when(deviceRegistryDBService.mergeDeviceRegistryById(eq(VALID_DEVICE_REGISTRY_ID), any())).thenReturn(VALID_DEVICE_REGISTRY); + + dto = new DeviceRegistryRequestDTO(); + dto.setDevice(VALID_DEVICE_REQUEST); + this.mockMvc.perform(patch("/deviceregistry/mgmt/" + VALID_DEVICE_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isOk()) + .andReturn(); + + dto = new DeviceRegistryRequestDTO(); + dto.setEndOfValidity(DATE_STRING); + this.mockMvc.perform(patch("/deviceregistry/mgmt/" + VALID_DEVICE_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isOk()) + .andReturn(); + + dto = new DeviceRegistryRequestDTO(); + dto.setMetadata(Map.of()); + this.mockMvc.perform(patch("/deviceregistry/mgmt/" + VALID_DEVICE_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isOk()) + .andReturn(); + + dto = new DeviceRegistryRequestDTO(); + dto.setVersion(2); + this.mockMvc.perform(patch("/deviceregistry/mgmt/" + VALID_DEVICE_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isOk()) + .andReturn(); } @Test - public void mergeDeviceRegistry() { + public void mergeDeviceWithEmpty() throws Exception { + final DeviceRegistryRequestDTO dto = new DeviceRegistryRequestDTO(); + when(deviceRegistryDBService.mergeDeviceRegistryById(eq(VALID_DEVICE_REGISTRY_ID), any())).thenReturn(VALID_DEVICE_REGISTRY); + + this.mockMvc.perform(patch("/deviceregistry/mgmt/" + VALID_DEVICE_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); } @Test - public void queryRegistry() { + public void mergeDeviceUnknownId() throws Exception { + final DeviceRegistryRequestDTO dto = new DeviceRegistryRequestDTO(VALID_DEVICE_REQUEST, DATE_STRING, null, 1); + when(deviceRegistryDBService.mergeDeviceRegistryById(eq(UNKNOWN_DEVICE_REGISTRY_ID), any())) + .thenThrow(new InvalidParameterException("No device with id : " + UNKNOWN_DEVICE_REGISTRY_ID)); + + this.mockMvc.perform(patch("/deviceregistry/mgmt/" + UNKNOWN_DEVICE_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); } @Test - public void queryRegistryByDeviceId() { + public void mergeDeviceInvalidId() throws Exception { + final DeviceRegistryRequestDTO dto = new DeviceRegistryRequestDTO(VALID_DEVICE_REQUEST, DATE_STRING, null, 1); + + this.mockMvc.perform(patch("/deviceregistry/mgmt/" + INVALID_DEVICE_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); } @Test - public void queryRegistryByDeviceDTO() { + public void registerDeviceNullPayload() throws Exception { + when(deviceRegistryDBService.registerDeviceRegistry(any())).thenReturn(VALID_DEVICE_REGISTRY); + + this.mockMvc.perform(post("/deviceregistry/register") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(null))) + .andExpect(status().isBadRequest()) + .andReturn(); } + @Test + public void registerDeviceNullEndOfValidity() throws Exception { + final DeviceRegistryRequestDTO deviceRegistryRequestDTO = + new DeviceRegistryRequestDTO(VALID_DEVICE_REQUEST, null, null, 1); + + when(deviceRegistryDBService.registerDeviceRegistry(any())).thenReturn(VALID_DEVICE_REGISTRY); + + this.mockMvc.perform(post("/deviceregistry/register") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(deviceRegistryRequestDTO))) + .andExpect(status().isCreated()) + .andReturn(); + } + + @Test + public void registerDeviceInvalidEndOfValidity() throws Exception { + final DeviceRegistryRequestDTO deviceRegistryRequestDTO = + new DeviceRegistryRequestDTO(VALID_DEVICE_REQUEST, "not parsable", null, 1); + + when(deviceRegistryDBService.registerDeviceRegistry(any())).thenReturn(VALID_DEVICE_REGISTRY); + + this.mockMvc.perform(post("/deviceregistry/register") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(deviceRegistryRequestDTO))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void unregisterDeviceNullDeviceName() throws Exception { + this.mockMvc.perform(delete("/deviceregistry/unregister") + .param("device_name", "") + .param("mac_address", "macAddress")) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void unregisterDeviceNullMacAddress() throws Exception { + this.mockMvc.perform(delete("/deviceregistry/unregister") + .param("device_name", "device") + .param("mac_address", "")) + .andExpect(status().isBadRequest()) + .andReturn(); + } //================================================================================================= // Tests of device registry + private T readResponse(final MvcResult result, final Class clz) throws IOException { + return objectMapper.readValue(result.getResponse().getContentAsString(), clz); + } } \ No newline at end of file diff --git a/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryControllerDeviceTest.java b/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryControllerDeviceTest.java index 3346b3e27..3873b07e0 100644 --- a/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryControllerDeviceTest.java +++ b/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryControllerDeviceTest.java @@ -6,6 +6,8 @@ import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.reset; import static org.mockito.Mockito.when; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; @@ -24,6 +26,8 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.mockito.stubbing.OngoingStubbing; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.mock.mockito.MockBean; @@ -67,16 +71,13 @@ public class DeviceRegistryControllerDeviceTest { @MockBean(name = "mockDeviceRegistryDBService") private DeviceRegistryDBService deviceRegistryDBService; - @MockBean(name = "mockCommonDBService") - private CommonDBService commonDBService; - - //================================================================================================= // methods //------------------------------------------------------------------------------------------------- @Before public void setup() { + reset(deviceRegistryDBService); this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); } @@ -453,14 +454,34 @@ public void mergeDeviceInvalidId() throws Exception { } @Test - public void removeDevice() { + public void removeDeviceInvalidId() throws Exception { + this.mockMvc.perform(delete("/deviceregistry/mgmt/devices/" + NEGATIVE_DEVICE_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); } @Test - public void registerDevice() { + public void removeDeviceUnknownId() throws Exception { + doThrow(new InvalidParameterException("No device with id : " + UNKNOWN_DEVICE_ID)) + .when(deviceRegistryDBService) + .removeDeviceById(eq(UNKNOWN_DEVICE_ID)); + + this.mockMvc.perform(delete("/deviceregistry/mgmt/devices/" + UNKNOWN_DEVICE_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); } @Test - public void unregisterDevice() { + public void removeDevice() throws Exception { + + this.mockMvc.perform(delete("/deviceregistry/mgmt/devices/" + VALID_DEVICE_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); } } \ No newline at end of file diff --git a/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryTestContext.java b/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryTestContext.java index 16fd0eb5d..671a72988 100644 --- a/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryTestContext.java +++ b/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryTestContext.java @@ -1,6 +1,7 @@ package eu.arrowhead.core.deviceregistry; import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.database.repository.CloudRepository; import eu.arrowhead.common.database.service.CommonDBService; import eu.arrowhead.core.deviceregistry.database.service.DeviceRegistryDBService; import org.mockito.Mockito; @@ -39,4 +40,11 @@ public DeviceRegistryDBService mockDeviceRegistryDBService() { public CommonDBService mockCommonDBService() { return Mockito.mock(CommonDBService.class); } + + //------------------------------------------------------------------------------------------------- + @Bean + @Primary // This bean is primary only in test context + public CloudRepository mockCloudRepository() { + return Mockito.mock(CloudRepository.class); + } } \ No newline at end of file diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java index 6cd20cf47..3a878e0d9 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java @@ -747,7 +747,7 @@ private void checkSystemRequest(final SystemRequestDTO request, final String ori } final int validatedPort = request.getPort(); - if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + if (validatedPort <= CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, origin); } } diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java index eeddbf4b1..6b685f50d 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java @@ -236,8 +236,8 @@ public System mergeSystem(final long systemId, final String systemName, final St if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) { checkConstraintsOfSystemTable(validatedSystemName != null ? validatedSystemName : system.getSystemName(), - validatedAddress != null ? validatedAddress : system.getAddress(), - validatedPort != null ? validatedPort : system.getPort()); + validatedAddress != null ? validatedAddress : system.getAddress(), + validatedPort != null ? validatedPort : system.getPort()); } if (Utilities.notEmpty(validatedSystemName)) { @@ -297,7 +297,7 @@ public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageP try { final Page devices = deviceRepository.findAll(PageRequest.of(pageParams.getValidatedPage(), pageParams.getValidatedSize(), - pageParams.getValidatedDirection(), validatedSortField)); + pageParams.getValidatedDirection(), validatedSortField)); return DTOConverter.convertDeviceEntryListToDeviceListResponseDTO(devices); } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); @@ -372,9 +372,9 @@ public SystemRegistryListResponseDTO getSystemRegistryEntries(final CoreUtilitie try { final PageRequest pageRequest = PageRequest.of(params.getValidatedPage(), - params.getValidatedSize(), - params.getValidatedDirection(), - validatedSortField); + params.getValidatedSize(), + params.getValidatedDirection(), + validatedSortField); final Page systemRegistryPage = systemRegistryRepository.findAll(pageRequest); return DTOConverter.convertSystemRegistryListToSystemRegistryListResponseDTO(systemRegistryPage); } catch (final Exception ex) { @@ -532,7 +532,7 @@ public SystemRegistryListResponseDTO getSystemRegistryEntriesBySystemName(final final List systemList = systemRepository.findBySystemName(systemName); final PageRequest pageRequest = PageRequest.of(pageParameters.getValidatedPage(), pageParameters.getValidatedSize(), - pageParameters.getValidatedDirection(), sortField); + pageParameters.getValidatedDirection(), sortField); final Page systemRegistries = systemRegistryRepository.findAllBySystemIsIn(systemList, pageRequest); return DTOConverter.convertSystemRegistryListToSystemRegistryListResponseDTO(systemRegistries); @@ -576,7 +576,8 @@ public SystemQueryResultDTO queryRegistry(final SystemQueryFormDTO form) { logger.debug("System not found: {}", systemName); return DTOConverter.convertSystemRegistryListToSystemQueryResultDTO(Collections.emptyList()); } - } else { + } + else { throw new InvalidParameterException("System Name must not be null"); } @@ -599,7 +600,8 @@ public SystemQueryResultDTO queryRegistry(final SystemQueryFormDTO form) { // filter on version if (Objects.nonNull(form.getVersionRequirement())) { registryList.removeIf(e -> Objects.equals(form.getVersionRequirement(), e.getVersion())); - } else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(form.getMaxVersionRequirement())) { + } + else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(form.getMaxVersionRequirement())) { final int minVersion = form.getMinVersionRequirement() == null ? 1 : form.getMinVersionRequirement(); final int maxVersion = form.getMaxVersionRequirement() == null ? Integer.MAX_VALUE : form.getMaxVersionRequirement(); @@ -610,15 +612,15 @@ public SystemQueryResultDTO queryRegistry(final SystemQueryFormDTO form) { if (form.getMetadataRequirements() != null && !form.getMetadataRequirements().isEmpty()) { final Map requiredMetadata = normalizeMetadata(form.getMetadataRequirements()); registryList.removeIf(e -> - { - final Map metadata = Utilities.text2Map(e.getMetadata()); - if (Objects.isNull(metadata)) { - // we have requirements but no metadata -> remove - return true; - } - - return !metadata.entrySet().containsAll(requiredMetadata.entrySet()); - }); + { + final Map metadata = Utilities.text2Map(e.getMetadata()); + if (Objects.isNull(metadata)) { + // we have requirements but no metadata -> remove + return true; + } + + return !metadata.entrySet().containsAll(requiredMetadata.entrySet()); + }); } // filter on ping @@ -690,9 +692,11 @@ private boolean checkSystemIfUniqueValidationNeeded(final System system, final S if (validatedSystemName != null && !actualSystemName.equalsIgnoreCase(validatedSystemName)) { return true; - } else if (validatedAddress != null && !actualAddress.equalsIgnoreCase(validatedAddress)) { + } + else if (validatedAddress != null && !actualAddress.equalsIgnoreCase(validatedAddress)) { return true; - } else { + } + else { return validatedPort != null && actualPort != validatedPort; } } @@ -728,11 +732,11 @@ private Map normalizeMetadata(final Map metadata final Map map = new HashMap<>(); metadata.forEach((k, v) -> - { - if (Objects.nonNull(v)) { - map.put(k.trim(), v.trim()); - } - }); + { + if (Objects.nonNull(v)) { + map.put(k.trim(), v.trim()); + } + }); return map; } @@ -780,7 +784,7 @@ private System validateNonNullSystemParameters(final String systemName, final St validateNonNullParameters(systemName, address); - if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + if (port <= CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); } @@ -901,9 +905,9 @@ private SystemRegistry getSystemRegistryEntryById(final long id) { //------------------------------------------------------------------------------------------------- private System findOrCreateSystem(SystemRequestDTO requestSystemDto) { return findOrCreateSystem(requestSystemDto.getSystemName(), - requestSystemDto.getAddress(), - requestSystemDto.getPort(), - requestSystemDto.getAuthenticationInfo()); + requestSystemDto.getAddress(), + requestSystemDto.getPort(), + requestSystemDto.getAuthenticationInfo()); } //------------------------------------------------------------------------------------------------- @@ -923,7 +927,8 @@ private System findOrCreateSystem(final String name, final String address, final provider.setAddress(validatedAddress); provider = systemRepository.saveAndFlush(provider); } - } else { + } + else { provider = createSystem(validatedName, validatedAddress, port, authenticationInfo); } return provider; @@ -932,9 +937,9 @@ private System findOrCreateSystem(final String name, final String address, final //------------------------------------------------------------------------------------------------- private Device findOrCreateDevice(DeviceRequestDTO requestDeviceDto) { return findOrCreateDevice(requestDeviceDto.getDeviceName(), - requestDeviceDto.getAddress(), - requestDeviceDto.getMacAddress(), - requestDeviceDto.getAuthenticationInfo()); + requestDeviceDto.getAddress(), + requestDeviceDto.getMacAddress(), + requestDeviceDto.getAuthenticationInfo()); } //------------------------------------------------------------------------------------------------- @@ -955,7 +960,8 @@ private Device findOrCreateDevice(String deviceName, String address, String macA provider.setAddress(validateAddress); provider = deviceRepository.saveAndFlush(provider); } - } else { + } + else { provider = createDevice(validateName, validateAddress, validatedMacAddress, authenticationInfo); } return provider; @@ -991,7 +997,7 @@ private void checkConstraintsOfSystemRegistryTable(final System systemDb, final final Optional find = systemRegistryRepository.findBySystemAndDevice(systemDb, deviceDb); if (find.isPresent()) { throw new InvalidParameterException("System Registry entry with provider: (" + deviceDb.getDeviceName() + ", " + deviceDb.getMacAddress() + - ") and system : " + systemDb.getSystemName() + " already exists."); + ") and system : " + systemDb.getSystemName() + " already exists."); } } catch (final InvalidParameterException ex) { throw ex; diff --git a/systemregistry/src/test/java/eu/arrowhead/TestConfiguration.java b/systemregistry/src/test/java/eu/arrowhead/common/database/service/DatabaseTestContext.java similarity index 81% rename from systemregistry/src/test/java/eu/arrowhead/TestConfiguration.java rename to systemregistry/src/test/java/eu/arrowhead/common/database/service/DatabaseTestContext.java index bd213c332..e8c11b927 100644 --- a/systemregistry/src/test/java/eu/arrowhead/TestConfiguration.java +++ b/systemregistry/src/test/java/eu/arrowhead/common/database/service/DatabaseTestContext.java @@ -1,4 +1,4 @@ -package eu.arrowhead; +package eu.arrowhead.common.database.service; import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.database.repository.RefreshableRepositoryImpl; @@ -9,6 +9,6 @@ @SpringBootConfiguration @EntityScan(basePackages = CoreCommonConstants.DATABASE_ENTITY_PACKAGE) @EnableJpaRepositories(basePackages = CoreCommonConstants.DATABASE_REPOSITORY_PACKAGE, repositoryBaseClass = RefreshableRepositoryImpl.class) -public class TestConfiguration { - public TestConfiguration() { super(); } +public class DatabaseTestContext { + public DatabaseTestContext() { super(); } } diff --git a/systemregistry/src/test/java/eu/arrowhead/core/systemregistry/StandaloneModeInSystemRegistryTests.java b/systemregistry/src/test/java/eu/arrowhead/core/systemregistry/StandaloneModeInSystemRegistryTests.java new file mode 100644 index 000000000..1029b04a4 --- /dev/null +++ b/systemregistry/src/test/java/eu/arrowhead/core/systemregistry/StandaloneModeInSystemRegistryTests.java @@ -0,0 +1,9 @@ +package eu.arrowhead.core.systemregistry; + +import eu.arrowhead.common.testhelper.StandaloneModeInTests; +import org.springframework.stereotype.Component; + +@Component +public class StandaloneModeInSystemRegistryTests extends StandaloneModeInTests { + +} \ No newline at end of file diff --git a/systemregistry/src/test/java/eu/arrowhead/core/systemregistry/SystemRegistryControllerSystemRegistryTest.java b/systemregistry/src/test/java/eu/arrowhead/core/systemregistry/SystemRegistryControllerSystemRegistryTest.java new file mode 100644 index 000000000..1188ee1b1 --- /dev/null +++ b/systemregistry/src/test/java/eu/arrowhead/core/systemregistry/SystemRegistryControllerSystemRegistryTest.java @@ -0,0 +1,434 @@ +package eu.arrowhead.core.systemregistry; + +import com.fasterxml.jackson.databind.ObjectMapper; +import eu.arrowhead.common.dto.internal.SystemRegistryListResponseDTO; +import eu.arrowhead.common.dto.shared.DeviceRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryRequestDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import eu.arrowhead.common.exception.InvalidParameterException; +import eu.arrowhead.core.systemregistry.database.service.SystemRegistryDBService; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.http.MediaType; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.MvcResult; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.web.context.WebApplicationContext; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.reset; +import static org.mockito.Mockito.when; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@RunWith(SpringRunner.class) +@SpringBootTest +@ContextConfiguration(classes = {SystemRegistryTestContext.class}) +public class SystemRegistryControllerSystemRegistryTest { + + + //================================================================================================= + // test data + private final static String DATE_STRING = "2020-01-01T00:00:00"; + + private final static long VALID_SYSTEM_ID = 1L; + private final static long VALID_DEVICE_ID = 1L; + + private final static long VALID_SYSTEM_REGISTRY_ID = 1L; + private final static long UNKNOWN_SYSTEM_REGISTRY_ID = 2L; + private final static long INVALID_SYSTEM_REGISTRY_ID = -1L; + + private final static String VALID_DEVICE_NAME = "device"; + private final static String VALID_SYSTEM_NAME = "system"; + private final static String UNKNOWN_SYSTEM_NAME = "unknown"; + private final static String INVALID_SYSTEM_NAME = ""; + + private static final SystemRequestDTO VALID_SYSTEM_REQUEST = + new SystemRequestDTO("system", "address", 80, "authenticationInfo"); + private final static SystemResponseDTO VALID_SYSTEM = + new SystemResponseDTO(VALID_SYSTEM_ID, VALID_SYSTEM_NAME, "address", 80, + "authenticationInfo", DATE_STRING, DATE_STRING); + + private final static DeviceRequestDTO VALID_DEVICE_REQUEST = + new DeviceRequestDTO(VALID_DEVICE_NAME, "address", "macAddress", "authenticationInfo"); + private final static DeviceResponseDTO VALID_DEVICE = + new DeviceResponseDTO(VALID_DEVICE_ID, VALID_DEVICE_NAME, "address", "macAddress", + "authenticationInfo", DATE_STRING, DATE_STRING); + + private final static SystemRegistryResponseDTO VALID_SYSTEM_REGISTRY = + new SystemRegistryResponseDTO(VALID_SYSTEM_REGISTRY_ID, VALID_SYSTEM, VALID_DEVICE, DATE_STRING, + null, 1, DATE_STRING, DATE_STRING); + + + //================================================================================================= + // members + + @Autowired + private WebApplicationContext wac; + + private MockMvc mockMvc; + + @Autowired + private ObjectMapper objectMapper; + + @MockBean(name = "mockSystemRegistryDBService") + private SystemRegistryDBService systemRegistryDBService; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Before + public void setup() { + reset(systemRegistryDBService); + this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); + } + + @Test + public void getSystemRegistryEntriesWithoutParameter() throws Exception { + final SystemRegistryListResponseDTO systemListResponseDTO = new SystemRegistryListResponseDTO(List.of(VALID_SYSTEM_REGISTRY), 1); + when(systemRegistryDBService.getSystemRegistryEntries(any(), any())).thenReturn(systemListResponseDTO); + + final MvcResult response = this.mockMvc.perform(get("/systemregistry/mgmt") + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final SystemRegistryListResponseDTO responseBody = readResponse(response, SystemRegistryListResponseDTO.class); + assertEquals(1, responseBody.getCount()); + } + + @Test + public void getSystemRegistryEntriesWithPageAndSizeParameter() throws Exception { + final SystemRegistryListResponseDTO systemListResponseDTO = new SystemRegistryListResponseDTO(List.of(VALID_SYSTEM_REGISTRY), 1); + when(systemRegistryDBService.getSystemRegistryEntries(any(), any())).thenReturn(systemListResponseDTO); + + final MvcResult response = this.mockMvc.perform(get("/systemregistry/mgmt") + .param("page", "0") + .param("item_per_page", String.valueOf(5)) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final SystemRegistryListResponseDTO responseBody = readResponse(response, SystemRegistryListResponseDTO.class); + assertEquals(1, responseBody.getCount()); + } + + @Test + public void getSystemRegistryEntryById() throws Exception { + when(systemRegistryDBService.getSystemRegistryById(VALID_SYSTEM_REGISTRY_ID)).thenReturn(VALID_SYSTEM_REGISTRY); + final MvcResult response = this.mockMvc.perform(get("/systemregistry/mgmt/" + VALID_SYSTEM_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final SystemRegistryResponseDTO responseDTO = readResponse(response, SystemRegistryResponseDTO.class); + assertEquals(VALID_SYSTEM_REGISTRY, responseDTO); + } + + @Test + public void getSystemRegistryEntryByIdUnknownId() throws Exception { + when(systemRegistryDBService.getSystemRegistryById(UNKNOWN_SYSTEM_REGISTRY_ID)).thenThrow( + new InvalidParameterException("System Registry with id " + UNKNOWN_SYSTEM_REGISTRY_ID + " not found.")); + + this.mockMvc.perform(get("/systemregistry/mgmt/" + UNKNOWN_SYSTEM_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void getSystemRegistryEntryByIdNegativeId() throws Exception { + this.mockMvc.perform(get("/systemregistry/mgmt/" + INVALID_SYSTEM_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void getSystemRegistryEntriesBySystemName() throws Exception { + final SystemRegistryListResponseDTO systemListResponseDTO = new SystemRegistryListResponseDTO(List.of(VALID_SYSTEM_REGISTRY), 1); + when(systemRegistryDBService.getSystemRegistryEntriesBySystemName(eq(VALID_SYSTEM_NAME), any(), any())) + .thenReturn(systemListResponseDTO); + + final MvcResult response = this.mockMvc.perform(get("/systemregistry/mgmt/systemname/" + VALID_SYSTEM_NAME) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final SystemRegistryListResponseDTO responseBody = readResponse(response, SystemRegistryListResponseDTO.class); + assertEquals(1, responseBody.getCount()); + } + + @Test + public void getSystemRegistryEntriesByUnknownSystemName() throws Exception { + final SystemRegistryListResponseDTO systemListResponseDTO = new SystemRegistryListResponseDTO(List.of(), 0); + when(systemRegistryDBService.getSystemRegistryEntriesBySystemName(eq(UNKNOWN_SYSTEM_NAME), any(), any())) + .thenReturn(systemListResponseDTO); + + final MvcResult response = this.mockMvc.perform(get("/systemregistry/mgmt/systemname/" + UNKNOWN_SYSTEM_NAME) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final SystemRegistryListResponseDTO responseBody = readResponse(response, SystemRegistryListResponseDTO.class); + assertEquals(0, responseBody.getCount()); + } + + @Test + public void getSystemRegistryEntriesByInvalidSystemName() throws Exception { + this.mockMvc.perform(get("/systemregistry/mgmt/systemname/" + INVALID_SYSTEM_NAME) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void removeSystemRegistryEntryByInvalidId() throws Exception { + this.mockMvc.perform(delete("/systemregistry/mgmt/" + INVALID_SYSTEM_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void removeSystemRegistryEntryByUnknownId() throws Exception { + doThrow(new InvalidParameterException("No system registry with id : " + UNKNOWN_SYSTEM_REGISTRY_ID)) + .when(systemRegistryDBService) + .removeSystemRegistryEntryById(eq(UNKNOWN_SYSTEM_REGISTRY_ID)); + + this.mockMvc.perform(delete("/systemregistry/mgmt/" + UNKNOWN_SYSTEM_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void removeSystemRegistryEntryById() throws Exception { + + this.mockMvc.perform(delete("/systemregistry/mgmt/" + VALID_SYSTEM_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + } + + @Test + public void updateSystemRegistryRequest() throws Exception { + final SystemRegistryRequestDTO dto = new SystemRegistryRequestDTO(VALID_SYSTEM_REQUEST, VALID_DEVICE_REQUEST, null, null, 1); + when(systemRegistryDBService.updateSystemRegistryById(eq(VALID_SYSTEM_REGISTRY_ID), any())).thenReturn(VALID_SYSTEM_REGISTRY); + + final MvcResult result = this.mockMvc.perform(put("/systemregistry/mgmt/" + VALID_SYSTEM_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isOk()) + .andReturn(); + assertEquals(VALID_SYSTEM_REGISTRY, objectMapper.readValue(result.getResponse().getContentAsString(), SystemRegistryResponseDTO.class)); + } + + @Test + public void updateSystemRegistryUnknownId() throws Exception { + final SystemRegistryRequestDTO dto = new SystemRegistryRequestDTO(VALID_SYSTEM_REQUEST, VALID_DEVICE_REQUEST, null, null, 1); + when(systemRegistryDBService.updateSystemRegistryById(eq(UNKNOWN_SYSTEM_REGISTRY_ID), any())) + .thenThrow(new InvalidParameterException("No system registry with id : " + UNKNOWN_SYSTEM_REGISTRY_ID)); + + this.mockMvc.perform(put("/systemregistry/mgmt/" + UNKNOWN_SYSTEM_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void updateSystemRegistryInvalidId() throws Exception { + final SystemRegistryRequestDTO dto = new SystemRegistryRequestDTO(VALID_SYSTEM_REQUEST, VALID_DEVICE_REQUEST, null, null, 1); + this.mockMvc.perform(put("/systemregistry/mgmt/systems/" + INVALID_SYSTEM_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void updateSystemRegistryNullPayload() throws Exception { + when(systemRegistryDBService.updateSystemRegistryById(eq(VALID_SYSTEM_REGISTRY_ID), any())).thenReturn(VALID_SYSTEM_REGISTRY); + this.mockMvc.perform(put("/systemregistry/mgmt/systems/" + VALID_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(null))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void mergeSystemWithOneField() throws Exception { + SystemRegistryRequestDTO dto = null; + when(systemRegistryDBService.mergeSystemRegistryById(eq(VALID_SYSTEM_REGISTRY_ID), any())).thenReturn(VALID_SYSTEM_REGISTRY); + + dto = new SystemRegistryRequestDTO(); + dto.setSystem(VALID_SYSTEM_REQUEST); + this.mockMvc.perform(patch("/systemregistry/mgmt/" + VALID_SYSTEM_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isOk()) + .andReturn(); + + dto = new SystemRegistryRequestDTO(); + dto.setEndOfValidity(DATE_STRING); + this.mockMvc.perform(patch("/systemregistry/mgmt/" + VALID_SYSTEM_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isOk()) + .andReturn(); + + dto = new SystemRegistryRequestDTO(); + dto.setMetadata(Map.of()); + this.mockMvc.perform(patch("/systemregistry/mgmt/" + VALID_SYSTEM_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isOk()) + .andReturn(); + + dto = new SystemRegistryRequestDTO(); + dto.setVersion(2); + this.mockMvc.perform(patch("/systemregistry/mgmt/" + VALID_SYSTEM_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isOk()) + .andReturn(); + } + + @Test + public void mergeSystemWithEmpty() throws Exception { + final SystemRegistryRequestDTO dto = new SystemRegistryRequestDTO(); + when(systemRegistryDBService.mergeSystemRegistryById(eq(VALID_SYSTEM_REGISTRY_ID), any())).thenReturn(VALID_SYSTEM_REGISTRY); + + this.mockMvc.perform(patch("/systemregistry/mgmt/" + VALID_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void mergeSystemUnknownId() throws Exception { + final SystemRegistryRequestDTO dto = new SystemRegistryRequestDTO(VALID_SYSTEM_REQUEST, VALID_DEVICE_REQUEST, DATE_STRING, null, 1); + when(systemRegistryDBService.mergeSystemRegistryById(eq(UNKNOWN_SYSTEM_REGISTRY_ID), any())) + .thenThrow(new InvalidParameterException("No system with id : " + UNKNOWN_SYSTEM_REGISTRY_ID)); + + this.mockMvc.perform(patch("/systemregistry/mgmt/" + UNKNOWN_SYSTEM_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void mergeSystemInvalidId() throws Exception { + final SystemRegistryRequestDTO dto = new SystemRegistryRequestDTO(VALID_SYSTEM_REQUEST, VALID_DEVICE_REQUEST, DATE_STRING, null, 1); + + this.mockMvc.perform(patch("/systemregistry/mgmt/" + INVALID_SYSTEM_REGISTRY_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void registerSystemNullPayload() throws Exception { + when(systemRegistryDBService.registerSystemRegistry(any())).thenReturn(VALID_SYSTEM_REGISTRY); + + this.mockMvc.perform(post("/systemregistry/register") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(null))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void registerSystemNullEndOfValidity() throws Exception { + final SystemRegistryRequestDTO systemRegistryRequestDTO = + new SystemRegistryRequestDTO(VALID_SYSTEM_REQUEST, VALID_DEVICE_REQUEST, null, null, 1); + + when(systemRegistryDBService.registerSystemRegistry(any())).thenReturn(VALID_SYSTEM_REGISTRY); + + this.mockMvc.perform(post("/systemregistry/register") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(systemRegistryRequestDTO))) + .andExpect(status().isCreated()) + .andReturn(); + } + + @Test + public void registerSystemInvalidEndOfValidity() throws Exception { + final SystemRegistryRequestDTO systemRegistryRequestDTO = + new SystemRegistryRequestDTO(VALID_SYSTEM_REQUEST, VALID_DEVICE_REQUEST, "not parsable", null, 1); + + when(systemRegistryDBService.registerSystemRegistry(any())).thenReturn(VALID_SYSTEM_REGISTRY); + + this.mockMvc.perform(post("/systemregistry/register") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(systemRegistryRequestDTO))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void unregisterSystemNullSystemName() throws Exception { + this.mockMvc.perform(delete("/systemregistry/unregister") + .param("system_name", "") + .param("port", "80")) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void unregisterSystemNullPort() throws Exception { + this.mockMvc.perform(delete("/systemregistry/unregister") + .param("system_name", "system") + .param("port", "")) + .andExpect(status().isBadRequest()) + .andReturn(); + } + //================================================================================================= + // Tests of system registry + + private T readResponse(final MvcResult result, final Class clz) throws IOException { + return objectMapper.readValue(result.getResponse().getContentAsString(), clz); + } +} \ No newline at end of file diff --git a/systemregistry/src/test/java/eu/arrowhead/core/systemregistry/SystemRegistryControllerSystemTest.java b/systemregistry/src/test/java/eu/arrowhead/core/systemregistry/SystemRegistryControllerSystemTest.java new file mode 100644 index 000000000..d4a3e0cb5 --- /dev/null +++ b/systemregistry/src/test/java/eu/arrowhead/core/systemregistry/SystemRegistryControllerSystemTest.java @@ -0,0 +1,496 @@ +package eu.arrowhead.core.systemregistry; + +import com.fasterxml.jackson.databind.ObjectMapper; +import eu.arrowhead.common.dto.internal.SystemListResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import eu.arrowhead.common.exception.InvalidParameterException; +import eu.arrowhead.core.systemregistry.database.service.SystemRegistryDBService; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.http.MediaType; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.MvcResult; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.web.context.WebApplicationContext; + +import java.io.IOException; +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.reset; +import static org.mockito.Mockito.when; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@RunWith(SpringRunner.class) +@SpringBootTest +@ContextConfiguration(classes = {SystemRegistryTestContext.class}) +public class SystemRegistryControllerSystemTest { + + + //================================================================================================= + // test data + private final static long VALID_SYSTEM_ID = 1L; + private final static long UNKNOWN_SYSTEM_ID = 2L; + private final static long NEGATIVE_SYSTEM_ID = -1L; + + private final static SystemResponseDTO VALID_SYSTEM = + new SystemResponseDTO(VALID_SYSTEM_ID, "system", "address", 80, + "authenticationInfo", "2020-01-01T00:00:00", "2020-01-01T00:00:00"); + + + //================================================================================================= + // members + + @Autowired + private WebApplicationContext wac; + + private MockMvc mockMvc; + + @Autowired + private ObjectMapper objectMapper; + + @MockBean(name = "mockSystemRegistryDBService") + private SystemRegistryDBService systemRegistryDBService; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Before + public void setup() { + reset(systemRegistryDBService); + this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); + } + + //================================================================================================= + // Tests of system registry + + @Test + public void echoOnboarding() throws Exception { + final MvcResult response = this.mockMvc.perform(get("/systemregistry/echo") + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + assertEquals("Got it!", response.getResponse().getContentAsString()); + } + + @Test + public void getSystemById() throws Exception { + when(systemRegistryDBService.getSystemById(VALID_SYSTEM_ID)).thenReturn(VALID_SYSTEM); + final MvcResult response = this.mockMvc.perform(get("/systemregistry/mgmt/system/" + VALID_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final SystemResponseDTO responseDTO = readResponse(response, SystemResponseDTO.class); + assertEquals(VALID_SYSTEM, responseDTO); + } + + @Test + public void getSystemByUnknownId() throws Exception { + when(systemRegistryDBService.getSystemById(UNKNOWN_SYSTEM_ID)) + .thenThrow(new InvalidParameterException("System with id " + UNKNOWN_SYSTEM_ID + " not found.")); + + this.mockMvc.perform(get("/systemregistry/mgmt/system/" + UNKNOWN_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void getSystemByNegativeId() throws Exception { + this.mockMvc.perform(get("/systemregistry/mgmt/system/" + NEGATIVE_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void getSystemsWithoutParameter() throws Exception { + final SystemListResponseDTO systemListResponseDTO = new SystemListResponseDTO(List.of(VALID_SYSTEM), 1); + when(systemRegistryDBService.getSystemEntries(any(), any())).thenReturn(systemListResponseDTO); + + final MvcResult response = this.mockMvc.perform(get("/systemregistry/mgmt/systems") + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final SystemListResponseDTO responseBody = readResponse(response, SystemListResponseDTO.class); + assertEquals(1, responseBody.getCount()); + } + + @Test + public void getSystemsWithPageAndSizeParameter() throws Exception { + final SystemListResponseDTO systemListResponseDTO = new SystemListResponseDTO(List.of(VALID_SYSTEM), 1); + when(systemRegistryDBService.getSystemEntries(any(), any())).thenReturn(systemListResponseDTO); + + final MvcResult response = this.mockMvc.perform(get("/systemregistry/mgmt/systems") + .param("page", "0") + .param("item_per_page", String.valueOf(5)) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + + final SystemListResponseDTO responseBody = readResponse(response, SystemListResponseDTO.class); + assertEquals(1, responseBody.getCount()); + } + + @Test + public void createSystemRequest() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO("system", "address", 80, "authenticationInfo"); + when(systemRegistryDBService.createSystemDto(anyString(), anyString(), anyInt(), anyString())).thenReturn(VALID_SYSTEM); + + final MvcResult response = this.mockMvc.perform(post("/systemregistry/mgmt/systems") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isCreated()) + .andReturn(); + assertEquals(VALID_SYSTEM, readResponse(response, SystemResponseDTO.class)); + } + + @Test + public void createSystemRequestNullPayload() throws Exception { + when(systemRegistryDBService.createSystemDto(anyString(), anyString(), anyInt(), anyString())).thenReturn(VALID_SYSTEM); + + this.mockMvc.perform(post("/systemregistry/mgmt/systems") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(null))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void createSystemRequestNullSystemName() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO(null, "address", 80, "authenticationInfo"); + when(systemRegistryDBService.createSystemDto(anyString(), anyString(), anyInt(), anyString())).thenReturn(VALID_SYSTEM); + + this.mockMvc.perform(post("/systemregistry/mgmt/systems") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void createSystemRequestEmptySystemName() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO("", "address", 80, "authenticationInfo"); + when(systemRegistryDBService.createSystemDto(anyString(), anyString(), anyInt(), anyString())).thenReturn(VALID_SYSTEM); + + this.mockMvc.perform(post("/systemregistry/mgmt/systems") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void createSystemRequestNullAddress() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO("system", null, 80, "authenticationInfo"); + when(systemRegistryDBService.createSystemDto(anyString(), anyString(), anyInt(), anyString())).thenReturn(VALID_SYSTEM); + + this.mockMvc.perform(post("/systemregistry/mgmt/systems") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void createSystemRequestEmptyAddress() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO("system", "", 80, "authenticationInfo"); + when(systemRegistryDBService.createSystemDto(anyString(), anyString(), anyInt(), anyString())).thenReturn(VALID_SYSTEM); + + this.mockMvc.perform(post("/systemregistry/mgmt/systems") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void createSystemRequestNullPort() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO("system", "address", null, "authenticationInfo"); + when(systemRegistryDBService.createSystemDto(anyString(), anyString(), anyInt(), anyString())).thenReturn(VALID_SYSTEM); + + this.mockMvc.perform(post("/systemregistry/mgmt/systems") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void createSystemRequestZeroPort() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO("system", "address", 0, "authenticationInfo"); + when(systemRegistryDBService.createSystemDto(anyString(), anyString(), anyInt(), anyString())).thenReturn(VALID_SYSTEM); + + this.mockMvc.perform(post("/systemregistry/mgmt/systems/") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void updateSystemRequest() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO("system", "address", 80, "authenticationInfo"); + when(systemRegistryDBService.updateSystemDto(eq(VALID_SYSTEM_ID), anyString(), anyString(), anyInt(), anyString())) + .thenReturn(VALID_SYSTEM); + + final MvcResult response = this.mockMvc.perform(put("/systemregistry/mgmt/systems/" + VALID_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isOk()) + .andReturn(); + assertEquals(VALID_SYSTEM, readResponse(response, SystemResponseDTO.class)); + } + + @Test + public void updateSystemUnknownId() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO("system", "address", 80, "authenticationInfo"); + when(systemRegistryDBService.updateSystemDto(eq(UNKNOWN_SYSTEM_ID), anyString(), anyString(), anyInt(), anyString())) + .thenThrow(new InvalidParameterException("No system with id : " + UNKNOWN_SYSTEM_ID)); + + this.mockMvc.perform(put("/systemregistry/mgmt/systems/" + UNKNOWN_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void updateSystemInvalidId() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO("system", "address", 80, "authenticationInfo"); + + this.mockMvc.perform(put("/systemregistry/mgmt/systems/" + NEGATIVE_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void updateSystemRequestNullPayload() throws Exception { + when(systemRegistryDBService.updateSystemDto(eq(VALID_SYSTEM_ID), anyString(), anyString(), anyInt(), anyString())) + .thenReturn(VALID_SYSTEM); + this.mockMvc.perform(put("/systemregistry/mgmt/systems/" + VALID_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(null))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void updateSystemRequestNullSystemName() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO(null, "address", 80, "authenticationInfo"); + this.mockMvc.perform(put("/systemregistry/mgmt/systems/" + VALID_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void updateSystemRequestEmptySystemName() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO("", "address", 80, "authenticationInfo"); + this.mockMvc.perform(put("/systemregistry/mgmt/systems/" + VALID_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void updateSystemRequestNullAddress() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO("system", null, 80, "authenticationInfo"); + this.mockMvc.perform(put("/systemregistry/mgmt/systems/" + VALID_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void updateSystemRequestEmptyAddress() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO("system", "", 80, "authenticationInfo"); + this.mockMvc.perform(put("/systemregistry/mgmt/systems/" + VALID_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void updateSystemRequestNullPort() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO("system", "address", null, "authenticationInfo"); + this.mockMvc.perform(put("/systemregistry/mgmt/systems/" + VALID_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void updateSystemRequestZeroPort() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO("system", "address", 0, "authenticationInfo"); + this.mockMvc.perform(put("/systemregistry/mgmt/systems/" + VALID_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void mergeSystemWithOneField() throws Exception { + SystemRequestDTO dto = null; + when(systemRegistryDBService.mergeSystemResponse(eq(VALID_SYSTEM_ID), anyString(), anyString(), anyInt(), anyString())).thenReturn(VALID_SYSTEM); + + dto = new SystemRequestDTO(); + dto.setSystemName("not empty"); + this.mockMvc.perform(patch("/systemregistry/mgmt/systems/" + VALID_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isOk()) + .andReturn(); + + dto = new SystemRequestDTO(); + dto.setPort(80); + this.mockMvc.perform(patch("/systemregistry/mgmt/systems/" + VALID_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isOk()) + .andReturn(); + + dto = new SystemRequestDTO(); + dto.setAddress("not empty"); + this.mockMvc.perform(patch("/systemregistry/mgmt/systems/" + VALID_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isOk()) + .andReturn(); + + dto = new SystemRequestDTO(); + dto.setAuthenticationInfo("not empty"); + this.mockMvc.perform(patch("/systemregistry/mgmt/systems/" + VALID_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isOk()) + .andReturn(); + } + + @Test + public void mergeSystemWithEmpty() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO(); + when(systemRegistryDBService.mergeSystemResponse(eq(VALID_SYSTEM_ID), anyString(), anyString(), anyInt(), anyString())).thenReturn(VALID_SYSTEM); + + this.mockMvc.perform(patch("/systemregistry/mgmt/systems/" + VALID_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void mergeSystemUnknownId() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO("system", "address", 80, "authenticationInfo"); + when(systemRegistryDBService.mergeSystemResponse(eq(UNKNOWN_SYSTEM_ID), anyString(), anyString(), anyInt(), anyString())) + .thenThrow(new InvalidParameterException("No system with id : " + UNKNOWN_SYSTEM_ID)); + + this.mockMvc.perform(patch("/systemregistry/mgmt/systems/" + UNKNOWN_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void mergeSystemInvalidId() throws Exception { + final SystemRequestDTO dto = new SystemRequestDTO("system", "address", 80, "authenticationInfo"); + + this.mockMvc.perform(patch("/systemregistry/mgmt/systems/" + NEGATIVE_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto))) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void removeSystemInvalidId() throws Exception { + this.mockMvc.perform(delete("/systemregistry/mgmt/systems/" + NEGATIVE_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void removeSystemUnknownId() throws Exception { + doThrow(new InvalidParameterException("No system with id : " + UNKNOWN_SYSTEM_ID)) + .when(systemRegistryDBService) + .removeSystemById(eq(UNKNOWN_SYSTEM_ID)); + + this.mockMvc.perform(delete("/systemregistry/mgmt/systems/" + UNKNOWN_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andReturn(); + } + + @Test + public void removeSystem() throws Exception { + + this.mockMvc.perform(delete("/systemregistry/mgmt/systems/" + VALID_SYSTEM_ID) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andReturn(); + } + //================================================================================================= + // Tests of system registry + + private T readResponse(final MvcResult response, final Class clz) throws IOException { + return objectMapper.readValue(response.getResponse().getContentAsString(), clz); + } +} \ No newline at end of file diff --git a/systemregistry/src/test/java/eu/arrowhead/core/systemregistry/SystemRegistryTestContext.java b/systemregistry/src/test/java/eu/arrowhead/core/systemregistry/SystemRegistryTestContext.java new file mode 100644 index 000000000..064312019 --- /dev/null +++ b/systemregistry/src/test/java/eu/arrowhead/core/systemregistry/SystemRegistryTestContext.java @@ -0,0 +1,50 @@ +package eu.arrowhead.core.systemregistry; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.database.repository.CloudRepository; +import eu.arrowhead.common.database.service.CommonDBService; +import eu.arrowhead.core.systemregistry.database.service.SystemRegistryDBService; +import org.mockito.Mockito; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration; +import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.FilterType; +import org.springframework.context.annotation.Primary; + +@Configuration +@ComponentScan(basePackages = CommonConstants.BASE_PACKAGE, + excludeFilters = { + @ComponentScan.Filter(type = FilterType.REGEX, pattern = ".*database.*"), + @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = SystemRegistryMain.class), + }) +@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, HibernateJpaAutoConfiguration.class}) +public class SystemRegistryTestContext { + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Bean + @Primary // This bean is primary only in test context + public SystemRegistryDBService mockSystemRegistryDBService() { + return Mockito.mock(SystemRegistryDBService.class); + } + + //------------------------------------------------------------------------------------------------- + @Bean + @Primary // This bean is primary only in test context + public CommonDBService mockCommonDBService() { + return Mockito.mock(CommonDBService.class); + } + + //------------------------------------------------------------------------------------------------- + @Bean + @Primary // This bean is primary only in test context + public CloudRepository mockCloudRepository() { + return Mockito.mock(CloudRepository.class); + } +} \ No newline at end of file From ea8d5e59cb0f242c9e2f8834e536fe7465773247 Mon Sep 17 00:00:00 2001 From: mzsilak Date: Tue, 3 Mar 2020 18:12:08 +0100 Subject: [PATCH 254/301] update documentation and merge pull request --- .../eu/arrowhead/common/core/CoreSystem.java | 9 +++++++++ .../common/core/CoreSystemService.java | 9 +++++++-- .../common/database/entity/Device.java | 12 ++++++++++++ .../service/DeviceRegistryDBService.java | 11 ++--------- .../ReleaseNotes-4.1.3-DeviceRegistry.odt | Bin 0 -> 21805 bytes .../ReleaseNotes-4.1.3-DeviceRegistry.pdf | Bin 0 -> 138247 bytes .../ReleaseNotes-4.1.3-Onboarding.odt | Bin 0 -> 17814 bytes .../ReleaseNotes-4.1.3-Onboarding.pdf | Bin 0 -> 91985 bytes .../ReleaseNotes-4.1.3-SystemRegistry.odt | Bin 0 -> 21889 bytes .../ReleaseNotes-4.1.3-SystemRegistry.pdf | Bin 0 -> 145845 bytes 10 files changed, 30 insertions(+), 11 deletions(-) create mode 100644 documentation/device_registry/ReleaseNotes-4.1.3-DeviceRegistry.odt create mode 100644 documentation/device_registry/ReleaseNotes-4.1.3-DeviceRegistry.pdf create mode 100644 documentation/onboarding/ReleaseNotes-4.1.3-Onboarding.odt create mode 100644 documentation/onboarding/ReleaseNotes-4.1.3-Onboarding.pdf create mode 100644 documentation/system_registry/ReleaseNotes-4.1.3-SystemRegistry.odt create mode 100644 documentation/system_registry/ReleaseNotes-4.1.3-SystemRegistry.pdf diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java index d7b507d4c..f631d2d98 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java @@ -7,12 +7,21 @@ import java.util.Collections; import java.util.List; +import static eu.arrowhead.common.core.CoreSystemService.DEVICE_REGISTRY_REGISTER_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.DEVICE_REGISTRY_UNREGISTER_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_SERVICE_WITH_NAME; +import static eu.arrowhead.common.core.CoreSystemService.SYSTEM_REGISTRY_REGISTER_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.SYSTEM_REGISTRY_UNREGISTER_SERVICE; + public enum CoreSystem { //================================================================================================= // elements SERVICE_REGISTRY(Defaults.DEFAULT_SERVICE_REGISTRY_PORT, null), + SYSTEM_REGISTRY(Defaults.DEFAULT_SYSTEM_REGISTRY_PORT, List.of(SYSTEM_REGISTRY_REGISTER_SERVICE, SYSTEM_REGISTRY_UNREGISTER_SERVICE)), + DEVICE_REGISTRY(Defaults.DEFAULT_DEVICE_REGISTRY_PORT, List.of(DEVICE_REGISTRY_REGISTER_SERVICE, DEVICE_REGISTRY_UNREGISTER_SERVICE)), + ONBOARDING(Defaults.DEFAULT_ONBOARDING_PORT, List.of(ONBOARDING_SERVICE_WITH_NAME)), AUTHORIZATION(Defaults.DEFAULT_AUTHORIZATION_PORT, List.of(CoreSystemService.AUTH_CONTROL_INTRA_SERVICE, CoreSystemService.AUTH_CONTROL_INTER_SERVICE, CoreSystemService.AUTH_TOKEN_GENERATION_SERVICE, CoreSystemService.AUTH_PUBLIC_KEY_SERVICE, CoreSystemService.AUTH_CONTROL_SUBSCRIPTION_SERVICE)), diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java index 42d2abddb..9e6f62c89 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java @@ -1,5 +1,6 @@ package eu.arrowhead.common.core; +import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.Utilities; import org.springframework.util.Assert; @@ -23,6 +24,7 @@ import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_CSR; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_NAME; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ORCH_PROCESS; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_QOS_MONITOR_PING_MEASUREMENT; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SERVICE_REGISTRY_REGISTER; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SERVICE_REGISTRY_UNREGISTER; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SYSTEM_REGISTRY_REGISTER; @@ -51,11 +53,14 @@ import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_CSR; import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_NAME; import static eu.arrowhead.common.CommonConstants.OP_ORCH_PROCESS; +import static eu.arrowhead.common.CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT; +import static eu.arrowhead.common.CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT_SUFFIX; import static eu.arrowhead.common.CommonConstants.OP_SERVICE_REGISTRY_REGISTER_URI; import static eu.arrowhead.common.CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_URI; import static eu.arrowhead.common.CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI; import static eu.arrowhead.common.CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_URI; import static eu.arrowhead.common.CommonConstants.ORCHESTRATOR_URI; +import static eu.arrowhead.common.CommonConstants.QOS_MONITOR_URI; import static eu.arrowhead.common.CommonConstants.SERVICE_REGISTRY_URI; import static eu.arrowhead.common.CommonConstants.SYSTEM_REGISTRY_URI; @@ -91,8 +96,8 @@ public enum CoreSystemService { EVENT_PUBLISH_AUTH_UPDATE_SERVICE(CORE_SERVICE_EVENT_HANDLER_PUBLISH_AUTH_UPDATE, EVENT_HANDLER_URI + OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE), // QoS Monitor services - QOS_MONITOR_PING_MEASUREMENT_SERVICE(CommonConstants.CORE_SERVICE_QOS_MONITOR_PING_MEASUREMENT, CommonConstants.QOS_MONITOR_URI + CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT + - CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT_SUFFIX), + QOS_MONITOR_PING_MEASUREMENT_SERVICE(CORE_SERVICE_QOS_MONITOR_PING_MEASUREMENT, + QOS_MONITOR_URI + OP_QOS_MONITOR_PING_MEASUREMENT + OP_QOS_MONITOR_PING_MEASUREMENT_SUFFIX), // Onboarding services diff --git a/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java b/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java index d52527be6..c1ecf6bc6 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/entity/Device.java @@ -77,6 +77,18 @@ public Device(final String deviceName, final String address, final String macAdd this.authenticationInfo = authenticationInfo; } + public Device(final long id, final String deviceName, final String address, final String macAddress, final String authenticationInfo, + final ZonedDateTime createdAt, final ZonedDateTime updatedAt, final Set systemRegistryEntries) { + this.id = id; + this.deviceName = deviceName; + this.address = address; + this.macAddress = macAddress; + this.authenticationInfo = authenticationInfo; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.systemRegistryEntries = systemRegistryEntries; + } + //------------------------------------------------------------------------------------------------- @PrePersist public void onCreate() { diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java index 7e89def36..294330add 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java @@ -61,20 +61,13 @@ public class DeviceRegistryDBService { private final DeviceRepository deviceRepository; - private final SSLProperties sslProperties; - - @Value(CoreCommonConstants.$SYSTEM_REGISTRY_PING_TIMEOUT_WD) - private int pingTimeout; - @Autowired public DeviceRegistryDBService(final DeviceRegistryRepository deviceRegistryRepository, final SystemRepository systemRepository, - final DeviceRepository deviceRepository, - final SSLProperties sslProperties) { + final DeviceRepository deviceRepository) { this.deviceRegistryRepository = deviceRegistryRepository; this.systemRepository = systemRepository; this.deviceRepository = deviceRepository; - this.sslProperties = sslProperties; } @@ -584,7 +577,7 @@ private Device validateNonNullDeviceParameters(final String deviceName, final St if (Utilities.isEmpty(macAddress)) { throw new InvalidParameterException("MAC address is null or empty"); } else { - final Matcher matcher = DeviceRegistryController.MAC_ADDRESS_PATTERN.matcher(address); + final Matcher matcher = DeviceRegistryController.MAC_ADDRESS_PATTERN.matcher(macAddress); if (!matcher.matches()) { throw new InvalidParameterException("Unrecognized format of MAC Address"); } diff --git a/documentation/device_registry/ReleaseNotes-4.1.3-DeviceRegistry.odt b/documentation/device_registry/ReleaseNotes-4.1.3-DeviceRegistry.odt new file mode 100644 index 0000000000000000000000000000000000000000..0b96c40ce9dd197c1a599e6db19875a3c40fdfc8 GIT binary patch literal 21805 zcmb5V1CVA-vo6{;rfu7{ZBN^_ZQHgnZBE;^-=4N@TX(*F?~b_VoNxaTr&iRes#Pnq zGRl=tmZA(O7%C7D6cCVxwXve!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df<~se1-m!4qfhKNjz=tn=p7#ovsT@I^oGSLXT7;YDUP z@T6OK&dU0gdA@?5b{5Yd2|C|r{FQgU?wr>5Gwdk;rP`}1V4XBK(a=avUa2SL%31Yv F^)LA=Fc1I$ literal 0 HcmV?d00001 diff --git a/documentation/device_registry/ReleaseNotes-4.1.3-DeviceRegistry.pdf b/documentation/device_registry/ReleaseNotes-4.1.3-DeviceRegistry.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0c00865dfc775dcad95991539422e4f6beaf0d37 GIT binary patch literal 138247 zcma&Ob9|lO5-*&jvDMhNZQHhOvteU5w$U_cY^$+t+cw^`=d}I3_niAVH-GKfGi%n& ztey3pXJ)O3SWZZUnx2LUlDIp+yQRCXI}4Hlj}Fh)zygwsi&o0m#?;9SkMaE*1zHhv zD<@+IS`jOKCu1RFLt7(b9v(}2SoLL0G^T88*hX$W z09@!bD^j|2fD7XGEDbdyXGx35ENiX^qSzmcsywa%FK;eyE1b_sg-+K`7#nJL?Qbnl zuS2iAoWbokXLmlQ3OtEkz7A4PK4%JF`<7MOPnHIadqOBdwWxq??#fqabzOEFw&eA6 z9>@uPxHwmu*?~r5QD(wYm0(0wZmClNk8W;kMTz9 zLits@-Txe|{$n7dN)0^yM|U4~G|&(QG<8}QOz%3lNO$M{oGD?KL8lz(2V55{ND4}^ zzHwR_6d==rf2rLG!WbR{HMC>PgJZ1$jO!b7v95&w>cAL+0hs0N)N&76KH87FqJv!}8ez;FGq&n!HmMuL~No+c8p5Z=dYb*{VLA{oBP5 zoGq-0o1-`E3E?orTLHL@1Fp)~NJ;V0 z&lxa^+Z28sEy-cf;%cI&7(&+|D-LcXxp+ndrI3eMC8oF4{*DS-T9Kk3AQA4Fuy39U{V2kTam zGH(r|eZO=&;kfuXEOS!DW;38Jmw$PD917il~7A*X~i@S zDpmTk0{jc;ve__#>d4!shv`5uSx8ys)UL_iUW)uR@IwPEEH2qG^LF!CWq}~x2rix^ zL5{6+`zd{6RP`4ajFQ=c;hnhq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kf0LuKo zt=Le0t=J?4<$0+@C534IZ#ec>Jh38P!msZ7Z$f(JN28* z{L`X-?Kkpkqmh4coB!_hS5oHh@5~C>-+8Qm_xx+*?C+lF6u+Wnf1z;x-Se+K`0vQt upH@Nl*Erk1`~9`w`Q5+&Xp|_V71N{};`z?}01jzc;UG4DvzWP743|qng literal 0 HcmV?d00001 diff --git a/documentation/onboarding/ReleaseNotes-4.1.3-Onboarding.pdf b/documentation/onboarding/ReleaseNotes-4.1.3-Onboarding.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a53683ba03d0b39dbbad07618365e41ecc4f6d6e GIT binary patch literal 91985 zcma&N1CSLc$ zLCnU`#Z<)9*xtmHpC91t;$&)Q3-HJ;)|8IN;eh@9uKt4ir-m{XACwk0X1Ozb3xsw? zcvd?LT~s^2{oy(dA#!iz$)iya(VX;lG9J}@FRt#}{`q=qH;;3;Xgdu$&h-1SbyGg? z>H7kgzqLo-e|ykn;vMJ}^V$E}h;mp(-T(4@j4UOBhFpg(#O`_cYP>XuON}cwUEMEN z!Pr!njyfliWLP#1dAuTI|Cf^*OhKcQL7#DIKTYbskh^I&A~#KVys8|@5!yrmYN~5< znTuE)E(ezsZRK7E&3WjICYMi@6Lx*oTvg0b{TwEiM;UU6Las6UR~5R9Dd|nYn8mM# z%sD2?eJdiDB^>_0o;B2nsEa(SSjEInUaCXxEkzm83Y8lID3=tONI0GKcGK2bLNtxKhkwdM0W>$ zxCvkTdd!Lak8BOchy^Jb23(GY)5fB3YJbU=MdEFo?o=BAA=CAgWgv)@?jCHCzVFEY zRuuYC-NbQf88Yx~_QAnNbYtR8ZYa5EqLB_tHB|v&n-yWf^?CQSe|2d4>={v>N0l83 z(+81C>-T<-4rvCBh3L!%gRiXC_=74UL)9GMKX9{80N@vmfRjh{g#RESBPWY9AKntV z+f=Tz=B1sa;RO2VTnlwj8bz_6)0|H;DBSmxz)jpgnyNxhN+wPfTI8eH z9TPX2mJnT67$CQBBgZh*Yu8#RQ(3qo<#it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-5E8 zOv15h#vaE_Tn0Id+YN<|=RU|AF7q3^-8zHfj?I~O7wr;> zxPJLP_BxUE2yiftHa@F0M&*={yeb2H4X=$-0;8w;Bx>t4IGPx!+~Zv z8fe3+0S9ma@_}t&Kd>E301mJX=u6{80q1M{IG~-z2VRrb4q$AMww{;91JFSl2JFAa zgTn&n;P`7aupI^J1js`HI?z6WHd;U6jixs!XH9?Hx_)R-M?eoyC))TZB^qdtY7WM$ zAvD`07+H-zZ|LB3|-^?m^@zQMkTUw)z0=QY3ltkvr*|EFXm z5c4=F4vv=li*S7pviF*&*9!-S-5`9EbHT}j#sCcn8U!!^IQjo%WZYj2gTVsYVbEAP zAl&{n4K3c*X|&E7zw^nH8MZmwng309UxBkzG}6s16j@pDu>deC+Dw>$yr|9& zu3#Zr!-Q#DyV~y~yUJ=1rPgN>dfmN(iWl`1#baFxffhw00jH8Y$kx=~O&A~}Xps## z;CIx4Y(V+6^|B%V9^#jifN_3h0xjdf=>J;=05n?U!+(hcrl@L7CGS&}2e7I@Y5>WB zM&dCzX*fa>4wsZ#XF6XGvK=!3Mscz#n~90o`DlZOApA3&u=Z1y=0i$VWMBmAKY9*;$D z))}Ay@ac{7zyl`TJRY8aAZ(5+JOM@6Y*Rb|js24kkKJrPJb{4NESCV_w>R5>07w1d za{{oQZI(-b1D5%B9#ju&0J`nL4BmP;_>qA$f*DdMz{&s?B;dA8%hiqorPT`XLKSKb zRUoRtF$fYGgU1kX1e7`)tAd6TFgR7BItr~$LXec0|1%3%1yw0Fq*G)YCr>XID2$+{ zf>lAHRaN0wqB;RcSTqrZAYxQiu?Q8c8bSpuU7l2H4=OF)32*`y!7MJWrl-#QU*ITl ABme*a literal 0 HcmV?d00001 diff --git a/documentation/system_registry/ReleaseNotes-4.1.3-SystemRegistry.odt b/documentation/system_registry/ReleaseNotes-4.1.3-SystemRegistry.odt new file mode 100644 index 0000000000000000000000000000000000000000..a9425d7976f65281972abd3d8ad47e93075f5025 GIT binary patch literal 21889 zcmb4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=Plpq>z~)^FnZR{mtCk7v)Hem|IwR2LcZyw^)`A?bww{CM;RCz;eeqFo%s38#OXe zWM~ef`t`EKVI~?|9cCA{RDlpB-Lp#y7w<^OoSLf9l3Nsw_Qf6r%n@%=(7pui+eRhL zOpT?ml~Q=wMq&BEVFNN;iosH$7@Q#~21gSLFFT^4Y8^&laWtZE9*U+o`ylqmLKE0U z$8c(kCDVY;Xfv8E33#`a>ey##v=J$$)2u`ylTCA!NhqT4B;EXz}$!L3VO8`?u(FZHIDOw;j z*h0=si!;3#qRF`c7vqCv@DMFUWEAcq7r=1DqMN3KN7Nf_CO`e#EOJW@f*KEpKlC7) z8A#Iu{Z+D?Yc<7dXi63}z_jB9TVet7S3HGb3{Nv?FO6PQvK@v#BjusjOBl=2pb0e$ zXgRd!R>Oc<7OC19#xo39qZ$UZ0^*Rkf)#wM$n2#MQRwr6I^(fU3h_cWdV%V znO0_b5(ejI$g0(N5FBW@!lT`u({r#4 zWHDzL2oJRB45L|wbKwOYkr3knE$d=KfCpz$#JoJq6Z|ne2ae>5hYn1gc;+Mpohy+r znXprulNp878wacqJOiGjkhFp%%cSfDNg-{L7G#DdpG}Yj7uf>@?XsMB7HOH30Sz#h z=Y?b?y3jJ58<>FNyVD#Btn~;v(+UlaN#cQTk#i{E(k?J?BhoJ+kO~AI12A-mr{)D< zJSkIv$z&{HXqh49!mzAJ+9ZO>gf0OlD|sUdV|h!8A= zD!dXR2h%!^H;96cg$PRP3?iq9L7G>iptXqJ5~oWv#l4@JHjC1-atP!wJu3(-&+2sw mW6%W$hcbFrC-EVYfkDfMRGZOi!zmXeps=*2fB(=3gXX`0)P(T> literal 0 HcmV?d00001 From cfd3eb874a4cf85de2a3587c14124cd8a289c947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Wed, 4 Mar 2020 15:06:35 +0100 Subject: [PATCH 255/301] Fail at startup if cloud certificate is not valid --- .../CertificateAuthorityService.java | 20 +++++-------------- .../CertificateAuthorityUtils.java | 17 ++++++++++++++++ 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java index 5478381c3..bc6284422 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java @@ -7,11 +7,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.bouncycastle.asn1.x500.RDN; -import org.bouncycastle.asn1.x500.X500Name; -import org.bouncycastle.asn1.x500.style.BCStyle; -import org.bouncycastle.asn1.x500.style.IETFUtils; -import org.bouncycastle.cert.jcajce.JcaX509CertificateHolder; import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -19,7 +14,6 @@ import javax.annotation.PostConstruct; import java.io.IOException; import java.security.*; -import java.security.cert.CertificateEncodingException; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.time.Duration; @@ -44,6 +38,7 @@ public class CertificateAuthorityService { private X509Certificate rootCertificate; private X509Certificate cloudCertificate; + private String cloudCommonName; @PostConstruct private void init() { @@ -53,26 +48,21 @@ private void init() { rootCertificate = Utilities.getRootCertFromKeyStore(keyStore); cloudCertificate = Utilities.getCloudCertFromKeyStore(keyStore); + cloudCommonName = CertificateAuthorityUtils.getCloudCommonName(cloudCertificate); } public String getCloudCommonName() { - try { - final X500Name subject = new JcaX509CertificateHolder(cloudCertificate).getSubject(); - final RDN cn = subject.getRDNs(BCStyle.CN)[0]; - return IETFUtils.valueToString(cn.getFirst().getValue()); - } catch (CertificateEncodingException e) { - throw new ServiceConfigurationError("Cannot get cloud common name from server cert.", e); - } + return cloudCommonName; } public CertificateSigningResponseDTO signCertificate(CertificateSigningRequestDTO request) { final JcaPKCS10CertificationRequest csr = CertificateAuthorityUtils.decodePKCS10CSR(request); - CertificateAuthorityUtils.checkCommonName(csr, getCloudCommonName()); + CertificateAuthorityUtils.checkCommonName(csr, cloudCommonName); CertificateAuthorityUtils.checkCsrSignature(csr); logger.info("Signing certificate for " + csr.getSubject().toString() + "..."); - final PrivateKey cloudPrivateKey = Utilities.getPrivateKey(keyStore, getCloudCommonName(), + final PrivateKey cloudPrivateKey = Utilities.getPrivateKey(keyStore, cloudCommonName, sslProperties.getKeyPassword()); final X509Certificate clientCertificate = buildCertificate(csr, cloudPrivateKey, cloudCertificate); diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java index 54158a4de..8d45f1062 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java @@ -15,14 +15,20 @@ import java.time.ZonedDateTime; import java.util.Base64; import java.util.Date; +import java.util.ServiceConfigurationError; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.bouncycastle.asn1.x500.RDN; +import org.bouncycastle.asn1.x500.X500Name; +import org.bouncycastle.asn1.x500.style.BCStyle; +import org.bouncycastle.asn1.x500.style.IETFUtils; import org.bouncycastle.asn1.x509.BasicConstraints; import org.bouncycastle.asn1.x509.Extension; import org.bouncycastle.cert.CertIOException; import org.bouncycastle.cert.X509v3CertificateBuilder; import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; +import org.bouncycastle.cert.jcajce.JcaX509CertificateHolder; import org.bouncycastle.cert.jcajce.JcaX509ExtensionUtils; import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder; import org.bouncycastle.jce.provider.BouncyCastleProvider; @@ -61,6 +67,17 @@ static String encodeCertificate(X509Certificate certificate) { } } + static String getCloudCommonName(X509Certificate cloudCertificate) { + try { + final X500Name subject = new JcaX509CertificateHolder(cloudCertificate).getSubject(); + final RDN cn = subject.getRDNs(BCStyle.CN)[0]; + return IETFUtils.valueToString(cn.getFirst().getValue()); + } catch (CertificateEncodingException | NullPointerException e) { + logger.error("Cannot get common name from cloud cert, because: " + e.getMessage()); + throw new ServiceConfigurationError("Cannot get common name from cloud cert.", e); + } + } + static void checkCommonName(JcaPKCS10CertificationRequest csr, String cloudCN) { final String clientCN = Utilities.getCertCNFromSubject(csr.getSubject().toString()); if (!Utilities.isKeyStoreCNArrowheadValid(clientCN, cloudCN)) { From 048a1a17e93f28d6af4e5c12bf0e1c73fd35e84e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Wed, 4 Mar 2020 15:57:57 +0100 Subject: [PATCH 256/301] Extract string literals to constants --- .../certificate_authority/CertificateAuthorityUtils.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java index 8d45f1062..aa2c28409 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java @@ -49,6 +49,9 @@ class CertificateAuthorityUtils { private static final Logger logger = LogManager.getLogger(CertificateAuthorityService.class); + private static final String PROVIDER = "BC"; + private static final String SIGNATURE_ALGORITM = "SHA512withRSA"; + static JcaPKCS10CertificationRequest decodePKCS10CSR(CertificateSigningRequestDTO csr) { try { final byte[] csrBytes = Base64.getDecoder().decode(csr.getEncodedCSR()); @@ -90,7 +93,7 @@ static void checkCommonName(JcaPKCS10CertificationRequest csr, String cloudCN) { static void checkCsrSignature(JcaPKCS10CertificationRequest csr) { Security.addProvider(new BouncyCastleProvider()); try { - ContentVerifierProvider verifierProvider = new JcaContentVerifierProviderBuilder().setProvider("BC") + ContentVerifierProvider verifierProvider = new JcaContentVerifierProviderBuilder().setProvider(PROVIDER) .build(csr.getSubjectPublicKeyInfo()); if (!csr.isSignatureValid(verifierProvider)) { throw new AuthException("Certificate request has invalid signature! (key pair does not match)"); @@ -144,9 +147,9 @@ static X509Certificate buildCertificate(JcaPKCS10CertificationRequest csr, Priva throw new AuthException("Appending extensions to the certificate failed! (" + e.getMessage() + ")", e); } - JcaContentSignerBuilder signerBuilder = new JcaContentSignerBuilder("SHA512withRSA").setProvider("BC"); + JcaContentSignerBuilder signerBuilder = new JcaContentSignerBuilder(SIGNATURE_ALGORITM).setProvider(PROVIDER); try { - return new JcaX509CertificateConverter().setProvider("BC") + return new JcaX509CertificateConverter().setProvider(PROVIDER) .getCertificate(builder.build(signerBuilder.build(cloudPrivateKey))); } catch (CertificateException e) { throw new AuthException("Certificate encoding failed! (" + e.getMessage() + ")", e); From c6091f841b95918212b15582d4b2d50f24edda3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Wed, 4 Mar 2020 15:59:22 +0100 Subject: [PATCH 257/301] Initialize Security provider only once --- .../CertificateAuthorityApplicationInitListener.java | 11 +++++++++++ .../CertificateAuthorityUtils.java | 3 --- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityApplicationInitListener.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityApplicationInitListener.java index 159dd1c88..aa3e97061 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityApplicationInitListener.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityApplicationInitListener.java @@ -1,9 +1,20 @@ package eu.arrowhead.core.certificate_authority; +import java.security.Security; + +import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.stereotype.Component; import eu.arrowhead.common.ApplicationInitListener; @Component public class CertificateAuthorityApplicationInitListener extends ApplicationInitListener { + @Override + protected void customInit(ContextRefreshedEvent event) { + logger.debug("customInit started..."); + + Security.addProvider(new BouncyCastleProvider()); + } + } diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java index aa2c28409..06e8b73c3 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java @@ -6,7 +6,6 @@ import java.security.PrivateKey; import java.security.PublicKey; import java.security.SecureRandom; -import java.security.Security; import java.security.cert.CertificateEncodingException; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; @@ -31,7 +30,6 @@ import org.bouncycastle.cert.jcajce.JcaX509CertificateHolder; import org.bouncycastle.cert.jcajce.JcaX509ExtensionUtils; import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder; -import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.operator.ContentVerifierProvider; import org.bouncycastle.operator.OperatorCreationException; import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; @@ -91,7 +89,6 @@ static void checkCommonName(JcaPKCS10CertificationRequest csr, String cloudCN) { } static void checkCsrSignature(JcaPKCS10CertificationRequest csr) { - Security.addProvider(new BouncyCastleProvider()); try { ContentVerifierProvider verifierProvider = new JcaContentVerifierProviderBuilder().setProvider(PROVIDER) .build(csr.getSubjectPublicKeyInfo()); From 995b4e9d7890769fbad7a74731752a43fb8a3c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Wed, 4 Mar 2020 16:14:21 +0100 Subject: [PATCH 258/301] Fix typo --- .../core/certificate_authority/CertificateAuthorityUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java index 06e8b73c3..e6ede305f 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java @@ -122,7 +122,7 @@ static X509Certificate buildCertificate(JcaPKCS10CertificationRequest csr, Priva X509v3CertificateBuilder builder = new JcaX509v3CertificateBuilder(cloudCertificate, serial, validFrom, validUntil, csr.getSubject(), clientKey); - /** + /* * Adding the following extensions to the new certificate: * * 1) The subject key identifier provides a hashed value that should uniquely From 654c2128d5e4f8e42dbe1f412d4655d333e18396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Thu, 5 Mar 2020 16:21:01 +0100 Subject: [PATCH 259/301] Add SAN extensions to the certificate --- .../CertificateAuthorityUtils.java | 76 +++++++++++++++---- 1 file changed, 60 insertions(+), 16 deletions(-) diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java index e6ede305f..742d58aeb 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java @@ -12,18 +12,25 @@ import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; +import java.util.ArrayList; import java.util.Base64; import java.util.Date; +import java.util.List; import java.util.ServiceConfigurationError; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.bouncycastle.asn1.pkcs.Attribute; +import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers; import org.bouncycastle.asn1.x500.RDN; import org.bouncycastle.asn1.x500.X500Name; import org.bouncycastle.asn1.x500.style.BCStyle; import org.bouncycastle.asn1.x500.style.IETFUtils; import org.bouncycastle.asn1.x509.BasicConstraints; import org.bouncycastle.asn1.x509.Extension; +import org.bouncycastle.asn1.x509.Extensions; +import org.bouncycastle.asn1.x509.GeneralName; +import org.bouncycastle.asn1.x509.GeneralNames; import org.bouncycastle.cert.CertIOException; import org.bouncycastle.cert.X509v3CertificateBuilder; import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; @@ -48,7 +55,7 @@ class CertificateAuthorityUtils { private static final Logger logger = LogManager.getLogger(CertificateAuthorityService.class); private static final String PROVIDER = "BC"; - private static final String SIGNATURE_ALGORITM = "SHA512withRSA"; + private static final String SIGNATURE_ALGORITHM = "SHA512withRSA"; static JcaPKCS10CertificationRequest decodePKCS10CSR(CertificateSigningRequestDTO csr) { try { @@ -122,20 +129,43 @@ static X509Certificate buildCertificate(JcaPKCS10CertificationRequest csr, Priva X509v3CertificateBuilder builder = new JcaX509v3CertificateBuilder(cloudCertificate, serial, validFrom, validUntil, csr.getSubject(), clientKey); - /* + addCertificateExtensions(builder, csr, clientKey, cloudCertificate); + + JcaContentSignerBuilder signerBuilder = new JcaContentSignerBuilder(SIGNATURE_ALGORITHM).setProvider(PROVIDER); + try { + return new JcaX509CertificateConverter().setProvider(PROVIDER) + .getCertificate(builder.build(signerBuilder.build(cloudPrivateKey))); + } catch (CertificateException e) { + throw new AuthException("Certificate encoding failed! (" + e.getMessage() + ")", e); + } catch (OperatorCreationException e) { + throw new AuthException("Certificate signing failed! (" + e.getMessage() + ")", e); + } + } + + /** * Adding the following extensions to the new certificate: + *
      + *
    1. The subject alternative name makes possible to use the certificate for + * accessing a host via IP address or hostname
    2. * - * 1) The subject key identifier provides a hashed value that should uniquely - * identify the public key + *
    3. The subject key identifier provides a hashed value that should uniquely + * identify the public key
    4. * - * 2) The authority key identifier provides a hashed value that should uniquely - * identify the issuer of the certificate + *
    5. The authority key identifier provides a hashed value that should uniquely + * identify the issuer of the certificate
    6. * - * 3) And this basic constraint is for forbidding issuing other certificates - * under this certificate + *
    7. And this basic constraint is for forbidding issuing other certificates + * under this certificate
    8. + *
    */ + static void addCertificateExtensions(X509v3CertificateBuilder builder, JcaPKCS10CertificationRequest csr, + PublicKey clientKey, X509Certificate cloudCertificate) { try { JcaX509ExtensionUtils extUtils = new JcaX509ExtensionUtils(); + + final List subjectAlternativeNames = getSubjectAlternativeNames(csr); + builder.addExtension(Extension.subjectAlternativeName, false, + new GeneralNames(subjectAlternativeNames.toArray(new GeneralName[] {}))); builder.addExtension(Extension.subjectKeyIdentifier, false, extUtils.createSubjectKeyIdentifier(clientKey)); builder.addExtension(Extension.authorityKeyIdentifier, false, extUtils.createAuthorityKeyIdentifier(cloudCertificate)); @@ -143,16 +173,30 @@ static X509Certificate buildCertificate(JcaPKCS10CertificationRequest csr, Priva } catch (NoSuchAlgorithmException | CertIOException | CertificateEncodingException e) { throw new AuthException("Appending extensions to the certificate failed! (" + e.getMessage() + ")", e); } + } - JcaContentSignerBuilder signerBuilder = new JcaContentSignerBuilder(SIGNATURE_ALGORITM).setProvider(PROVIDER); - try { - return new JcaX509CertificateConverter().setProvider(PROVIDER) - .getCertificate(builder.build(signerBuilder.build(cloudPrivateKey))); - } catch (CertificateException e) { - throw new AuthException("Certificate encoding failed! (" + e.getMessage() + ")", e); - } catch (OperatorCreationException e) { - throw new AuthException("Certificate signing failed! (" + e.getMessage() + ")", e); + static List getSubjectAlternativeNames(JcaPKCS10CertificationRequest csr) { + List alternativeNames = new ArrayList<>(); + + for (final Attribute attribute : csr.getAttributes()) { + if (attribute == null) { + continue; + } + if (attribute.getAttrType().equals(PKCSObjectIdentifiers.pkcs_9_at_extensionRequest)) { + final Extensions extensions = Extensions.getInstance(attribute.getAttrValues().getObjectAt(0)); + final GeneralNames generalNames = GeneralNames.fromExtensions(extensions, + Extension.subjectAlternativeName); + if (generalNames != null && generalNames.getNames() != null && generalNames.getNames().length > 0) { + for (final GeneralName name : generalNames.getNames()) { + if (name.getTagNo() == GeneralName.dNSName || name.getTagNo() == GeneralName.iPAddress) { + alternativeNames.add(name); + } + } + } + } } + + return alternativeNames; } private CertificateAuthorityUtils() { From 039ffaa38fd6c7524adc593e5b2ccf623bc142e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Thu, 5 Mar 2020 16:46:31 +0100 Subject: [PATCH 260/301] Remove unnecessary DB permissions for CA --- docker-all/example/sql/setup.sql | 32 ------------------ scripts/certificate_authority_privileges.sql | 34 -------------------- 2 files changed, 66 deletions(-) diff --git a/docker-all/example/sql/setup.sql b/docker-all/example/sql/setup.sql index 1ad2be0ae..8fc8e0225 100644 --- a/docker-all/example/sql/setup.sql +++ b/docker-all/example/sql/setup.sql @@ -540,42 +540,10 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'gateway'@'%'; -- Certificate Authority DROP USER IF EXISTS 'certificate_authority'@'localhost'; CREATE USER IF NOT EXISTS 'certificate_authority'@'localhost' IDENTIFIED BY 'FsdG6Kgf9QpPfv2'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`certificate_authority` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`certificate_authority_interface_connection` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'certificate_authority'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'certificate_authority'@'localhost'; DROP USER IF EXISTS 'certificate_authority'@'%'; CREATE USER IF NOT EXISTS 'certificate_authority'@'%' IDENTIFIED BY 'FsdG6Kgf9QpPfv2'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`certificate_authority` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`certificate_authority_interface_connection` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'certificate_authority'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'certificate_authority'@'%'; FLUSH PRIVILEGES; diff --git a/scripts/certificate_authority_privileges.sql b/scripts/certificate_authority_privileges.sql index b09cc1cbb..e39d0c9f7 100644 --- a/scripts/certificate_authority_privileges.sql +++ b/scripts/certificate_authority_privileges.sql @@ -1,43 +1,9 @@ USE `arrowhead`; REVOKE ALL, GRANT OPTION FROM 'certificate_authority'@'localhost'; - -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`certificate_authority` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`certificate_authority_interface_connection` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'certificate_authority'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'certificate_authority'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'certificate_authority'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'certificate_authority'@'%'; - -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`certificate_authority` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`certificate_authority_interface_connection` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`orchestrator_store` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`subscription` TO 'certificate_authority'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`subscription_publisher_connection` TO 'certificate_authority'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'certificate_authority'@'%'; FLUSH PRIVILEGES; From cb0ba2099f9d2479430b37c2caa9eb092001a7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Thu, 5 Mar 2020 17:27:11 +0100 Subject: [PATCH 261/301] Add description for the configurable CA properties --- ...itional-spring-configuration-metadata.json | 30 ++++--------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/serviceregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/serviceregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 8ccdfc698..2623b21e2 100644 --- a/serviceregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/serviceregistry/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -1,28 +1,13 @@ {"properties": [ { - "name": "ping_scheduled", - "type": "java.lang.Boolean", - "description": "A description for 'ping_scheduled'" - }, - { - "name": "ping_timeout", - "type": "java.lang.Long", - "description": "A description for 'ping_timeout'" - }, - { - "name": "ping_interval", + "name": "ca.validity.negative-offest-millis", "type": "java.lang.Long", - "description": "A description for 'ping_interval'" + "description": "The negative offset in milliseconds from the current time for the beginning of the validity of the generated certificates" }, { - "name": "ttl_scheduled", - "type": "java.lang.Boolean", - "description": "A description for 'ttl_scheduled'" - }, - { - "name": "ttl_interval", + "name": "ca.validity.positive-offest-millis", "type": "java.lang.Long", - "description": "A description for 'ttl_interval'" + "description": "The offset in milliseconds from the current time for the end of the validity of the generated certificates" }, { "name": "disable.hostname.verifier", @@ -34,11 +19,6 @@ "type": "java.lang.Boolean", "description": "A description for 'log_all_request_and_response'" }, - { - "name": "use_strict_service_intf_name_verifier", - "type": "java.lang.Boolean", - "description": "A description for 'use_strict_service_intf_name_verifier'" - }, { "name": "core_system_name", "type": "java.lang.String", @@ -54,4 +34,4 @@ "type": "java.lang.Integer", "description": "A description for 'domain.port'" } -]} \ No newline at end of file +]} From 23a57e082fee29c6b8132e65ec5f8a09751d4047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Thu, 5 Mar 2020 17:34:32 +0100 Subject: [PATCH 262/301] Removed unnecessary lines from CA deb scripts --- certificate-authority/src/deb/control/postinst | 6 ------ certificate-authority/src/deb/control/postrm | 5 ++--- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/certificate-authority/src/deb/control/postinst b/certificate-authority/src/deb/control/postinst index 79e93a8f3..e7ed018aa 100644 --- a/certificate-authority/src/deb/control/postinst +++ b/certificate-authority/src/deb/control/postinst @@ -44,12 +44,6 @@ case "$1" in ah_cert_signed_system ${SYSTEM_NAME} - if [ ! -d "${AH_SYSTEMS_DIR}/sysop" ]; then - mkdir -p ${AH_SYSTEMS_DIR}/sysop - fi - - ah_cert_signed_system sysop - # modify log config and application.properties ah_transform_log_file ${SYSTEM_DIR} diff --git a/certificate-authority/src/deb/control/postrm b/certificate-authority/src/deb/control/postrm index 1af2f066c..9b46d8e3a 100644 --- a/certificate-authority/src/deb/control/postrm +++ b/certificate-authority/src/deb/control/postrm @@ -31,12 +31,11 @@ case "$1" in rm -f \ /var/log/arrowhead/${SYSTEM_NAME}*.log \ - ${SYSTEM_DIR}/log4j2.xml \ + ${SYSTEM_DIR}/log4j2.xml \ ${SYSTEM_DIR}/application.properties \ ${SYSTEM_DIR}/${SYSTEM_NAME}.p12 \ - ${AH_SYSTEMS_DIR}/sysop/sysop.p12 rmdir ${SYSTEM_DIR} 2>/dev/null || true - rmdir ${AH_SYSTEMS_DIR}/sysop 2>/dev/null || true + rmdir ${AH_SYSTEMS_DIR}/sysop 2>/dev/null || true db_purge ;; remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) From db9bceca9ce02766834806218687244d3fd49cdd Mon Sep 17 00:00:00 2001 From: mzsilak Date: Thu, 5 Mar 2020 18:29:31 +0100 Subject: [PATCH 263/301] changed to using default ApplicationInitListener --- ...DeviceRegistryApplicationInitListener.java | 100 +---------- .../service/DeviceRegistryDBService.java | 50 ------ .../DeviceRegistryTestContext.java | 24 +++ .../OnboardingApplicationInitListener.java | 100 +---------- .../database/service/OnboardingDBService.java | 162 +----------------- .../core/qos/QoSMonitorController.java | 29 ++-- .../security/SRAccessControlFilter.java | 13 +- ...SystemRegistryApplicationInitListener.java | 93 +--------- .../service/SystemRegistryDBService.java | 85 ++++----- 9 files changed, 99 insertions(+), 557 deletions(-) diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java index 76b936d83..247d7f1a0 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java @@ -1,114 +1,22 @@ package eu.arrowhead.core.deviceregistry; import eu.arrowhead.common.ApplicationInitListener; -import eu.arrowhead.common.CommonConstants; -import eu.arrowhead.common.CoreDefaults; -import eu.arrowhead.common.database.entity.System; -import eu.arrowhead.common.database.service.CommonDBService; -import eu.arrowhead.common.exception.ArrowheadException; -import eu.arrowhead.common.exception.DataNotFoundException; -import eu.arrowhead.core.deviceregistry.database.service.DeviceRegistryDBService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.stereotype.Component; import java.util.Base64; -import java.util.List; -import java.util.Map; @Component -public class DeviceRegistryApplicationInitListener extends ApplicationInitListener -{ +public class DeviceRegistryApplicationInitListener extends ApplicationInitListener { //================================================================================================= // members - private final CommonDBService commonDBService; - private final DeviceRegistryDBService deviceRegistryDBService; - - @Autowired - public DeviceRegistryApplicationInitListener(final CommonDBService commonDBService, - final DeviceRegistryDBService deviceRegistryDBService) - { - this.commonDBService = commonDBService; - this.deviceRegistryDBService = deviceRegistryDBService; - } - - //================================================================================================= - // assistant methods - //------------------------------------------------------------------------------------------------- @Override - protected void customInit(final ContextRefreshedEvent event) - { - logger.debug("customInit started..."); - if (!isOwnCloudRegistered()) - { - registerOwnCloud(event.getApplicationContext()); - } - - try - { - final String name = coreSystemRegistrationProperties.getCoreSystem().name().toLowerCase(); - final List oldSystems = deviceRegistryDBService.getSystemByName(name); - if (!oldSystems.isEmpty()) - { - for (final System system : oldSystems) - { - deviceRegistryDBService.removeSystemById(system.getId()); - } - } - - final String authInfo = sslProperties.isSslEnabled() ? Base64.getEncoder().encodeToString(publicKey.getEncoded()) : null; - deviceRegistryDBService.createSystem(name, - coreSystemRegistrationProperties.getCoreSystemDomainName(), - coreSystemRegistrationProperties.getCoreSystemDomainPort(), - authInfo); - } - catch (final ArrowheadException ex) - { - logger.error("Can't register {} as a system.", coreSystemRegistrationProperties.getCoreSystem().name()); - logger.debug("Stacktrace", ex); - } - } - - //------------------------------------------------------------------------------------------------- - private boolean isOwnCloudRegistered() - { - logger.debug("isOwnCloudRegistered started..."); - try - { - commonDBService.getOwnCloud(sslProperties.isSslEnabled()); - return true; - } - catch (final DataNotFoundException ex) - { - return false; - } - } - - //------------------------------------------------------------------------------------------------- - private void registerOwnCloud(final ApplicationContext appContext) - { - logger.debug("registerOwnCloud started..."); - - if (!standaloneMode) - { - String name = CoreDefaults.DEFAULT_OWN_CLOUD_NAME; - String operator = CoreDefaults.DEFAULT_OWN_CLOUD_OPERATOR; - - if (sslProperties.isSslEnabled()) - { - @SuppressWarnings("unchecked") final Map context = appContext.getBean(CommonConstants.ARROWHEAD_CONTEXT, Map.class); - final String serverCN = (String) context.get(CommonConstants.SERVER_COMMON_NAME); - final String[] serverFields = serverCN.split("\\."); - name = serverFields[1]; - operator = serverFields[2]; - } - - commonDBService.insertOwnCloud(operator, name, sslProperties.isSslEnabled(), null); - logger.info("{}.{} own cloud is registered in {} mode.", name, operator, getModeString()); + protected void customInit(final ContextRefreshedEvent event) { + if (sslProperties.isSslEnabled()) { + logger.debug("AuthInfo: {}" + Base64.getEncoder().encodeToString(publicKey.getEncoded())); } } } \ No newline at end of file diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java index 294330add..3a7503041 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java @@ -3,7 +3,6 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.CoreUtilities; -import eu.arrowhead.common.SSLProperties; import eu.arrowhead.common.Utilities; import eu.arrowhead.common.database.entity.Device; import eu.arrowhead.common.database.entity.DeviceRegistry; @@ -26,7 +25,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.stereotype.Service; @@ -494,32 +492,6 @@ public DeviceQueryResultDTO queryRegistry(final DeviceQueryFormDTO form) { } } - //------------------------------------------------------------------------------------------------- - @Transactional(rollbackFor = ArrowheadException.class) - public List getSystemByName(final String name) { - try { - return systemRepository.findBySystemName(Utilities.lowerCaseTrim(name)); - } catch (final Exception ex) { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } - } - - //------------------------------------------------------------------------------------------------- - @Transactional(rollbackFor = ArrowheadException.class) - public System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) { - logger.debug("createSystem started..."); - - final System system = validateNonNullSystemParameters(systemName, address, port, authenticationInfo); - - try { - return systemRepository.saveAndFlush(system); - } catch (final Exception ex) { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } - } - //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- @@ -653,28 +625,6 @@ private Device findOrCreateDevice(String deviceName, String address, String macA return provider; } - //------------------------------------------------------------------------------------------------- - private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) { - logger.debug("validateNonNullSystemParameters started..."); - - if (Utilities.isEmpty(systemName)) { - throw new InvalidParameterException("Name is null or empty"); - } - if (Utilities.isEmpty(address)) { - throw new InvalidParameterException("Address is null or empty"); - } - if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { - throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); - } - - final String validatedSystemName = Utilities.lowerCaseTrim(systemName); - final String validatedAddress = Utilities.lowerCaseTrim(address); - - checkConstraintsOfSystemTable(validatedSystemName, validatedAddress, port); - - return new System(validatedSystemName, validatedAddress, port, authenticationInfo); - } - //------------------------------------------------------------------------------------------------- private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) { logger.debug("checkConstraintsOfSystemTable started..."); diff --git a/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryTestContext.java b/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryTestContext.java index 671a72988..7f4b897d4 100644 --- a/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryTestContext.java +++ b/deviceregistry/src/test/java/eu/arrowhead/core/deviceregistry/DeviceRegistryTestContext.java @@ -2,6 +2,9 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.database.repository.CloudRepository; +import eu.arrowhead.common.database.repository.DeviceRegistryRepository; +import eu.arrowhead.common.database.repository.DeviceRepository; +import eu.arrowhead.common.database.repository.SystemRepository; import eu.arrowhead.common.database.service.CommonDBService; import eu.arrowhead.core.deviceregistry.database.service.DeviceRegistryDBService; import org.mockito.Mockito; @@ -47,4 +50,25 @@ public CommonDBService mockCommonDBService() { public CloudRepository mockCloudRepository() { return Mockito.mock(CloudRepository.class); } + + //------------------------------------------------------------------------------------------------- + @Bean + @Primary // This bean is primary only in test context + public DeviceRegistryRepository mockDeviceRegistryRepository() { + return Mockito.mock(DeviceRegistryRepository.class); + } + + //------------------------------------------------------------------------------------------------- + @Bean + @Primary // This bean is primary only in test context + public DeviceRepository mockDeviceRepository() { + return Mockito.mock(DeviceRepository.class); + } + + //------------------------------------------------------------------------------------------------- + @Bean + @Primary // This bean is primary only in test context + public SystemRepository mockSystemRepository() { + return Mockito.mock(SystemRepository.class); + } } \ No newline at end of file diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java index efed23160..8d4363672 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java @@ -1,114 +1,22 @@ package eu.arrowhead.core.onboarding; import eu.arrowhead.common.ApplicationInitListener; -import eu.arrowhead.common.CommonConstants; -import eu.arrowhead.common.CoreDefaults; -import eu.arrowhead.common.database.entity.System; -import eu.arrowhead.common.database.service.CommonDBService; -import eu.arrowhead.common.exception.ArrowheadException; -import eu.arrowhead.common.exception.DataNotFoundException; -import eu.arrowhead.core.onboarding.database.service.OnboardingDBService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.stereotype.Component; import java.util.Base64; -import java.util.List; -import java.util.Map; @Component -public class OnboardingApplicationInitListener extends ApplicationInitListener -{ +public class OnboardingApplicationInitListener extends ApplicationInitListener { //================================================================================================= // members - private final CommonDBService commonDBService; - private final OnboardingDBService onboardingControllerDBService; - - @Autowired - public OnboardingApplicationInitListener(final CommonDBService commonDBService, - final OnboardingDBService onboardingControllerDBService) - { - this.commonDBService = commonDBService; - this.onboardingControllerDBService = onboardingControllerDBService; - } - - //================================================================================================= - // assistant methods - //------------------------------------------------------------------------------------------------- @Override - protected void customInit(final ContextRefreshedEvent event) - { - logger.debug("customInit started..."); - if (!isOwnCloudRegistered()) - { - registerOwnCloud(event.getApplicationContext()); - } - - try - { - final String name = coreSystemRegistrationProperties.getCoreSystem().name().toLowerCase(); - final List oldSystems = onboardingControllerDBService.getSystemByName(name); - if (!oldSystems.isEmpty()) - { - for (final System system : oldSystems) - { - onboardingControllerDBService.removeSystemById(system.getId()); - } - } - - final String authInfo = sslProperties.isSslEnabled() ? Base64.getEncoder().encodeToString(publicKey.getEncoded()) : null; - onboardingControllerDBService.createSystem(name, - coreSystemRegistrationProperties.getCoreSystemDomainName(), - coreSystemRegistrationProperties.getCoreSystemDomainPort(), - authInfo); - } - catch (final ArrowheadException ex) - { - logger.error("Can't register {} as a system.", coreSystemRegistrationProperties.getCoreSystem().name()); - logger.debug("Stacktrace", ex); - } - } - - //------------------------------------------------------------------------------------------------- - private boolean isOwnCloudRegistered() - { - logger.debug("isOwnCloudRegistered started..."); - try - { - commonDBService.getOwnCloud(sslProperties.isSslEnabled()); - return true; - } - catch (final DataNotFoundException ex) - { - return false; - } - } - - //------------------------------------------------------------------------------------------------- - private void registerOwnCloud(final ApplicationContext appContext) - { - logger.debug("registerOwnCloud started..."); - - if (!standaloneMode) - { - String name = CoreDefaults.DEFAULT_OWN_CLOUD_NAME; - String operator = CoreDefaults.DEFAULT_OWN_CLOUD_OPERATOR; - - if (sslProperties.isSslEnabled()) - { - @SuppressWarnings("unchecked") final Map context = appContext.getBean(CommonConstants.ARROWHEAD_CONTEXT, Map.class); - final String serverCN = (String) context.get(CommonConstants.SERVER_COMMON_NAME); - final String[] serverFields = serverCN.split("\\."); - name = serverFields[1]; - operator = serverFields[2]; - } - - commonDBService.insertOwnCloud(operator, name, sslProperties.isSslEnabled(), null); - logger.info("{}.{} own cloud is registered in {} mode.", name, operator, getModeString()); + protected void customInit(final ContextRefreshedEvent event) { + if (sslProperties.isSslEnabled()) { + logger.debug("AuthInfo: {}" + Base64.getEncoder().encodeToString(publicKey.getEncoded())); } } } \ No newline at end of file diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java index 16fd5d7c3..ed9441af4 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java @@ -1,41 +1,24 @@ package eu.arrowhead.core.onboarding.database.service; -import eu.arrowhead.common.CommonConstants; -import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.SSLProperties; -import eu.arrowhead.common.Utilities; -import eu.arrowhead.common.database.entity.System; -import eu.arrowhead.common.database.repository.SystemRepository; import eu.arrowhead.common.dto.shared.OnboardingWithCsrRequestDTO; import eu.arrowhead.common.dto.shared.OnboardingWithCsrResponseDTO; import eu.arrowhead.common.dto.shared.OnboardingWithNameRequestDTO; import eu.arrowhead.common.dto.shared.OnboardingWithNameResponseDTO; -import eu.arrowhead.common.exception.ArrowheadException; -import eu.arrowhead.common.exception.InvalidParameterException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; -import java.util.Optional; @Service -public class OnboardingDBService -{ - private static final String COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE = "Could not delete System, with given parameters"; - private static final String PORT_RANGE_ERROR_MESSAGE = "Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + "."; +public class OnboardingDBService { //================================================================================================= // members private final Logger logger = LogManager.getLogger(OnboardingDBService.class); - private final SystemRepository systemRepository; private final SSLProperties sslProperties; @Autowired - public OnboardingDBService(final SystemRepository systemRepository, final SSLProperties sslProperties) - { - this.systemRepository = systemRepository; + public OnboardingDBService(final SSLProperties sslProperties) { this.sslProperties = sslProperties; } @@ -43,157 +26,20 @@ public OnboardingDBService(final SystemRepository systemRepository, final SSLPro // methods //------------------------------------------------------------------------------------------------- - public OnboardingWithNameResponseDTO onboarding(final OnboardingWithNameRequestDTO onboardingRequest) - { + public OnboardingWithNameResponseDTO onboarding(final OnboardingWithNameRequestDTO onboardingRequest) { logger.debug("onboarding started..."); // TODO contact certificate authority return null; } //------------------------------------------------------------------------------------------------- - public OnboardingWithCsrResponseDTO onboarding(final OnboardingWithCsrRequestDTO onboardingRequest) - { + public OnboardingWithCsrResponseDTO onboarding(final OnboardingWithCsrRequestDTO onboardingRequest) { logger.debug("onboarding started..."); // TODO contact certificate authority return null; } - //------------------------------------------------------------------------------------------------- - @Transactional(rollbackFor = ArrowheadException.class) - public List getSystemByName(final String systemName) - { - logger.debug("getSystemByName started..."); - - final String name = validateSystemParamString(systemName); - try - { - return systemRepository.findBySystemName(name); - } - catch (final Exception ex) - { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } - } - - //------------------------------------------------------------------------------------------------- - @Transactional(rollbackFor = ArrowheadException.class) - public void removeSystemById(final long id) - { - logger.debug("removeSystemById started..."); - - try - { - if (!systemRepository.existsById(id)) - { - throw new InvalidParameterException(COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE); - } - - systemRepository.deleteById(id); - systemRepository.flush(); - } - catch (final InvalidParameterException ex) - { - throw ex; - } - catch (final Exception ex) - { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } - } - - //------------------------------------------------------------------------------------------------- - @Transactional(rollbackFor = ArrowheadException.class) - public System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) - { - logger.debug("createSystem started..."); - - final System system = validateNonNullSystemParameters(systemName, address, port, authenticationInfo); - - try - { - return systemRepository.saveAndFlush(system); - } - catch (final Exception ex) - { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } - } - //================================================================================================= // assistant methods - //------------------------------------------------------------------------------------------------- - private String validateSystemParamString(final String param) - { - logger.debug("validateSystemParamString started..."); - - if (Utilities.isEmpty(param)) - { - throw new InvalidParameterException("parameter null or empty"); - } - - return param.trim().toLowerCase(); - } - - //------------------------------------------------------------------------------------------------- - private System validateNonNullSystemParameters(final String systemName, final String address, final int port, final String authenticationInfo) - { - logger.debug("validateNonNullSystemParameters started..."); - - if (Utilities.isEmpty(systemName)) - { - throw new InvalidParameterException("System name is null or empty"); - } - - if (Utilities.isEmpty(address)) - { - throw new InvalidParameterException("System address is null or empty"); - } - - if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) - { - throw new InvalidParameterException(PORT_RANGE_ERROR_MESSAGE); - } - - final String validatedSystemName = systemName.trim().toLowerCase(); - if (validatedSystemName.contains(".")) - { - throw new InvalidParameterException("System name can't contain dot (.)"); - } - final String validatedAddress = address.trim().toLowerCase(); - - checkConstraintsOfSystemTable(validatedSystemName, validatedAddress, port); - - return new System(validatedSystemName, validatedAddress, port, authenticationInfo); - } - - //------------------------------------------------------------------------------------------------- - private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) - { - logger.debug("checkConstraintsOfSystemTable started..."); - - try - { - final Optional find = systemRepository - .findBySystemNameAndAddressAndPort(validatedSystemName.toLowerCase().trim(), validatedAddress.toLowerCase().trim(), validatedPort); - if (find.isPresent()) - { - throw new InvalidParameterException( - "System with name: " + validatedSystemName + ", address: " + validatedAddress + ", port: " + validatedPort + " already exists."); - } - } - catch (final InvalidParameterException ex) - { - throw ex; - } - catch (final Exception ex) - { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } - } - } diff --git a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java index 1b754b16c..02626d4ae 100644 --- a/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java +++ b/qos-monitor/src/main/java/eu/arrowhead/core/qos/QoSMonitorController.java @@ -1,19 +1,5 @@ package eu.arrowhead.core.qos; -import org.apache.http.HttpStatus; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.CrossOrigin; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; - import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.CoreDefaults; @@ -28,6 +14,19 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; +import org.apache.http.HttpStatus; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; @Api(tags = { CoreCommonConstants.SWAGGER_TAG_ALL }) @CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, @@ -100,7 +99,7 @@ public String echoService() { final ValidatedPageParams validParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.QOS_MONITOR_URI + QOS_MONITOR_PING_MEASUREMENTS_MGMT_URI); final PingMeasurementListResponseDTO measurementResponse = qoSDBService.getPingMeasurementResponse(validParameters.getValidatedPage(), validParameters.getValidatedSize(), - validParameters.getValidatedDirecion(), sortField); + validParameters.getValidatedDirection(), sortField); logger.debug("Measurements with page: {} and item_per page: {} retrieved successfully", page, size); return measurementResponse; diff --git a/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/security/SRAccessControlFilter.java b/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/security/SRAccessControlFilter.java index 6c300a0b7..328c838f0 100644 --- a/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/security/SRAccessControlFilter.java +++ b/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/security/SRAccessControlFilter.java @@ -1,11 +1,5 @@ package eu.arrowhead.core.serviceregistry.security; -import java.util.Map; - -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.http.HttpStatus; -import org.springframework.stereotype.Component; - import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.Utilities; @@ -15,6 +9,11 @@ import eu.arrowhead.common.dto.shared.ServiceRegistryRequestDTO; import eu.arrowhead.common.exception.AuthException; import eu.arrowhead.common.security.CoreSystemAccessControlFilter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Component; + +import java.util.Map; @Component @ConditionalOnProperty(name = CommonConstants.SERVER_SSL_ENABLED, matchIfMissing = true) @@ -24,7 +23,7 @@ public class SRAccessControlFilter extends CoreSystemAccessControlFilter { // members private static final CoreSystem[] allowedCoreSystemsForQuery = { CoreSystem.ORCHESTRATOR, CoreSystem.GATEKEEPER, CoreSystem.CERTIFICATE_AUTHORITY, CoreSystem.EVENT_HANDLER, - CoreSystem.AUTHORIZATION }; + CoreSystem.AUTHORIZATION, CoreSystem.ONBOARDING, CoreSystem.DEVICE_REGISTRY, CoreSystem.SYSTEM_REGISTRY }; private static final CoreSystem[] allowedCoreSystemsForQueryBySystemId = { CoreSystem.ORCHESTRATOR }; private static final CoreSystem[] allowedCoreSystemsForQueryBySystemDTO = { CoreSystem.ORCHESTRATOR }; private static final CoreSystem[] allowedCoreSystemsForQueryAll = { CoreSystem.QOS_MONITOR }; diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryApplicationInitListener.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryApplicationInitListener.java index c76d2a422..43616a5c8 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryApplicationInitListener.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryApplicationInitListener.java @@ -1,97 +1,22 @@ package eu.arrowhead.core.systemregistry; import eu.arrowhead.common.ApplicationInitListener; -import eu.arrowhead.common.CommonConstants; -import eu.arrowhead.common.CoreDefaults; -import eu.arrowhead.common.database.entity.System; -import eu.arrowhead.common.database.service.CommonDBService; -import eu.arrowhead.common.exception.ArrowheadException; -import eu.arrowhead.common.exception.DataNotFoundException; -import eu.arrowhead.core.systemregistry.database.service.SystemRegistryDBService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.stereotype.Component; import java.util.Base64; -import java.util.List; -import java.util.Map; @Component public class SystemRegistryApplicationInitListener extends ApplicationInitListener { - - //================================================================================================= - // members - - private final CommonDBService commonDBService; - private final SystemRegistryDBService systemRegistryDBService; - @Autowired - public SystemRegistryApplicationInitListener(final CommonDBService commonDBService, - final SystemRegistryDBService systemRegistryDBService) - { - this.commonDBService = commonDBService; - this.systemRegistryDBService = systemRegistryDBService; - } + //================================================================================================= + // members - //================================================================================================= - // assistant methods - - //------------------------------------------------------------------------------------------------- - @Override - protected void customInit(final ContextRefreshedEvent event) { - logger.debug("customInit started..."); - if (!isOwnCloudRegistered()) { - registerOwnCloud(event.getApplicationContext()); - } - - try { - final String name = coreSystemRegistrationProperties.getCoreSystem().name().toLowerCase(); - final List oldSystems = systemRegistryDBService.getSystemByName(name); - if (!oldSystems.isEmpty()) { - for (final System system : oldSystems) { - systemRegistryDBService.removeSystemById(system.getId()); - } - } - - final String authInfo = sslProperties.isSslEnabled() ? Base64.getEncoder().encodeToString(publicKey.getEncoded()) : null; - systemRegistryDBService.createSystem(name, coreSystemRegistrationProperties.getCoreSystemDomainName(), coreSystemRegistrationProperties.getCoreSystemDomainPort(), authInfo); - } catch (final ArrowheadException ex) { - logger.error("Can't registrate {} as a system.", coreSystemRegistrationProperties.getCoreSystem().name()); - logger.debug("Stacktrace", ex); - } - } - - //------------------------------------------------------------------------------------------------- - private boolean isOwnCloudRegistered() { - logger.debug("isOwnCloudRegistered started..."); - try { - commonDBService.getOwnCloud(sslProperties.isSslEnabled()); - return true; - } catch (final DataNotFoundException ex) { - return false; - } - } - - //------------------------------------------------------------------------------------------------- - private void registerOwnCloud(final ApplicationContext appContext) { - logger.debug("registerOwnCloud started..."); - - if (!standaloneMode) { - String name = CoreDefaults.DEFAULT_OWN_CLOUD_NAME; - String operator = CoreDefaults.DEFAULT_OWN_CLOUD_OPERATOR; - - if (sslProperties.isSslEnabled()) { - @SuppressWarnings("unchecked") - final Map context = appContext.getBean(CommonConstants.ARROWHEAD_CONTEXT, Map.class); - final String serverCN = (String) context.get(CommonConstants.SERVER_COMMON_NAME); - final String[] serverFields = serverCN.split("\\."); - name = serverFields[1]; - operator = serverFields[2]; - } - - commonDBService.insertOwnCloud(operator, name, sslProperties.isSslEnabled(), null); - logger.info("{}.{} own cloud is registered in {} mode.", name, operator, getModeString()); - } - } + //------------------------------------------------------------------------------------------------- + @Override + protected void customInit(final ContextRefreshedEvent event) { + if (sslProperties.isSslEnabled()) { + logger.debug("AuthInfo: {}" + Base64.getEncoder().encodeToString(publicKey.getEncoded())); + } + } } \ No newline at end of file diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java index 6b685f50d..be15b56f9 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java @@ -236,8 +236,8 @@ public System mergeSystem(final long systemId, final String systemName, final St if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) { checkConstraintsOfSystemTable(validatedSystemName != null ? validatedSystemName : system.getSystemName(), - validatedAddress != null ? validatedAddress : system.getAddress(), - validatedPort != null ? validatedPort : system.getPort()); + validatedAddress != null ? validatedAddress : system.getAddress(), + validatedPort != null ? validatedPort : system.getPort()); } if (Utilities.notEmpty(validatedSystemName)) { @@ -297,7 +297,7 @@ public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageP try { final Page devices = deviceRepository.findAll(PageRequest.of(pageParams.getValidatedPage(), pageParams.getValidatedSize(), - pageParams.getValidatedDirection(), validatedSortField)); + pageParams.getValidatedDirection(), validatedSortField)); return DTOConverter.convertDeviceEntryListToDeviceListResponseDTO(devices); } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); @@ -372,9 +372,9 @@ public SystemRegistryListResponseDTO getSystemRegistryEntries(final CoreUtilitie try { final PageRequest pageRequest = PageRequest.of(params.getValidatedPage(), - params.getValidatedSize(), - params.getValidatedDirection(), - validatedSortField); + params.getValidatedSize(), + params.getValidatedDirection(), + validatedSortField); final Page systemRegistryPage = systemRegistryRepository.findAll(pageRequest); return DTOConverter.convertSystemRegistryListToSystemRegistryListResponseDTO(systemRegistryPage); } catch (final Exception ex) { @@ -532,7 +532,7 @@ public SystemRegistryListResponseDTO getSystemRegistryEntriesBySystemName(final final List systemList = systemRepository.findBySystemName(systemName); final PageRequest pageRequest = PageRequest.of(pageParameters.getValidatedPage(), pageParameters.getValidatedSize(), - pageParameters.getValidatedDirection(), sortField); + pageParameters.getValidatedDirection(), sortField); final Page systemRegistries = systemRegistryRepository.findAllBySystemIsIn(systemList, pageRequest); return DTOConverter.convertSystemRegistryListToSystemRegistryListResponseDTO(systemRegistries); @@ -576,8 +576,7 @@ public SystemQueryResultDTO queryRegistry(final SystemQueryFormDTO form) { logger.debug("System not found: {}", systemName); return DTOConverter.convertSystemRegistryListToSystemQueryResultDTO(Collections.emptyList()); } - } - else { + } else { throw new InvalidParameterException("System Name must not be null"); } @@ -600,8 +599,7 @@ public SystemQueryResultDTO queryRegistry(final SystemQueryFormDTO form) { // filter on version if (Objects.nonNull(form.getVersionRequirement())) { registryList.removeIf(e -> Objects.equals(form.getVersionRequirement(), e.getVersion())); - } - else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(form.getMaxVersionRequirement())) { + } else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(form.getMaxVersionRequirement())) { final int minVersion = form.getMinVersionRequirement() == null ? 1 : form.getMinVersionRequirement(); final int maxVersion = form.getMaxVersionRequirement() == null ? Integer.MAX_VALUE : form.getMaxVersionRequirement(); @@ -612,15 +610,15 @@ else if (Objects.nonNull(form.getMinVersionRequirement()) || Objects.nonNull(for if (form.getMetadataRequirements() != null && !form.getMetadataRequirements().isEmpty()) { final Map requiredMetadata = normalizeMetadata(form.getMetadataRequirements()); registryList.removeIf(e -> - { - final Map metadata = Utilities.text2Map(e.getMetadata()); - if (Objects.isNull(metadata)) { - // we have requirements but no metadata -> remove - return true; - } - - return !metadata.entrySet().containsAll(requiredMetadata.entrySet()); - }); + { + final Map metadata = Utilities.text2Map(e.getMetadata()); + if (Objects.isNull(metadata)) { + // we have requirements but no metadata -> remove + return true; + } + + return !metadata.entrySet().containsAll(requiredMetadata.entrySet()); + }); } // filter on ping @@ -645,17 +643,6 @@ public SystemResponseDTO getSystemDtoByNameAndAddressAndPort(final String system return DTOConverter.convertSystemToSystemResponseDTO(system); } - //------------------------------------------------------------------------------------------------- - @Transactional(rollbackFor = ArrowheadException.class) - public List getSystemByName(final String name) { - try { - return systemRepository.findBySystemName(Utilities.lowerCaseTrim(name)); - } catch (final Exception ex) { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } - } - //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public System createSystem(final String systemName, final String address, final int port, final String authenticationInfo) { @@ -692,11 +679,9 @@ private boolean checkSystemIfUniqueValidationNeeded(final System system, final S if (validatedSystemName != null && !actualSystemName.equalsIgnoreCase(validatedSystemName)) { return true; - } - else if (validatedAddress != null && !actualAddress.equalsIgnoreCase(validatedAddress)) { + } else if (validatedAddress != null && !actualAddress.equalsIgnoreCase(validatedAddress)) { return true; - } - else { + } else { return validatedPort != null && actualPort != validatedPort; } } @@ -732,11 +717,11 @@ private Map normalizeMetadata(final Map metadata final Map map = new HashMap<>(); metadata.forEach((k, v) -> - { - if (Objects.nonNull(v)) { - map.put(k.trim(), v.trim()); - } - }); + { + if (Objects.nonNull(v)) { + map.put(k.trim(), v.trim()); + } + }); return map; } @@ -905,9 +890,9 @@ private SystemRegistry getSystemRegistryEntryById(final long id) { //------------------------------------------------------------------------------------------------- private System findOrCreateSystem(SystemRequestDTO requestSystemDto) { return findOrCreateSystem(requestSystemDto.getSystemName(), - requestSystemDto.getAddress(), - requestSystemDto.getPort(), - requestSystemDto.getAuthenticationInfo()); + requestSystemDto.getAddress(), + requestSystemDto.getPort(), + requestSystemDto.getAuthenticationInfo()); } //------------------------------------------------------------------------------------------------- @@ -927,8 +912,7 @@ private System findOrCreateSystem(final String name, final String address, final provider.setAddress(validatedAddress); provider = systemRepository.saveAndFlush(provider); } - } - else { + } else { provider = createSystem(validatedName, validatedAddress, port, authenticationInfo); } return provider; @@ -937,9 +921,9 @@ private System findOrCreateSystem(final String name, final String address, final //------------------------------------------------------------------------------------------------- private Device findOrCreateDevice(DeviceRequestDTO requestDeviceDto) { return findOrCreateDevice(requestDeviceDto.getDeviceName(), - requestDeviceDto.getAddress(), - requestDeviceDto.getMacAddress(), - requestDeviceDto.getAuthenticationInfo()); + requestDeviceDto.getAddress(), + requestDeviceDto.getMacAddress(), + requestDeviceDto.getAuthenticationInfo()); } //------------------------------------------------------------------------------------------------- @@ -960,8 +944,7 @@ private Device findOrCreateDevice(String deviceName, String address, String macA provider.setAddress(validateAddress); provider = deviceRepository.saveAndFlush(provider); } - } - else { + } else { provider = createDevice(validateName, validateAddress, validatedMacAddress, authenticationInfo); } return provider; @@ -997,7 +980,7 @@ private void checkConstraintsOfSystemRegistryTable(final System systemDb, final final Optional find = systemRegistryRepository.findBySystemAndDevice(systemDb, deviceDb); if (find.isPresent()) { throw new InvalidParameterException("System Registry entry with provider: (" + deviceDb.getDeviceName() + ", " + deviceDb.getMacAddress() + - ") and system : " + systemDb.getSystemName() + " already exists."); + ") and system : " + systemDb.getSystemName() + " already exists."); } } catch (final InvalidParameterException ex) { throw ex; From f76b8090347db8f4a17c5f99c4ce4ebbe76eb9b5 Mon Sep 17 00:00:00 2001 From: mzsilak Date: Fri, 6 Mar 2020 11:03:30 +0100 Subject: [PATCH 264/301] WIP commit --- .../core/onboarding/OnboardingController.java | 188 ++++++++++++++---- .../database/service/OnboardingDBService.java | 155 ++++++++++++++- 2 files changed, 303 insertions(+), 40 deletions(-) diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java index e429f78f5..b9f915c49 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java @@ -3,13 +3,17 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.Defaults; +import eu.arrowhead.common.SSLProperties; import eu.arrowhead.common.Utilities; import eu.arrowhead.common.dto.shared.DeviceResponseDTO; import eu.arrowhead.common.dto.shared.OnboardingWithCsrRequestDTO; import eu.arrowhead.common.dto.shared.OnboardingWithCsrResponseDTO; import eu.arrowhead.common.dto.shared.OnboardingWithNameRequestDTO; import eu.arrowhead.common.dto.shared.OnboardingWithNameResponseDTO; +import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.common.exception.AuthException; import eu.arrowhead.common.exception.BadPayloadException; +import eu.arrowhead.common.exception.InvalidParameterException; import eu.arrowhead.core.onboarding.database.service.OnboardingDBService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -19,18 +23,25 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpHeaders; +import org.springframework.util.Assert; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.security.cert.X509Certificate; +import java.util.Base64; +import java.util.Map; import java.util.Objects; +import java.util.Optional; @Api(tags = {CoreCommonConstants.SWAGGER_TAG_ALL}) @CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, @@ -38,8 +49,7 @@ ) @RestController @RequestMapping(CommonConstants.ONBOARDING_URI) -public class OnboardingController -{ +public class OnboardingController { //================================================================================================= // members @@ -49,16 +59,27 @@ public class OnboardingController private static final String DEVICE_NAME_NULL_ERROR_MESSAGE = " Device name must have value "; private static final String CSR_NULL_ERROR_MESSAGE = " CertificateSigningRequest must have value "; + private static final String AUTHENTICATE_WITH_CERTIFICATE = "/certificate"; + private static final String AUTHENTICATE_WITH_SHARED_SECRET = "/sharedsecret"; + private static final String ONBOARDING_WITH_NAME_URI = "/name"; private static final String ONBOARDING_WITH_CSR_URI = "/csr"; private final Logger logger = LogManager.getLogger(OnboardingController.class); private final OnboardingDBService onboardingDBService; + private final SSLProperties sslProperties; + + + @Resource(name = CommonConstants.ARROWHEAD_CONTEXT) + private Map arrowheadContext; + + @Value(value = "${sharedSecret:#{null}}") + private Optional sharedSecret; @Autowired - public OnboardingController(final OnboardingDBService onboardingDBService) - { + public OnboardingController(final OnboardingDBService onboardingDBService, final SSLProperties sslProperties) { this.onboardingDBService = onboardingDBService; + this.sslProperties = sslProperties; } //================================================================================================= @@ -72,48 +93,85 @@ public OnboardingController(final OnboardingDBService onboardingDBService) @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) @GetMapping(path = CommonConstants.ECHO_URI) - public String echoOnboarding() - { + public String echoOnboarding() { return "Got it!"; } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return onboarding certificate", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiOperation(value = "Onboarding with certificate and device name", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = ONBOARDING_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = ONBOARDING_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(AUTHENTICATE_WITH_CERTIFICATE + ONBOARDING_WITH_NAME_URI) + @ResponseBody + public OnboardingWithNameResponseDTO onboardWithCertificateAndName(final HttpServletRequest httpServletRequest, + @RequestBody final OnboardingWithNameRequestDTO onboardingRequest) { + logger.debug("onboardWithCertificateAndName started ..."); + + authenticateCertificate(httpServletRequest); + verifyRequest(onboardingRequest, CommonConstants.ONBOARDING_URI + ONBOARDING_WITH_NAME_URI); + + return onboardingDBService.onboarding(onboardingRequest); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Onboarding with shared secret and device name", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = ONBOARDING_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = ONBOARDING_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(AUTHENTICATE_WITH_SHARED_SECRET + ONBOARDING_WITH_NAME_URI) + @ResponseBody + public OnboardingWithNameResponseDTO onboardWithSharedSecretAndName(@RequestBody final OnboardingWithNameRequestDTO onboardingRequest, + @RequestHeader(HttpHeaders.AUTHORIZATION) final String authorization) { + logger.debug("onboardWithSharedSecretAndName started ..."); + + authenticateSharedSecret(authorization); + verifyRequest(onboardingRequest, CommonConstants.ONBOARDING_URI + ONBOARDING_WITH_NAME_URI); + + return onboardingDBService.onboarding(onboardingRequest); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Onboarding with certificate and certificate signing request", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_OK, message = ONBOARDING_HTTP_200_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = ONBOARDING_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @PostMapping(ONBOARDING_WITH_NAME_URI) + @PostMapping(AUTHENTICATE_WITH_CERTIFICATE + ONBOARDING_WITH_CSR_URI) @ResponseBody - public OnboardingWithNameResponseDTO onboardWithName(final HttpServletRequest httpServletRequest, - @RequestBody final OnboardingWithNameRequestDTO onboardingRequest) - { - logger.debug("onboardWithName started ..."); + public OnboardingWithCsrResponseDTO onboardWithCertificateAndSigningRequest(final HttpServletRequest httpServletRequest, + @RequestBody final OnboardingWithCsrRequestDTO onboardingRequest) { + logger.debug("onboardWithCertificateAndSigningRequest started ..."); - authenticateRequest(httpServletRequest); + authenticateCertificate(httpServletRequest); verifyRequest(onboardingRequest, CommonConstants.ONBOARDING_URI + ONBOARDING_WITH_NAME_URI); return onboardingDBService.onboarding(onboardingRequest); } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return onboarding certificate", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiOperation(value = "Onboarding with certificate and certificate signing request", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_OK, message = ONBOARDING_HTTP_200_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = ONBOARDING_HTTP_400_MESSAGE), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @PostMapping(ONBOARDING_WITH_CSR_URI) + @PostMapping(AUTHENTICATE_WITH_SHARED_SECRET + ONBOARDING_WITH_CSR_URI) @ResponseBody - public OnboardingWithCsrResponseDTO onboardWithCsr(final HttpServletRequest httpServletRequest, - @RequestBody final OnboardingWithCsrRequestDTO onboardingRequest) - { - logger.debug("onboardWithName started ..."); + public OnboardingWithCsrResponseDTO onboardWithSharedSecretAndSigningRequest(@RequestBody final OnboardingWithCsrRequestDTO onboardingRequest, + @RequestHeader(HttpHeaders.AUTHORIZATION) final String authorization) { + logger.debug("onboardWithSharedSecretAndSigningRequest started ..."); - authenticateRequest(httpServletRequest); + authenticateSharedSecret(authorization); verifyRequest(onboardingRequest, CommonConstants.ONBOARDING_URI + ONBOARDING_WITH_NAME_URI); return onboardingDBService.onboarding(onboardingRequest); @@ -123,45 +181,101 @@ public OnboardingWithCsrResponseDTO onboardWithCsr(final HttpServletRequest http // assistant methods //------------------------------------------------------------------------------------------------- - private void authenticateRequest(final HttpServletRequest httpServletRequest) - { + private void authenticateCertificate(final HttpServletRequest httpServletRequest) { final X509Certificate[] certificates = (X509Certificate[]) httpServletRequest.getAttribute(CommonConstants.ATTR_JAVAX_SERVLET_REQUEST_X509_CERTIFICATE); - if (Objects.nonNull(certificates)) - { - // TODO verify certificate with certificate authority + if (sslProperties.isSslEnabled()) { + if (Objects.nonNull(certificates) && certificates.length > 0) { + + // TODO verification should be done by CA + final X509Certificate cert = certificates[0]; + final String clientCN = Utilities.getCertCNFromSubject(cert.getSubjectDN().getName()); + final String requestTarget = Utilities.stripEndSlash(httpServletRequest.getRequestURL().toString()); + + if (!Utilities.isKeyStoreCNArrowheadValid(clientCN)) { + logger.debug("{} is not a valid common name, access denied!", clientCN); + throw new AuthException(clientCN + " is unauthorized to access " + requestTarget); + } + + // All requests from the local cloud are allowed + if (!Utilities.isKeyStoreCNArrowheadValid(clientCN, getServerCloudCN())) { + logger.debug("{} is unauthorized to access {}", clientCN, requestTarget); + throw new AuthException(clientCN + " is unauthorized to access " + requestTarget); + } + } + else + { + logger.debug("No client certificate given!"); + throw new AuthException("Client certificate in needed!"); + } + } + } + + //------------------------------------------------------------------------------------------------- + private void authenticateSharedSecret(final String authorization) { + if (sharedSecret.isEmpty()) { + throw new InvalidParameterException("Shared Secret is not accepted by this service"); + } + + if (Utilities.isEmpty(authorization)) { + throw new AuthException("Basic Authentication is needed for this method", HttpStatus.SC_UNAUTHORIZED); + } + + // Header is in the format "Basic 5tyc0uiDat4" + // We need to extract data before decoding it back to original string + final String[] authParts = authorization.split("\\s+"); + final String authInfo = authParts[1]; + + // Decode the data back to original string + byte[] bytes; + try { + bytes = Base64.getDecoder().decode(authInfo); + } catch (IllegalArgumentException e) { + logger.error(e.getMessage()); + throw new ArrowheadException("Unable to decode authorization header"); + } + + final String expectedSecret = sharedSecret.get(); + final String[] basicAuth = new String(bytes).split(":"); + + if (!(basicAuth.length == 2 && expectedSecret.equals(basicAuth[1]))) { + throw new AuthException("Basic Authentication failed with the given secret", HttpStatus.SC_UNAUTHORIZED); } } //------------------------------------------------------------------------------------------------- - private void verifyRequest(final OnboardingWithNameRequestDTO onboardingRequest, final String origin) - { + private void verifyRequest(final OnboardingWithNameRequestDTO onboardingRequest, final String origin) { logger.debug("verifyRequest started..."); - if (onboardingRequest == null) - { + if (onboardingRequest == null) { throw new BadPayloadException("Request is null.", HttpStatus.SC_BAD_REQUEST, origin); } - if (Utilities.isEmpty(onboardingRequest.getDeviceName())) - { + if (Utilities.isEmpty(onboardingRequest.getDeviceName())) { throw new BadPayloadException(DEVICE_NAME_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); } } //------------------------------------------------------------------------------------------------- - private void verifyRequest(final OnboardingWithCsrRequestDTO onboardingRequest, final String origin) - { + private void verifyRequest(final OnboardingWithCsrRequestDTO onboardingRequest, final String origin) { logger.debug("verifyRequest started..."); - if (onboardingRequest == null) - { + if (onboardingRequest == null) { throw new BadPayloadException("Request is null.", HttpStatus.SC_BAD_REQUEST, origin); } - if (Utilities.isEmpty(onboardingRequest.getCertificateSigningRequest())) - { + if (Utilities.isEmpty(onboardingRequest.getCertificateSigningRequest())) { throw new BadPayloadException(CSR_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); } } + + //------------------------------------------------------------------------------------------------- + private String getServerCloudCN() { + final String serverCN = (String) arrowheadContext.get(CommonConstants.SERVER_COMMON_NAME); + final String[] serverFields = serverCN.split("\\.", 2); // serverFields contains: coreSystemName, cloudName.operator.arrowhead.eu + Assert.isTrue(serverFields.length >= 2, "Server common name is invalid: " + serverCN); + + return serverFields[1]; + } + } \ No newline at end of file diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java index ed9441af4..af918be24 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java @@ -1,25 +1,55 @@ package eu.arrowhead.core.onboarding.database.service; +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreSystemRegistrationProperties; import eu.arrowhead.common.SSLProperties; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.core.CoreSystemService; +import eu.arrowhead.common.database.repository.SystemRepository; import eu.arrowhead.common.dto.shared.OnboardingWithCsrRequestDTO; import eu.arrowhead.common.dto.shared.OnboardingWithCsrResponseDTO; import eu.arrowhead.common.dto.shared.OnboardingWithNameRequestDTO; import eu.arrowhead.common.dto.shared.OnboardingWithNameResponseDTO; +import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; +import eu.arrowhead.common.dto.shared.OrchestrationResponseDTO; +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; +import eu.arrowhead.common.dto.shared.ServiceEndpoint; +import eu.arrowhead.common.dto.shared.ServiceQueryFormDTO; +import eu.arrowhead.common.dto.shared.ServiceQueryResultDTO; +import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.common.http.HttpService; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; +import org.springframework.web.util.UriComponents; + +import java.util.Objects; @Service public class OnboardingDBService { + private static final String COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE = "Could not delete System, with given parameters"; + private static final String PORT_RANGE_ERROR_MESSAGE = "Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + "."; //================================================================================================= // members private final Logger logger = LogManager.getLogger(OnboardingDBService.class); + private final SystemRepository systemRepository; private final SSLProperties sslProperties; + private final HttpService httpService; + private final CoreSystemRegistrationProperties coreSystemRegistrationProperties; @Autowired - public OnboardingDBService(final SSLProperties sslProperties) { + public OnboardingDBService(final SystemRepository systemRepository, final SSLProperties sslProperties, + final HttpService httpService, final CoreSystemRegistrationProperties coreSystemRegistrationProperties) { + this.systemRepository = systemRepository; this.sslProperties = sslProperties; + this.httpService = httpService; + this.coreSystemRegistrationProperties = coreSystemRegistrationProperties; } //================================================================================================= @@ -35,11 +65,130 @@ public OnboardingWithNameResponseDTO onboarding(final OnboardingWithNameRequestD //------------------------------------------------------------------------------------------------- public OnboardingWithCsrResponseDTO onboarding(final OnboardingWithCsrRequestDTO onboardingRequest) { logger.debug("onboarding started..."); - // TODO contact certificate authority - return null; + return executeCertificateSigningRequest(onboardingRequest.getCertificateSigningRequest()); } //================================================================================================= // assistant methods + + //------------------------------------------------------------------------------------------------- + private OnboardingWithCsrResponseDTO executeCertificateSigningRequest(String certificateSigningRequest) { + + final ServiceRegistryResponseDTO orchService = getOrchestratorService(); + // TODO replace with CoreSystemService constant + final OrchestrationResultDTO caOrchResult = contactOrchestrationService(orchService, "ca-sign"); + + final UriComponents caUri = createUri(caOrchResult.getProvider(), + CommonConstants.CERTIFICATE_AUTHRORITY_URI + CommonConstants.OP_CA_SIGN_CERTIFICATE_URI); + + final CertificateSigningRequestDTO csrDTO = new CertificateSigningRequestDTO(certificateSigningRequest); + final ResponseEntity httpResponse = httpService.sendRequest(caUri, HttpMethod.POST, CertificateSigningResponseDTO.class, csrDTO); + + final CertificateSigningResponseDTO csrResult = httpResponse.getBody(); + + if (Objects.isNull(csrResult) || csrResult.getServiceQueryData().isEmpty()) { + throw new ArrowheadException("Unable to contact Certificate Authority"); + } + + final OnboardingWithCsrResponseDTO retValue = new OnboardingWithCsrResponseDTO(); + retValue.setRootCertificate(csrResult.get(0)); + retValue.setIntermediateCertificate(csrResult.get(1)); + retValue.setOnboardingCertificate(csrResult.get(2)); + + final OrchestrationResultDTO drOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_DEVICE_REGISTRY_REGISTER); + final OrchestrationResultDTO sysrOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_SYSTEM_REGISTRY_REGISTER); + final OrchestrationResultDTO srOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_SERVICE_REGISTRY_REGISTER); + + final UriComponents drUri = createUri(drOrchResult.getProvider(), + CommonConstants.DEVICE_REGISTRY_URI + CommonConstants.OP_DEVICE_REGISTRY_REGISTER_URI); + final UriComponents sysrUri = createUri(drOrchResult.getProvider(), + CommonConstants.SYSTEM_REGISTRY_URI + CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI); + final UriComponents srUri = createUri(drOrchResult.getProvider(), + CommonConstants.SERVICE_REGISTRY_URI + CommonConstants.OP_SERVICE_REGISTRY_REGISTER_URI); + + retValue.setDeviceRegistry(new ServiceEndpoint(CoreSystemService.DEVICE_REGISTRY_REGISTER_SERVICE, drUri.toUri())); + retValue.setDeviceRegistry(new ServiceEndpoint(CoreSystemService.SYSTEM_REGISTRY_REGISTER_SERVICE, sysrUri.toUri())); + retValue.setDeviceRegistry(new ServiceEndpoint(CoreSystemService.SERVICE_REGISTRY_REGISTER_SERVICE, srUri.toUri())); + + return retValue; + } + + //------------------------------------------------------------------------------------------------- + private void pingService(final SystemResponseDTO system, final String uriPrefix) { + logger.debug("getCertificateAuthorityService started..."); + + final UriComponents echoUri = createUri(system, uriPrefix + CommonConstants.ECHO_URI); + httpService.sendRequest(echoUri, HttpMethod.GET, String.class); + logger.info("Service at {} is accessible...", echoUri); + } + + //------------------------------------------------------------------------------------------------- + private ServiceRegistryResponseDTO getOrchestratorService() { + + final SystemResponseDTO serviceRegistrySystem = new SystemResponseDTO(); + serviceRegistrySystem.setAddress(coreSystemRegistrationProperties.getServiceRegistryAddress()); + serviceRegistrySystem.setPort(coreSystemRegistrationProperties.getServiceRegistryPort()); + + logger.debug("getOrchestratorService started..."); + pingService(serviceRegistrySystem, CommonConstants.SERVICE_REGISTRY_URI); + + final UriComponents srQueryUri = createUri(serviceRegistrySystem, + CommonConstants.SERVICE_REGISTRY_URI + CommonConstants.OP_SERVICE_REGISTRY_QUERY_URI); + + final ServiceQueryFormDTO srQueryForm = new ServiceQueryFormDTO + .Builder(CoreSystemService.ORCHESTRATION_SERVICE.getServiceDefinition()) + .build(); + + final ResponseEntity httpResponse = httpService.sendRequest(srQueryUri, HttpMethod.POST, ServiceQueryResultDTO.class, srQueryForm); + final ServiceQueryResultDTO srQueryResult = httpResponse.getBody(); + + if (Objects.isNull(srQueryResult) || srQueryResult.getServiceQueryData().isEmpty()) { + throw new ArrowheadException("Unable to find orchestrator service"); + } + + return srQueryResult.getServiceQueryData().get(0); + } + + //------------------------------------------------------------------------------------------------- + private OrchestrationResultDTO contactOrchestrationService(final ServiceRegistryResponseDTO orchService, final String serviceDefinition) { + + logger.debug("contactOrchestrationService started..."); + pingService(orchService.getProvider(), CommonConstants.ORCHESTRATOR_URI); + + final UriComponents orchUri = createUri(orchService.getProvider(), + CommonConstants.ORCHESTRATOR_URI + CommonConstants.OP_ORCH_PROCESS); + + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setAddress(coreSystemRegistrationProperties.getCoreSystemDomainName()); + requester.setPort(coreSystemRegistrationProperties.getCoreSystemDomainPort()); + requester.setSystemName(coreSystemRegistrationProperties.getCoreSystemName()); + + final ServiceQueryFormDTO requestForm = new ServiceQueryFormDTO + .Builder(serviceDefinition) + .build(); + + final OrchestrationFormRequestDTO orchForm = new OrchestrationFormRequestDTO + .Builder(requester) + .requestedService(requestForm) + .build(); + + final ResponseEntity httpResponse = httpService.sendRequest(orchUri, HttpMethod.POST, OrchestrationResponseDTO.class, orchForm); + final OrchestrationResponseDTO orchQueryResult = httpResponse.getBody(); + + if (Objects.isNull(orchQueryResult) || orchQueryResult.getResponse().isEmpty()) { + throw new ArrowheadException("Unable to find " + serviceDefinition); + } + + return orchQueryResult.getResponse().get(0); + } + + //------------------------------------------------------------------------------------------------- + private UriComponents createUri(final SystemResponseDTO system, final String serviceUri) { + final String scheme = sslProperties.isSslEnabled() ? CommonConstants.HTTPS : CommonConstants.HTTP; + return Utilities.createURI(scheme, + system.getAddress(), + system.getPort(), + serviceUri); + } } From 318737c0da7665a7c664e58a65e3bbadc7b8ea74 Mon Sep 17 00:00:00 2001 From: mzsilak Date: Fri, 6 Mar 2020 17:44:17 +0100 Subject: [PATCH 265/301] fixed issues after tests on real devices --- .../CertificateAuthorityService.java | 14 +- core-common/src/deb/control/templates | 7 +- .../eu/arrowhead/common/CommonConstants.java | 21 ++- .../arrowhead/common/OrchestrationDriver.java | 134 ++++++++++++++++++ .../eu/arrowhead/common/core/CoreSystem.java | 81 ++++++----- .../common/core/CoreSystemService.java | 19 ++- .../shared/CertificateCreationRequestDTO.java | 58 ++++++++ .../dto/shared/CertificateResponseDTO.java | 105 ++++++++++++++ .../shared/OnboardingWithCsrResponseDTO.java | 29 ++-- .../shared/OnboardingWithNameRequestDTO.java | 66 ++++----- .../shared/OnboardingWithNameResponseDTO.java | 58 +------- .../src/deb/arrowhead-deviceregistry.service | 2 +- deviceregistry/src/deb/control/postinst | 9 +- .../src/main/resources/application.properties | 4 + .../src/deb/arrowhead-onboarding.service | 2 +- onboarding/src/deb/control/postinst | 7 + .../core/onboarding/OnboardingController.java | 37 +++-- .../database/service/OnboardingDBService.java | 123 ++++------------ .../onboarding/swagger/SRSwaggerConfig.java | 27 ---- .../src/main/resources/application.properties | 8 +- scripts/create_empty_arrowhead_db.sql | 4 +- scripts/device_registry_privileges.sql | 8 -- scripts/onboarding_controller_privileges.sql | 47 +++--- .../security/SRAccessControlFilter.java | 2 +- .../src/deb/arrowhead-systemregistry.service | 2 +- systemregistry/src/deb/control/postinst | 9 +- .../src/main/resources/application.properties | 11 +- systemregistry/src/main/resources/log4j2.xml | 2 +- 28 files changed, 537 insertions(+), 359 deletions(-) create mode 100644 core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationRequestDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateResponseDTO.java delete mode 100644 onboarding/src/main/java/eu/arrowhead/core/onboarding/swagger/SRSwaggerConfig.java diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java index bc6284422..9b834f1cc 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java @@ -4,7 +4,6 @@ import eu.arrowhead.common.Utilities; import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; import eu.arrowhead.common.dto.internal.CertificateSigningResponseDTO; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest; @@ -13,14 +12,21 @@ import javax.annotation.PostConstruct; import java.io.IOException; -import java.security.*; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.SecureRandom; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.time.Duration; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; -import java.util.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.ServiceConfigurationError; @Service public class CertificateAuthorityService { @@ -43,7 +49,7 @@ public class CertificateAuthorityService { @PostConstruct private void init() { random = new SecureRandom(); - random.reseed(); + //random.reseed(); keyStore = getKeyStore(); rootCertificate = Utilities.getRootCertFromKeyStore(keyStore); diff --git a/core-common/src/deb/control/templates b/core-common/src/deb/control/templates index 64705a612..a7b3ab39e 100644 --- a/core-common/src/deb/control/templates +++ b/core-common/src/deb/control/templates @@ -114,7 +114,12 @@ Description: MySQL password for Device Registry system (leave empty for random). Template: arrowhead-core-common/mysql_password_onboarding Type: password Default: -Description: MySQL password for Onboarding controller system (leave empty for random). +Description: MySQL password for Onboarding Controller system (leave empty for random). + +Template: arrowhead-core-common/mysql_password_ca +Type: password +Default: +Description: MySQL password for Certificate Authority system (leave empty for random). Template: arrowhead-core-common/sr_host Type: string diff --git a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java index 1d2e90ed6..7d3a4ac1f 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java @@ -1,12 +1,11 @@ package eu.arrowhead.common; -import java.util.List; - +import eu.arrowhead.common.core.CoreSystemService; import org.jose4j.jwe.ContentEncryptionAlgorithmIdentifiers; import org.jose4j.jwe.KeyManagementAlgorithmIdentifiers; import org.jose4j.jws.AlgorithmIdentifiers; -import eu.arrowhead.common.core.CoreSystemService; +import java.util.List; public class CommonConstants { @@ -63,8 +62,10 @@ public class CommonConstants { public static final String CORE_SERVICE_DEVICE_REGISTRY_REGISTER = "device-register"; public static final String CORE_SERVICE_DEVICE_REGISTRY_UNREGISTER = "device-unregister"; - public static final String CORE_SERVICE_ONBOARDING_NAME = "onboarding-plain"; - public static final String CORE_SERVICE_ONBOARDING_CSR = "onboarding-with-csr"; + public static final String CORE_SERVICE_ONBOARDING_WITH_CERTIFICATE_AND_NAME = "onboarding-with-certificate-and-name"; + public static final String CORE_SERVICE_ONBOARDING_WITH_CERTIFICATE_AND_CSR = "onboarding-with-certificate-and-csr"; + public static final String CORE_SERVICE_ONBOARDING_WITH_SHARED_SECRET_AND_NAME = "onboarding-with-shared-secret-and-name"; + public static final String CORE_SERVICE_ONBOARDING_WITH_SHARED_SECRET_AND_CSR = "onboarding-with-shared-secret-and-csr"; public static final String COMMON_FIELD_NAME_ID = "id"; @@ -113,8 +114,14 @@ public class CommonConstants { public static final String OP_DEVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_MAC_ADDRESS = "mac_address"; public static final String ONBOARDING_URI = "/onboarding"; - public static final String OP_ONBOARDING_NAME = "/name"; - public static final String OP_ONBOARDING_CSR = "/csr"; + public static final String ONBOARDING_AUTH_WITH_CERTIFICATE_URI = "/certificate"; + public static final String ONBOARDING_AUTH_WITH_SHARED_SECRET_URI = "/sharedsecret"; + public static final String ONBOARDING_WITH_NAME_URI = "/name"; + public static final String ONBOARDING_WITH_CSR_URI = "/csr"; + public static final String OP_ONBOARDING_WITH_CERTIFICATE_AND_NAME = ONBOARDING_AUTH_WITH_CERTIFICATE_URI + ONBOARDING_WITH_NAME_URI; + public static final String OP_ONBOARDING_WITH_CERTIFICATE_AND_CSR = ONBOARDING_AUTH_WITH_CERTIFICATE_URI + ONBOARDING_WITH_CSR_URI; + public static final String OP_ONBOARDING_WITH_SHARED_SECRET_AND_NAME = ONBOARDING_AUTH_WITH_SHARED_SECRET_URI + ONBOARDING_WITH_NAME_URI; + public static final String OP_ONBOARDING_WITH_SHARED_SECRET_AND_CSR = ONBOARDING_AUTH_WITH_SHARED_SECRET_URI + ONBOARDING_WITH_CSR_URI; public static final String AUTHORIZATION_URI = "/authorization"; public static final String OP_AUTH_TOKEN_URI = "/token"; diff --git a/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java b/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java new file mode 100644 index 000000000..fd4650f05 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java @@ -0,0 +1,134 @@ +package eu.arrowhead.common; + +import eu.arrowhead.common.core.CoreSystemService; +import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; +import eu.arrowhead.common.dto.shared.OrchestrationResponseDTO; +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; +import eu.arrowhead.common.dto.shared.ServiceQueryFormDTO; +import eu.arrowhead.common.dto.shared.ServiceQueryResultDTO; +import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.common.http.HttpService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Component; +import org.springframework.web.util.UriComponents; + +import java.util.Objects; + +@Component +public class OrchestrationDriver { + + //================================================================================================= + // members + private final Logger logger = LogManager.getLogger(OrchestrationDriver.class); + private final SSLProperties sslProperties; + private final HttpService httpService; + private final CoreSystemRegistrationProperties coreSystemRegistrationProperties; + + @Autowired + public OrchestrationDriver(final SSLProperties sslProperties, final HttpService httpService, + final CoreSystemRegistrationProperties coreSystemRegistrationProperties) { + this.sslProperties = sslProperties; + this.httpService = httpService; + this.coreSystemRegistrationProperties = coreSystemRegistrationProperties; + } + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public void pingService(final SystemResponseDTO system, final String uriPrefix) { + logger.debug("getCertificateAuthorityService started..."); + + final UriComponents echoUri = createUri(system, uriPrefix + CommonConstants.ECHO_URI); + httpService.sendRequest(echoUri, HttpMethod.GET, String.class); + logger.info("Service at {} is accessible...", echoUri); + } + + //------------------------------------------------------------------------------------------------- + public ServiceQueryResultDTO getOrchestratorService() { + + final SystemResponseDTO serviceRegistrySystem = new SystemResponseDTO(); + serviceRegistrySystem.setAddress(coreSystemRegistrationProperties.getServiceRegistryAddress()); + serviceRegistrySystem.setPort(coreSystemRegistrationProperties.getServiceRegistryPort()); + + logger.debug("getOrchestratorService started..."); + pingService(serviceRegistrySystem, CommonConstants.SERVICE_REGISTRY_URI); + + final UriComponents srQueryUri = createUri(serviceRegistrySystem, + CommonConstants.SERVICE_REGISTRY_URI + CommonConstants.OP_SERVICE_REGISTRY_QUERY_URI); + + final ServiceQueryFormDTO srQueryForm = new ServiceQueryFormDTO + .Builder(CoreSystemService.ORCHESTRATION_SERVICE.getServiceDefinition()) + .build(); + + final ResponseEntity httpResponse = httpService.sendRequest(srQueryUri, HttpMethod.POST, ServiceQueryResultDTO.class, srQueryForm); + final ServiceQueryResultDTO srQueryResult = httpResponse.getBody(); + + if (Objects.isNull(srQueryResult) || srQueryResult.getServiceQueryData().isEmpty()) { + throw new ArrowheadException("Unable to find orchestrator service"); + } + + return srQueryResult; + } + + //------------------------------------------------------------------------------------------------- + public OrchestrationResponseDTO contactOrchestrationService(final ServiceRegistryResponseDTO orchService, final String serviceDefinition) { + + logger.debug("contactOrchestrationService started..."); + pingService(orchService.getProvider(), CommonConstants.ORCHESTRATOR_URI); + + final UriComponents orchUri = createUri(orchService.getProvider(), + CommonConstants.ORCHESTRATOR_URI + CommonConstants.OP_ORCH_PROCESS); + + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setAddress(coreSystemRegistrationProperties.getCoreSystemDomainName()); + requester.setPort(coreSystemRegistrationProperties.getCoreSystemDomainPort()); + requester.setSystemName(coreSystemRegistrationProperties.getCoreSystemName()); + + final ServiceQueryFormDTO requestForm = new ServiceQueryFormDTO + .Builder(serviceDefinition) + .build(); + + final OrchestrationFormRequestDTO orchForm = new OrchestrationFormRequestDTO + .Builder(requester) + .requestedService(requestForm) + .build(); + + final ResponseEntity httpResponse = httpService.sendRequest(orchUri, HttpMethod.POST, OrchestrationResponseDTO.class, orchForm); + final OrchestrationResponseDTO orchQueryResult = httpResponse.getBody(); + + if (Objects.isNull(orchQueryResult) || orchQueryResult.getResponse().isEmpty()) { + throw new ArrowheadException("Unable to find " + serviceDefinition); + } + + return orchQueryResult; + } + + //================================================================================================= + // support methods + + //------------------------------------------------------------------------------------------------- + public UriComponents createUri(final SystemResponseDTO system, final String serviceUri) { + final String scheme = sslProperties.isSslEnabled() ? CommonConstants.HTTPS : CommonConstants.HTTP; + return Utilities.createURI(scheme, + system.getAddress(), + system.getPort(), + serviceUri); + } + + //------------------------------------------------------------------------------------------------- + public UriComponents createUri(final OrchestrationResultDTO result) { + final String scheme = sslProperties.isSslEnabled() ? CommonConstants.HTTPS : CommonConstants.HTTP; + return Utilities.createURI(scheme, + result.getProvider().getAddress(), + result.getProvider().getPort(), + result.getServiceUri()); + } +} diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java index 10282d5fb..cd3d7376c 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java @@ -9,46 +9,55 @@ import static eu.arrowhead.common.core.CoreSystemService.DEVICE_REGISTRY_REGISTER_SERVICE; import static eu.arrowhead.common.core.CoreSystemService.DEVICE_REGISTRY_UNREGISTER_SERVICE; -import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_SERVICE_WITH_NAME; +import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_WITH_CERTIFICATE_AND_CSR; +import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_WITH_CERTIFICATE_AND_NAME; +import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_WITH_SHARED_SECRET_AND_CSR; +import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_WITH_SHARED_SECRET_AND_NAME; import static eu.arrowhead.common.core.CoreSystemService.SYSTEM_REGISTRY_REGISTER_SERVICE; import static eu.arrowhead.common.core.CoreSystemService.SYSTEM_REGISTRY_UNREGISTER_SERVICE; public enum CoreSystem { - - //================================================================================================= - // elements - - SERVICE_REGISTRY(Defaults.DEFAULT_SERVICE_REGISTRY_PORT, null), - SYSTEM_REGISTRY(Defaults.DEFAULT_SYSTEM_REGISTRY_PORT, List.of(SYSTEM_REGISTRY_REGISTER_SERVICE, SYSTEM_REGISTRY_UNREGISTER_SERVICE)), - DEVICE_REGISTRY(Defaults.DEFAULT_DEVICE_REGISTRY_PORT, List.of(DEVICE_REGISTRY_REGISTER_SERVICE, DEVICE_REGISTRY_UNREGISTER_SERVICE)), - ONBOARDING(Defaults.DEFAULT_ONBOARDING_PORT, List.of(ONBOARDING_SERVICE_WITH_NAME)), - AUTHORIZATION(Defaults.DEFAULT_AUTHORIZATION_PORT, List.of(CoreSystemService.AUTH_CONTROL_INTRA_SERVICE, CoreSystemService.AUTH_CONTROL_INTER_SERVICE, - CoreSystemService.AUTH_TOKEN_GENERATION_SERVICE, CoreSystemService.AUTH_PUBLIC_KEY_SERVICE, - CoreSystemService.AUTH_CONTROL_SUBSCRIPTION_SERVICE)), - ORCHESTRATOR(Defaults.DEFAULT_ORCHESTRATOR_PORT, List.of(CoreSystemService.ORCHESTRATION_SERVICE)), - GATEKEEPER(Defaults.DEFAULT_GATEKEEPER_PORT, List.of(CoreSystemService.GATEKEEPER_GLOBAL_SERVICE_DISCOVERY, CoreSystemService.GATEKEEPER_INTER_CLOUD_NEGOTIATION)), - EVENT_HANDLER(Defaults.DEFAULT_EVENT_HANDLER_PORT, List.of(CoreSystemService.EVENT_PUBLISH_SERVICE, CoreSystemService.EVENT_SUBSCRIBE_SERVICE - , CoreSystemService.EVENT_UNSUBSCRIBE_SERVICE, CoreSystemService.EVENT_PUBLISH_AUTH_UPDATE_SERVICE)), - GATEWAY(Defaults.DEFAULT_GATEWAY_PORT, List.of(CoreSystemService.GATEWAY_PUBLIC_KEY_SERVICE, CoreSystemService.GATEWAY_PROVIDER_SERVICE,CoreSystemService.GATEWAY_CONSUMER_SERVICE)), - CHOREOGRAPHER(Defaults.DEFAULT_CHOREOGRAPHER_PORT, List.of()), // TODO: add services - QOS_MONITOR(Defaults.DEFAULT_QOS_MONITOR_PORT, List.of(CoreSystemService.QOS_MONITOR_PING_MEASUREMENT_SERVICE)), - CERTIFICATE_AUTHORITY(Defaults.DEFAULT_CERTIFICATE_AUTHORITY_PORT, List.of(CoreSystemService.CERTIFICATE_AUTHORITY_SIGN_SERVICE)); - - //================================================================================================= - // members - - private final int defaultPort; - private final List services; - - //================================================================================================= - // methods - - //------------------------------------------------------------------------------------------------- - public int getDefaultPort() { return defaultPort; } - public List getServices() { return services; } - - //================================================================================================= - // assistant methods + + //================================================================================================= + // elements + + SERVICE_REGISTRY(Defaults.DEFAULT_SERVICE_REGISTRY_PORT, null), + SYSTEM_REGISTRY(Defaults.DEFAULT_SYSTEM_REGISTRY_PORT, List.of(SYSTEM_REGISTRY_REGISTER_SERVICE, SYSTEM_REGISTRY_UNREGISTER_SERVICE)), + DEVICE_REGISTRY(Defaults.DEFAULT_DEVICE_REGISTRY_PORT, List.of(DEVICE_REGISTRY_REGISTER_SERVICE, DEVICE_REGISTRY_UNREGISTER_SERVICE)), + ONBOARDING_CONTROLLER(Defaults.DEFAULT_ONBOARDING_PORT, List.of(ONBOARDING_WITH_CERTIFICATE_AND_NAME, ONBOARDING_WITH_SHARED_SECRET_AND_NAME, + ONBOARDING_WITH_CERTIFICATE_AND_CSR, ONBOARDING_WITH_SHARED_SECRET_AND_CSR)), + AUTHORIZATION(Defaults.DEFAULT_AUTHORIZATION_PORT, List.of(CoreSystemService.AUTH_CONTROL_INTRA_SERVICE, CoreSystemService.AUTH_CONTROL_INTER_SERVICE, + CoreSystemService.AUTH_TOKEN_GENERATION_SERVICE, CoreSystemService.AUTH_PUBLIC_KEY_SERVICE, + CoreSystemService.AUTH_CONTROL_SUBSCRIPTION_SERVICE)), + ORCHESTRATOR(Defaults.DEFAULT_ORCHESTRATOR_PORT, List.of(CoreSystemService.ORCHESTRATION_SERVICE)), + GATEKEEPER(Defaults.DEFAULT_GATEKEEPER_PORT, List.of(CoreSystemService.GATEKEEPER_GLOBAL_SERVICE_DISCOVERY, CoreSystemService.GATEKEEPER_INTER_CLOUD_NEGOTIATION)), + EVENT_HANDLER(Defaults.DEFAULT_EVENT_HANDLER_PORT, List.of(CoreSystemService.EVENT_PUBLISH_SERVICE, CoreSystemService.EVENT_SUBSCRIBE_SERVICE + , CoreSystemService.EVENT_UNSUBSCRIBE_SERVICE, CoreSystemService.EVENT_PUBLISH_AUTH_UPDATE_SERVICE)), + GATEWAY(Defaults.DEFAULT_GATEWAY_PORT, List.of(CoreSystemService.GATEWAY_PUBLIC_KEY_SERVICE, CoreSystemService.GATEWAY_PROVIDER_SERVICE, CoreSystemService.GATEWAY_CONSUMER_SERVICE)), + CHOREOGRAPHER(Defaults.DEFAULT_CHOREOGRAPHER_PORT, List.of()), // TODO: add services + QOS_MONITOR(Defaults.DEFAULT_QOS_MONITOR_PORT, List.of(CoreSystemService.QOS_MONITOR_PING_MEASUREMENT_SERVICE)), + CERTIFICATE_AUTHORITY(Defaults.DEFAULT_CERTIFICATE_AUTHORITY_PORT, List.of(CoreSystemService.CERTIFICATE_AUTHORITY_SIGN_SERVICE)); + + //================================================================================================= + // members + + private final int defaultPort; + private final List services; + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public int getDefaultPort() { + return defaultPort; + } + + public List getServices() { + return services; + } + + //================================================================================================= + // assistant methods //------------------------------------------------------------------------------------------------- private CoreSystem(final int defaultPort, final List services) { diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java index 00020555e..c4a068c3c 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java @@ -21,8 +21,10 @@ import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_GATEWAY_CONNECT_CONSUMER; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_GATEWAY_CONNECT_PROVIDER; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_GATEWAY_PUBLIC_KEY; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_CSR; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_NAME; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_WITH_CERTIFICATE_AND_CSR; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_WITH_CERTIFICATE_AND_NAME; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_WITH_SHARED_SECRET_AND_CSR; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_WITH_SHARED_SECRET_AND_NAME; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ORCH_PROCESS; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_QOS_MONITOR_PING_MEASUREMENT; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SERVICE_REGISTRY_REGISTER; @@ -50,8 +52,10 @@ import static eu.arrowhead.common.CommonConstants.OP_GATEWAY_CONNECT_CONSUMER_URI; import static eu.arrowhead.common.CommonConstants.OP_GATEWAY_CONNECT_PROVIDER_URI; import static eu.arrowhead.common.CommonConstants.OP_GATEWAY_KEY_URI; -import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_CSR; -import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_NAME; +import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_CERTIFICATE_AND_CSR; +import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_CERTIFICATE_AND_NAME; +import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_SHARED_SECRET_AND_CSR; +import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_SHARED_SECRET_AND_NAME; import static eu.arrowhead.common.CommonConstants.OP_ORCH_PROCESS; import static eu.arrowhead.common.CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT; import static eu.arrowhead.common.CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT_SUFFIX; @@ -102,10 +106,11 @@ public enum CoreSystemService { QOS_MONITOR_PING_MEASUREMENT_SERVICE(CORE_SERVICE_QOS_MONITOR_PING_MEASUREMENT, QOS_MONITOR_URI + OP_QOS_MONITOR_PING_MEASUREMENT + OP_QOS_MONITOR_PING_MEASUREMENT_SUFFIX), - // Onboarding services - ONBOARDING_SERVICE_WITH_NAME(CORE_SERVICE_ONBOARDING_NAME, ONBOARDING_URI + OP_ONBOARDING_NAME), - ONBOARDING_SERVICE_WITH_CSR(CORE_SERVICE_ONBOARDING_CSR, ONBOARDING_URI + OP_ONBOARDING_CSR), + ONBOARDING_WITH_CERTIFICATE_AND_NAME(CORE_SERVICE_ONBOARDING_WITH_CERTIFICATE_AND_NAME, ONBOARDING_URI + OP_ONBOARDING_WITH_CERTIFICATE_AND_NAME), + ONBOARDING_WITH_CERTIFICATE_AND_CSR(CORE_SERVICE_ONBOARDING_WITH_CERTIFICATE_AND_CSR, ONBOARDING_URI + OP_ONBOARDING_WITH_CERTIFICATE_AND_CSR), + ONBOARDING_WITH_SHARED_SECRET_AND_NAME(CORE_SERVICE_ONBOARDING_WITH_SHARED_SECRET_AND_NAME, ONBOARDING_URI + OP_ONBOARDING_WITH_SHARED_SECRET_AND_NAME), + ONBOARDING_WITH_SHARED_SECRET_AND_CSR(CORE_SERVICE_ONBOARDING_WITH_SHARED_SECRET_AND_CSR, ONBOARDING_URI + OP_ONBOARDING_WITH_SHARED_SECRET_AND_CSR), // Device Registry services DEVICE_REGISTRY_REGISTER_SERVICE(CORE_SERVICE_DEVICE_REGISTRY_REGISTER, DEVICE_REGISTRY_URI + OP_DEVICE_REGISTRY_REGISTER_URI), diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationRequestDTO.java new file mode 100644 index 000000000..d2dc8b78a --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationRequestDTO.java @@ -0,0 +1,58 @@ +package eu.arrowhead.common.dto.shared; + +import java.io.Serializable; + +public class CertificateCreationRequestDTO implements Serializable { + + //================================================================================================= + // members + private static final long serialVersionUID = 1L; + + private String commonName; + private byte[] publicKey; + private byte[] privateKey; + + + //================================================================================================= + // constructors + + public CertificateCreationRequestDTO() { + } + + public CertificateCreationRequestDTO(final String commonName) { + this.commonName = commonName; + } + + public CertificateCreationRequestDTO(final String commonName, final byte[] publicKey, final byte[] privateKey) { + this.commonName = commonName; + this.publicKey = publicKey; + this.privateKey = privateKey; + } + + //================================================================================================= + // methods + + public String getCommonName() { + return commonName; + } + + public void setCommonName(String commonName) { + this.commonName = commonName; + } + + public byte[] getPublicKey() { + return publicKey; + } + + public void setPublicKey(byte[] publicKey) { + this.publicKey = publicKey; + } + + public byte[] getPrivateKey() { + return privateKey; + } + + public void setPrivateKey(byte[] privateKey) { + this.privateKey = privateKey; + } +} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateResponseDTO.java new file mode 100644 index 000000000..8536fd7d3 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateResponseDTO.java @@ -0,0 +1,105 @@ +package eu.arrowhead.common.dto.shared; + +import java.io.Serializable; +import java.util.Arrays; +import java.util.Objects; + +public class CertificateResponseDTO implements Serializable { + + //================================================================================================= + // members + private static final long serialVersionUID = 1L; + + private String certificate; + private String keyAlgorithm; + private String keyFormat; + private byte[] publicKey; + private byte[] privateKey; + + + //================================================================================================= + // constructors + + public CertificateResponseDTO() { + } + + public CertificateResponseDTO(final String certificate, final String keyAlgorithm, final String keyFormat, + final byte[] publicKey) { + this.certificate = certificate; + this.keyAlgorithm = keyAlgorithm; + this.keyFormat = keyFormat; + this.publicKey = publicKey; + } + + public CertificateResponseDTO(final String certificate, final String keyAlgorithm, final String keyFormat, + final byte[] publicKey, final byte[] privateKey) { + this.certificate = certificate; + this.keyAlgorithm = keyAlgorithm; + this.keyFormat = keyFormat; + this.publicKey = publicKey; + this.privateKey = privateKey; + } + + //================================================================================================= + // methods + + public String getCertificate() { + return certificate; + } + + public void setCertificate(String certificate) { + this.certificate = certificate; + } + + public String getKeyAlgorithm() { + return keyAlgorithm; + } + + public void setKeyAlgorithm(String keyAlgorithm) { + this.keyAlgorithm = keyAlgorithm; + } + + public String getKeyFormat() { + return keyFormat; + } + + public void setKeyFormat(String keyFormat) { + this.keyFormat = keyFormat; + } + + public byte[] getPublicKey() { + return publicKey; + } + + public void setPublicKey(byte[] publicKey) { + this.publicKey = publicKey; + } + + public byte[] getPrivateKey() { + return privateKey; + } + + public void setPrivateKey(byte[] privateKey) { + this.privateKey = privateKey; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CertificateResponseDTO that = (CertificateResponseDTO) o; + return certificate.equals(that.certificate) && + Objects.equals(keyAlgorithm, that.keyAlgorithm) && + Objects.equals(keyFormat, that.keyFormat) && + Arrays.equals(publicKey, that.publicKey) && + Arrays.equals(privateKey, that.privateKey); + } + + @Override + public int hashCode() { + int result = Objects.hash(certificate, keyAlgorithm, keyFormat); + result = 31 * result + Arrays.hashCode(publicKey); + result = 31 * result + Arrays.hashCode(privateKey); + return result; + } +} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java index 0365f06ec..3ec1d0d39 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java @@ -11,11 +11,11 @@ public class OnboardingWithCsrResponseDTO implements Serializable { private ServiceEndpoint deviceRegistry; private ServiceEndpoint systemRegistry; private ServiceEndpoint serviceRegistry; + private ServiceEndpoint orchestrationService; - private String onboardingCertificate; + private CertificateResponseDTO onboardingCertificate; private String intermediateCertificate; private String rootCertificate; - private byte[] publicKey; //================================================================================================= @@ -58,13 +58,23 @@ public void setServiceRegistry(final ServiceEndpoint serviceRegistry) } //------------------------------------------------------------------------------------------------- - public String getOnboardingCertificate() + public ServiceEndpoint getOrchestrationService() { + return orchestrationService; + } + + //------------------------------------------------------------------------------------------------- + public void setOrchestrationService(ServiceEndpoint orchestrationService) { + this.orchestrationService = orchestrationService; + } + + //------------------------------------------------------------------------------------------------- + public CertificateResponseDTO getOnboardingCertificate() { return onboardingCertificate; } //------------------------------------------------------------------------------------------------- - public void setOnboardingCertificate(final String onboardingCertificate) + public void setOnboardingCertificate(final CertificateResponseDTO onboardingCertificate) { this.onboardingCertificate = onboardingCertificate; } @@ -93,15 +103,4 @@ public void setRootCertificate(final String rootCertificate) this.rootCertificate = rootCertificate; } - //------------------------------------------------------------------------------------------------- - public byte[] getPublicKey() - { - return publicKey; - } - - //------------------------------------------------------------------------------------------------- - public void setPublicKey(final byte[] publicKey) - { - this.publicKey = publicKey; - } } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameRequestDTO.java index d6f8c59f9..8321d7fd6 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameRequestDTO.java @@ -4,46 +4,36 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; import java.io.Serializable; -import java.util.Objects; @JsonInclude(Include.NON_NULL) public class OnboardingWithNameRequestDTO implements Serializable { - //================================================================================================= - // members - - private static final long serialVersionUID = 1L; - - private String deviceName; - - //================================================================================================= - // methods - //------------------------------------------------------------------------------------------------- - public String getDeviceName() { return deviceName; } - - //------------------------------------------------------------------------------------------------- - public void setDeviceName(final String deviceName) { this.deviceName = deviceName; } - - //------------------------------------------------------------------------------------------------- - @Override - public int hashCode() { - return Objects.hash(deviceName); - } - - //------------------------------------------------------------------------------------------------- - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final OnboardingWithNameRequestDTO other = (OnboardingWithNameRequestDTO) obj; - - return Objects.equals(deviceName, other.deviceName); - } + //================================================================================================= + // members + + private static final long serialVersionUID = 1L; + + private CertificateCreationRequestDTO creationRequestDTO; + + //================================================================================================= + // constructors + + public OnboardingWithNameRequestDTO() { + } + + public OnboardingWithNameRequestDTO(CertificateCreationRequestDTO creationRequestDTO) { + this.creationRequestDTO = creationRequestDTO; + } + + //================================================================================================= + // methods + //------------------------------------------------------------------------------------------------- + + public CertificateCreationRequestDTO getCreationRequestDTO() { + return creationRequestDTO; + } + + public void setCreationRequestDTO(CertificateCreationRequestDTO creationRequestDTO) { + this.creationRequestDTO = creationRequestDTO; + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java index dcb7891bb..3b1ef766b 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java @@ -11,13 +11,9 @@ public class OnboardingWithNameResponseDTO implements Serializable { private ServiceEndpoint systemRegistry; private ServiceEndpoint serviceRegistry; - private String onboardingCertificate; + private CertificateResponseDTO onboardingCertificate; private String intermediateCertificate; private String rootCertificate; - private String keyAlgorithm; - private String keyFormat; - private byte[] privateKey; - private byte[] publicKey; //================================================================================================= @@ -60,13 +56,13 @@ public void setServiceRegistry(final ServiceEndpoint serviceRegistry) } //------------------------------------------------------------------------------------------------- - public String getOnboardingCertificate() + public CertificateResponseDTO getOnboardingCertificate() { return onboardingCertificate; } //------------------------------------------------------------------------------------------------- - public void setOnboardingCertificate(final String onboardingCertificate) + public void setOnboardingCertificate(final CertificateResponseDTO onboardingCertificate) { this.onboardingCertificate = onboardingCertificate; } @@ -94,52 +90,4 @@ public void setRootCertificate(final String rootCertificate) { this.rootCertificate = rootCertificate; } - - //------------------------------------------------------------------------------------------------- - public String getKeyAlgorithm() - { - return keyAlgorithm; - } - - //------------------------------------------------------------------------------------------------- - public void setKeyAlgorithm(final String keyAlgorithm) - { - this.keyAlgorithm = keyAlgorithm; - } - - //------------------------------------------------------------------------------------------------- - public String getKeyFormat() - { - return keyFormat; - } - - //------------------------------------------------------------------------------------------------- - public void setKeyFormat(final String keyFormat) - { - this.keyFormat = keyFormat; - } - - //------------------------------------------------------------------------------------------------- - public byte[] getPrivateKey() - { - return privateKey; - } - - //------------------------------------------------------------------------------------------------- - public void setPrivateKey(final byte[] privateKey) - { - this.privateKey = privateKey; - } - - //------------------------------------------------------------------------------------------------- - public byte[] getPublicKey() - { - return publicKey; - } - - //------------------------------------------------------------------------------------------------- - public void setPublicKey(final byte[] publicKey) - { - this.publicKey = publicKey; - } } diff --git a/deviceregistry/src/deb/arrowhead-deviceregistry.service b/deviceregistry/src/deb/arrowhead-deviceregistry.service index 59a800ac1..1c1e55361 100644 --- a/deviceregistry/src/deb/arrowhead-deviceregistry.service +++ b/deviceregistry/src/deb/arrowhead-deviceregistry.service @@ -1,6 +1,6 @@ [Unit] Description=arrowhead-deviceregistry -After=network.target mysql.target +After=network.target mysql.target arrowhead-serviceregistry [Service] WorkingDirectory=/etc/arrowhead/systems/device_registry diff --git a/deviceregistry/src/deb/control/postinst b/deviceregistry/src/deb/control/postinst index d668b89dd..f58726b71 100644 --- a/deviceregistry/src/deb/control/postinst +++ b/deviceregistry/src/deb/control/postinst @@ -55,7 +55,13 @@ case "$1" in # modify log config and application.properties ah_transform_log_file ${SYSTEM_DIR} - + + db_get arrowhead-core-common/sr_host; sr_host=$RET || true + + if [ -z ${sr_host} ]; then + sr_host=${OWN_IP} + fi + db_get arrowhead-core-common/db_host; db_host=$RET || true mv ${SYSTEM_DIR}/application.properties ${SYSTEM_DIR}/application.properties.orig @@ -63,6 +69,7 @@ case "$1" in sed -r -e "\#^.*spring\.datasource\.url=#s#.*\$#spring.datasource.url=jdbc:mysql://"${db_host}":3306/arrowhead?serverTimezone=Europe/Budapest#" \ -e "\#^.*spring\.datasource\.password=#s#.*\$#spring.datasource.password=${system_passwd}#" \ -e "\#^.*domain\.name=#s#.*\$#domain.name=${domain_name}#" \ + -e "\#^.*sr_address=#s#.*\$#sr_address=${sr_host}#" \ -e "\#^.*server\.ssl\.key-store=#s#.*\$#server.ssl.key-store=file:${SYSTEM_DIR}/${SYSTEM_NAME}.p12#" \ -e "\#^.*server\.ssl\.key-store-password=#s#.*\$#server.ssl.key-store-password=${AH_PASS_CERT}#" \ -e "\#^.*server\.ssl\.key-password=#s#.*\$#server.ssl.key-password=${AH_PASS_CERT}#" \ diff --git a/deviceregistry/src/main/resources/application.properties b/deviceregistry/src/main/resources/application.properties index 74a7de960..9949ee6f0 100644 --- a/deviceregistry/src/main/resources/application.properties +++ b/deviceregistry/src/main/resources/application.properties @@ -31,6 +31,10 @@ core_system_name=DEVICE_REGISTRY # Show all request/response in debug log log_all_request_and_response=false +# Service Registry web-server parameters (to register the Authorization services) +sr_address=127.0.0.1 +sr_port=8443 + ############################################ ### SECURE MODE ### ############################################ diff --git a/onboarding/src/deb/arrowhead-onboarding.service b/onboarding/src/deb/arrowhead-onboarding.service index 5f3c12f18..12a8dc2ab 100644 --- a/onboarding/src/deb/arrowhead-onboarding.service +++ b/onboarding/src/deb/arrowhead-onboarding.service @@ -1,6 +1,6 @@ [Unit] Description=arrowhead-onboarding -After=network.target mysql.target +After=network.target mysql.target arrowhead-serviceregistry arrowhead-certificate-authority arrowhead-orchestration [Service] WorkingDirectory=/etc/arrowhead/systems/onboarding_controller diff --git a/onboarding/src/deb/control/postinst b/onboarding/src/deb/control/postinst index 8437b973e..9eef2a8d1 100644 --- a/onboarding/src/deb/control/postinst +++ b/onboarding/src/deb/control/postinst @@ -56,6 +56,12 @@ case "$1" in ah_transform_log_file ${SYSTEM_DIR} + db_get arrowhead-core-common/sr_host; sr_host=$RET || true + + if [ -z ${sr_host} ]; then + sr_host=${OWN_IP} + fi + db_get arrowhead-core-common/db_host; db_host=$RET || true mv ${SYSTEM_DIR}/application.properties ${SYSTEM_DIR}/application.properties.orig @@ -63,6 +69,7 @@ case "$1" in sed -r -e "\#^.*spring\.datasource\.url=#s#.*\$#spring.datasource.url=jdbc:mysql://"${db_host}":3306/arrowhead?serverTimezone=Europe/Budapest#" \ -e "\#^.*spring\.datasource\.password=#s#.*\$#spring.datasource.password=${system_passwd}#" \ -e "\#^.*domain\.name=#s#.*\$#domain.name=${domain_name}#" \ + -e "\#^.*sr_address=#s#.*\$#sr_address=${sr_host}#" \ -e "\#^.*server\.ssl\.key-store=#s#.*\$#server.ssl.key-store=file:${SYSTEM_DIR}/${SYSTEM_NAME}.p12#" \ -e "\#^.*server\.ssl\.key-store-password=#s#.*\$#server.ssl.key-store-password=${AH_PASS_CERT}#" \ -e "\#^.*server\.ssl\.key-password=#s#.*\$#server.ssl.key-password=${AH_PASS_CERT}#" \ diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java index b9f915c49..c1e34e696 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java @@ -43,6 +43,11 @@ import java.util.Objects; import java.util.Optional; +import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_CERTIFICATE_AND_CSR; +import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_CERTIFICATE_AND_NAME; +import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_SHARED_SECRET_AND_CSR; +import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_SHARED_SECRET_AND_NAME; + @Api(tags = {CoreCommonConstants.SWAGGER_TAG_ALL}) @CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, allowedHeaders = {HttpHeaders.ORIGIN, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT, HttpHeaders.AUTHORIZATION} @@ -56,15 +61,9 @@ public class OnboardingController { private static final String ONBOARDING_HTTP_200_MESSAGE = "Initial Onboarding successful"; private static final String ONBOARDING_HTTP_400_MESSAGE = "Request parameter missing"; - private static final String DEVICE_NAME_NULL_ERROR_MESSAGE = " Device name must have value "; + private static final String COMMON_NAME_NULL_ERROR_MESSAGE = " Common name must have value "; private static final String CSR_NULL_ERROR_MESSAGE = " CertificateSigningRequest must have value "; - private static final String AUTHENTICATE_WITH_CERTIFICATE = "/certificate"; - private static final String AUTHENTICATE_WITH_SHARED_SECRET = "/sharedsecret"; - - private static final String ONBOARDING_WITH_NAME_URI = "/name"; - private static final String ONBOARDING_WITH_CSR_URI = "/csr"; - private final Logger logger = LogManager.getLogger(OnboardingController.class); private final OnboardingDBService onboardingDBService; private final SSLProperties sslProperties; @@ -105,14 +104,14 @@ public String echoOnboarding() { @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @PostMapping(AUTHENTICATE_WITH_CERTIFICATE + ONBOARDING_WITH_NAME_URI) + @PostMapping(OP_ONBOARDING_WITH_CERTIFICATE_AND_NAME) @ResponseBody public OnboardingWithNameResponseDTO onboardWithCertificateAndName(final HttpServletRequest httpServletRequest, @RequestBody final OnboardingWithNameRequestDTO onboardingRequest) { logger.debug("onboardWithCertificateAndName started ..."); authenticateCertificate(httpServletRequest); - verifyRequest(onboardingRequest, CommonConstants.ONBOARDING_URI + ONBOARDING_WITH_NAME_URI); + verifyRequest(onboardingRequest, CommonConstants.ONBOARDING_URI + OP_ONBOARDING_WITH_CERTIFICATE_AND_NAME); return onboardingDBService.onboarding(onboardingRequest); } @@ -125,14 +124,14 @@ public OnboardingWithNameResponseDTO onboardWithCertificateAndName(final HttpSer @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @PostMapping(AUTHENTICATE_WITH_SHARED_SECRET + ONBOARDING_WITH_NAME_URI) + @PostMapping(OP_ONBOARDING_WITH_SHARED_SECRET_AND_NAME) @ResponseBody public OnboardingWithNameResponseDTO onboardWithSharedSecretAndName(@RequestBody final OnboardingWithNameRequestDTO onboardingRequest, @RequestHeader(HttpHeaders.AUTHORIZATION) final String authorization) { logger.debug("onboardWithSharedSecretAndName started ..."); authenticateSharedSecret(authorization); - verifyRequest(onboardingRequest, CommonConstants.ONBOARDING_URI + ONBOARDING_WITH_NAME_URI); + verifyRequest(onboardingRequest, CommonConstants.ONBOARDING_URI + OP_ONBOARDING_WITH_SHARED_SECRET_AND_NAME); return onboardingDBService.onboarding(onboardingRequest); } @@ -145,14 +144,14 @@ public OnboardingWithNameResponseDTO onboardWithSharedSecretAndName(@RequestBody @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @PostMapping(AUTHENTICATE_WITH_CERTIFICATE + ONBOARDING_WITH_CSR_URI) + @PostMapping(OP_ONBOARDING_WITH_CERTIFICATE_AND_CSR) @ResponseBody public OnboardingWithCsrResponseDTO onboardWithCertificateAndSigningRequest(final HttpServletRequest httpServletRequest, @RequestBody final OnboardingWithCsrRequestDTO onboardingRequest) { logger.debug("onboardWithCertificateAndSigningRequest started ..."); authenticateCertificate(httpServletRequest); - verifyRequest(onboardingRequest, CommonConstants.ONBOARDING_URI + ONBOARDING_WITH_NAME_URI); + verifyRequest(onboardingRequest, CommonConstants.ONBOARDING_URI + OP_ONBOARDING_WITH_CERTIFICATE_AND_CSR); return onboardingDBService.onboarding(onboardingRequest); } @@ -165,14 +164,14 @@ public OnboardingWithCsrResponseDTO onboardWithCertificateAndSigningRequest(fina @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) - @PostMapping(AUTHENTICATE_WITH_SHARED_SECRET + ONBOARDING_WITH_CSR_URI) + @PostMapping(OP_ONBOARDING_WITH_SHARED_SECRET_AND_CSR) @ResponseBody public OnboardingWithCsrResponseDTO onboardWithSharedSecretAndSigningRequest(@RequestBody final OnboardingWithCsrRequestDTO onboardingRequest, @RequestHeader(HttpHeaders.AUTHORIZATION) final String authorization) { logger.debug("onboardWithSharedSecretAndSigningRequest started ..."); authenticateSharedSecret(authorization); - verifyRequest(onboardingRequest, CommonConstants.ONBOARDING_URI + ONBOARDING_WITH_NAME_URI); + verifyRequest(onboardingRequest, CommonConstants.ONBOARDING_URI + OP_ONBOARDING_WITH_SHARED_SECRET_AND_CSR); return onboardingDBService.onboarding(onboardingRequest); } @@ -247,12 +246,12 @@ private void authenticateSharedSecret(final String authorization) { private void verifyRequest(final OnboardingWithNameRequestDTO onboardingRequest, final String origin) { logger.debug("verifyRequest started..."); - if (onboardingRequest == null) { + if (Objects.isNull(onboardingRequest) || Objects.isNull(onboardingRequest.getCreationRequestDTO())) { throw new BadPayloadException("Request is null.", HttpStatus.SC_BAD_REQUEST, origin); } - if (Utilities.isEmpty(onboardingRequest.getDeviceName())) { - throw new BadPayloadException(DEVICE_NAME_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + if (Utilities.isEmpty(onboardingRequest.getCreationRequestDTO().getCommonName())) { + throw new BadPayloadException(COMMON_NAME_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); } } @@ -260,7 +259,7 @@ private void verifyRequest(final OnboardingWithNameRequestDTO onboardingRequest, private void verifyRequest(final OnboardingWithCsrRequestDTO onboardingRequest, final String origin) { logger.debug("verifyRequest started..."); - if (onboardingRequest == null) { + if (Objects.isNull(onboardingRequest)) { throw new BadPayloadException("Request is null.", HttpStatus.SC_BAD_REQUEST, origin); } diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java index af918be24..c3929ec21 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java @@ -1,23 +1,18 @@ package eu.arrowhead.core.onboarding.database.service; import eu.arrowhead.common.CommonConstants; -import eu.arrowhead.common.CoreSystemRegistrationProperties; -import eu.arrowhead.common.SSLProperties; -import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.OrchestrationDriver; import eu.arrowhead.common.core.CoreSystemService; -import eu.arrowhead.common.database.repository.SystemRepository; +import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; +import eu.arrowhead.common.dto.internal.CertificateSigningResponseDTO; +import eu.arrowhead.common.dto.shared.CertificateResponseDTO; import eu.arrowhead.common.dto.shared.OnboardingWithCsrRequestDTO; import eu.arrowhead.common.dto.shared.OnboardingWithCsrResponseDTO; import eu.arrowhead.common.dto.shared.OnboardingWithNameRequestDTO; import eu.arrowhead.common.dto.shared.OnboardingWithNameResponseDTO; -import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; -import eu.arrowhead.common.dto.shared.OrchestrationResponseDTO; import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; import eu.arrowhead.common.dto.shared.ServiceEndpoint; -import eu.arrowhead.common.dto.shared.ServiceQueryFormDTO; -import eu.arrowhead.common.dto.shared.ServiceQueryResultDTO; import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; -import eu.arrowhead.common.dto.shared.SystemRequestDTO; import eu.arrowhead.common.dto.shared.SystemResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.http.HttpService; @@ -33,23 +28,17 @@ @Service public class OnboardingDBService { - private static final String COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE = "Could not delete System, with given parameters"; - private static final String PORT_RANGE_ERROR_MESSAGE = "Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + "."; + //================================================================================================= // members private final Logger logger = LogManager.getLogger(OnboardingDBService.class); - private final SystemRepository systemRepository; - private final SSLProperties sslProperties; + private final OrchestrationDriver orchestration; private final HttpService httpService; - private final CoreSystemRegistrationProperties coreSystemRegistrationProperties; @Autowired - public OnboardingDBService(final SystemRepository systemRepository, final SSLProperties sslProperties, - final HttpService httpService, final CoreSystemRegistrationProperties coreSystemRegistrationProperties) { - this.systemRepository = systemRepository; - this.sslProperties = sslProperties; + public OnboardingDBService(final OrchestrationDriver orchestration, HttpService httpService) { + this.orchestration = orchestration; this.httpService = httpService; - this.coreSystemRegistrationProperties = coreSystemRegistrationProperties; } //================================================================================================= @@ -73,13 +62,13 @@ public OnboardingWithCsrResponseDTO onboarding(final OnboardingWithCsrRequestDTO //------------------------------------------------------------------------------------------------- - private OnboardingWithCsrResponseDTO executeCertificateSigningRequest(String certificateSigningRequest) { + private OnboardingWithCsrResponseDTO executeCertificateSigningRequest(final String certificateSigningRequest) { final ServiceRegistryResponseDTO orchService = getOrchestratorService(); // TODO replace with CoreSystemService constant - final OrchestrationResultDTO caOrchResult = contactOrchestrationService(orchService, "ca-sign"); + final OrchestrationResultDTO caOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_CERTIFICATE_AUTHORITY_SIGN); - final UriComponents caUri = createUri(caOrchResult.getProvider(), + final UriComponents caUri = orchestration.createUri(caOrchResult.getProvider(), CommonConstants.CERTIFICATE_AUTHRORITY_URI + CommonConstants.OP_CA_SIGN_CERTIFICATE_URI); final CertificateSigningRequestDTO csrDTO = new CertificateSigningRequestDTO(certificateSigningRequest); @@ -87,29 +76,28 @@ private OnboardingWithCsrResponseDTO executeCertificateSigningRequest(String cer final CertificateSigningResponseDTO csrResult = httpResponse.getBody(); - if (Objects.isNull(csrResult) || csrResult.getServiceQueryData().isEmpty()) { + if (Objects.isNull(csrResult) || csrResult.getCertificateChain().isEmpty()) { throw new ArrowheadException("Unable to contact Certificate Authority"); } + final CertificateResponseDTO certificateResponseDTO = new CertificateResponseDTO(); + certificateResponseDTO.setCertificate(csrResult.getCertificateChain().get(2)); + final OnboardingWithCsrResponseDTO retValue = new OnboardingWithCsrResponseDTO(); - retValue.setRootCertificate(csrResult.get(0)); - retValue.setIntermediateCertificate(csrResult.get(1)); - retValue.setOnboardingCertificate(csrResult.get(2)); + retValue.setRootCertificate(csrResult.getCertificateChain().get(0)); + retValue.setIntermediateCertificate(csrResult.getCertificateChain().get(1)); + retValue.setOnboardingCertificate(certificateResponseDTO); final OrchestrationResultDTO drOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_DEVICE_REGISTRY_REGISTER); final OrchestrationResultDTO sysrOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_SYSTEM_REGISTRY_REGISTER); final OrchestrationResultDTO srOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_SERVICE_REGISTRY_REGISTER); + final OrchestrationResultDTO orchOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_ORCH_PROCESS); - final UriComponents drUri = createUri(drOrchResult.getProvider(), - CommonConstants.DEVICE_REGISTRY_URI + CommonConstants.OP_DEVICE_REGISTRY_REGISTER_URI); - final UriComponents sysrUri = createUri(drOrchResult.getProvider(), - CommonConstants.SYSTEM_REGISTRY_URI + CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI); - final UriComponents srUri = createUri(drOrchResult.getProvider(), - CommonConstants.SERVICE_REGISTRY_URI + CommonConstants.OP_SERVICE_REGISTRY_REGISTER_URI); - retValue.setDeviceRegistry(new ServiceEndpoint(CoreSystemService.DEVICE_REGISTRY_REGISTER_SERVICE, drUri.toUri())); - retValue.setDeviceRegistry(new ServiceEndpoint(CoreSystemService.SYSTEM_REGISTRY_REGISTER_SERVICE, sysrUri.toUri())); - retValue.setDeviceRegistry(new ServiceEndpoint(CoreSystemService.SERVICE_REGISTRY_REGISTER_SERVICE, srUri.toUri())); + retValue.setDeviceRegistry(new ServiceEndpoint(CoreSystemService.DEVICE_REGISTRY_REGISTER_SERVICE, orchestration.createUri(drOrchResult).toUri())); + retValue.setSystemRegistry(new ServiceEndpoint(CoreSystemService.SYSTEM_REGISTRY_REGISTER_SERVICE, orchestration.createUri(sysrOrchResult).toUri())); + retValue.setServiceRegistry(new ServiceEndpoint(CoreSystemService.SERVICE_REGISTRY_REGISTER_SERVICE, orchestration.createUri(srOrchResult).toUri())); + retValue.setOrchestrationService(new ServiceEndpoint(CoreSystemService.ORCHESTRATION_SERVICE, orchestration.createUri(orchOrchResult).toUri())); return retValue; } @@ -118,77 +106,18 @@ private OnboardingWithCsrResponseDTO executeCertificateSigningRequest(String cer private void pingService(final SystemResponseDTO system, final String uriPrefix) { logger.debug("getCertificateAuthorityService started..."); - final UriComponents echoUri = createUri(system, uriPrefix + CommonConstants.ECHO_URI); + final UriComponents echoUri = orchestration.createUri(system, uriPrefix + CommonConstants.ECHO_URI); httpService.sendRequest(echoUri, HttpMethod.GET, String.class); logger.info("Service at {} is accessible...", echoUri); } //------------------------------------------------------------------------------------------------- private ServiceRegistryResponseDTO getOrchestratorService() { - - final SystemResponseDTO serviceRegistrySystem = new SystemResponseDTO(); - serviceRegistrySystem.setAddress(coreSystemRegistrationProperties.getServiceRegistryAddress()); - serviceRegistrySystem.setPort(coreSystemRegistrationProperties.getServiceRegistryPort()); - - logger.debug("getOrchestratorService started..."); - pingService(serviceRegistrySystem, CommonConstants.SERVICE_REGISTRY_URI); - - final UriComponents srQueryUri = createUri(serviceRegistrySystem, - CommonConstants.SERVICE_REGISTRY_URI + CommonConstants.OP_SERVICE_REGISTRY_QUERY_URI); - - final ServiceQueryFormDTO srQueryForm = new ServiceQueryFormDTO - .Builder(CoreSystemService.ORCHESTRATION_SERVICE.getServiceDefinition()) - .build(); - - final ResponseEntity httpResponse = httpService.sendRequest(srQueryUri, HttpMethod.POST, ServiceQueryResultDTO.class, srQueryForm); - final ServiceQueryResultDTO srQueryResult = httpResponse.getBody(); - - if (Objects.isNull(srQueryResult) || srQueryResult.getServiceQueryData().isEmpty()) { - throw new ArrowheadException("Unable to find orchestrator service"); - } - - return srQueryResult.getServiceQueryData().get(0); + return orchestration.getOrchestratorService().getServiceQueryData().get(0); } //------------------------------------------------------------------------------------------------- private OrchestrationResultDTO contactOrchestrationService(final ServiceRegistryResponseDTO orchService, final String serviceDefinition) { - - logger.debug("contactOrchestrationService started..."); - pingService(orchService.getProvider(), CommonConstants.ORCHESTRATOR_URI); - - final UriComponents orchUri = createUri(orchService.getProvider(), - CommonConstants.ORCHESTRATOR_URI + CommonConstants.OP_ORCH_PROCESS); - - final SystemRequestDTO requester = new SystemRequestDTO(); - requester.setAddress(coreSystemRegistrationProperties.getCoreSystemDomainName()); - requester.setPort(coreSystemRegistrationProperties.getCoreSystemDomainPort()); - requester.setSystemName(coreSystemRegistrationProperties.getCoreSystemName()); - - final ServiceQueryFormDTO requestForm = new ServiceQueryFormDTO - .Builder(serviceDefinition) - .build(); - - final OrchestrationFormRequestDTO orchForm = new OrchestrationFormRequestDTO - .Builder(requester) - .requestedService(requestForm) - .build(); - - final ResponseEntity httpResponse = httpService.sendRequest(orchUri, HttpMethod.POST, OrchestrationResponseDTO.class, orchForm); - final OrchestrationResponseDTO orchQueryResult = httpResponse.getBody(); - - if (Objects.isNull(orchQueryResult) || orchQueryResult.getResponse().isEmpty()) { - throw new ArrowheadException("Unable to find " + serviceDefinition); - } - - return orchQueryResult.getResponse().get(0); - } - - //------------------------------------------------------------------------------------------------- - private UriComponents createUri(final SystemResponseDTO system, final String serviceUri) { - final String scheme = sslProperties.isSslEnabled() ? CommonConstants.HTTPS : CommonConstants.HTTP; - return Utilities.createURI(scheme, - system.getAddress(), - system.getPort(), - serviceUri); + return orchestration.contactOrchestrationService(orchService,serviceDefinition).getResponse().get(0); } } diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/swagger/SRSwaggerConfig.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/swagger/SRSwaggerConfig.java deleted file mode 100644 index 323bd161f..000000000 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/swagger/SRSwaggerConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -package eu.arrowhead.core.onboarding.swagger; - -import eu.arrowhead.common.CommonConstants; -import eu.arrowhead.common.swagger.DefaultSwaggerConfig; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -@EnableSwagger2 -@Configuration -public class SRSwaggerConfig extends DefaultSwaggerConfig { - - //================================================================================================= - // methods - - //------------------------------------------------------------------------------------------------- - public SRSwaggerConfig() { - super(CommonConstants.CORE_SYSTEM_ONBOARDING); - } - - //------------------------------------------------------------------------------------------------- - @Bean - public Docket customizeSwagger() { - return configureSwaggerForCoreSystem(this.getClass().getPackageName()); - } -} \ No newline at end of file diff --git a/onboarding/src/main/resources/application.properties b/onboarding/src/main/resources/application.properties index cb98d4d8b..5588849f8 100644 --- a/onboarding/src/main/resources/application.properties +++ b/onboarding/src/main/resources/application.properties @@ -26,11 +26,15 @@ domain.port=8435 ############################################ # Name of the core system -core_system_name=ONBOARDING +core_system_name=ONBOARDING_CONTROLLER # Show all request/response in debug log log_all_request_and_response=false +# Service Registry web-server parameters (to register the Authorization services) +sr_address=127.0.0.1 +sr_port=8443 + ############################################ ### SECURE MODE ### ############################################ @@ -43,7 +47,7 @@ server.ssl.enabled=true server.ssl.key-store-type=PKCS12 server.ssl.key-store=classpath:certificates/onboarding.p12 server.ssl.key-store-password=123456 -server.ssl.key-alias=onboarding +server.ssl.key-alias=onboarding_controller server.ssl.key-password=123456 server.ssl.client-auth=need server.ssl.trust-store-type=PKCS12 diff --git a/scripts/create_empty_arrowhead_db.sql b/scripts/create_empty_arrowhead_db.sql index a6668bb2e..82139460b 100644 --- a/scripts/create_empty_arrowhead_db.sql +++ b/scripts/create_empty_arrowhead_db.sql @@ -23,8 +23,8 @@ CREATE USER IF NOT EXISTS 'device_registry'@'%' IDENTIFIED BY 'iooHU87hNGUalht'; source device_registry_privileges.sql -- Onboarding controller -CREATE USER IF NOT EXISTS 'onboarding'@'localhost' IDENTIFIED BY 'JKgh1as5f6oi7aV'; -CREATE USER IF NOT EXISTS 'onboarding'@'%' IDENTIFIED BY 'JKgh1as5f6oi7aV'; +CREATE USER IF NOT EXISTS 'onboarding_controller'@'localhost' IDENTIFIED BY 'JKgh1as5f6oi7aV'; +CREATE USER IF NOT EXISTS 'onboarding_controller'@'%' IDENTIFIED BY 'JKgh1as5f6oi7aV'; source onboarding_controller_privileges.sql -- Authorization diff --git a/scripts/device_registry_privileges.sql b/scripts/device_registry_privileges.sql index c24db11d1..06fccc203 100644 --- a/scripts/device_registry_privileges.sql +++ b/scripts/device_registry_privileges.sql @@ -15,10 +15,6 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'device_registry'@' GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'device_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'device_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'device_registry'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'device_registry'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'device_registry'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'device_registry'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'device_registry'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'device_registry'@'%'; @@ -35,9 +31,5 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'device_registry'@' GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'device_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'device_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'device_registry'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'device_registry'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'device_registry'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'device_registry'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'device_registry'@'%'; FLUSH PRIVILEGES; \ No newline at end of file diff --git a/scripts/onboarding_controller_privileges.sql b/scripts/onboarding_controller_privileges.sql index 202b60ef9..f060c7319 100644 --- a/scripts/onboarding_controller_privileges.sql +++ b/scripts/onboarding_controller_privileges.sql @@ -1,30 +1,25 @@ USE `arrowhead`; -REVOKE ALL, GRANT OPTION FROM 'onboarding'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'onboarding'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'onboarding'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'onboarding'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'onboarding'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'onboarding'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'onboarding'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'onboarding'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'onboarding'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'onboarding'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'onboarding'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'onboarding'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'onboarding'@'localhost'; -REVOKE ALL, GRANT OPTION FROM 'onboarding'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'onboarding'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'onboarding'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'onboarding'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'onboarding'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'onboarding'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'onboarding'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'onboarding'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'onboarding'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'onboarding'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'onboarding'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'onboarding'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'onboarding'@'%'; +REVOKE ALL, GRANT OPTION FROM 'onboarding_controller'@'localhost'; + +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'onboarding_controller'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'onboarding_controller'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'onboarding_controller'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'onboarding_controller'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'onboarding_controller'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'onboarding_controller'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'onboarding_controller'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'onboarding_controller'@'localhost'; + +REVOKE ALL, GRANT OPTION FROM 'onboarding_controller'@'%'; + +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'onboarding_controller'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'onboarding_controller'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud` TO 'onboarding_controller'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gatekeeper_relay` TO 'onboarding_controller'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`cloud_gateway_relay` TO 'onboarding_controller'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`relay` TO 'onboarding_controller'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'onboarding_controller'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'onboarding_controller'@'%'; FLUSH PRIVILEGES; \ No newline at end of file diff --git a/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/security/SRAccessControlFilter.java b/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/security/SRAccessControlFilter.java index 328c838f0..d35734928 100644 --- a/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/security/SRAccessControlFilter.java +++ b/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/security/SRAccessControlFilter.java @@ -23,7 +23,7 @@ public class SRAccessControlFilter extends CoreSystemAccessControlFilter { // members private static final CoreSystem[] allowedCoreSystemsForQuery = { CoreSystem.ORCHESTRATOR, CoreSystem.GATEKEEPER, CoreSystem.CERTIFICATE_AUTHORITY, CoreSystem.EVENT_HANDLER, - CoreSystem.AUTHORIZATION, CoreSystem.ONBOARDING, CoreSystem.DEVICE_REGISTRY, CoreSystem.SYSTEM_REGISTRY }; + CoreSystem.AUTHORIZATION, CoreSystem.ONBOARDING_CONTROLLER, CoreSystem.DEVICE_REGISTRY, CoreSystem.SYSTEM_REGISTRY }; private static final CoreSystem[] allowedCoreSystemsForQueryBySystemId = { CoreSystem.ORCHESTRATOR }; private static final CoreSystem[] allowedCoreSystemsForQueryBySystemDTO = { CoreSystem.ORCHESTRATOR }; private static final CoreSystem[] allowedCoreSystemsForQueryAll = { CoreSystem.QOS_MONITOR }; diff --git a/systemregistry/src/deb/arrowhead-systemregistry.service b/systemregistry/src/deb/arrowhead-systemregistry.service index 76455e16a..af50de394 100644 --- a/systemregistry/src/deb/arrowhead-systemregistry.service +++ b/systemregistry/src/deb/arrowhead-systemregistry.service @@ -1,6 +1,6 @@ [Unit] Description=arrowhead-systemregistry -After=network.target mysql.target +After=network.target mysql.target arrowhead-serviceregistry [Service] WorkingDirectory=/etc/arrowhead/systems/system_registry diff --git a/systemregistry/src/deb/control/postinst b/systemregistry/src/deb/control/postinst index c2ed57b68..a9ee7abcb 100644 --- a/systemregistry/src/deb/control/postinst +++ b/systemregistry/src/deb/control/postinst @@ -55,7 +55,13 @@ case "$1" in # modify log config and application.properties ah_transform_log_file ${SYSTEM_DIR} - + + db_get arrowhead-core-common/sr_host; sr_host=$RET || true + + if [ -z ${sr_host} ]; then + sr_host=${OWN_IP} + fi + db_get arrowhead-core-common/db_host; db_host=$RET || true mv ${SYSTEM_DIR}/application.properties ${SYSTEM_DIR}/application.properties.orig @@ -63,6 +69,7 @@ case "$1" in sed -r -e "\#^.*spring\.datasource\.url=#s#.*\$#spring.datasource.url=jdbc:mysql://"${db_host}":3306/arrowhead?serverTimezone=Europe/Budapest#" \ -e "\#^.*spring\.datasource\.password=#s#.*\$#spring.datasource.password=${system_passwd}#" \ -e "\#^.*domain\.name=#s#.*\$#domain.name=${domain_name}#" \ + -e "\#^.*sr_address=#s#.*\$#sr_address=${sr_host}#" \ -e "\#^.*server\.ssl\.key-store=#s#.*\$#server.ssl.key-store=file:${SYSTEM_DIR}/${SYSTEM_NAME}.p12#" \ -e "\#^.*server\.ssl\.key-store-password=#s#.*\$#server.ssl.key-store-password=${AH_PASS_CERT}#" \ -e "\#^.*server\.ssl\.key-password=#s#.*\$#server.ssl.key-password=${AH_PASS_CERT}#" \ diff --git a/systemregistry/src/main/resources/application.properties b/systemregistry/src/main/resources/application.properties index d6dbbd769..fbd6e50d3 100644 --- a/systemregistry/src/main/resources/application.properties +++ b/systemregistry/src/main/resources/application.properties @@ -31,14 +31,9 @@ core_system_name=SYSTEM_REGISTRY # Show all request/response in debug log log_all_request_and_response=false -# System Registry has an optional feature to ping service providers in a fixed time interval, -# and remove service offerings where the service provider was not available -# use this feature (true/false) -ping_scheduled=false -# how much time the System Registry should wait for the ping response (in milliseconds) -ping_timeout=5000 -# how frequently should the ping happen, in minutes -ping_interval=60 +# Service Registry web-server parameters (to register the Authorization services) +sr_address=127.0.0.1 +sr_port=8443 ############################################ ### SECURE MODE ### diff --git a/systemregistry/src/main/resources/log4j2.xml b/systemregistry/src/main/resources/log4j2.xml index de3e42cf3..1309f0e14 100644 --- a/systemregistry/src/main/resources/log4j2.xml +++ b/systemregistry/src/main/resources/log4j2.xml @@ -5,7 +5,7 @@ %d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex INFO - DEBUG + INFO . From b23d7922e6affacf9c1c0d3b992a976a6547d64d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Tue, 10 Mar 2020 15:03:45 +0100 Subject: [PATCH 266/301] Validate CertificateSigningRequest --- .../CertificateAuthorityController.java | 33 ++++++++++++++++--- .../CertificateAuthorityService.java | 28 ++++++++++++++-- .../CertificateAuthorityControllerTest.java | 22 +++++++++++++ .../CertificateSigningRequestDTO.java | 3 ++ 4 files changed, 80 insertions(+), 6 deletions(-) diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityController.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityController.java index a2275d366..75608ddb3 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityController.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityController.java @@ -1,10 +1,15 @@ package eu.arrowhead.core.certificate_authority; +import java.util.List; + +import javax.validation.Valid; + import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.Defaults; import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; import eu.arrowhead.common.dto.internal.CertificateSigningResponseDTO; +import eu.arrowhead.common.exception.BadPayloadException; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; @@ -15,7 +20,15 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.*; +import org.springframework.validation.BindingResult; +import org.springframework.validation.ObjectError; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; @Api(tags = { CoreCommonConstants.SWAGGER_TAG_ALL }) @CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, @@ -27,7 +40,7 @@ public class CertificateAuthorityController { //================================================================================================= // members -// + // private static final String GET_CLOUD_COMMON_NAME_HTTP_200_MESSAGE = "Cloud Common Name returned"; private static final String SIGN_CERTIFICATE_HTTP_200_MESSAGE = "Successful certificate signing"; private static final String SIGN_CERTIFICATE_HTTP_400_MESSAGE = "Invalid Certificate Signing Request"; @@ -67,7 +80,7 @@ public String getCloudCommonName() { } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return a signed certificate", response = CertificateSigningResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT}) + @ApiOperation(value = "Return a signed certificate", response = CertificateSigningResponseDTO.class, tags = { CoreCommonConstants.SWAGGER_TAG_CLIENT }) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_OK, message = SIGN_CERTIFICATE_HTTP_200_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SIGN_CERTIFICATE_HTTP_400_MESSAGE), @@ -75,7 +88,19 @@ public String getCloudCommonName() { @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) @PostMapping(path = CommonConstants.OP_CA_SIGN_CERTIFICATE_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody public CertificateSigningResponseDTO signCertificate(@RequestBody final CertificateSigningRequestDTO request) { + @ResponseBody + public CertificateSigningResponseDTO signCertificate(@Valid @RequestBody final CertificateSigningRequestDTO request, BindingResult bindingResult) { + handleBindingResult(bindingResult); return certificateAuthorityService.signCertificate(request); } + + private void handleBindingResult(BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + final List allErrors = bindingResult.getAllErrors(); + for (ObjectError error : allErrors) { + logger.debug(error.toString()); + } + throw new BadPayloadException(allErrors.get(0).getDefaultMessage()); + } + } } diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java index bc6284422..55f6a2f9d 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java @@ -4,6 +4,7 @@ import eu.arrowhead.common.Utilities; import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; import eu.arrowhead.common.dto.internal.CertificateSigningResponseDTO; +import eu.arrowhead.common.exception.InvalidParameterException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -13,14 +14,21 @@ import javax.annotation.PostConstruct; import java.io.IOException; -import java.security.*; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.SecureRandom; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.time.Duration; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; -import java.util.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.ServiceConfigurationError; @Service public class CertificateAuthorityService { @@ -56,6 +64,8 @@ public String getCloudCommonName() { } public CertificateSigningResponseDTO signCertificate(CertificateSigningRequestDTO request) { + verifyCertificateSigningRequest(request); + final JcaPKCS10CertificationRequest csr = CertificateAuthorityUtils.decodePKCS10CSR(request); CertificateAuthorityUtils.checkCommonName(csr, cloudCommonName); CertificateAuthorityUtils.checkCsrSignature(csr); @@ -82,6 +92,20 @@ private KeyStore getKeyStore() { } } + private static void verifyCertificateSigningRequest(CertificateSigningRequestDTO request) { + if (request == null) { + logger.error("CertificateSigningRequest cannot be null"); + throw new InvalidParameterException("CertificateSigningRequest cannot be null"); + } + + final String encodedCSR = request.getEncodedCSR(); + + if (encodedCSR == null || encodedCSR.isEmpty()) { + logger.error("CertificateSigningRequest cannot be empty"); + throw new InvalidParameterException("CertificateSigningRequest cannot be empty"); + } + } + private List buildEncodedCertificateChain(X509Certificate clientCertificate) { final ArrayList encodedCertificateChain = new ArrayList<>(); encodedCertificateChain.add(CertificateAuthorityUtils.encodeCertificate(clientCertificate)); diff --git a/certificate-authority/src/test/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityControllerTest.java b/certificate-authority/src/test/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityControllerTest.java index 6e426cf34..dda6e9b0b 100644 --- a/certificate-authority/src/test/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityControllerTest.java +++ b/certificate-authority/src/test/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityControllerTest.java @@ -157,6 +157,28 @@ public void testSignPostInvalidContentType() throws Exception { .andExpect(status().isUnsupportedMediaType()); } + @Test + public void testSignPostWithNullCSR() throws Exception { + mockMvc.perform(post("/certificate-authority/sign") + .secure(true) + .with(x509("certificates/valid.pem")) + .contentType(MediaType.APPLICATION_JSON) + .accept(MediaType.APPLICATION_JSON) + .content(asJsonString(new CertificateSigningRequestDTO(null)))) + .andExpect(status().isBadRequest()); + } + + @Test + public void testSignPostWithInvalidCSR() throws Exception { + mockMvc.perform(post("/certificate-authority/sign") + .secure(true) + .with(x509("certificates/valid.pem")) + .contentType(MediaType.APPLICATION_JSON) + .accept(MediaType.APPLICATION_JSON) + .content(asJsonString(new CertificateSigningRequestDTO("INVALID")))) + .andExpect(status().isBadRequest()); + } + @Test public void testSignPostWithValidCSR() throws Exception { mockMvc.perform(post("/certificate-authority/sign") diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningRequestDTO.java index 0231f9bcd..780c30e81 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateSigningRequestDTO.java @@ -2,10 +2,13 @@ import java.io.Serializable; +import javax.validation.constraints.NotBlank; + public class CertificateSigningRequestDTO implements Serializable { private static final long serialVersionUID = -6810780579000655432L; + @NotBlank(message = "The encodedCSR is mandatory") private String encodedCSR; public CertificateSigningRequestDTO() {} From 846944ef0495c13eb6d6f43324edb34fcd8d6d34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Tue, 10 Mar 2020 15:38:26 +0100 Subject: [PATCH 267/301] Add NPE checks, tests --- .../CertificateAuthorityUtils.java | 49 ++++++---- .../CertificateAuthorityUtilsTest.java | 94 +++++++++++++++++++ 2 files changed, 124 insertions(+), 19 deletions(-) create mode 100644 certificate-authority/src/test/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtilsTest.java diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java index 742d58aeb..ac012b205 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java @@ -49,6 +49,7 @@ import eu.arrowhead.common.exception.AuthException; import eu.arrowhead.common.exception.BadPayloadException; import eu.arrowhead.common.exception.DataNotFoundException; +import eu.arrowhead.common.exception.InvalidParameterException; class CertificateAuthorityUtils { @@ -61,16 +62,16 @@ static JcaPKCS10CertificationRequest decodePKCS10CSR(CertificateSigningRequestDT try { final byte[] csrBytes = Base64.getDecoder().decode(csr.getEncodedCSR()); return new JcaPKCS10CertificationRequest(csrBytes); - } catch (Exception ex) { - logger.error("Failed to parse request as a PKCS10 CSR, because: " + ex.getMessage()); - throw new BadPayloadException("Failed to parse request as a PKCS10 CSR", ex); + } catch (Exception e) { + logger.error("Failed to parse request as a PKCS10 CSR, because: " + e.getMessage()); + throw new BadPayloadException("Failed to parse request as a PKCS10 CSR", e); } } static String encodeCertificate(X509Certificate certificate) { try { return Base64.getEncoder().encodeToString(certificate.getEncoded()); - } catch (CertificateEncodingException e) { + } catch (CertificateEncodingException | NullPointerException e) { throw new AuthException("Certificate encoding failed! (" + e.getMessage() + ")", e); } } @@ -87,6 +88,12 @@ static String getCloudCommonName(X509Certificate cloudCertificate) { } static void checkCommonName(JcaPKCS10CertificationRequest csr, String cloudCN) { + if (csr == null) { + throw new BadPayloadException("CSR cannot be null"); + } + if (cloudCN == null || cloudCN.isEmpty()) { + throw new BadPayloadException("CloudCN cannot be null"); + } final String clientCN = Utilities.getCertCNFromSubject(csr.getSubject().toString()); if (!Utilities.isKeyStoreCNArrowheadValid(clientCN, cloudCN)) { throw new BadPayloadException( @@ -97,20 +104,21 @@ static void checkCommonName(JcaPKCS10CertificationRequest csr, String cloudCN) { static void checkCsrSignature(JcaPKCS10CertificationRequest csr) { try { - ContentVerifierProvider verifierProvider = new JcaContentVerifierProviderBuilder().setProvider(PROVIDER) + final ContentVerifierProvider verifierProvider = new JcaContentVerifierProviderBuilder() + .setProvider(PROVIDER) .build(csr.getSubjectPublicKeyInfo()); if (!csr.isSignatureValid(verifierProvider)) { - throw new AuthException("Certificate request has invalid signature! (key pair does not match)"); + throw new BadPayloadException("Certificate request has invalid signature! (key pair does not match)"); } - } catch (OperatorCreationException | PKCSException e) { - throw new AuthException("Encapsulated " + e.getClass().getCanonicalName() + ": " + e.getMessage(), e); + } catch (OperatorCreationException | PKCSException | NullPointerException e) { + throw new BadPayloadException("Encapsulated " + e.getClass().getCanonicalName() + ": " + e.getMessage(), e); } } static PublicKey getClientKey(JcaPKCS10CertificationRequest csr) { try { return csr.getPublicKey(); - } catch (InvalidKeyException | NoSuchAlgorithmException e) { + } catch (InvalidKeyException | NoSuchAlgorithmException | NullPointerException e) { // This should not be possible after a successful signature verification throw new DataNotFoundException("Extracting the public key from the CSR failed (" + e.getMessage() + ")", e); @@ -136,28 +144,28 @@ static X509Certificate buildCertificate(JcaPKCS10CertificationRequest csr, Priva return new JcaX509CertificateConverter().setProvider(PROVIDER) .getCertificate(builder.build(signerBuilder.build(cloudPrivateKey))); } catch (CertificateException e) { - throw new AuthException("Certificate encoding failed! (" + e.getMessage() + ")", e); + throw new BadPayloadException("Certificate encoding failed! (" + e.getMessage() + ")", e); } catch (OperatorCreationException e) { - throw new AuthException("Certificate signing failed! (" + e.getMessage() + ")", e); + throw new BadPayloadException("Certificate signing failed! (" + e.getMessage() + ")", e); } } /** - * Adding the following extensions to the new certificate: + * Adding the following extensions to the new certificate: *
      *
    1. The subject alternative name makes possible to use the certificate for * accessing a host via IP address or hostname
    2. - * + * *
    3. The subject key identifier provides a hashed value that should uniquely * identify the public key
    4. - * + * *
    5. The authority key identifier provides a hashed value that should uniquely * identify the issuer of the certificate
    6. - * + * *
    7. And this basic constraint is for forbidding issuing other certificates * under this certificate
    8. *
    - */ + */ static void addCertificateExtensions(X509v3CertificateBuilder builder, JcaPKCS10CertificationRequest csr, PublicKey clientKey, X509Certificate cloudCertificate) { try { @@ -170,14 +178,17 @@ static void addCertificateExtensions(X509v3CertificateBuilder builder, JcaPKCS10 builder.addExtension(Extension.authorityKeyIdentifier, false, extUtils.createAuthorityKeyIdentifier(cloudCertificate)); builder.addExtension(Extension.basicConstraints, true, new BasicConstraints(false)); - } catch (NoSuchAlgorithmException | CertIOException | CertificateEncodingException e) { - throw new AuthException("Appending extensions to the certificate failed! (" + e.getMessage() + ")", e); + } catch (NoSuchAlgorithmException | CertIOException | CertificateEncodingException | NullPointerException e) { + throw new InvalidParameterException("Appending extensions to the certificate failed! (" + e.getMessage() + ")", e); } } static List getSubjectAlternativeNames(JcaPKCS10CertificationRequest csr) { - List alternativeNames = new ArrayList<>(); + if (csr == null) { + throw new InvalidParameterException("CSR cannot be null"); + } + List alternativeNames = new ArrayList<>(); for (final Attribute attribute : csr.getAttributes()) { if (attribute == null) { continue; diff --git a/certificate-authority/src/test/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtilsTest.java b/certificate-authority/src/test/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtilsTest.java new file mode 100644 index 000000000..a11fe32a8 --- /dev/null +++ b/certificate-authority/src/test/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtilsTest.java @@ -0,0 +1,94 @@ +package eu.arrowhead.core.certificate_authority; + +import static org.junit.Assert.assertNotNull; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.Base64; +import java.util.ServiceConfigurationError; + +import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest; +import org.hamcrest.core.IsInstanceOf; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; +import org.springframework.core.io.ClassPathResource; +import org.springframework.test.context.junit4.SpringRunner; + +import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; +import eu.arrowhead.common.exception.AuthException; +import eu.arrowhead.common.exception.BadPayloadException; +import eu.arrowhead.common.exception.DataNotFoundException; + +@RunWith(SpringRunner.class) +public class CertificateAuthorityUtilsTest { + + @Rule + public ExpectedException thrownException = ExpectedException.none(); + + @Test(expected = BadPayloadException.class) + public void testDecodePKCS10CSRNull() { + CertificateAuthorityUtils.decodePKCS10CSR(null); + } + + @Test(expected = BadPayloadException.class) + public void testDecodePKCS10CSREmpty() { + CertificateAuthorityUtils.decodePKCS10CSR(new CertificateSigningRequestDTO()); + } + + @Test(expected = BadPayloadException.class) + public void testDecodePKCS10CSRInvalidString() { + CertificateAuthorityUtils.decodePKCS10CSR(new CertificateSigningRequestDTO("Invalid CSR String")); + } + + @Test + public void testEncodeCertificateNull() { + thrownException.expect(IsInstanceOf.instanceOf(AuthException.class)); + thrownException.expectCause(IsInstanceOf.instanceOf(NullPointerException.class)); + CertificateAuthorityUtils.encodeCertificate(null); + } + + @Test(expected = ServiceConfigurationError.class) + public void testGetCloudCommonNameNullCert() { + CertificateAuthorityUtils.getCloudCommonName(null); + } + + @Test(expected = BadPayloadException.class) + public void testCheckCommonNameNullCSR() { + CertificateAuthorityUtils.checkCommonName(null, "cloudCN"); + } + + @Test(expected = BadPayloadException.class) + public void testCheckCommonNameNullCloudCN() throws NullPointerException, IOException { + final JcaPKCS10CertificationRequest csr = getResourceCSR("certificates/valid.csr"); + assertNotNull(csr); + CertificateAuthorityUtils.checkCommonName(csr, null); + } + + @Test(expected = BadPayloadException.class) + public void testCheckCsrSignatureNull() { + CertificateAuthorityUtils.checkCsrSignature(null); + } + + @Test + public void testGetClientKeyNull() { + thrownException.expect(DataNotFoundException.class); + thrownException.expectCause(IsInstanceOf.instanceOf(NullPointerException.class)); + CertificateAuthorityUtils.getClientKey(null); + } + + private static String getResourceContentAsString(final String resourcePath) throws IOException { + final File resource = new ClassPathResource(resourcePath).getFile(); + return new String(Files.readAllBytes(resource.toPath())).trim(); + } + + private static JcaPKCS10CertificationRequest getResourceCSR( + final String resourcePath) + throws IOException, NullPointerException { + final String resourceBytes = getResourceContentAsString(resourcePath); + final byte[] csrBytes = Base64.getDecoder().decode(resourceBytes); + return new JcaPKCS10CertificationRequest(csrBytes); + } +} From 69d6720c2a4db0e813bb6ff6ddb378b66f73f336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Mon, 16 Mar 2020 11:39:18 +0100 Subject: [PATCH 268/301] Add documentation --- README.md | 109 +++++++++++++++++- ...eleaseNotes-4.1.3-CertificateAuthority.odt | Bin 0 -> 10850 bytes 2 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 documentation/certificate_authority/ReleaseNotes-4.1.3-CertificateAuthority.odt diff --git a/README.md b/README.md index c1a70b759..6aa500b7c 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,14 @@ Please be aware, that 4.1.3 is __NOT__ backwards compatible with 4.1.2. If you h * [Client](#gateway_endpoints_client) * [Private](#gateway_endpoints_private) * [Management](#gateway_endpoints_mgmt) - 6. [QoS Monitor (Quality of Service Monitor)](#qos_monitor) + 7. [Certificate Authority](#ca) + * [System Design Description Overview](#ca_sdd) + * [Services and Use Cases](#ca_usecases) + * [Endpoints](#ca_endpoints) + * [Client](#ca_endpoints_client) + * [Private](#ca_endpoints_private) + * [Management](#ca_endpoints_mgmt) + 8. [QoS Monitor (Quality of Service Monitor)](#qos_monitor) * [System Design Description Overview](#qos_monitor_sdd) * [Services and Use Cases](#qos_monitor_usecases) * [Endpoints](#qos_monitor_endpoints) @@ -6273,6 +6280,106 @@ __ActiveSession__ is the output. | `responseControlQueue` | control queue of response messaging through the the Relay | | `sessionStartedAt` | Time stamp of session start | +
    + +# Certificate Authority + + + +## System Design Description Overview + +The purpose of the Certificate Authority supporting core system is issuing signed certificates to be used in the local cloud. + + + +## Provided services + +The Certificate Authority provides the following services: +* [Echo](#ca_endpoints_get_echo) +* [Certificate signing](#ca_endpoints_sign) + + + +## Use cases + +The main use case of the Certificate Authority is to issue signed certificates to new consumers coming via the Onboarding Controller. + + + +## Endpoints + + + +### Client endpoint description
    + +| Function | URL subpath | Method | Input | Output | +| -------- | ----------- | ------ | ----- | ------ | +| [Echo](#ca_endpoints_get_echo) | /echo | GET | - | OK | + +
    + +### Private endpoint description
    + +| Function | URL subpath | Method | Input | Output | +| -------- | ----------- | ------ | ----- | ------ | +| [Sign CSR with the Cloud Certificate](#ca_endpoints_sign) | /sign | POST | CertificateSigningRequest | [CertificateSigningResponse](#ca_certificate_signing_response) | + +
    + +### Echo +``` +GET /certificate-authority/echo +``` + +Returns a "Got it" message with the purpose of testing the core service availability. + + + +### Sign CSR with the Cloud Certificate + +``` +POST /certificate-authority/sign +``` + +Returns the whole certificate chain beginning with the newly generated leaf certificate and ending with the root certificate. + +Each certificate's issuer is the same as the subject of the following one. The issuer of the root certificate is the same as the subject. + +__Sign CSR with the Cloud Certificate__ inputs: + +`https://ca_ip:ca_port/certificate-authority/sign` + +| __Sign CSR with the Cloud Certificate__ query parameters | +| ------------------------------------------------------- | + +| Parameter | Description | Necessity | Format/Limitations | +| --------- | ----------- | --------- | ----------- | +| `encodedCSR` | PKCS #10 Certificate Signing Request | mandatory | Base64 encoded CSR | + + + +__Sign CSR with the Cloud Certificate__ output : + +```json +{ + "certificateChain": [ + "", + "", + "" + ] +} +``` + +| Field | Description | +| ----- | ----------- | +| `certificateChain` | The whole certificate chain in an array of PEM encoded strings | + + + +### Management endpoint description
    + +The Certificate Authority does not have management endpoints. +
    # QOS MONITOR (QUALITY OF SERVICE MONITOR) diff --git a/documentation/certificate_authority/ReleaseNotes-4.1.3-CertificateAuthority.odt b/documentation/certificate_authority/ReleaseNotes-4.1.3-CertificateAuthority.odt new file mode 100644 index 0000000000000000000000000000000000000000..eb222ba709c30f0200003ac0f789052b47cc9f0f GIT binary patch literal 10850 zcmaKS1ymf_)^!5`g1ghW1$PS;+$9j)T^e_HcLD?_!97T5Jh*#scXtU+_&f7vp3HmS z-)q(Cu3KmCBllLV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yQcPp>b{(^Gg zDKtC1UU%v}gOuSfc;o(i4MnJ9XIJqREt>N`kV}UHQqr|0H!Aj>zjN)8XqZXdf_mCN z9GJN%qxASP$yQF;hr(P%OmJ~I)`_DyKdtyet6luLbUm)zK8_48Pz9@d_ZUZ*kY3)m%D^QGn&b2|X_nvkH8u$qT}rkI(?k_N zZb2-s`n1bH(;Xq;#t<*{J1Zg3jr6$Yjv19Nt)5r5=xBj6tf2cE>R1Xv_t#J6N$)#8v$~F)IsX z4qve&xPq=asyt1RF&~1W<~Xp%koSahe}c|;aAaMb<=3@v#3<%yKIBGE5fg$vwu-AK-6du$>twQw7;YNu2}jv6zqTKm;Mg? idynp4KquUP@7O8J!9t{-0Ehq-4xkN@#$D3=KKp;fZ2u Date: Tue, 17 Mar 2020 12:35:12 +0100 Subject: [PATCH 269/301] continuing CA integration --- core-common/pom.xml | 10 +- .../arrowhead/common/SecurityUtilities.java | 199 ++++++++++++++++++ .../shared/CertificateCreationRequestDTO.java | 14 +- .../dto/shared/OnboardingResponseDTO.java | 106 ++++++++++ .../shared/OnboardingWithCsrResponseDTO.java | 98 +-------- .../shared/OnboardingWithNameResponseDTO.java | 87 +------- .../database/service/OnboardingDBService.java | 76 ++++--- 7 files changed, 371 insertions(+), 219 deletions(-) create mode 100644 core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingResponseDTO.java diff --git a/core-common/pom.xml b/core-common/pom.xml index 1e5d966f4..b9b633f30 100644 --- a/core-common/pom.xml +++ b/core-common/pom.xml @@ -1,6 +1,14 @@ 4.0.0 - + + + org.bouncycastle + bcpkix-jdk15on + 1.64 + compile + + + eu.arrowhead core ${revision} diff --git a/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java b/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java new file mode 100644 index 000000000..45d1eb3b5 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java @@ -0,0 +1,199 @@ +package eu.arrowhead.common; + +import eu.arrowhead.common.dto.shared.CertificateCreationRequestDTO; +import eu.arrowhead.common.exception.AuthException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.bouncycastle.asn1.x500.X500Name; +import org.bouncycastle.operator.ContentSigner; +import org.bouncycastle.operator.OperatorCreationException; +import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; +import org.bouncycastle.pkcs.PKCS10CertificationRequest; +import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequestBuilder; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import org.springframework.util.Assert; + +import java.io.IOException; +import java.security.KeyFactory; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.Principal; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.X509EncodedKeySpec; +import java.util.Base64; +import java.util.Objects; + +@Component +public class SecurityUtilities { + + //================================================================================================= + // members + private final static String SIGNATURE_ALGORITHM = "SHA256WithRSA"; + + private final Logger logger = LogManager.getLogger(SecurityUtilities.class); + + private final KeyFactory keyFactory; + private final KeyPairGenerator keyPairGenerator; + private final SSLProperties sslProperties; + + //================================================================================================= + // constructors + @Autowired + public SecurityUtilities(@Value("${security.key.algorithm:RSA}") final String keyFactoryAlgorithm, + @Value("${security.key.size:2048}") final Integer keySize, + final SSLProperties sslProperties) throws NoSuchAlgorithmException { + this.sslProperties = sslProperties; + keyFactory = KeyFactory.getInstance(keyFactoryAlgorithm); + keyPairGenerator = KeyPairGenerator.getInstance(keyFactoryAlgorithm); + keyPairGenerator.initialize(keySize); + } + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public String createEncodedCSR(final String baseCommonName, final KeyPair keyPair) + throws IOException, CertificateException, NoSuchAlgorithmException, KeyStoreException, OperatorCreationException { + + Assert.notNull(sslProperties.getKeyStore(), "KeyStore property must not be null!"); + Assert.hasText(sslProperties.getKeyStorePassword(), "KeyStore password property must not be null or empty!"); + + // get cloud certificate for cloudName and operator + final KeyStore keyStore = KeyStore.getInstance(sslProperties.getKeyStore().getFile(), sslProperties.getKeyStorePassword().toCharArray()); + final X509Certificate cloudCertFromKeyStore = Utilities.getCloudCertFromKeyStore(keyStore); + + // "CN=...arrowhead.eu, OU=, O=arrowhead, C=eu" + final String cloudName = getCloudName(cloudCertFromKeyStore.getSubjectDN()); + final String operator = getOperatorName(cloudCertFromKeyStore.getSubjectDN()); + final String organization = getOrganization(cloudCertFromKeyStore.getSubjectDN()); + final String country = getCountry(cloudCertFromKeyStore.getSubjectDN()); + final String commonName = String.format("CN=%s.%s.%s.%s.%s, OU=%s, O=%s, C=%s", + baseCommonName, cloudName, operator, organization, country, + operator, organization, country); + final X500Name x500Name = new X500Name(commonName); + + // create certificate signing request + final JcaPKCS10CertificationRequestBuilder builder = new JcaPKCS10CertificationRequestBuilder(x500Name, keyPair.getPublic()); + final JcaContentSignerBuilder contentSignerBuilder = new JcaContentSignerBuilder(SIGNATURE_ALGORITHM); + final ContentSigner contentSigner = contentSignerBuilder.build(keyPair.getPrivate()); + final PKCS10CertificationRequest csr = builder.build(contentSigner); + return Base64.getEncoder().encodeToString(csr.getEncoded()); + } + + //------------------------------------------------------------------------------------------------- + public KeyPair generateKeyPair() { + return keyPairGenerator.generateKeyPair(); + } + + //------------------------------------------------------------------------------------------------- + public KeyPair getKeyPairFromBase64EncodedStrings(final String encodedPublicKey, + final String encodedPrivateKey) { + final PublicKey publicKey = getPublicKeyFromBase64EncodedString(encodedPublicKey); + final PrivateKey privateKey = getPrivateKeyFromBase64EncodedString(encodedPrivateKey); + return new KeyPair(publicKey, privateKey); + } + + //------------------------------------------------------------------------------------------------- + public KeyPair extractKeyPair(final CertificateCreationRequestDTO creationRequestDTO) { + final String commonName = creationRequestDTO.getCommonName(); + final String encodedPublicKey = creationRequestDTO.getPublicKey(); + final String encodedPrivateKey = creationRequestDTO.getPrivateKey(); + + Assert.isTrue(Utilities.notEmpty(commonName), "CommonName is null or blank"); + final KeyPair keyPair; + + if (Objects.nonNull(encodedPrivateKey) && Objects.nonNull(encodedPublicKey)) { + keyPair = getKeyPairFromBase64EncodedStrings(encodedPublicKey, encodedPrivateKey); + } + else { + keyPair = generateKeyPair(); + } + + return keyPair; + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private PublicKey getPublicKeyFromBase64EncodedString(final String encodedKey) { + Assert.isTrue(Utilities.notEmpty(encodedKey), "Encoded key is null or blank"); + + final byte[] keyBytes = Base64.getDecoder().decode(encodedKey); + return generatePublicKeyFromByteArray(keyBytes); + } + + //------------------------------------------------------------------------------------------------- + private PrivateKey getPrivateKeyFromBase64EncodedString(final String encodedKey) { + Assert.isTrue(Utilities.notEmpty(encodedKey), "Encoded key is null or blank"); + + final byte[] keyBytes = Base64.getDecoder().decode(encodedKey); + return generatePrivateKeyFromByteArray(keyBytes); + } + + //------------------------------------------------------------------------------------------------- + private String getCloudName(final Principal principal) { + return extractCNPart(principal, 3); + } + + //------------------------------------------------------------------------------------------------- + private String getOperatorName(final Principal principal) { + return extractCNPart(principal, 2); + } + + //------------------------------------------------------------------------------------------------- + private String getOrganization(final Principal principal) { + return extractCNPart(principal, 1); + } + + //------------------------------------------------------------------------------------------------- + private String getCountry(final Principal principal) { + return extractCNPart(principal, 0); + } + + //------------------------------------------------------------------------------------------------- + + //------------------------------------------------------------------------------------------------- + private String extractCNPart(final Principal principal, final int tailIndex) { + Assert.notNull(principal, "Principal must not be null"); + final String fullCN = principal.getName(); + Assert.hasText(fullCN, "Empty common name is not allowed"); + + final String[] strings = fullCN.split("\\."); + + if (tailIndex >= strings.length) { + throw new IllegalArgumentException("Internal error: Unable to extract information from cloud certificate"); + } + + return strings[strings.length - (tailIndex + 1)]; + } + + //------------------------------------------------------------------------------------------------- + private PublicKey generatePublicKeyFromByteArray(final byte[] keyBytes) { + try { + return keyFactory.generatePublic(new X509EncodedKeySpec(keyBytes)); + } catch (final InvalidKeySpecException ex) { + logger.error("getPublicKey: X509 keySpec could not be created from the decoded bytes."); + throw new AuthException("Public key decoding failed due wrong input key", ex); + } + } + + //------------------------------------------------------------------------------------------------- + private PrivateKey generatePrivateKeyFromByteArray(final byte[] keyBytes) { + try { + return keyFactory.generatePrivate(new X509EncodedKeySpec(keyBytes)); + } catch (final InvalidKeySpecException ex) { + logger.error("getPublicKey: X509 keySpec could not be created from the decoded bytes."); + throw new AuthException("Public key decoding failed due wrong input key", ex); + } + } +} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationRequestDTO.java index d2dc8b78a..eeaa6dbfd 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationRequestDTO.java @@ -9,8 +9,8 @@ public class CertificateCreationRequestDTO implements Serializable { private static final long serialVersionUID = 1L; private String commonName; - private byte[] publicKey; - private byte[] privateKey; + private String publicKey; + private String privateKey; //================================================================================================= @@ -23,7 +23,7 @@ public CertificateCreationRequestDTO(final String commonName) { this.commonName = commonName; } - public CertificateCreationRequestDTO(final String commonName, final byte[] publicKey, final byte[] privateKey) { + public CertificateCreationRequestDTO(final String commonName, final String publicKey, final String privateKey) { this.commonName = commonName; this.publicKey = publicKey; this.privateKey = privateKey; @@ -40,19 +40,19 @@ public void setCommonName(String commonName) { this.commonName = commonName; } - public byte[] getPublicKey() { + public String getPublicKey() { return publicKey; } - public void setPublicKey(byte[] publicKey) { + public void setPublicKey(String publicKey) { this.publicKey = publicKey; } - public byte[] getPrivateKey() { + public String getPrivateKey() { return privateKey; } - public void setPrivateKey(byte[] privateKey) { + public void setPrivateKey(String privateKey) { this.privateKey = privateKey; } } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingResponseDTO.java new file mode 100644 index 000000000..03378f505 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingResponseDTO.java @@ -0,0 +1,106 @@ +package eu.arrowhead.common.dto.shared; + +import java.io.Serializable; + +public abstract class OnboardingResponseDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = 1L; + private ServiceEndpoint deviceRegistry; + private ServiceEndpoint systemRegistry; + private ServiceEndpoint serviceRegistry; + private ServiceEndpoint orchestrationService; + + private CertificateResponseDTO onboardingCertificate; + private String intermediateCertificate; + private String rootCertificate; + + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + public ServiceEndpoint getDeviceRegistry() + { + return deviceRegistry; + } + + //------------------------------------------------------------------------------------------------- + public void setDeviceRegistry(final ServiceEndpoint deviceRegistry) + { + this.deviceRegistry = deviceRegistry; + } + + //------------------------------------------------------------------------------------------------- + public ServiceEndpoint getSystemRegistry() + { + return systemRegistry; + } + + //------------------------------------------------------------------------------------------------- + public void setSystemRegistry(final ServiceEndpoint systemRegistry) + { + this.systemRegistry = systemRegistry; + } + + //------------------------------------------------------------------------------------------------- + public ServiceEndpoint getServiceRegistry() + { + return serviceRegistry; + } + + //------------------------------------------------------------------------------------------------- + public void setServiceRegistry(final ServiceEndpoint serviceRegistry) + { + this.serviceRegistry = serviceRegistry; + } + + //------------------------------------------------------------------------------------------------- + public ServiceEndpoint getOrchestrationService() { + return orchestrationService; + } + + //------------------------------------------------------------------------------------------------- + public void setOrchestrationService(ServiceEndpoint orchestrationService) { + this.orchestrationService = orchestrationService; + } + + //------------------------------------------------------------------------------------------------- + public CertificateResponseDTO getOnboardingCertificate() + { + return onboardingCertificate; + } + + //------------------------------------------------------------------------------------------------- + public void setOnboardingCertificate(final CertificateResponseDTO onboardingCertificate) + { + this.onboardingCertificate = onboardingCertificate; + } + + //------------------------------------------------------------------------------------------------- + public String getIntermediateCertificate() + { + return intermediateCertificate; + } + + //------------------------------------------------------------------------------------------------- + public void setIntermediateCertificate(final String intermediateCertificate) + { + this.intermediateCertificate = intermediateCertificate; + } + + //------------------------------------------------------------------------------------------------- + public String getRootCertificate() + { + return rootCertificate; + } + + //------------------------------------------------------------------------------------------------- + public void setRootCertificate(final String rootCertificate) + { + this.rootCertificate = rootCertificate; + } + +} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java index 3ec1d0d39..12e336e70 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java @@ -2,105 +2,11 @@ import java.io.Serializable; -public class OnboardingWithCsrResponseDTO implements Serializable { +public class OnboardingWithCsrResponseDTO extends OnboardingResponseDTO implements Serializable { //================================================================================================= // members - private static final long serialVersionUID = 1L; - private ServiceEndpoint deviceRegistry; - private ServiceEndpoint systemRegistry; - private ServiceEndpoint serviceRegistry; - private ServiceEndpoint orchestrationService; - - private CertificateResponseDTO onboardingCertificate; - private String intermediateCertificate; - private String rootCertificate; - - - //================================================================================================= - // methods - - //------------------------------------------------------------------------------------------------- - public ServiceEndpoint getDeviceRegistry() - { - return deviceRegistry; - } - - //------------------------------------------------------------------------------------------------- - public void setDeviceRegistry(final ServiceEndpoint deviceRegistry) - { - this.deviceRegistry = deviceRegistry; - } - - //------------------------------------------------------------------------------------------------- - public ServiceEndpoint getSystemRegistry() - { - return systemRegistry; - } - - //------------------------------------------------------------------------------------------------- - public void setSystemRegistry(final ServiceEndpoint systemRegistry) - { - this.systemRegistry = systemRegistry; - } - - //------------------------------------------------------------------------------------------------- - public ServiceEndpoint getServiceRegistry() - { - return serviceRegistry; - } - - //------------------------------------------------------------------------------------------------- - public void setServiceRegistry(final ServiceEndpoint serviceRegistry) - { - this.serviceRegistry = serviceRegistry; - } - - //------------------------------------------------------------------------------------------------- - public ServiceEndpoint getOrchestrationService() { - return orchestrationService; - } - - //------------------------------------------------------------------------------------------------- - public void setOrchestrationService(ServiceEndpoint orchestrationService) { - this.orchestrationService = orchestrationService; - } - - //------------------------------------------------------------------------------------------------- - public CertificateResponseDTO getOnboardingCertificate() - { - return onboardingCertificate; - } - - //------------------------------------------------------------------------------------------------- - public void setOnboardingCertificate(final CertificateResponseDTO onboardingCertificate) - { - this.onboardingCertificate = onboardingCertificate; - } - - //------------------------------------------------------------------------------------------------- - public String getIntermediateCertificate() - { - return intermediateCertificate; - } - - //------------------------------------------------------------------------------------------------- - public void setIntermediateCertificate(final String intermediateCertificate) - { - this.intermediateCertificate = intermediateCertificate; - } - - //------------------------------------------------------------------------------------------------- - public String getRootCertificate() - { - return rootCertificate; - } - - //------------------------------------------------------------------------------------------------- - public void setRootCertificate(final String rootCertificate) - { - this.rootCertificate = rootCertificate; - } + // this class exist to keep the structure of RequestDTO, ResponseDTO } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java index 3b1ef766b..78794c475 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java @@ -1,93 +1,10 @@ package eu.arrowhead.common.dto.shared; -import java.io.Serializable; - -public class OnboardingWithNameResponseDTO implements Serializable { +public class OnboardingWithNameResponseDTO extends OnboardingResponseDTO { //================================================================================================= // members private static final long serialVersionUID = 1L; - private ServiceEndpoint deviceRegistry; - private ServiceEndpoint systemRegistry; - private ServiceEndpoint serviceRegistry; - - private CertificateResponseDTO onboardingCertificate; - private String intermediateCertificate; - private String rootCertificate; - - - //================================================================================================= - // methods - - //------------------------------------------------------------------------------------------------- - public ServiceEndpoint getDeviceRegistry() - { - return deviceRegistry; - } - - //------------------------------------------------------------------------------------------------- - public void setDeviceRegistry(final ServiceEndpoint deviceRegistry) - { - this.deviceRegistry = deviceRegistry; - } - - //------------------------------------------------------------------------------------------------- - public ServiceEndpoint getSystemRegistry() - { - return systemRegistry; - } - - //------------------------------------------------------------------------------------------------- - public void setSystemRegistry(final ServiceEndpoint systemRegistry) - { - this.systemRegistry = systemRegistry; - } - - //------------------------------------------------------------------------------------------------- - public ServiceEndpoint getServiceRegistry() - { - return serviceRegistry; - } - - //------------------------------------------------------------------------------------------------- - public void setServiceRegistry(final ServiceEndpoint serviceRegistry) - { - this.serviceRegistry = serviceRegistry; - } - - //------------------------------------------------------------------------------------------------- - public CertificateResponseDTO getOnboardingCertificate() - { - return onboardingCertificate; - } - - //------------------------------------------------------------------------------------------------- - public void setOnboardingCertificate(final CertificateResponseDTO onboardingCertificate) - { - this.onboardingCertificate = onboardingCertificate; - } - - //------------------------------------------------------------------------------------------------- - public String getIntermediateCertificate() - { - return intermediateCertificate; - } - - //------------------------------------------------------------------------------------------------- - public void setIntermediateCertificate(final String intermediateCertificate) - { - this.intermediateCertificate = intermediateCertificate; - } - - //------------------------------------------------------------------------------------------------- - public String getRootCertificate() - { - return rootCertificate; - } - //------------------------------------------------------------------------------------------------- - public void setRootCertificate(final String rootCertificate) - { - this.rootCertificate = rootCertificate; - } + // this class exist to keep the structure of RequestDTO, ResponseDTO } diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java index c3929ec21..90acd8705 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java @@ -2,10 +2,13 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.OrchestrationDriver; +import eu.arrowhead.common.SecurityUtilities; import eu.arrowhead.common.core.CoreSystemService; import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; import eu.arrowhead.common.dto.internal.CertificateSigningResponseDTO; +import eu.arrowhead.common.dto.shared.CertificateCreationRequestDTO; import eu.arrowhead.common.dto.shared.CertificateResponseDTO; +import eu.arrowhead.common.dto.shared.OnboardingResponseDTO; import eu.arrowhead.common.dto.shared.OnboardingWithCsrRequestDTO; import eu.arrowhead.common.dto.shared.OnboardingWithCsrResponseDTO; import eu.arrowhead.common.dto.shared.OnboardingWithNameRequestDTO; @@ -13,7 +16,6 @@ import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; import eu.arrowhead.common.dto.shared.ServiceEndpoint; import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; -import eu.arrowhead.common.dto.shared.SystemResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.http.HttpService; import org.apache.logging.log4j.LogManager; @@ -24,6 +26,7 @@ import org.springframework.stereotype.Service; import org.springframework.web.util.UriComponents; +import java.security.KeyPair; import java.util.Objects; @Service @@ -34,11 +37,15 @@ public class OnboardingDBService { private final Logger logger = LogManager.getLogger(OnboardingDBService.class); private final OrchestrationDriver orchestration; private final HttpService httpService; + private final SecurityUtilities securityUtilities; @Autowired - public OnboardingDBService(final OrchestrationDriver orchestration, HttpService httpService) { + public OnboardingDBService(final OrchestrationDriver orchestration, + final HttpService httpService, + final SecurityUtilities securityUtilities) { this.orchestration = orchestration; this.httpService = httpService; + this.securityUtilities = securityUtilities; } //================================================================================================= @@ -47,32 +54,45 @@ public OnboardingDBService(final OrchestrationDriver orchestration, HttpService //------------------------------------------------------------------------------------------------- public OnboardingWithNameResponseDTO onboarding(final OnboardingWithNameRequestDTO onboardingRequest) { logger.debug("onboarding started..."); - // TODO contact certificate authority - return null; + + final CertificateCreationRequestDTO creationRequestDTO = onboardingRequest.getCreationRequestDTO(); + final KeyPair keyPair = securityUtilities.extractKeyPair(creationRequestDTO); + final String certificateSigningRequest; + + try { + certificateSigningRequest = securityUtilities.createEncodedCSR(creationRequestDTO.getCommonName(), keyPair); + } catch (Exception e) { + logger.error(e.getMessage(), e); + throw new ArrowheadException("Unable to create certificate signing request: " + e.getMessage()); + } + + final CertificateSigningResponseDTO signingResponseDTO = executeCertificateSigningRequest(certificateSigningRequest); + return enrichOnboardingResponse(new OnboardingWithNameResponseDTO(), signingResponseDTO); } //------------------------------------------------------------------------------------------------- public OnboardingWithCsrResponseDTO onboarding(final OnboardingWithCsrRequestDTO onboardingRequest) { logger.debug("onboarding started..."); - return executeCertificateSigningRequest(onboardingRequest.getCertificateSigningRequest()); + final CertificateSigningResponseDTO signingResponseDTO = + executeCertificateSigningRequest(onboardingRequest.getCertificateSigningRequest()); + return enrichOnboardingResponse(new OnboardingWithCsrResponseDTO(), signingResponseDTO); } //================================================================================================= // assistant methods - //------------------------------------------------------------------------------------------------- - private OnboardingWithCsrResponseDTO executeCertificateSigningRequest(final String certificateSigningRequest) { + private CertificateSigningResponseDTO executeCertificateSigningRequest(final String certificateSigningRequest) { final ServiceRegistryResponseDTO orchService = getOrchestratorService(); - // TODO replace with CoreSystemService constant final OrchestrationResultDTO caOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_CERTIFICATE_AUTHORITY_SIGN); final UriComponents caUri = orchestration.createUri(caOrchResult.getProvider(), - CommonConstants.CERTIFICATE_AUTHRORITY_URI + CommonConstants.OP_CA_SIGN_CERTIFICATE_URI); + CommonConstants.CERTIFICATE_AUTHRORITY_URI + CommonConstants.OP_CA_SIGN_CERTIFICATE_URI); final CertificateSigningRequestDTO csrDTO = new CertificateSigningRequestDTO(certificateSigningRequest); - final ResponseEntity httpResponse = httpService.sendRequest(caUri, HttpMethod.POST, CertificateSigningResponseDTO.class, csrDTO); + final ResponseEntity httpResponse = httpService + .sendRequest(caUri, HttpMethod.POST, CertificateSigningResponseDTO.class, csrDTO); final CertificateSigningResponseDTO csrResult = httpResponse.getBody(); @@ -80,35 +100,31 @@ private OnboardingWithCsrResponseDTO executeCertificateSigningRequest(final Stri throw new ArrowheadException("Unable to contact Certificate Authority"); } + return csrResult; + } + + private T enrichOnboardingResponse(final T responseDTO, + final CertificateSigningResponseDTO csrResult) { + final ServiceRegistryResponseDTO orchService = getOrchestratorService(); + final CertificateResponseDTO certificateResponseDTO = new CertificateResponseDTO(); certificateResponseDTO.setCertificate(csrResult.getCertificateChain().get(2)); - final OnboardingWithCsrResponseDTO retValue = new OnboardingWithCsrResponseDTO(); - retValue.setRootCertificate(csrResult.getCertificateChain().get(0)); - retValue.setIntermediateCertificate(csrResult.getCertificateChain().get(1)); - retValue.setOnboardingCertificate(certificateResponseDTO); + responseDTO.setRootCertificate(csrResult.getCertificateChain().get(0)); + responseDTO.setIntermediateCertificate(csrResult.getCertificateChain().get(1)); + responseDTO.setOnboardingCertificate(certificateResponseDTO); final OrchestrationResultDTO drOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_DEVICE_REGISTRY_REGISTER); final OrchestrationResultDTO sysrOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_SYSTEM_REGISTRY_REGISTER); final OrchestrationResultDTO srOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_SERVICE_REGISTRY_REGISTER); final OrchestrationResultDTO orchOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_ORCH_PROCESS); + responseDTO.setDeviceRegistry(new ServiceEndpoint(CoreSystemService.DEVICE_REGISTRY_REGISTER_SERVICE, orchestration.createUri(drOrchResult).toUri())); + responseDTO.setSystemRegistry(new ServiceEndpoint(CoreSystemService.SYSTEM_REGISTRY_REGISTER_SERVICE, orchestration.createUri(sysrOrchResult).toUri())); + responseDTO.setServiceRegistry(new ServiceEndpoint(CoreSystemService.SERVICE_REGISTRY_REGISTER_SERVICE, orchestration.createUri(srOrchResult).toUri())); + responseDTO.setOrchestrationService(new ServiceEndpoint(CoreSystemService.ORCHESTRATION_SERVICE, orchestration.createUri(orchOrchResult).toUri())); - retValue.setDeviceRegistry(new ServiceEndpoint(CoreSystemService.DEVICE_REGISTRY_REGISTER_SERVICE, orchestration.createUri(drOrchResult).toUri())); - retValue.setSystemRegistry(new ServiceEndpoint(CoreSystemService.SYSTEM_REGISTRY_REGISTER_SERVICE, orchestration.createUri(sysrOrchResult).toUri())); - retValue.setServiceRegistry(new ServiceEndpoint(CoreSystemService.SERVICE_REGISTRY_REGISTER_SERVICE, orchestration.createUri(srOrchResult).toUri())); - retValue.setOrchestrationService(new ServiceEndpoint(CoreSystemService.ORCHESTRATION_SERVICE, orchestration.createUri(orchOrchResult).toUri())); - - return retValue; - } - - //------------------------------------------------------------------------------------------------- - private void pingService(final SystemResponseDTO system, final String uriPrefix) { - logger.debug("getCertificateAuthorityService started..."); - - final UriComponents echoUri = orchestration.createUri(system, uriPrefix + CommonConstants.ECHO_URI); - httpService.sendRequest(echoUri, HttpMethod.GET, String.class); - logger.info("Service at {} is accessible...", echoUri); + return responseDTO; } //------------------------------------------------------------------------------------------------- @@ -118,6 +134,6 @@ private ServiceRegistryResponseDTO getOrchestratorService() { //------------------------------------------------------------------------------------------------- private OrchestrationResultDTO contactOrchestrationService(final ServiceRegistryResponseDTO orchService, final String serviceDefinition) { - return orchestration.contactOrchestrationService(orchService,serviceDefinition).getResponse().get(0); + return orchestration.contactOrchestrationService(orchService, serviceDefinition).getResponse().get(0); } } From f75ac028262b29340563a8e4fd2f56ebb26c23a3 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Tue, 17 Mar 2020 16:58:15 +0100 Subject: [PATCH 270/301] commiting missing changes to README --- README.md | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c1a70b759..599476f31 100644 --- a/README.md +++ b/README.md @@ -74,13 +74,23 @@ Please be aware, that 4.1.3 is __NOT__ backwards compatible with 4.1.2. If you h * [Client](#gateway_endpoints_client) * [Private](#gateway_endpoints_private) * [Management](#gateway_endpoints_mgmt) - 6. [QoS Monitor (Quality of Service Monitor)](#qos_monitor) + 7. [QoS Monitor (Quality of Service Monitor)](#qos_monitor) * [System Design Description Overview](#qos_monitor_sdd) * [Services and Use Cases](#qos_monitor_usecases) * [Endpoints](#qos_monitor_endpoints) * [Client](#qos_monitor_endpoints_client) * [Private](#qos_monitor_endpoints_private) * [Management](#qos_monitor_endpoints_mgmt) + 8. [System Registry](#systenregistry) + * [System Design Description Overview](#systemregistry_sdd) + * [Services and Use Cases](#systemregistry_usecases) + * [Security](#systemregistry_security) + * [Endpoints](#systenregistry_endpoints) + * [Client](#systenregistry_endpoints_client) + * [Private](#systenregistry_endpoints_private) + * [Management](#systenregistry_endpoints_mgmt) + * [Removed Endpoints](#systenregistry_removed) + @@ -6554,3 +6564,103 @@ __Ping Measurment response by system id__ the output : ### Get ping measurements by system id For private endpoints no detailed description available. + + + +# System Registry + + + +## System Design Description Overview + +This System provides the database, which stores information related to the System of the currently actively offered Services within the Local Cloud. + +The purpose of this System is therefore to allow: +- Devices to register which Systems they offer at the moment, making this announcement available to other Application Systems on the network. +- They are also allowed to remove or update their entries when it is necessary. +- Generate a client certificate which can be used by the System to offer Services + + + +## Services and Use Cases + +This System provides two Core Service the __system registration__ and __de-registration__ + +The __register__ method is used to register a system. The system will contain various metadata as well as a physical endpoint. +The various parameters are representing the endpoint information that should be registered. + +The __unregister__ method is used to unregister system instances that were previously registered in the Registry. +The instance parameter is representing the endpoint information that should be removed. + + + +## Security + +This System can be secured via the HTTPS protocol. If it is started in secure mode, it verifies whether the Application System possesses a proper X.509 identity certificate and whether that certificate is Arrowhead compliant in its making. This certificate structure and creation guidelines ensure: +- Application System is properly bootstrapped into the Local Cloud +- The Application System indeed belongs to this Local Cloud +- The Application System then automatically has the right to register its Services in the Registry. + +If these criteria are met, the Application System’s registration or removal message is processed. An Application System can only delete or alter entries that contain the Device as the System Provider in the entry. + + + +## Endpoints + +The System Registry offers three types of endpoints. Client, Management and Private. + +Swagger API documentation is available on: `https://:`
    +The base URL for the requests: `http://:/systemregistry` + +
    + +### Client endpoint description
    + +| Function | URL subpath | Method | Input | Output | +| -------- | ----------- | ------ | ----- | ------ | +| [Echo](#systemregistry_endpoints_get_echo) | /echo | GET | - | OK | +| [Query](#systemregistry_endpoints_post_query) | /query | POST | [SystemQueryForm](#datastructures_systemqueryform) | [SystemQueryList](#datastructures_systemquerylist) | +| [Register](#systemregistry_endpoints_post_register) | /register | POST | [SystenRegistryEntry](#datastructures_systemregistryentry) | [SystenRegistryEntry](#datastructures_systemregistryentry) | +| [Unregister](#systemregistry_delete_unregister) | /unregister | DELETE | System Name, Address and Port in query parameters| OK | + +
    + +### Private endpoint description
    + +These services can only be used by other core services, therefore they are not part of the public API. + +| Function | URL subpath | Method | Input | Output | +| -------- | ----------- | ------ | ----- | ------ | +| [Query System](#systemregistry_endpoints_post_query_system) | /query/system | POST | System | System | +| [Query System By ID](#systemregistry_endpoints_get_query_system_id) | /query/system/{id} | GET | ID | System| + +
    + +### Management endpoint description
    + +These endpoints are mainly used by the Management Tool and Cloud Administrators. + +| Function | URL subpath | Method | Input | Output | +| -------- | ----------- | ------ | ----- | ------ | +| [Get all entries](#systemregistry_endpoints_get_mgmt) | /mgmt/ | GET | - | [SystemRegistryEntryList](#datastructures_systemregistryentrylist) | +| [Add an entry](#systemregistry_endpoints_post_mgmt) | /mgmt/ | POST | [SystemRegistryEntry](#datastructures_systemregistryentry) | [SystemRegistryEntry](#datastructures_systemregistry_entry) | +| [Get an entry by ID](#systemregistry_endpoints_get_mgmt) | /mgmt/{id} | GET | SystemRegistryEntryID | [SystemRegistryEntry](#datastructures_systemregistryentry) | +| [Replace an entry by ID](#systemregistry_endpoints_put_mgmt) | /mgmt/{id} | PUT | [SystemRegistryEntry](#datastructures_systemregistryentry) | [SystemRegistryEntry](#datastructures_systemregistryentry) | +| [Modify an entry by ID](#systemregistry_endpoints_patch_mgmt) | /mgmt/{id} | PATCH | [SystemRegistryEntry](#datastructures_systemregistryentry) | [SystemRegistryEntry](#datastructures_systemregistryentry) | +| [Delete and entry by ID](systemregistry_endpoints_delete_mgmt) | /mgmt/{id} | DELETE | SystemRegistryEntryID | - | +| [Get all devices](#systemregistry_endpoints_get_devices) | /mgmt/devices | GET | - | [DeviceList](#datastructures_devicelist) | +| [Add a device](#systemregistry_endpoints_post_devices) | /mgmt/devices | POST | [Device](#datastructure_device) | [Device](#datastructure_device) | +| [Get a device by ID](#systemregistry_endpoints_get_device_id) | /mgmt/devices/{id} | GET | DeviceID | [Device](#datastructure_device) | +| [Replace a device by ID](#systemregistry_endpoints_put_device_id) | /mgmt/devices/{id} | PUT | [Device](#datastructure_device) | [Device](#datastructure_device) | +| [Modify a device by ID](#systemregistry_endpoints_patch_device_id) | /mgmt/devices/{id} | PATCH | [Device](#datastructure_device) | [Device](#datastructure_device) | +| [Delete a device by ID](#systemregistry_endpoints_delete_device_id) | /mgmt/devices/{id} | DELETE | DeviceID | - | +| [Get all systems](#systemregistry_endpoints_get_systems) | /mgmt/systems | GET | - | [SystemList](#datastructures_systemlist) | +| [Add a system](#systemregistry_endpoints_post_system) | /mgmt/systems | POST | [System](#datastructures_system) | [System](#datastructures_system) | +| [Get a system by ID](#systemregistry_endpoints_get_system_id) | /mgmt/systems/{id} | GET | SystemID | [System](#datastructures_system) | +| [Replace a system by ID](#systemregistry_endpoints_put_system_id) | /mgmt/systems/(id} | PUT | [System](#datastructures_system) | [System](#datastructures_system) | +| [Modify a system by ID](#systemregistry_endpoints_patch_system_id) | /mgmt/systems/{id} | PATCH | [System](#datastructures_system) | [System](#datastructures_system) | +| [Delete a system by ID](#systemregistry_endpoints_delete_system_id) | /mgmt/systems/{id} | DELETE | SystemID | - | + +### Detailed description
    + +A detailed description is available in the release notes. From 0e1560077a9478e976be7d657a75a03712569ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Wed, 18 Mar 2020 12:24:14 +0100 Subject: [PATCH 271/301] Do not remove sysop dir --- certificate-authority/src/deb/control/postrm | 1 - 1 file changed, 1 deletion(-) diff --git a/certificate-authority/src/deb/control/postrm b/certificate-authority/src/deb/control/postrm index 9b46d8e3a..5ec593529 100644 --- a/certificate-authority/src/deb/control/postrm +++ b/certificate-authority/src/deb/control/postrm @@ -35,7 +35,6 @@ case "$1" in ${SYSTEM_DIR}/application.properties \ ${SYSTEM_DIR}/${SYSTEM_NAME}.p12 \ rmdir ${SYSTEM_DIR} 2>/dev/null || true - rmdir ${AH_SYSTEMS_DIR}/sysop 2>/dev/null || true db_purge ;; remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) From f3b245fde3d386f8eb6780561cfe571924527b72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Wed, 18 Mar 2020 12:25:44 +0100 Subject: [PATCH 272/301] Minor code clean-up --- .../certificate_authority/security/CAAccessControlFilter.java | 3 +-- .../main/java/eu/arrowhead/common/core/CoreSystemService.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/security/CAAccessControlFilter.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/security/CAAccessControlFilter.java index 475614cd6..0af563874 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/security/CAAccessControlFilter.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/security/CAAccessControlFilter.java @@ -7,7 +7,6 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; -import eu.arrowhead.common.core.CoreSystem; import eu.arrowhead.common.security.CoreSystemAccessControlFilter; @Component @@ -32,4 +31,4 @@ protected void checkClientAuthorized(final String clientCN, final String method, checkIfLocalSystemOperator(clientCN, cloudCN, requestTarget); } } -} \ No newline at end of file +} diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java index 2a4f2f078..2cbe9f535 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java @@ -35,7 +35,7 @@ public enum CoreSystemService { EVENT_UNSUBSCRIBE_SERVICE(CommonConstants.CORE_SERVICE_EVENT_HANDLER_UNSUBSCRIBE, CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_UNSUBSCRIBE), EVENT_PUBLISH_AUTH_UPDATE_SERVICE(CommonConstants.CORE_SERVICE_EVENT_HANDLER_PUBLISH_AUTH_UPDATE, CommonConstants.EVENT_HANDLER_URI + CommonConstants.OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE), - // CA services + // CA services CERTIFICATE_AUTHORITY_SIGN_SERVICE(CommonConstants.CORE_SERVICE_CERTIFICATE_AUTHORITY_SIGN, CommonConstants.CERTIFICATE_AUTHRORITY_URI + CommonConstants.OP_CA_SIGN_CERTIFICATE_URI), // QoS Monitor services From 8e027c14e6a0d9d0d1e2162bfd0874807294592d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Wed, 18 Mar 2020 12:26:34 +0100 Subject: [PATCH 273/301] Add CA target folder to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index eb1e1b535..ab1f74c70 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ wrapper /mvnw.cmd /orchestrator/target /serviceregistry/target +/certificate-authority/target /.settings /authorization/.settings /core-common/.settings From 08b303010555ba20632264d69d2bd43c3402f575 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Sat, 21 Mar 2020 00:02:39 +0100 Subject: [PATCH 274/301] bug and issue fixes --- .../security/AuthAccessControlFilter.java | 10 +- certificates/testcloud2/onboarding.p12 | Bin 5343 -> 0 bytes .../testcloud2/onboarding_controller.p12 | Bin 0 -> 6237 bytes core-common/pom.xml | 21 +- .../arrowhead/common/OrchestrationDriver.java | 44 ++-- .../arrowhead/common/SecurityUtilities.java | 22 +- .../eu/arrowhead/common/core/CoreSystem.java | 4 +- .../shared/CertificateCreationRequestDTO.java | 2 +- .../dto/shared/OnboardingResponseDTO.java | 44 ++-- .../common/dto/shared/ServiceEndpoint.java | 19 +- .../OnboardingApplicationInitListener.java | 84 ++++++++ .../core/onboarding/OnboardingConstants.java | 15 ++ .../core/onboarding/OnboardingController.java | 7 +- .../database/service/OnboardingDBService.java | 26 ++- .../OnboardingAccessControlFilter.java | 47 ++++- .../src/main/resources/application.properties | 11 +- onboarding/src/main/resources/banner.txt | 8 + .../resources/certificates/onboarding.p12 | Bin 5343 -> 0 bytes .../certificates/onboarding_controller.p12 | Bin 0 -> 6237 bytes onboarding/src/main/resources/log4j2.xml | 2 + ...erviceRegistryApplicationInitListener.java | 192 +++++++++++------- 21 files changed, 402 insertions(+), 156 deletions(-) delete mode 100644 certificates/testcloud2/onboarding.p12 create mode 100644 certificates/testcloud2/onboarding_controller.p12 create mode 100644 onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingConstants.java create mode 100644 onboarding/src/main/resources/banner.txt delete mode 100644 onboarding/src/main/resources/certificates/onboarding.p12 create mode 100644 onboarding/src/main/resources/certificates/onboarding_controller.p12 diff --git a/authorization/src/main/java/eu/arrowhead/core/authorization/security/AuthAccessControlFilter.java b/authorization/src/main/java/eu/arrowhead/core/authorization/security/AuthAccessControlFilter.java index ecb04cbbc..2714c3ab5 100644 --- a/authorization/src/main/java/eu/arrowhead/core/authorization/security/AuthAccessControlFilter.java +++ b/authorization/src/main/java/eu/arrowhead/core/authorization/security/AuthAccessControlFilter.java @@ -16,10 +16,11 @@ public class AuthAccessControlFilter extends CoreSystemAccessControlFilter { //================================================================================================= // members - + private static final String AUTHORIZATION_INTRA_CLOUD_MGMT_URI = CoreCommonConstants.MGMT_URI + "/intracloud"; private static final CoreSystem[] allowedCoreSystemsForChecks = { CoreSystem.ORCHESTRATOR, CoreSystem.GATEKEEPER }; private static final CoreSystem[] allowedCoreSystemsForSubscriptionChecks = { CoreSystem.EVENT_HANDLER }; - + private static final CoreSystem[] allowedCoreSystemsForRuleMgmt = { CoreSystem.ONBOARDING_CONTROLLER }; + //================================================================================================= // assistant methods @@ -31,6 +32,11 @@ protected void checkClientAuthorized(final String clientCN, final String method, final String cloudCN = getServerCloudCN(); if (requestTarget.endsWith(CommonConstants.OP_AUTH_KEY_URI) || requestTarget.endsWith(CommonConstants.ECHO_URI)) { // Everybody in the local cloud can get the Authorization public key (because it is PUBLIC) or test the server => no further check is necessary + } else if (requestTarget.endsWith(AUTHORIZATION_INTRA_CLOUD_MGMT_URI)) { + // onboarding controller may use this method + if(!checkIfClientIsAnAllowedCoreSystemNoException(clientCN, cloudCN, allowedCoreSystemsForRuleMgmt, requestTarget)) { + checkIfLocalSystemOperator(clientCN, cloudCN, requestTarget); + } } else if (requestTarget.contains(CoreCommonConstants.MGMT_URI)) { // Only the local System Operator can use these methods checkIfLocalSystemOperator(clientCN, cloudCN, requestTarget); diff --git a/certificates/testcloud2/onboarding.p12 b/certificates/testcloud2/onboarding.p12 deleted file mode 100644 index a7ed58077d9e52e421ca33cdceb923d1a47dd199..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5343 zcmY+FRa6uJu!e~Rq#L9=7nUw*q=corkz86zx|S4>SP2mp5ZI*~1O$;5Bo*oI?gnA6 z_nsT)KFrLSfBu=rZv>$f3mE8_f>4SKY+T+r^|%{CbR6_TC`Bv)N)h!>4iki8dH=r= zmK^|!W&KY!{};yC`2W2{fQODz2n9R{LIF2|JlJ^uBmX;22cQ727C)6@=00(OqQFRL zdeyO3j3W$8v|e2R6flSmR`AJh%>KT?sW#{4`XZ%0RfHnB#w~IxAtt0;@nTN-NyK(S zCtf%t%yU=Ci9L%w(&Kd~WlQ-`{<=)+si#-vTLa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ux9$6#vE>xAsb0`GP*sg3f%>qzP?py_{i4YAW3LuV=do0hO2WL&m4}=mhEsT?K z{tcDvDU|`=ZLVUk`d2wWR}{nmr9$v?;WdA6oBTj;xuQ6ona||?TsTf#lota}-`It- z{NryIt2Bih^QqXeHq{l82oR`+1BPodR`fSUQBnfM#*mIGH&w?$j2HpacD`4Mv>02a zO=hm~)`ZFv*F?Kwk!J#-Ord&CkI4ZYA1jCA6R*zpMSAGv&o0TbR@Fah2newV7V+Va zSw{_uj}OqPaqJS=zi%Ur9b-YW(->w^A>BXuUG}}>Fg*}uqt$uMhzHJ@b6b0?jm?~7 z-Z{7w`nx$ygi)fENdo+!toYTu$%O`El@vBbY&%FTJU{HgCND(NWa5?n7C1_-i338u z6v{XpOc+cUsut1vdsjtqJ@W=HG?zJC?xk}ll2HKE0J~f>7Vxd4NB8e2L%_=80nsVGp|Z8n_pic8U5BD;IeBQrmjrfehQrcUhd_~bl-RdkCRL`mMddz}J&5xT zd_8i;&~XGc2E-uuoy{8wwT!NC4$2#hK;rD3y1#i;I1(L%kuT=Fp#^w(X^K8?n8Ll2 zA#Y)vZY@ZA(a&V*+9duB9)f7e9`nYA=PU*iIMM@QcGTn#7(3G5OB~eB+f1jm| zM(xj~8hEEN298HF?U?GW9t;@Jj`M}Be2<3Atx6AVS88!YNdt<}bEuB)i^q2sbf{i2Un z;JLMc6*;VH%8kCvM6`DOyBEe+l(Oy|q8#)bm}sc1cqqt}r~n|zd&`VB-A8_ys`2&Hf|oHb k-?>VQfg~#&3pADsKP}>NchEDxxaWtLr57TjAVuW;2aV^^`~Uy| literal 0 HcmV?d00001 diff --git a/core-common/pom.xml b/core-common/pom.xml index b9b633f30..ec10307f3 100644 --- a/core-common/pom.xml +++ b/core-common/pom.xml @@ -1,13 +1,5 @@ 4.0.0 - - - org.bouncycastle - bcpkix-jdk15on - 1.64 - compile - - eu.arrowhead core @@ -22,8 +14,17 @@ core-client-skeleton - - + + + + org.bouncycastle + bcpkix-jdk15on + 1.64 + compile + + + + src/main/java diff --git a/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java b/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java index fd4650f05..023446edc 100644 --- a/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java +++ b/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java @@ -1,12 +1,15 @@ package eu.arrowhead.common; import eu.arrowhead.common.core.CoreSystemService; +import eu.arrowhead.common.dto.shared.OrchestrationFlags; import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; import eu.arrowhead.common.dto.shared.OrchestrationResponseDTO; import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; import eu.arrowhead.common.dto.shared.ServiceQueryFormDTO; import eu.arrowhead.common.dto.shared.ServiceQueryResultDTO; +import eu.arrowhead.common.dto.shared.ServiceRegistryRequestDTO; import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.ServiceSecurityType; import eu.arrowhead.common.dto.shared.SystemRequestDTO; import eu.arrowhead.common.dto.shared.SystemResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; @@ -19,6 +22,8 @@ import org.springframework.stereotype.Component; import org.springframework.web.util.UriComponents; +import java.util.Base64; +import java.util.List; import java.util.Objects; @Component @@ -52,32 +57,38 @@ public void pingService(final SystemResponseDTO system, final String uriPrefix) } //------------------------------------------------------------------------------------------------- - public ServiceQueryResultDTO getOrchestratorService() { - + public ServiceQueryResultDTO getService(final CoreSystemService service) { + logger.debug("getService started..."); final SystemResponseDTO serviceRegistrySystem = new SystemResponseDTO(); serviceRegistrySystem.setAddress(coreSystemRegistrationProperties.getServiceRegistryAddress()); serviceRegistrySystem.setPort(coreSystemRegistrationProperties.getServiceRegistryPort()); - logger.debug("getOrchestratorService started..."); pingService(serviceRegistrySystem, CommonConstants.SERVICE_REGISTRY_URI); final UriComponents srQueryUri = createUri(serviceRegistrySystem, - CommonConstants.SERVICE_REGISTRY_URI + CommonConstants.OP_SERVICE_REGISTRY_QUERY_URI); + CommonConstants.SERVICE_REGISTRY_URI + CommonConstants.OP_SERVICE_REGISTRY_QUERY_URI); final ServiceQueryFormDTO srQueryForm = new ServiceQueryFormDTO - .Builder(CoreSystemService.ORCHESTRATION_SERVICE.getServiceDefinition()) + .Builder(service.getServiceDefinition()) .build(); - final ResponseEntity httpResponse = httpService.sendRequest(srQueryUri, HttpMethod.POST, ServiceQueryResultDTO.class, srQueryForm); + final ResponseEntity httpResponse = httpService + .sendRequest(srQueryUri, HttpMethod.POST, ServiceQueryResultDTO.class, srQueryForm); final ServiceQueryResultDTO srQueryResult = httpResponse.getBody(); if (Objects.isNull(srQueryResult) || srQueryResult.getServiceQueryData().isEmpty()) { - throw new ArrowheadException("Unable to find orchestrator service"); + throw new ArrowheadException("Unable to find service"); } return srQueryResult; } + //------------------------------------------------------------------------------------------------- + public ServiceQueryResultDTO getOrchestratorService() { + logger.debug("getOrchestratorService started..."); + return getService(CoreSystemService.ORCHESTRATION_SERVICE); + } + //------------------------------------------------------------------------------------------------- public OrchestrationResponseDTO contactOrchestrationService(final ServiceRegistryResponseDTO orchService, final String serviceDefinition) { @@ -85,7 +96,7 @@ public OrchestrationResponseDTO contactOrchestrationService(final ServiceRegistr pingService(orchService.getProvider(), CommonConstants.ORCHESTRATOR_URI); final UriComponents orchUri = createUri(orchService.getProvider(), - CommonConstants.ORCHESTRATOR_URI + CommonConstants.OP_ORCH_PROCESS); + CommonConstants.ORCHESTRATOR_URI + CommonConstants.OP_ORCH_PROCESS); final SystemRequestDTO requester = new SystemRequestDTO(); requester.setAddress(coreSystemRegistrationProperties.getCoreSystemDomainName()); @@ -94,14 +105,17 @@ public OrchestrationResponseDTO contactOrchestrationService(final ServiceRegistr final ServiceQueryFormDTO requestForm = new ServiceQueryFormDTO .Builder(serviceDefinition) + .interfaces(CommonConstants.HTTP_SECURE_JSON) .build(); final OrchestrationFormRequestDTO orchForm = new OrchestrationFormRequestDTO .Builder(requester) .requestedService(requestForm) + .flag(OrchestrationFlags.Flag.OVERRIDE_STORE, true) .build(); - final ResponseEntity httpResponse = httpService.sendRequest(orchUri, HttpMethod.POST, OrchestrationResponseDTO.class, orchForm); + final ResponseEntity httpResponse = httpService + .sendRequest(orchUri, HttpMethod.POST, OrchestrationResponseDTO.class, orchForm); final OrchestrationResponseDTO orchQueryResult = httpResponse.getBody(); if (Objects.isNull(orchQueryResult) || orchQueryResult.getResponse().isEmpty()) { @@ -118,17 +132,17 @@ public OrchestrationResponseDTO contactOrchestrationService(final ServiceRegistr public UriComponents createUri(final SystemResponseDTO system, final String serviceUri) { final String scheme = sslProperties.isSslEnabled() ? CommonConstants.HTTPS : CommonConstants.HTTP; return Utilities.createURI(scheme, - system.getAddress(), - system.getPort(), - serviceUri); + system.getAddress(), + system.getPort(), + serviceUri); } //------------------------------------------------------------------------------------------------- public UriComponents createUri(final OrchestrationResultDTO result) { final String scheme = sslProperties.isSslEnabled() ? CommonConstants.HTTPS : CommonConstants.HTTP; return Utilities.createURI(scheme, - result.getProvider().getAddress(), - result.getProvider().getPort(), - result.getServiceUri()); + result.getProvider().getAddress(), + result.getProvider().getPort(), + result.getServiceUri()); } } diff --git a/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java b/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java index 45d1eb3b5..8d75abe49 100644 --- a/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java @@ -15,6 +15,7 @@ import org.springframework.stereotype.Component; import org.springframework.util.Assert; +import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.security.KeyFactory; import java.security.KeyPair; @@ -67,6 +68,7 @@ public String createEncodedCSR(final String baseCommonName, final KeyPair keyPai Assert.notNull(sslProperties.getKeyStore(), "KeyStore property must not be null!"); Assert.hasText(sslProperties.getKeyStorePassword(), "KeyStore password property must not be null or empty!"); + logger.debug("Preparing Certificate Signing Request ..."); // get cloud certificate for cloudName and operator final KeyStore keyStore = KeyStore.getInstance(sslProperties.getKeyStore().getFile(), sslProperties.getKeyStorePassword().toCharArray()); final X509Certificate cloudCertFromKeyStore = Utilities.getCloudCertFromKeyStore(keyStore); @@ -76,16 +78,17 @@ public String createEncodedCSR(final String baseCommonName, final KeyPair keyPai final String operator = getOperatorName(cloudCertFromKeyStore.getSubjectDN()); final String organization = getOrganization(cloudCertFromKeyStore.getSubjectDN()); final String country = getCountry(cloudCertFromKeyStore.getSubjectDN()); - final String commonName = String.format("CN=%s.%s.%s.%s.%s, OU=%s, O=%s, C=%s", - baseCommonName, cloudName, operator, organization, country, - operator, organization, country); + final String commonName = String.format("CN=%s.%s, OU=%s, O=%s, C=%s", + baseCommonName, cloudName,operator, organization, country); final X500Name x500Name = new X500Name(commonName); + logger.debug("Building and Signing Certificate Signing Request for {}", x500Name); // create certificate signing request final JcaPKCS10CertificationRequestBuilder builder = new JcaPKCS10CertificationRequestBuilder(x500Name, keyPair.getPublic()); final JcaContentSignerBuilder contentSignerBuilder = new JcaContentSignerBuilder(SIGNATURE_ALGORITHM); final ContentSigner contentSigner = contentSignerBuilder.build(keyPair.getPrivate()); final PKCS10CertificationRequest csr = builder.build(contentSigner); + return Base64.getEncoder().encodeToString(csr.getEncoded()); } @@ -121,6 +124,17 @@ public KeyPair extractKeyPair(final CertificateCreationRequestDTO creationReques return keyPair; } + //------------------------------------------------------------------------------------------------- + public static String getCertificateCNFromRequest(final HttpServletRequest request) { + final X509Certificate[] certificates = (X509Certificate[]) request.getAttribute(CommonConstants.ATTR_JAVAX_SERVLET_REQUEST_X509_CERTIFICATE); + if (certificates != null && certificates.length != 0) { + final X509Certificate cert = certificates[0]; + return Utilities.getCertCNFromSubject(cert.getSubjectDN().getName()); + } + + return null; + } + //================================================================================================= // assistant methods @@ -142,7 +156,7 @@ private PrivateKey getPrivateKeyFromBase64EncodedString(final String encodedKey) //------------------------------------------------------------------------------------------------- private String getCloudName(final Principal principal) { - return extractCNPart(principal, 3); + return Utilities.getCertCNFromSubject(principal.getName()); } //------------------------------------------------------------------------------------------------- diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java index cd3d7376c..1c606a6c8 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java @@ -13,6 +13,8 @@ import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_WITH_CERTIFICATE_AND_NAME; import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_WITH_SHARED_SECRET_AND_CSR; import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_WITH_SHARED_SECRET_AND_NAME; +import static eu.arrowhead.common.core.CoreSystemService.SERVICE_REGISTRY_REGISTER_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.SERVICE_REGISTRY_UNREGISTER_SERVICE; import static eu.arrowhead.common.core.CoreSystemService.SYSTEM_REGISTRY_REGISTER_SERVICE; import static eu.arrowhead.common.core.CoreSystemService.SYSTEM_REGISTRY_UNREGISTER_SERVICE; @@ -21,7 +23,7 @@ public enum CoreSystem { //================================================================================================= // elements - SERVICE_REGISTRY(Defaults.DEFAULT_SERVICE_REGISTRY_PORT, null), + SERVICE_REGISTRY(Defaults.DEFAULT_SERVICE_REGISTRY_PORT, List.of(SERVICE_REGISTRY_REGISTER_SERVICE, SERVICE_REGISTRY_UNREGISTER_SERVICE)), SYSTEM_REGISTRY(Defaults.DEFAULT_SYSTEM_REGISTRY_PORT, List.of(SYSTEM_REGISTRY_REGISTER_SERVICE, SYSTEM_REGISTRY_UNREGISTER_SERVICE)), DEVICE_REGISTRY(Defaults.DEFAULT_DEVICE_REGISTRY_PORT, List.of(DEVICE_REGISTRY_REGISTER_SERVICE, DEVICE_REGISTRY_UNREGISTER_SERVICE)), ONBOARDING_CONTROLLER(Defaults.DEFAULT_ONBOARDING_PORT, List.of(ONBOARDING_WITH_CERTIFICATE_AND_NAME, ONBOARDING_WITH_SHARED_SECRET_AND_NAME, diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationRequestDTO.java index eeaa6dbfd..9dd59347c 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationRequestDTO.java @@ -9,7 +9,7 @@ public class CertificateCreationRequestDTO implements Serializable { private static final long serialVersionUID = 1L; private String commonName; - private String publicKey; + private String publicKey; // TODO add KeyAlgorithm private String privateKey; diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingResponseDTO.java index 03378f505..b5f5d51a1 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingResponseDTO.java @@ -17,43 +17,38 @@ public abstract class OnboardingResponseDTO implements Serializable { private String intermediateCertificate; private String rootCertificate; + private String certificateType; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- - public ServiceEndpoint getDeviceRegistry() - { + public ServiceEndpoint getDeviceRegistry() { return deviceRegistry; } //------------------------------------------------------------------------------------------------- - public void setDeviceRegistry(final ServiceEndpoint deviceRegistry) - { + public void setDeviceRegistry(final ServiceEndpoint deviceRegistry) { this.deviceRegistry = deviceRegistry; } //------------------------------------------------------------------------------------------------- - public ServiceEndpoint getSystemRegistry() - { + public ServiceEndpoint getSystemRegistry() { return systemRegistry; } //------------------------------------------------------------------------------------------------- - public void setSystemRegistry(final ServiceEndpoint systemRegistry) - { + public void setSystemRegistry(final ServiceEndpoint systemRegistry) { this.systemRegistry = systemRegistry; } //------------------------------------------------------------------------------------------------- - public ServiceEndpoint getServiceRegistry() - { + public ServiceEndpoint getServiceRegistry() { return serviceRegistry; } //------------------------------------------------------------------------------------------------- - public void setServiceRegistry(final ServiceEndpoint serviceRegistry) - { + public void setServiceRegistry(final ServiceEndpoint serviceRegistry) { this.serviceRegistry = serviceRegistry; } @@ -68,39 +63,40 @@ public void setOrchestrationService(ServiceEndpoint orchestrationService) { } //------------------------------------------------------------------------------------------------- - public CertificateResponseDTO getOnboardingCertificate() - { + public CertificateResponseDTO getOnboardingCertificate() { return onboardingCertificate; } //------------------------------------------------------------------------------------------------- - public void setOnboardingCertificate(final CertificateResponseDTO onboardingCertificate) - { + public void setOnboardingCertificate(final CertificateResponseDTO onboardingCertificate) { this.onboardingCertificate = onboardingCertificate; } //------------------------------------------------------------------------------------------------- - public String getIntermediateCertificate() - { + public String getIntermediateCertificate() { return intermediateCertificate; } //------------------------------------------------------------------------------------------------- - public void setIntermediateCertificate(final String intermediateCertificate) - { + public void setIntermediateCertificate(final String intermediateCertificate) { this.intermediateCertificate = intermediateCertificate; } //------------------------------------------------------------------------------------------------- - public String getRootCertificate() - { + public String getRootCertificate() { return rootCertificate; } //------------------------------------------------------------------------------------------------- - public void setRootCertificate(final String rootCertificate) - { + public void setRootCertificate(final String rootCertificate) { this.rootCertificate = rootCertificate; } + public String getCertificateType() { + return certificateType; + } + + public void setCertificateType(final String certificateType) { + this.certificateType = certificateType; + } } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceEndpoint.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceEndpoint.java index 8ea924f69..d8e802a82 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceEndpoint.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceEndpoint.java @@ -11,22 +11,25 @@ public class ServiceEndpoint implements Serializable { // members private static final long serialVersionUID = 1L; - private final CoreSystemService system; - private final URI uri; + private CoreSystemService system; + private URI uri; - public ServiceEndpoint(final CoreSystemService service, final URI uri) - { + public ServiceEndpoint() { + super(); + } + + public ServiceEndpoint(final CoreSystemService service, final URI uri) { this.system = service; this.uri = uri; } - public CoreSystemService getService() - { + public CoreSystemService getService() { return system; } + public void setSystem(final CoreSystemService system) { this.system = system; } - public URI getUri() - { + public URI getUri() { return uri; } + public void setUri(final URI uri) { this.uri = uri; } } diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java index 8d4363672..ea2d39b2a 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java @@ -1,22 +1,106 @@ package eu.arrowhead.core.onboarding; import eu.arrowhead.common.ApplicationInitListener; +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.OrchestrationDriver; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.core.CoreSystemService; +import eu.arrowhead.common.dto.internal.AuthorizationIntraCloudListResponseDTO; +import eu.arrowhead.common.dto.internal.AuthorizationIntraCloudRequestDTO; +import eu.arrowhead.common.dto.shared.ServiceInterfaceResponseDTO; +import eu.arrowhead.common.dto.shared.ServiceQueryResultDTO; +import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.event.ContextRefreshedEvent; +import org.springframework.http.HttpMethod; import org.springframework.stereotype.Component; +import org.springframework.web.util.UriComponents; import java.util.Base64; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; @Component public class OnboardingApplicationInitListener extends ApplicationInitListener { + private final Logger logger = LogManager.getLogger(OnboardingApplicationInitListener.class); + private final OrchestrationDriver driver; + + @Autowired + public OnboardingApplicationInitListener(final OrchestrationDriver driver) {this.driver = driver;} + //================================================================================================= // members //------------------------------------------------------------------------------------------------- @Override protected void customInit(final ContextRefreshedEvent event) { + final String scheme; if (sslProperties.isSslEnabled()) { logger.debug("AuthInfo: {}" + Base64.getEncoder().encodeToString(publicKey.getEncoded())); + scheme = CommonConstants.HTTPS; + } + else { + scheme = CommonConstants.HTTP; } + + logger.info("Searching for authorization system"); + final ServiceRegistryResponseDTO authEntry = lookup(CoreSystemService.AUTH_CONTROL_INTRA_SERVICE, CommonConstants.AUTHORIZATION_URI); + final SystemResponseDTO authSystem = authEntry.getProvider(); + + final UriComponents authMgmtUri = Utilities.createURI(scheme, authSystem.getAddress(), authSystem.getPort(), + CommonConstants.AUTHORIZATION_URI + OnboardingConstants.AUTHORIZATION_INTRA_CLOUD_MGMT_URI); + + logger.debug("Searching for own system entry"); + final ServiceRegistryResponseDTO onboardingEntry = lookup(CoreSystemService.ONBOARDING_WITH_CERTIFICATE_AND_CSR); + final SystemResponseDTO onboardingSystem = onboardingEntry.getProvider(); + + logger.debug("Authorization system intracloud management uri created: {}", authMgmtUri.toUriString()); + lookupAndAuthorize(authMgmtUri, onboardingSystem, CoreSystemService.CERTIFICATE_AUTHORITY_SIGN_SERVICE, CommonConstants.CERTIFICATE_AUTHRORITY_URI); + lookupAndAuthorize(authMgmtUri, onboardingSystem, CoreSystemService.ORCHESTRATION_SERVICE, CommonConstants.ORCHESTRATOR_URI); + lookupAndAuthorize(authMgmtUri, onboardingSystem, CoreSystemService.DEVICE_REGISTRY_REGISTER_SERVICE, CommonConstants.DEVICE_REGISTRY_URI); + lookupAndAuthorize(authMgmtUri, onboardingSystem, CoreSystemService.SYSTEM_REGISTRY_REGISTER_SERVICE, CommonConstants.SYSTEM_REGISTRY_URI); + lookupAndAuthorize(authMgmtUri, onboardingSystem, CoreSystemService.SERVICE_REGISTRY_REGISTER_SERVICE, CommonConstants.SERVICE_REGISTRY_URI); + } + + @Override + protected List getRequiredCoreSystemServiceUris() { + return List.of(CoreSystemService.CERTIFICATE_AUTHORITY_SIGN_SERVICE, + CoreSystemService.ORCHESTRATION_SERVICE, + CoreSystemService.DEVICE_REGISTRY_REGISTER_SERVICE, + CoreSystemService.SYSTEM_REGISTRY_REGISTER_SERVICE, + CoreSystemService.SERVICE_REGISTRY_REGISTER_SERVICE); + } + + private void lookupAndAuthorize(final UriComponents authMgmtUri, + final SystemResponseDTO consumer, + final CoreSystemService service, + final String prefix) { + final ServiceRegistryResponseDTO serviceEntry = lookup(service, prefix); + final SystemResponseDTO systemEntry = serviceEntry.getProvider(); + + logger.debug("Creating authorization rule"); + final var authRequest = new AuthorizationIntraCloudRequestDTO(); + authRequest.setConsumerId(consumer.getId()); + authRequest.setProviderIds(Collections.singletonList(systemEntry.getId())); + authRequest.setInterfaceIds(serviceEntry.getInterfaces().stream().map(ServiceInterfaceResponseDTO::getId).collect(Collectors.toList())); + authRequest.setServiceDefinitionIds(Collections.singletonList(serviceEntry.getServiceDefinition().getId())); + httpService.sendRequest(authMgmtUri, HttpMethod.POST, AuthorizationIntraCloudListResponseDTO.class, authRequest); + } + + private ServiceRegistryResponseDTO lookup(final CoreSystemService coreSystemService) { + logger.info("Looking up {}", coreSystemService.getServiceDefinition()); + final ServiceQueryResultDTO onboardingQueryResultDTO = driver.getService(coreSystemService); + return onboardingQueryResultDTO.getServiceQueryData().get(0); + } + + private ServiceRegistryResponseDTO lookup(final CoreSystemService coreSystemService, final String prefix) { + final ServiceRegistryResponseDTO responseDTO = lookup(coreSystemService); + driver.pingService(responseDTO.getProvider(), prefix); + return responseDTO; } } \ No newline at end of file diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingConstants.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingConstants.java new file mode 100644 index 000000000..ed97ec7e2 --- /dev/null +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingConstants.java @@ -0,0 +1,15 @@ +package eu.arrowhead.core.onboarding; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; + +public class OnboardingConstants { + + public static final String AUTHORIZATION_INTRA_CLOUD_MGMT_URI = CoreCommonConstants.MGMT_URI + "/intracloud"; + public static final String SERVICE_REGISTRY_QUERY_BY_DTO_PATH = + CommonConstants.SERVICE_REGISTRY_URI + CoreCommonConstants.OP_SERVICE_REGISTRY_QUERY_BY_SYSTEM_DTO_URI; + public static final String SERVICE_REGISTRY_QUERY_BY_DTO_KEY = SERVICE_REGISTRY_QUERY_BY_DTO_PATH + CoreCommonConstants.URI_SUFFIX; + + //------------------------------------------------------------------------------------------------- + private OnboardingConstants() { super(); } +} diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java index c1e34e696..9055983f2 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java @@ -39,6 +39,7 @@ import javax.servlet.http.HttpServletRequest; import java.security.cert.X509Certificate; import java.util.Base64; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -127,10 +128,10 @@ public OnboardingWithNameResponseDTO onboardWithCertificateAndName(final HttpSer @PostMapping(OP_ONBOARDING_WITH_SHARED_SECRET_AND_NAME) @ResponseBody public OnboardingWithNameResponseDTO onboardWithSharedSecretAndName(@RequestBody final OnboardingWithNameRequestDTO onboardingRequest, - @RequestHeader(HttpHeaders.AUTHORIZATION) final String authorization) { + @RequestHeader final HttpHeaders headers) { logger.debug("onboardWithSharedSecretAndName started ..."); - authenticateSharedSecret(authorization); + authenticateSharedSecret(headers.getFirst(HttpHeaders.AUTHORIZATION)); verifyRequest(onboardingRequest, CommonConstants.ONBOARDING_URI + OP_ONBOARDING_WITH_SHARED_SECRET_AND_NAME); return onboardingDBService.onboarding(onboardingRequest); @@ -213,7 +214,7 @@ private void authenticateCertificate(final HttpServletRequest httpServletRequest //------------------------------------------------------------------------------------------------- private void authenticateSharedSecret(final String authorization) { if (sharedSecret.isEmpty()) { - throw new InvalidParameterException("Shared Secret is not accepted by this service"); + throw new InvalidParameterException("Shared Secret is disabled by this service"); } if (Utilities.isEmpty(authorization)) { diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java index 90acd8705..dfd1cfb6e 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java @@ -34,8 +34,10 @@ public class OnboardingDBService { //================================================================================================= // members - private final Logger logger = LogManager.getLogger(OnboardingDBService.class); + private final static String CERTIFICATE_TYPE = "X.509"; + private final OrchestrationDriver orchestration; + private final Logger logger = LogManager.getLogger(OnboardingDBService.class); private final HttpService httpService; private final SecurityUtilities securityUtilities; @@ -67,7 +69,18 @@ public OnboardingWithNameResponseDTO onboarding(final OnboardingWithNameRequestD } final CertificateSigningResponseDTO signingResponseDTO = executeCertificateSigningRequest(certificateSigningRequest); - return enrichOnboardingResponse(new OnboardingWithNameResponseDTO(), signingResponseDTO); + final OnboardingWithNameResponseDTO responseDTO = enrichOnboardingResponse(new OnboardingWithNameResponseDTO(), signingResponseDTO); + + final CertificateResponseDTO onboardingCertificate = responseDTO.getOnboardingCertificate(); + + onboardingCertificate.setKeyAlgorithm(keyPair.getPrivate().getAlgorithm()); + onboardingCertificate.setKeyFormat(keyPair.getPrivate().getFormat()); + onboardingCertificate.setPrivateKey(keyPair.getPrivate().getEncoded()); // TODO change to Base64? + onboardingCertificate.setPublicKey(keyPair.getPublic().getEncoded()); + + responseDTO.setCertificateType(CERTIFICATE_TYPE); + + return responseDTO; } //------------------------------------------------------------------------------------------------- @@ -84,9 +97,13 @@ public OnboardingWithCsrResponseDTO onboarding(final OnboardingWithCsrRequestDTO //------------------------------------------------------------------------------------------------- private CertificateSigningResponseDTO executeCertificateSigningRequest(final String certificateSigningRequest) { + logger.debug("Loading OrchestrationDriver ..."); final ServiceRegistryResponseDTO orchService = getOrchestratorService(); + + logger.debug("Orchestrate CertificateAuthority ..."); final OrchestrationResultDTO caOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_CERTIFICATE_AUTHORITY_SIGN); + logger.debug("Contact CertificateAuthority ..."); final UriComponents caUri = orchestration.createUri(caOrchResult.getProvider(), CommonConstants.CERTIFICATE_AUTHRORITY_URI + CommonConstants.OP_CA_SIGN_CERTIFICATE_URI); @@ -107,6 +124,7 @@ private T enrichOnboardingResponse(final T res final CertificateSigningResponseDTO csrResult) { final ServiceRegistryResponseDTO orchService = getOrchestratorService(); + logger.debug("Processing response from Certificate Authority ..."); final CertificateResponseDTO certificateResponseDTO = new CertificateResponseDTO(); certificateResponseDTO.setCertificate(csrResult.getCertificateChain().get(2)); @@ -114,9 +132,13 @@ private T enrichOnboardingResponse(final T res responseDTO.setIntermediateCertificate(csrResult.getCertificateChain().get(1)); responseDTO.setOnboardingCertificate(certificateResponseDTO); + logger.debug("Orchestrating Device Registry ..."); final OrchestrationResultDTO drOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_DEVICE_REGISTRY_REGISTER); + logger.debug("Orchestrating System Registry ..."); final OrchestrationResultDTO sysrOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_SYSTEM_REGISTRY_REGISTER); + logger.debug("Orchestrating Service Registry ..."); final OrchestrationResultDTO srOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_SERVICE_REGISTRY_REGISTER); + logger.debug("Orchestrating Orchestration Service ..."); final OrchestrationResultDTO orchOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_ORCH_PROCESS); responseDTO.setDeviceRegistry(new ServiceEndpoint(CoreSystemService.DEVICE_REGISTRY_REGISTER_SERVICE, orchestration.createUri(drOrchResult).toUri())); diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/security/OnboardingAccessControlFilter.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/security/OnboardingAccessControlFilter.java index 832c5045e..154c9e515 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/security/OnboardingAccessControlFilter.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/security/OnboardingAccessControlFilter.java @@ -2,29 +2,70 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.SecurityUtilities; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.exception.ArrowheadException; +import eu.arrowhead.common.exception.AuthException; +import eu.arrowhead.common.filter.thirdparty.MultiReadRequestWrapper; import eu.arrowhead.common.security.CoreSystemAccessControlFilter; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; +import org.springframework.util.Assert; +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; import java.util.Map; +import static eu.arrowhead.common.CommonConstants.ONBOARDING_AUTH_WITH_SHARED_SECRET_URI; + @Component @ConditionalOnProperty(name = CommonConstants.SERVER_SSL_ENABLED, matchIfMissing = true) public class OnboardingAccessControlFilter extends CoreSystemAccessControlFilter { + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @Override + public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { + if (request instanceof HttpServletRequest) { + log.debug("Checking access in OnboardingAccessControlFilter..."); + try { + final MultiReadRequestWrapper requestWrapper = new MultiReadRequestWrapper((HttpServletRequest) request); + final String requestTarget = Utilities.stripEndSlash(requestWrapper.getRequestURL().toString()); + + if (requestTarget.contains(CoreCommonConstants.MGMT_URI)) { + // Only the local System Operator can use these methods + final String cloudCN = getServerCloudCN(); + final String clientCN = SecurityUtilities.getCertificateCNFromRequest(requestWrapper); + + checkIfLocalSystemOperator(clientCN, cloudCN, requestTarget); + } + + log.debug("Using MultiReadRequestWrapper in the filter chain from now..."); + chain.doFilter(requestWrapper, response); + } catch (final ArrowheadException ex) { + handleException(ex, response); + } + } else { + chain.doFilter(request, response); + } + } + //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- @Override protected void checkClientAuthorized(final String clientCN, final String method, final String requestTarget, final String requestJSON, final Map queryParams) { - super.checkClientAuthorized(clientCN, method, requestTarget, requestJSON, queryParams); - final String cloudCN = getServerCloudCN(); if (requestTarget.contains(CoreCommonConstants.MGMT_URI)) { // Only the local System Operator can use these methods checkIfLocalSystemOperator(clientCN, cloudCN, requestTarget); } } - } \ No newline at end of file diff --git a/onboarding/src/main/resources/application.properties b/onboarding/src/main/resources/application.properties index 5588849f8..90546b6d5 100644 --- a/onboarding/src/main/resources/application.properties +++ b/onboarding/src/main/resources/application.properties @@ -5,13 +5,13 @@ # Database connection (mandatory) # Change the server timezone if necessary spring.datasource.url=jdbc:mysql://127.0.0.1:3306/arrowhead?serverTimezone=Europe/Budapest -spring.datasource.username=onboarding +spring.datasource.username=onboarding_controller spring.datasource.password=JKgh1as5f6oi7aV spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect # use true only for debugging -spring.jpa.show-sql=false +spring.jpa.show-sql=false spring.jpa.properties.hibernate.format_sql=true spring.jpa.hibernate.ddl-auto=none @@ -39,17 +39,18 @@ sr_port=8443 ### SECURE MODE ### ############################################ -# configure secure mode +# configure shared secret. comment to disable +sharedSecret=hidden_secret # Set this to false to disable https mode server.ssl.enabled=true server.ssl.key-store-type=PKCS12 -server.ssl.key-store=classpath:certificates/onboarding.p12 +server.ssl.key-store=classpath:certificates/onboarding_controller.p12 server.ssl.key-store-password=123456 server.ssl.key-alias=onboarding_controller server.ssl.key-password=123456 -server.ssl.client-auth=need +server.ssl.client-auth=want server.ssl.trust-store-type=PKCS12 server.ssl.trust-store=classpath:certificates/truststore.p12 server.ssl.trust-store-password=123456 diff --git a/onboarding/src/main/resources/banner.txt b/onboarding/src/main/resources/banner.txt new file mode 100644 index 000000000..82fe4e6b5 --- /dev/null +++ b/onboarding/src/main/resources/banner.txt @@ -0,0 +1,8 @@ +=========================================================================== + _____ _____ ______ ___ _ ______ _____ + /\ | __ \| __ \ / __ \ \ / / | | | ____| /\ | __ \ + / \ | |__) | |__) | | | \ \ /\ / /| |__| | |__ / \ | | | | + / /\ \ | _ /| _ /| | | |\ \/ \/ / | __ | __| / /\ \ | | | | + / ____ \| | \ \| | \ \| |__| | \ /\ / | | | | |____ / ____ \| |__| | + /_/ \_\_| \_\_| \_\\____/ \/ \/ |_| |_|______/_/ \_\_____/ +=========================================================================== \ No newline at end of file diff --git a/onboarding/src/main/resources/certificates/onboarding.p12 b/onboarding/src/main/resources/certificates/onboarding.p12 deleted file mode 100644 index a7ed58077d9e52e421ca33cdceb923d1a47dd199..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5343 zcmY+FRa6uJu!e~Rq#L9=7nUw*q=corkz86zx|S4>SP2mp5ZI*~1O$;5Bo*oI?gnA6 z_nsT)KFrLSfBu=rZv>$f3mE8_f>4SKY+T+r^|%{CbR6_TC`Bv)N)h!>4iki8dH=r= zmK^|!W&KY!{};yC`2W2{fQODz2n9R{LIF2|JlJ^uBmX;22cQ727C)6@=00(OqQFRL zdeyO3j3W$8v|e2R6flSmR`AJh%>KT?sW#{4`XZ%0RfHnB#w~IxAtt0;@nTN-NyK(S zCtf%t%yU=Ci9L%w(&Kd~WlQ-`{<=)+si#-vTLa=pz*3`}Ele^(nisgV+;Q>@U2X#R2cRGKaj>rs z1vs7D%TkpZjq<%C8>ZI0*4?&IVj%=3?B>>0y6cvyy5o~N1SCG8t^b-Yj`KicM>x4JaxW?`knxKJaIYEmSzweWIw6;va8Z3vlI-+^*gO_2_ zzoS%&>E5i2Yl8DG?@-JNWKnRMDk|`4f3CXX8k2`G90yyc!(SecF}2UMe40shW*?cYcgNo%zuV62#9tB{y&fsr>vF_aJW2 zUod*8fZNj1!5NaHsi6PCIvYN|v;^b%p^31`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%Ur9b-YW(->w^A>BXuUG}}>Fg*}uqt$uMhzHJ@b6b0?jm?~7 z-Z{7w`nx$ygi)fENdo+!toYTu$%O`El@vBbY&%FTJU{HgCND(NWa5?n7C1_-i338u z6v{XpOc+cUsut1vdsjtqJ@W=HG?zJC?xk}ll2HKE0J~f>7Vxd4NB8e2L%_=80nsVGp|Z8n_pic8U5BD;IeBQrmjrfehQrcUhd_~bl-RdkCRL`mMddz}J&5xT zd_8i;&~XGc2E-uuoy{8wwT!NC4$2#hK;rD3y1#i;I1(L%kuT=Fp#^w(X^K8?n8Ll2 zA#Y)vZY@ZA(a&V*+9duB9)f7e9`nYA=PU*iIMM@QcGTn#7(3G5OB~eB+f1jm| zM(xj~8hEEN298HF?U?GW9t;@Jj`M}Be2<3Atx6AVS88!YNdt<}bEuB)i^q2sbf{i2Un z;JLMc6*;VH%8kCvM6`DOyBEe+l(Oy|q8#)bm}sc1cqqt}r~n|zd&`VB-A8_ys`2&Hf|oHb k-?>VQfg~#&3pADsKP}>NchEDxxaWtLr57TjAVuW;2aV^^`~Uy| literal 0 HcmV?d00001 diff --git a/onboarding/src/main/resources/log4j2.xml b/onboarding/src/main/resources/log4j2.xml index 054f27268..6ef70b044 100644 --- a/onboarding/src/main/resources/log4j2.xml +++ b/onboarding/src/main/resources/log4j2.xml @@ -42,5 +42,7 @@ + + \ No newline at end of file diff --git a/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/ServiceRegistryApplicationInitListener.java b/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/ServiceRegistryApplicationInitListener.java index 69d8f2ccd..705581fe1 100644 --- a/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/ServiceRegistryApplicationInitListener.java +++ b/serviceregistry/src/main/java/eu/arrowhead/core/serviceregistry/ServiceRegistryApplicationInitListener.java @@ -1,93 +1,129 @@ package eu.arrowhead.core.serviceregistry; -import java.util.Base64; -import java.util.List; -import java.util.Map; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; -import org.springframework.context.event.ContextRefreshedEvent; -import org.springframework.stereotype.Component; - import eu.arrowhead.common.ApplicationInitListener; import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreDefaults; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.core.CoreSystem; +import eu.arrowhead.common.core.CoreSystemService; +import eu.arrowhead.common.database.entity.ServiceRegistry; import eu.arrowhead.common.database.entity.System; import eu.arrowhead.common.database.service.CommonDBService; +import eu.arrowhead.common.dto.shared.ServiceRegistryRequestDTO; +import eu.arrowhead.common.dto.shared.ServiceSecurityType; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.exception.DataNotFoundException; import eu.arrowhead.core.serviceregistry.database.service.ServiceRegistryDBService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.context.event.ContextRefreshedEvent; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Sort; +import org.springframework.stereotype.Component; + +import java.time.ZonedDateTime; +import java.util.Base64; +import java.util.List; +import java.util.Map; @Component public class ServiceRegistryApplicationInitListener extends ApplicationInitListener { - - //================================================================================================= - // members - - @Autowired - private CommonDBService commonDBService; - - @Autowired - private ServiceRegistryDBService serviceRegistryDBService; - - //================================================================================================= - // assistant methods - - //------------------------------------------------------------------------------------------------- - @Override - protected void customInit(final ContextRefreshedEvent event) { - logger.debug("customInit started..."); - if (!isOwnCloudRegistered()) { - registerOwnCloud(event.getApplicationContext()); - } - - try { - final String name = coreSystemRegistrationProperties.getCoreSystem().name().toLowerCase(); - final List oldSystems = serviceRegistryDBService.getSystemByName(name); - if (!oldSystems.isEmpty()) { - for (final System system : oldSystems) { - serviceRegistryDBService.removeSystemById(system.getId()); - } - } - - final String authInfo = sslProperties.isSslEnabled() ? Base64.getEncoder().encodeToString(publicKey.getEncoded()) : null; - serviceRegistryDBService.createSystem(name, coreSystemRegistrationProperties.getCoreSystemDomainName(), coreSystemRegistrationProperties.getCoreSystemDomainPort(), authInfo); - } catch (final ArrowheadException ex) { - logger.error("Can't registrate {} as a system.", coreSystemRegistrationProperties.getCoreSystem().name()); - logger.debug("Stacktrace", ex); - } - } - - //------------------------------------------------------------------------------------------------- - private boolean isOwnCloudRegistered() { - logger.debug("isOwnCloudRegistered started..."); - try { - commonDBService.getOwnCloud(sslProperties.isSslEnabled()); - return true; - } catch (final DataNotFoundException ex) { - return false; - } - } - - //------------------------------------------------------------------------------------------------- - private void registerOwnCloud(final ApplicationContext appContext) { - logger.debug("registerOwnCloud started..."); - - if (!standaloneMode) { - String name = CoreDefaults.DEFAULT_OWN_CLOUD_NAME; - String operator = CoreDefaults.DEFAULT_OWN_CLOUD_OPERATOR; - - if (sslProperties.isSslEnabled()) { - @SuppressWarnings("unchecked") - final Map context = appContext.getBean(CommonConstants.ARROWHEAD_CONTEXT, Map.class); - final String serverCN = (String) context.get(CommonConstants.SERVER_COMMON_NAME); - final String[] serverFields = serverCN.split("\\."); - name = serverFields[1]; - operator = serverFields[2]; + + //================================================================================================= + // members + + @Autowired + private CommonDBService commonDBService; + + @Autowired + private ServiceRegistryDBService serviceRegistryDBService; + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + @Override + protected void customInit(final ContextRefreshedEvent event) { + logger.debug("customInit started..."); + if (!isOwnCloudRegistered()) { + registerOwnCloud(event.getApplicationContext()); + } + + try { + final String name = coreSystemRegistrationProperties.getCoreSystem().name().toLowerCase(); + final List oldSystems = serviceRegistryDBService.getSystemByName(name); + if (!oldSystems.isEmpty()) { + for (final System system : oldSystems) { + removeServiceRegistryEntries(system); + serviceRegistryDBService.removeSystemById(system.getId()); + } + } + + final String authInfo = sslProperties.isSslEnabled() ? Base64.getEncoder().encodeToString(publicKey.getEncoded()) : null; + final SystemRequestDTO systemRequestDTO = new SystemRequestDTO(name, coreSystemRegistrationProperties.getCoreSystemDomainName(), + coreSystemRegistrationProperties.getCoreSystemDomainPort(), authInfo); + + final ServiceSecurityType securityType = sslProperties.isSslEnabled() ? ServiceSecurityType.CERTIFICATE : ServiceSecurityType.NOT_SECURE; + final String serviceInterface = sslProperties.isSslEnabled() ? CommonConstants.HTTP_SECURE_JSON : CommonConstants.HTTP_INSECURE_JSON; + + for (CoreSystemService service : CoreSystem.SERVICE_REGISTRY.getServices()) { + final ServiceRegistryRequestDTO registryRequest = new ServiceRegistryRequestDTO(); + registryRequest.setProviderSystem(systemRequestDTO); + registryRequest.setServiceDefinition(service.getServiceDefinition()); + registryRequest.setEndOfValidity(Utilities.convertZonedDateTimeToUTCString(ZonedDateTime.now().plusYears(1))); + registryRequest.setInterfaces(List.of(serviceInterface)); + registryRequest.setServiceUri(service.getServiceUri()); + registryRequest.setSecure(securityType.name()); + + serviceRegistryDBService.registerServiceResponse(registryRequest); + } + } catch (final ArrowheadException ex) { + logger.error("Can't registrate {} as a system.", coreSystemRegistrationProperties.getCoreSystem().name()); + logger.debug("Stacktrace", ex); + } + } + + //------------------------------------------------------------------------------------------------- + private void removeServiceRegistryEntries(final System system) { + for (CoreSystemService service : CoreSystem.SERVICE_REGISTRY.getServices()) { + try { + serviceRegistryDBService.removeServiceRegistry(service.getServiceDefinition(), system.getSystemName(), system.getAddress(), system.getPort()); + } catch (final Exception ex) { + // ignore } - - commonDBService.insertOwnCloud(operator, name, sslProperties.isSslEnabled(), null); - logger.info("{}.{} own cloud is registered in {} mode.", name, operator, getModeString()); - } - } + } + } + + //------------------------------------------------------------------------------------------------- + private boolean isOwnCloudRegistered() { + logger.debug("isOwnCloudRegistered started..."); + try { + commonDBService.getOwnCloud(sslProperties.isSslEnabled()); + return true; + } catch (final DataNotFoundException ex) { + return false; + } + } + + //------------------------------------------------------------------------------------------------- + private void registerOwnCloud(final ApplicationContext appContext) { + logger.debug("registerOwnCloud started..."); + + if (!standaloneMode) { + String name = CoreDefaults.DEFAULT_OWN_CLOUD_NAME; + String operator = CoreDefaults.DEFAULT_OWN_CLOUD_OPERATOR; + + if (sslProperties.isSslEnabled()) { + @SuppressWarnings("unchecked") final Map context = appContext.getBean(CommonConstants.ARROWHEAD_CONTEXT, Map.class); + final String serverCN = (String) context.get(CommonConstants.SERVER_COMMON_NAME); + final String[] serverFields = serverCN.split("\\."); + name = serverFields[1]; + operator = serverFields[2]; + } + + commonDBService.insertOwnCloud(operator, name, sslProperties.isSslEnabled(), null); + logger.info("{}.{} own cloud is registered in {} mode.", name, operator, getModeString()); + } + } } \ No newline at end of file From dfd3681822d9ff7239cd31f7dc7df87fcc851be3 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Sun, 22 Mar 2020 03:13:38 +0100 Subject: [PATCH 275/301] bug and issue fixes --- .../src/main/java/eu/arrowhead/common/OrchestrationDriver.java | 2 +- .../database/service/DeviceRegistryDBService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java b/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java index 023446edc..0a3e32338 100644 --- a/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java +++ b/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java @@ -53,7 +53,7 @@ public void pingService(final SystemResponseDTO system, final String uriPrefix) final UriComponents echoUri = createUri(system, uriPrefix + CommonConstants.ECHO_URI); httpService.sendRequest(echoUri, HttpMethod.GET, String.class); - logger.info("Service at {} is accessible...", echoUri); + logger.debug("Service at {} is accessible...", echoUri); } //------------------------------------------------------------------------------------------------- diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java index 3a7503041..32823be5d 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java @@ -667,7 +667,7 @@ private void checkConstraintsOfDeviceRegistryTable(final Device deviceDb) { try { final Optional find = deviceRegistryRepository.findByDevice(deviceDb); if (find.isPresent()) { - throw new InvalidParameterException("System Registry entry with provider: (" + + throw new InvalidParameterException("Device Registry entry with provider: (" + deviceDb.getDeviceName() + ", " + deviceDb.getMacAddress() + ") already exists."); From 1a7cb97e56e638527532b97cc96ef26048f8097b Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Mon, 23 Mar 2020 08:43:06 +0100 Subject: [PATCH 276/301] fixed alias lookup issue --- .../java/eu/arrowhead/common/Utilities.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/Utilities.java b/core-common/src/main/java/eu/arrowhead/common/Utilities.java index 666baab17..18ad8a379 100644 --- a/core-common/src/main/java/eu/arrowhead/common/Utilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/Utilities.java @@ -384,13 +384,17 @@ public static X509Certificate getCloudCertFromKeyStore(final KeyStore keystore) Assert.notNull(keystore, "Key store is not defined."); try { + // debian installation with new certificates have a different alias final Enumeration enumeration = keystore.aliases(); while (enumeration.hasMoreElements()) { final String alias = enumeration.nextElement(); - final String[] aliasParts = alias.split("\\."); - if (aliasParts.length == 4 && aliasParts[2].equals(AH_MASTER_NAME) && aliasParts[3].equals(AH_MASTER_SUFFIX)) { + final X509Certificate certificate = (X509Certificate) keystore.getCertificate(alias); + final String commonName = getCertCNFromSubject(certificate.getSubjectDN().getName()); + Assert.notNull(commonName, "Certificate without commonName is not allowed"); + final String[] cnParts = commonName.split("\\."); + if (cnParts.length == 4 && cnParts[2].equals(AH_MASTER_NAME) && cnParts[3].equals(AH_MASTER_SUFFIX)) { return (X509Certificate) keystore.getCertificate(alias); - } + } } final String errorMsg = "Getting the cloud cert from keystore failed. " + @@ -408,13 +412,17 @@ public static X509Certificate getRootCertFromKeyStore(final KeyStore keystore) { Assert.notNull(keystore, "Key store is not defined."); try { - final Enumeration enumeration = keystore.aliases(); + // debian installation with new certificates have a different alias + Enumeration enumeration = keystore.aliases(); while (enumeration.hasMoreElements()) { final String alias = enumeration.nextElement(); - final String[] aliasParts = alias.split("\\."); - if (aliasParts.length == 2 && aliasParts[0].equals(AH_MASTER_NAME) && aliasParts[1].equals(AH_MASTER_SUFFIX)) { + final X509Certificate certificate = (X509Certificate) keystore.getCertificate(alias); + final String commonName = getCertCNFromSubject(certificate.getSubjectDN().getName()); + Assert.notNull(commonName, "Certificate without commonName is not allowed"); + final String[] cnParts = commonName.split("\\."); + if (cnParts.length == 2 && cnParts[0].equals(AH_MASTER_NAME) && cnParts[1].equals(AH_MASTER_SUFFIX)) { return (X509Certificate) keystore.getCertificate(alias); - } + } } final String errorMsg = "Getting the root cert from keystore failed. " + From 6a6b736cb549ba3460ddc3e3321840eaa38b2d82 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Mon, 23 Mar 2020 09:44:54 +0100 Subject: [PATCH 277/301] fixed alias cloud lookup issue --- certificate-authority/src/deb/control/postinst | 18 ++++++++++++------ .../java/eu/arrowhead/common/Utilities.java | 5 ++++- onboarding/src/deb/control/postinst | 1 + 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/certificate-authority/src/deb/control/postinst b/certificate-authority/src/deb/control/postinst index e7ed018aa..1f9a53f8d 100644 --- a/certificate-authority/src/deb/control/postinst +++ b/certificate-authority/src/deb/control/postinst @@ -35,14 +35,19 @@ case "$1" in system_passwd="$(openssl rand -base64 12)" fi - echo "Configuring MySQL database..." >&2 - ah_db_tables_and_user ${SYSTEM_NAME} ${SYSTEM_NAME}_privileges.sql ${system_passwd} + echo "Configuring MySQL database..." >&2 + ah_db_tables_and_user ${SYSTEM_NAME} ${SYSTEM_NAME}_privileges.sql ${system_passwd} - if [ ! -d "${SYSTEM_DIR}" ]; then - mkdir -p ${SYSTEM_DIR} - fi + if [ ! -d "${SYSTEM_DIR}" ]; then + mkdir -p ${SYSTEM_DIR} + fi - ah_cert_signed_system ${SYSTEM_NAME} + domain_name=${AH_DOMAIN_NAME} + if [ -z ${domain_name} ]; then + domain_name=${OWN_IP} + fi + + ah_cert_signed_system ${SYSTEM_NAME} # modify log config and application.properties @@ -54,6 +59,7 @@ case "$1" in cat ${SYSTEM_DIR}/application.properties.orig | \ sed -r -e "\#^.*spring\.datasource\.url=#s#.*\$#spring.datasource.url=jdbc:mysql://"${db_host}":3306/arrowhead?serverTimezone=Europe/Budapest#" \ -e "\#^.*spring\.datasource\.password=#s#.*\$#spring.datasource.password=${system_passwd}#" \ + -e "\#^.*domain\.name=#s#.*\$#domain.name=${domain_name}#" \ -e "\#^.*server\.address=#s#.*\$#server.address=${OWN_IP}#" \ -e "\#^.*server\.ssl\.key-store=#s#.*\$#server.ssl.key-store=file:${SYSTEM_DIR}/${SYSTEM_NAME}.p12#" \ -e "\#^.*server\.ssl\.key-store-password=#s#.*\$#server.ssl.key-store-password=${AH_PASS_CERT}#" \ diff --git a/core-common/src/main/java/eu/arrowhead/common/Utilities.java b/core-common/src/main/java/eu/arrowhead/common/Utilities.java index 18ad8a379..03b1aa05c 100644 --- a/core-common/src/main/java/eu/arrowhead/common/Utilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/Utilities.java @@ -385,6 +385,7 @@ public static X509Certificate getCloudCertFromKeyStore(final KeyStore keystore) try { // debian installation with new certificates have a different alias + // i.e. the format is {cloudname}." + AH_MASTER_NAME + "." + AH_MASTER_SUFFIX final Enumeration enumeration = keystore.aliases(); while (enumeration.hasMoreElements()) { final String alias = enumeration.nextElement(); @@ -392,8 +393,10 @@ public static X509Certificate getCloudCertFromKeyStore(final KeyStore keystore) final String commonName = getCertCNFromSubject(certificate.getSubjectDN().getName()); Assert.notNull(commonName, "Certificate without commonName is not allowed"); final String[] cnParts = commonName.split("\\."); - if (cnParts.length == 4 && cnParts[2].equals(AH_MASTER_NAME) && cnParts[3].equals(AH_MASTER_SUFFIX)) { + if (cnParts.length == 3 && cnParts[1].equals(AH_MASTER_NAME) && cnParts[2].equals(AH_MASTER_SUFFIX)) { return (X509Certificate) keystore.getCertificate(alias); + } else if (cnParts.length == 4 && cnParts[2].equals(AH_MASTER_NAME) && cnParts[3].equals(AH_MASTER_SUFFIX)) { + return (X509Certificate) keystore.getCertificate(alias); } } diff --git a/onboarding/src/deb/control/postinst b/onboarding/src/deb/control/postinst index 9eef2a8d1..a2e66a110 100644 --- a/onboarding/src/deb/control/postinst +++ b/onboarding/src/deb/control/postinst @@ -69,6 +69,7 @@ case "$1" in sed -r -e "\#^.*spring\.datasource\.url=#s#.*\$#spring.datasource.url=jdbc:mysql://"${db_host}":3306/arrowhead?serverTimezone=Europe/Budapest#" \ -e "\#^.*spring\.datasource\.password=#s#.*\$#spring.datasource.password=${system_passwd}#" \ -e "\#^.*domain\.name=#s#.*\$#domain.name=${domain_name}#" \ + -e "\#^.*server\.address=#s#.*\$#server.address=${OWN_IP}#" \ -e "\#^.*sr_address=#s#.*\$#sr_address=${sr_host}#" \ -e "\#^.*server\.ssl\.key-store=#s#.*\$#server.ssl.key-store=file:${SYSTEM_DIR}/${SYSTEM_NAME}.p12#" \ -e "\#^.*server\.ssl\.key-store-password=#s#.*\$#server.ssl.key-store-password=${AH_PASS_CERT}#" \ From 3b8012fcba1384e2532d7e78a351d7900f517a05 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Mon, 23 Mar 2020 11:12:44 +0100 Subject: [PATCH 278/301] workaround: cloud common not is not an alias --- .../src/main/java/eu/arrowhead/common/Utilities.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/Utilities.java b/core-common/src/main/java/eu/arrowhead/common/Utilities.java index 03b1aa05c..7a9a8dbd9 100644 --- a/core-common/src/main/java/eu/arrowhead/common/Utilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/Utilities.java @@ -471,11 +471,13 @@ public static PrivateKey getPrivateKey(final KeyStore keystore, final String ali Assert.notNull(keyPass, "Password is not defined."); try { - PrivateKey privateKey = (PrivateKey) keystore.getKey(alias, keyPass.toCharArray()); - if (privateKey != null) { - return privateKey; - } else { - throw new ServiceConfigurationError("Getting the private key failed, key store aliases do not identify a key."); + // TODO issue: the cloud common name is not the alias in debian installation with own certificates + PrivateKey privateKey = (PrivateKey) keystore.getKey(alias, keyPass.toCharArray()); + if (privateKey != null) { + return privateKey; + } else { + return getPrivateKey(keystore, keyPass); + // throw new ServiceConfigurationError("Getting the private key failed, key store aliases do not identify a key."); } } catch (final KeyStoreException | UnrecoverableKeyException | NoSuchAlgorithmException ex) { logger.error("Getting the private key from key store failed...", ex); From f0e3476679067c2ec9688036fd24df9be7ac6853 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Mon, 23 Mar 2020 13:28:33 +0100 Subject: [PATCH 279/301] issue with certificate order --- .../onboarding/database/service/OnboardingDBService.java | 6 +++--- onboarding/src/main/resources/application.properties | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java index dfd1cfb6e..15718aa60 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java @@ -126,10 +126,10 @@ private T enrichOnboardingResponse(final T res logger.debug("Processing response from Certificate Authority ..."); final CertificateResponseDTO certificateResponseDTO = new CertificateResponseDTO(); - certificateResponseDTO.setCertificate(csrResult.getCertificateChain().get(2)); - - responseDTO.setRootCertificate(csrResult.getCertificateChain().get(0)); + certificateResponseDTO.setCertificate(csrResult.getCertificateChain().get(0)); responseDTO.setIntermediateCertificate(csrResult.getCertificateChain().get(1)); + responseDTO.setRootCertificate(csrResult.getCertificateChain().get(2)); + responseDTO.setOnboardingCertificate(certificateResponseDTO); logger.debug("Orchestrating Device Registry ..."); diff --git a/onboarding/src/main/resources/application.properties b/onboarding/src/main/resources/application.properties index 90546b6d5..d7f253a24 100644 --- a/onboarding/src/main/resources/application.properties +++ b/onboarding/src/main/resources/application.properties @@ -16,7 +16,7 @@ spring.jpa.properties.hibernate.format_sql=true spring.jpa.hibernate.ddl-auto=none # Onboarding Controller web-server parameters -server.address=0.0.0.0 +server.address=127.0.0.1 server.port=8435 domain.name=127.0.0.1 domain.port=8435 From 5efb5f6e8d945aed8666c355c21ffb1222140017 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Tue, 24 Mar 2020 12:27:24 +0100 Subject: [PATCH 280/301] working eisenstadt demo (except CA) --- .../certificate_authority/CAProperties.java | 12 ++--- .../CertificateAuthorityService.java | 9 ++-- .../CertificateAuthorityUtils.java | 14 ++--- .../eu/arrowhead/common/CommonConstants.java | 8 +-- .../java/eu/arrowhead/common/Defaults.java | 4 +- .../arrowhead/common/OrchestrationDriver.java | 6 +-- .../arrowhead/common/SecurityUtilities.java | 51 ++++++++++++++----- .../java/eu/arrowhead/common/Utilities.java | 16 ++++-- .../src/deb/arrowhead-onboarding.service | 2 +- .../core/onboarding/OnboardingController.java | 11 ++-- .../database/service/OnboardingDBService.java | 4 +- 11 files changed, 86 insertions(+), 51 deletions(-) diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CAProperties.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CAProperties.java index a466f1fe3..d4120006a 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CAProperties.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CAProperties.java @@ -9,16 +9,16 @@ public class CAProperties { @Value(CommonConstants.$CA_CERT_VALIDITY_NEG_OFFSET_MILLIS) - private long certValidityNegativeOffsetMillis; + private long certValidityNegativeOffsetMinutes; @Value(CommonConstants.$CA_CERT_VALIDITY_POS_OFFSET_MILLIS) - private long certValidityPositiveOffsetMillis; + private long certValidityPositiveOffsetMinutes; - public long getCertValidityNegativeOffsetMillis() { - return certValidityNegativeOffsetMillis; + public long getCertValidityNegativeOffsetMinutes() { + return certValidityNegativeOffsetMinutes; } - public long getCertValidityPositiveOffsetMillis() { - return certValidityPositiveOffsetMillis; + public long getCertValidityPositiveOffsetMinutes() { + return certValidityPositiveOffsetMinutes; } } diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java index 3f46569b6..929021cde 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java @@ -22,8 +22,6 @@ import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.time.Duration; -import java.time.LocalDateTime; -import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Date; @@ -116,12 +114,13 @@ private List buildEncodedCertificateChain(X509Certificate clientCertific private X509Certificate buildCertificate(JcaPKCS10CertificationRequest csr, PrivateKey cloudPrivateKey, X509Certificate cloudCertificate) { - final ZonedDateTime now = LocalDateTime.now().atZone(ZoneId.systemDefault()); + final ZonedDateTime now = ZonedDateTime.now(); final Date validFrom = Date.from( - now.minus(Duration.ofMillis(caProperties.getCertValidityPositiveOffsetMillis())).toInstant()); + now.minusMinutes(caProperties.getCertValidityNegativeOffsetMinutes()).toInstant()); final Date validUntil = Date.from( - now.plus(Duration.ofMillis(caProperties.getCertValidityPositiveOffsetMillis())).toInstant()); + now.plusMinutes(caProperties.getCertValidityPositiveOffsetMinutes()).toInstant()); + logger.debug("Setting validity from='{}' to='{}'", validFrom, validUntil); return CertificateAuthorityUtils.buildCertificate(csr, cloudPrivateKey, cloudCertificate, validFrom, validUntil, random); } diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java index ac012b205..38c801197 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java @@ -56,7 +56,7 @@ class CertificateAuthorityUtils { private static final Logger logger = LogManager.getLogger(CertificateAuthorityService.class); private static final String PROVIDER = "BC"; - private static final String SIGNATURE_ALGORITHM = "SHA512withRSA"; + private static final String SIGNATURE_ALGORITHM = "SHA256withRSA"; static JcaPKCS10CertificationRequest decodePKCS10CSR(CertificateSigningRequestDTO csr) { try { @@ -128,9 +128,7 @@ static PublicKey getClientKey(JcaPKCS10CertificationRequest csr) { static X509Certificate buildCertificate(JcaPKCS10CertificationRequest csr, PrivateKey cloudPrivateKey, X509Certificate cloudCertificate, Date validFrom, Date validUntil, SecureRandom random) { - final ZonedDateTime now = LocalDateTime.now().atZone(ZoneId.systemDefault()); - final BigInteger serial = BigInteger.valueOf(now.toInstant().toEpochMilli()) - .multiply(BigInteger.valueOf(random.nextLong())); + final BigInteger serial = new BigInteger(32, random); final PublicKey clientKey = getClientKey(csr); @@ -168,19 +166,21 @@ static X509Certificate buildCertificate(JcaPKCS10CertificationRequest csr, Priva */ static void addCertificateExtensions(X509v3CertificateBuilder builder, JcaPKCS10CertificationRequest csr, PublicKey clientKey, X509Certificate cloudCertificate) { + return; // testing + /* try { JcaX509ExtensionUtils extUtils = new JcaX509ExtensionUtils(); final List subjectAlternativeNames = getSubjectAlternativeNames(csr); builder.addExtension(Extension.subjectAlternativeName, false, - new GeneralNames(subjectAlternativeNames.toArray(new GeneralName[] {}))); + new GeneralNames(subjectAlternativeNames.toArray(new GeneralName[] {}))); builder.addExtension(Extension.subjectKeyIdentifier, false, extUtils.createSubjectKeyIdentifier(clientKey)); builder.addExtension(Extension.authorityKeyIdentifier, false, extUtils.createAuthorityKeyIdentifier(cloudCertificate)); - builder.addExtension(Extension.basicConstraints, true, new BasicConstraints(false)); + //builder.addExtension(Extension.basicConstraints, true, new BasicConstraints(false)); } catch (NoSuchAlgorithmException | CertIOException | CertificateEncodingException | NullPointerException e) { throw new InvalidParameterException("Appending extensions to the certificate failed! (" + e.getMessage() + ")", e); - } + }*/ } static List getSubjectAlternativeNames(JcaPKCS10CertificationRequest csr) { diff --git a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java index 7d3a4ac1f..845e2c7b2 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java @@ -209,10 +209,10 @@ public class CommonConstants { public static final String DISABLE_HOSTNAME_VERIFIER = "disable.hostname.verifier"; public static final String $DISABLE_HOSTNAME_VERIFIER_WD = "${" + DISABLE_HOSTNAME_VERIFIER + ":" + Defaults.DEFAULT_DISABLE_HOSTNAME_VERIFIER + "}"; - public static final String CA_CERT_VALIDITY_NEG_OFFSET_MILLIS = "ca.validity.negative-offest-millis"; - public static final String $CA_CERT_VALIDITY_NEG_OFFSET_MILLIS = "${" + CA_CERT_VALIDITY_NEG_OFFSET_MILLIS + ":" + Defaults.DEFAULT_CA_CERT_VALIDITY_NEG_OFFSET_MILLIS + "}"; - public static final String CA_CERT_VALIDITY_POS_OFFSET_MILLIS = "ca.validity.positive-offest-millis"; - public static final String $CA_CERT_VALIDITY_POS_OFFSET_MILLIS = "${" + CA_CERT_VALIDITY_POS_OFFSET_MILLIS + ":" + Defaults.DEFAULT_CA_CERT_VALIDITY_POS_OFFSET_MILLIS + "}"; + public static final String CA_CERT_VALIDITY_NEG_OFFSET_MINUTES = "ca.validity.negative-offset-minutes"; + public static final String $CA_CERT_VALIDITY_NEG_OFFSET_MILLIS = "${" + CA_CERT_VALIDITY_NEG_OFFSET_MINUTES + ":" + Defaults.DEFAULT_CA_CERT_VALIDITY_NEG_OFFSET_MINUTES + "}"; + public static final String CA_CERT_VALIDITY_POS_OFFSET_MINUTES = "ca.validity.positive-offset-minutes"; + public static final String $CA_CERT_VALIDITY_POS_OFFSET_MILLIS = "${" + CA_CERT_VALIDITY_POS_OFFSET_MINUTES + ":" + Defaults.DEFAULT_CA_CERT_VALIDITY_POS_OFFSET_MINUTES + "}"; public static final String JWT_CLAIM_CONSUMER_ID = "cid"; public static final String JWT_CLAIM_SERVICE_ID = "sid"; diff --git a/core-common/src/main/java/eu/arrowhead/common/Defaults.java b/core-common/src/main/java/eu/arrowhead/common/Defaults.java index e671f785e..2be4d5b00 100644 --- a/core-common/src/main/java/eu/arrowhead/common/Defaults.java +++ b/core-common/src/main/java/eu/arrowhead/common/Defaults.java @@ -35,8 +35,8 @@ public class Defaults { public static final String CORS_ALLOW_CREDENTIALS = "true"; // CA defaults - public static final long DEFAULT_CA_CERT_VALIDITY_NEG_OFFSET_MILLIS = 5000; - public static final long DEFAULT_CA_CERT_VALIDITY_POS_OFFSET_MILLIS = 1000 * 3600 * 24 * 365; + public static final long DEFAULT_CA_CERT_VALIDITY_NEG_OFFSET_MINUTES = 5000; + public static final long DEFAULT_CA_CERT_VALIDITY_POS_OFFSET_MINUTES = 60 * 24 * 365; //------------------------------------------------------------------------------------------------- private Defaults() { diff --git a/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java b/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java index 0a3e32338..8848f1378 100644 --- a/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java +++ b/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java @@ -49,7 +49,7 @@ public OrchestrationDriver(final SSLProperties sslProperties, final HttpService //------------------------------------------------------------------------------------------------- public void pingService(final SystemResponseDTO system, final String uriPrefix) { - logger.debug("getCertificateAuthorityService started..."); + logger.debug("ping started..."); final UriComponents echoUri = createUri(system, uriPrefix + CommonConstants.ECHO_URI); httpService.sendRequest(echoUri, HttpMethod.GET, String.class); @@ -77,7 +77,7 @@ public ServiceQueryResultDTO getService(final CoreSystemService service) { final ServiceQueryResultDTO srQueryResult = httpResponse.getBody(); if (Objects.isNull(srQueryResult) || srQueryResult.getServiceQueryData().isEmpty()) { - throw new ArrowheadException("Unable to find service"); + throw new ArrowheadException("Unable to find '" + service.getServiceDefinition() + "' on ServiceRegistry"); } return srQueryResult; @@ -119,7 +119,7 @@ public OrchestrationResponseDTO contactOrchestrationService(final ServiceRegistr final OrchestrationResponseDTO orchQueryResult = httpResponse.getBody(); if (Objects.isNull(orchQueryResult) || orchQueryResult.getResponse().isEmpty()) { - throw new ArrowheadException("Unable to find " + serviceDefinition); + throw new ArrowheadException("Unable to find '" + serviceDefinition + "' on OrchestrationSystem"); } return orchQueryResult; diff --git a/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java b/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java index 8d75abe49..6ec50986e 100644 --- a/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java @@ -4,7 +4,13 @@ import eu.arrowhead.common.exception.AuthException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.bouncycastle.asn1.DEROctetString; +import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers; import org.bouncycastle.asn1.x500.X500Name; +import org.bouncycastle.asn1.x509.Extension; +import org.bouncycastle.asn1.x509.Extensions; +import org.bouncycastle.asn1.x509.GeneralName; +import org.bouncycastle.asn1.x509.GeneralNamesBuilder; import org.bouncycastle.operator.ContentSigner; import org.bouncycastle.operator.OperatorCreationException; import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; @@ -62,7 +68,18 @@ public SecurityUtilities(@Value("${security.key.algorithm:RSA}") final String ke // methods //------------------------------------------------------------------------------------------------- - public String createEncodedCSR(final String baseCommonName, final KeyPair keyPair) + public static String getCertificateCNFromRequest(final HttpServletRequest request) { + final X509Certificate[] certificates = (X509Certificate[]) request.getAttribute(CommonConstants.ATTR_JAVAX_SERVLET_REQUEST_X509_CERTIFICATE); + if (certificates != null && certificates.length != 0) { + final X509Certificate cert = certificates[0]; + return Utilities.getCertCNFromSubject(cert.getSubjectDN().getName()); + } + + return null; + } + + //------------------------------------------------------------------------------------------------- + public String createEncodedCSR(final String baseCommonName, final KeyPair keyPair, final String host, final String address) throws IOException, CertificateException, NoSuchAlgorithmException, KeyStoreException, OperatorCreationException { Assert.notNull(sslProperties.getKeyStore(), "KeyStore property must not be null!"); @@ -78,13 +95,30 @@ public String createEncodedCSR(final String baseCommonName, final KeyPair keyPai final String operator = getOperatorName(cloudCertFromKeyStore.getSubjectDN()); final String organization = getOrganization(cloudCertFromKeyStore.getSubjectDN()); final String country = getCountry(cloudCertFromKeyStore.getSubjectDN()); - final String commonName = String.format("CN=%s.%s, OU=%s, O=%s, C=%s", - baseCommonName, cloudName,operator, organization, country); + //final String commonName = String.format("CN=%s.%s, OU=%s, O=%s, C=%s", + // baseCommonName, cloudName, operator, organization, country); + final String commonName = String.format("CN=%s.%s", baseCommonName, cloudName); final X500Name x500Name = new X500Name(commonName); logger.debug("Building and Signing Certificate Signing Request for {}", x500Name); // create certificate signing request final JcaPKCS10CertificationRequestBuilder builder = new JcaPKCS10CertificationRequestBuilder(x500Name, keyPair.getPublic()); + final GeneralNamesBuilder namesBuilder = new GeneralNamesBuilder(); + + namesBuilder.addName(new GeneralName(GeneralName.dNSName, "localhost")); + namesBuilder.addName(new GeneralName(GeneralName.dNSName, baseCommonName)); + namesBuilder.addName(new GeneralName(GeneralName.iPAddress, "127.0.0.1")); + + if (Objects.nonNull(host)) { + namesBuilder.addName(new GeneralName(GeneralName.dNSName, host)); + } + if (Objects.nonNull(host)) { + namesBuilder.addName(new GeneralName(GeneralName.iPAddress, address)); + } + + final Extension extension = new Extension(Extension.subjectAlternativeName, false, new DEROctetString(namesBuilder.build())); + builder.addAttribute(PKCSObjectIdentifiers.pkcs_9_at_extensionRequest, new Extensions(extension)); + final JcaContentSignerBuilder contentSignerBuilder = new JcaContentSignerBuilder(SIGNATURE_ALGORITHM); final ContentSigner contentSigner = contentSignerBuilder.build(keyPair.getPrivate()); final PKCS10CertificationRequest csr = builder.build(contentSigner); @@ -124,17 +158,6 @@ public KeyPair extractKeyPair(final CertificateCreationRequestDTO creationReques return keyPair; } - //------------------------------------------------------------------------------------------------- - public static String getCertificateCNFromRequest(final HttpServletRequest request) { - final X509Certificate[] certificates = (X509Certificate[]) request.getAttribute(CommonConstants.ATTR_JAVAX_SERVLET_REQUEST_X509_CERTIFICATE); - if (certificates != null && certificates.length != 0) { - final X509Certificate cert = certificates[0]; - return Utilities.getCertCNFromSubject(cert.getSubjectDN().getName()); - } - - return null; - } - //================================================================================================= // assistant methods diff --git a/core-common/src/main/java/eu/arrowhead/common/Utilities.java b/core-common/src/main/java/eu/arrowhead/common/Utilities.java index 7a9a8dbd9..d8515de4b 100644 --- a/core-common/src/main/java/eu/arrowhead/common/Utilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/Utilities.java @@ -39,6 +39,7 @@ import java.security.PrivateKey; import java.security.PublicKey; import java.security.UnrecoverableKeyException; +import java.security.cert.Certificate; import java.security.cert.X509Certificate; import java.security.spec.InvalidKeySpecException; import java.security.spec.X509EncodedKeySpec; @@ -371,9 +372,16 @@ public static X509Certificate getFirstCertFromKeyStore(final KeyStore keystore) Assert.notNull(keystore, "Key store is not defined."); try { + // the first certificate is not always the end certificate. java does not guarantee the order final Enumeration enumeration = keystore.aliases(); - final String alias = enumeration.nextElement(); - return (X509Certificate) keystore.getCertificate(alias); + while (enumeration.hasMoreElements()) { + final Certificate[] chain = keystore.getCertificateChain(enumeration.nextElement()); + + if(Objects.nonNull(chain) && chain.length >= 3) { + return (X509Certificate) chain[0]; + } + } + throw new ServiceConfigurationError("Getting the first cert from keystore failed..."); } catch (final KeyStoreException | NoSuchElementException ex) { logger.error("Getting the first cert from key store failed...", ex); throw new ServiceConfigurationError("Getting the first cert from keystore failed...", ex); @@ -393,9 +401,9 @@ public static X509Certificate getCloudCertFromKeyStore(final KeyStore keystore) final String commonName = getCertCNFromSubject(certificate.getSubjectDN().getName()); Assert.notNull(commonName, "Certificate without commonName is not allowed"); final String[] cnParts = commonName.split("\\."); - if (cnParts.length == 3 && cnParts[1].equals(AH_MASTER_NAME) && cnParts[2].equals(AH_MASTER_SUFFIX)) { + if (cnParts.length == 4 && cnParts[2].equals(AH_MASTER_NAME) && cnParts[3].equals(AH_MASTER_SUFFIX)) { return (X509Certificate) keystore.getCertificate(alias); - } else if (cnParts.length == 4 && cnParts[2].equals(AH_MASTER_NAME) && cnParts[3].equals(AH_MASTER_SUFFIX)) { + } else if (cnParts.length == 3 && cnParts[1].equals(AH_MASTER_NAME) && cnParts[2].equals(AH_MASTER_SUFFIX)) { return (X509Certificate) keystore.getCertificate(alias); } } diff --git a/onboarding/src/deb/arrowhead-onboarding.service b/onboarding/src/deb/arrowhead-onboarding.service index 12a8dc2ab..d75c01021 100644 --- a/onboarding/src/deb/arrowhead-onboarding.service +++ b/onboarding/src/deb/arrowhead-onboarding.service @@ -1,6 +1,6 @@ [Unit] Description=arrowhead-onboarding -After=network.target mysql.target arrowhead-serviceregistry arrowhead-certificate-authority arrowhead-orchestration +After=network.target mysql.target arrowhead-serviceregistry arrowhead-authorization arrowhead-certificate-authority arrowhead-orchestration [Service] WorkingDirectory=/etc/arrowhead/systems/onboarding_controller diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java index 9055983f2..bed29a70e 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java @@ -114,7 +114,9 @@ public OnboardingWithNameResponseDTO onboardWithCertificateAndName(final HttpSer authenticateCertificate(httpServletRequest); verifyRequest(onboardingRequest, CommonConstants.ONBOARDING_URI + OP_ONBOARDING_WITH_CERTIFICATE_AND_NAME); - return onboardingDBService.onboarding(onboardingRequest); + final String host = httpServletRequest.getRemoteHost(); + final String address = httpServletRequest.getRemoteAddr(); + return onboardingDBService.onboarding(onboardingRequest, host, address); } //------------------------------------------------------------------------------------------------- @@ -127,14 +129,17 @@ public OnboardingWithNameResponseDTO onboardWithCertificateAndName(final HttpSer }) @PostMapping(OP_ONBOARDING_WITH_SHARED_SECRET_AND_NAME) @ResponseBody - public OnboardingWithNameResponseDTO onboardWithSharedSecretAndName(@RequestBody final OnboardingWithNameRequestDTO onboardingRequest, + public OnboardingWithNameResponseDTO onboardWithSharedSecretAndName(final HttpServletRequest httpServletRequest, + @RequestBody final OnboardingWithNameRequestDTO onboardingRequest, @RequestHeader final HttpHeaders headers) { logger.debug("onboardWithSharedSecretAndName started ..."); authenticateSharedSecret(headers.getFirst(HttpHeaders.AUTHORIZATION)); verifyRequest(onboardingRequest, CommonConstants.ONBOARDING_URI + OP_ONBOARDING_WITH_SHARED_SECRET_AND_NAME); - return onboardingDBService.onboarding(onboardingRequest); + final String host = httpServletRequest.getRemoteHost(); + final String address = httpServletRequest.getRemoteAddr(); + return onboardingDBService.onboarding(onboardingRequest, host, address); } //------------------------------------------------------------------------------------------------- diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java index 15718aa60..cd3e5b3d3 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java @@ -54,7 +54,7 @@ public OnboardingDBService(final OrchestrationDriver orchestration, // methods //------------------------------------------------------------------------------------------------- - public OnboardingWithNameResponseDTO onboarding(final OnboardingWithNameRequestDTO onboardingRequest) { + public OnboardingWithNameResponseDTO onboarding(final OnboardingWithNameRequestDTO onboardingRequest, final String host, final String address) { logger.debug("onboarding started..."); final CertificateCreationRequestDTO creationRequestDTO = onboardingRequest.getCreationRequestDTO(); @@ -62,7 +62,7 @@ public OnboardingWithNameResponseDTO onboarding(final OnboardingWithNameRequestD final String certificateSigningRequest; try { - certificateSigningRequest = securityUtilities.createEncodedCSR(creationRequestDTO.getCommonName(), keyPair); + certificateSigningRequest = securityUtilities.createEncodedCSR(creationRequestDTO.getCommonName(), keyPair, host, address); } catch (Exception e) { logger.error(e.getMessage(), e); throw new ArrowheadException("Unable to create certificate signing request: " + e.getMessage()); From 89abd74342470d4b65858edd59170a60ae64c731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Krist=C3=B3f?= Date: Tue, 24 Mar 2020 22:32:10 +0100 Subject: [PATCH 281/301] Fix integer overflow error in CA --- core-common/src/main/java/eu/arrowhead/common/Defaults.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/Defaults.java b/core-common/src/main/java/eu/arrowhead/common/Defaults.java index 0522f9c0b..f26508c58 100644 --- a/core-common/src/main/java/eu/arrowhead/common/Defaults.java +++ b/core-common/src/main/java/eu/arrowhead/common/Defaults.java @@ -33,7 +33,7 @@ public class Defaults { // CA defaults public static final long DEFAULT_CA_CERT_VALIDITY_NEG_OFFSET_MILLIS = 5000; - public static final long DEFAULT_CA_CERT_VALIDITY_POS_OFFSET_MILLIS = 1000 * 3600 * 24 * 365; + public static final long DEFAULT_CA_CERT_VALIDITY_POS_OFFSET_MILLIS = 1000L * 3600 * 24 * 365; //------------------------------------------------------------------------------------------------- private Defaults() { throw new UnsupportedOperationException(); From f2fd5a04c79a7094180942b6360043ddbb085e73 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Wed, 25 Mar 2020 12:53:43 +0100 Subject: [PATCH 282/301] introduction of certificate type --- .../arrowhead/common/SecurityUtilities.java | 19 +++++----- .../common/dto/internal/CertificateType.java | 38 +++++++++++++++++++ 2 files changed, 48 insertions(+), 9 deletions(-) create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateType.java diff --git a/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java b/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java index 6ec50986e..11a812c86 100644 --- a/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java @@ -1,5 +1,6 @@ package eu.arrowhead.common; +import eu.arrowhead.common.dto.internal.CertificateType; import eu.arrowhead.common.dto.shared.CertificateCreationRequestDTO; import eu.arrowhead.common.exception.AuthException; import org.apache.logging.log4j.LogManager; @@ -79,7 +80,7 @@ public static String getCertificateCNFromRequest(final HttpServletRequest reques } //------------------------------------------------------------------------------------------------- - public String createEncodedCSR(final String baseCommonName, final KeyPair keyPair, final String host, final String address) + public String createEncodedCSR(final String baseCommonName, final KeyPair keyPair, final String host, final String address, final CertificateType type) throws IOException, CertificateException, NoSuchAlgorithmException, KeyStoreException, OperatorCreationException { Assert.notNull(sslProperties.getKeyStore(), "KeyStore property must not be null!"); @@ -92,12 +93,12 @@ public String createEncodedCSR(final String baseCommonName, final KeyPair keyPai // "CN=...arrowhead.eu, OU=, O=arrowhead, C=eu" final String cloudName = getCloudName(cloudCertFromKeyStore.getSubjectDN()); - final String operator = getOperatorName(cloudCertFromKeyStore.getSubjectDN()); - final String organization = getOrganization(cloudCertFromKeyStore.getSubjectDN()); - final String country = getCountry(cloudCertFromKeyStore.getSubjectDN()); + //final String operator = getOperatorName(cloudCertFromKeyStore.getSubjectDN()); + //final String organization = getOrganization(cloudCertFromKeyStore.getSubjectDN()); + //final String country = getCountry(cloudCertFromKeyStore.getSubjectDN()); //final String commonName = String.format("CN=%s.%s, OU=%s, O=%s, C=%s", // baseCommonName, cloudName, operator, organization, country); - final String commonName = String.format("CN=%s.%s", baseCommonName, cloudName); + final String commonName = String.format("CN=%s.%s.%s", baseCommonName, type.getCommonNamePart(), cloudName); final X500Name x500Name = new X500Name(commonName); logger.debug("Building and Signing Certificate Signing Request for {}", x500Name); @@ -116,8 +117,8 @@ public String createEncodedCSR(final String baseCommonName, final KeyPair keyPai namesBuilder.addName(new GeneralName(GeneralName.iPAddress, address)); } - final Extension extension = new Extension(Extension.subjectAlternativeName, false, new DEROctetString(namesBuilder.build())); - builder.addAttribute(PKCSObjectIdentifiers.pkcs_9_at_extensionRequest, new Extensions(extension)); + final Extension extAlternativeNames = new Extension(Extension.subjectAlternativeName, false, new DEROctetString(namesBuilder.build())); + builder.addAttribute(PKCSObjectIdentifiers.pkcs_9_at_extensionRequest, new Extensions(extAlternativeNames)); final JcaContentSignerBuilder contentSignerBuilder = new JcaContentSignerBuilder(SIGNATURE_ALGORITHM); final ContentSigner contentSigner = contentSignerBuilder.build(keyPair.getPrivate()); @@ -127,12 +128,12 @@ public String createEncodedCSR(final String baseCommonName, final KeyPair keyPai } //------------------------------------------------------------------------------------------------- - public KeyPair generateKeyPair() { + private KeyPair generateKeyPair() { return keyPairGenerator.generateKeyPair(); } //------------------------------------------------------------------------------------------------- - public KeyPair getKeyPairFromBase64EncodedStrings(final String encodedPublicKey, + private KeyPair getKeyPairFromBase64EncodedStrings(final String encodedPublicKey, final String encodedPrivateKey) { final PublicKey publicKey = getPublicKeyFromBase64EncodedString(encodedPublicKey); final PrivateKey privateKey = getPrivateKeyFromBase64EncodedString(encodedPrivateKey); diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateType.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateType.java new file mode 100644 index 000000000..758082fea --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateType.java @@ -0,0 +1,38 @@ +package eu.arrowhead.common.dto.internal; + +public enum CertificateType { + + ONBOARDING("onboarding"), + DEVICE("device"), + SYSTEM("system"), + SERVICE("service"), + UNKNOWN("unknown"); + + private final String commonNamePart; + + private CertificateType(final String commonNamePart) { + this.commonNamePart = commonNamePart; + } + + public static CertificateType getTypeFromCN(final String commonName) { + final String[] split = commonName.split("\\."); + if (split.length >= 2) { + return CertificateType.getTypeFromCNPart(split[1]); + } + + return UNKNOWN; + } + + private static CertificateType getTypeFromCNPart(final String commonNamePart) { + for (CertificateType type : values()) { + if (type.commonNamePart.equalsIgnoreCase(commonNamePart)) { + return type; + } + } + return UNKNOWN; + } + + public String getCommonNamePart() { + return commonNamePart; + } +} From 3a1b5462b311aa9ac9c5ef79f0e8604078c4214e Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Wed, 25 Mar 2020 13:16:55 +0100 Subject: [PATCH 283/301] reverted demo tests --- .../CertificateAuthorityUtils.java | 78 +++++++++---------- 1 file changed, 36 insertions(+), 42 deletions(-) diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java index 38c801197..6d3e000bd 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java @@ -1,23 +1,11 @@ package eu.arrowhead.core.certificate_authority; -import java.math.BigInteger; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.security.PrivateKey; -import java.security.PublicKey; -import java.security.SecureRandom; -import java.security.cert.CertificateEncodingException; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.util.ArrayList; -import java.util.Base64; -import java.util.Date; -import java.util.List; -import java.util.ServiceConfigurationError; - +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; +import eu.arrowhead.common.exception.AuthException; +import eu.arrowhead.common.exception.BadPayloadException; +import eu.arrowhead.common.exception.DataNotFoundException; +import eu.arrowhead.common.exception.InvalidParameterException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.bouncycastle.asn1.pkcs.Attribute; @@ -44,12 +32,20 @@ import org.bouncycastle.pkcs.PKCSException; import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest; -import eu.arrowhead.common.Utilities; -import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; -import eu.arrowhead.common.exception.AuthException; -import eu.arrowhead.common.exception.BadPayloadException; -import eu.arrowhead.common.exception.DataNotFoundException; -import eu.arrowhead.common.exception.InvalidParameterException; +import java.math.BigInteger; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.SecureRandom; +import java.security.cert.CertificateEncodingException; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Base64; +import java.util.Date; +import java.util.List; +import java.util.ServiceConfigurationError; class CertificateAuthorityUtils { @@ -58,6 +54,9 @@ class CertificateAuthorityUtils { private static final String PROVIDER = "BC"; private static final String SIGNATURE_ALGORITHM = "SHA256withRSA"; + private CertificateAuthorityUtils() { + } + static JcaPKCS10CertificationRequest decodePKCS10CSR(CertificateSigningRequestDTO csr) { try { final byte[] csrBytes = Base64.getDecoder().decode(csr.getEncodedCSR()); @@ -121,26 +120,26 @@ static PublicKey getClientKey(JcaPKCS10CertificationRequest csr) { } catch (InvalidKeyException | NoSuchAlgorithmException | NullPointerException e) { // This should not be possible after a successful signature verification throw new DataNotFoundException("Extracting the public key from the CSR failed (" + e.getMessage() + ")", - e); + e); } } static X509Certificate buildCertificate(JcaPKCS10CertificationRequest csr, PrivateKey cloudPrivateKey, - X509Certificate cloudCertificate, Date validFrom, Date validUntil, SecureRandom random) { + X509Certificate cloudCertificate, Date validFrom, Date validUntil, SecureRandom random) { final BigInteger serial = new BigInteger(32, random); final PublicKey clientKey = getClientKey(csr); X509v3CertificateBuilder builder = new JcaX509v3CertificateBuilder(cloudCertificate, serial, validFrom, - validUntil, csr.getSubject(), clientKey); + validUntil, csr.getSubject(), clientKey); addCertificateExtensions(builder, csr, clientKey, cloudCertificate); JcaContentSignerBuilder signerBuilder = new JcaContentSignerBuilder(SIGNATURE_ALGORITHM).setProvider(PROVIDER); try { return new JcaX509CertificateConverter().setProvider(PROVIDER) - .getCertificate(builder.build(signerBuilder.build(cloudPrivateKey))); + .getCertificate(builder.build(signerBuilder.build(cloudPrivateKey))); } catch (CertificateException e) { throw new BadPayloadException("Certificate encoding failed! (" + e.getMessage() + ")", e); } catch (OperatorCreationException e) { @@ -153,34 +152,32 @@ static X509Certificate buildCertificate(JcaPKCS10CertificationRequest csr, Priva *
      *
    1. The subject alternative name makes possible to use the certificate for * accessing a host via IP address or hostname
    2. - * + * *
    3. The subject key identifier provides a hashed value that should uniquely * identify the public key
    4. - * + * *
    5. The authority key identifier provides a hashed value that should uniquely * identify the issuer of the certificate
    6. - * + * *
    7. And this basic constraint is for forbidding issuing other certificates * under this certificate
    8. *
    */ static void addCertificateExtensions(X509v3CertificateBuilder builder, JcaPKCS10CertificationRequest csr, - PublicKey clientKey, X509Certificate cloudCertificate) { - return; // testing - /* + PublicKey clientKey, X509Certificate cloudCertificate) { try { JcaX509ExtensionUtils extUtils = new JcaX509ExtensionUtils(); final List subjectAlternativeNames = getSubjectAlternativeNames(csr); builder.addExtension(Extension.subjectAlternativeName, false, - new GeneralNames(subjectAlternativeNames.toArray(new GeneralName[] {}))); + new GeneralNames(subjectAlternativeNames.toArray(new GeneralName[]{}))); builder.addExtension(Extension.subjectKeyIdentifier, false, extUtils.createSubjectKeyIdentifier(clientKey)); builder.addExtension(Extension.authorityKeyIdentifier, false, - extUtils.createAuthorityKeyIdentifier(cloudCertificate)); - //builder.addExtension(Extension.basicConstraints, true, new BasicConstraints(false)); + extUtils.createAuthorityKeyIdentifier(cloudCertificate)); + builder.addExtension(Extension.basicConstraints, true, new BasicConstraints(false)); } catch (NoSuchAlgorithmException | CertIOException | CertificateEncodingException | NullPointerException e) { throw new InvalidParameterException("Appending extensions to the certificate failed! (" + e.getMessage() + ")", e); - }*/ + } } static List getSubjectAlternativeNames(JcaPKCS10CertificationRequest csr) { @@ -196,7 +193,7 @@ static List getSubjectAlternativeNames(JcaPKCS10CertificationReques if (attribute.getAttrType().equals(PKCSObjectIdentifiers.pkcs_9_at_extensionRequest)) { final Extensions extensions = Extensions.getInstance(attribute.getAttrValues().getObjectAt(0)); final GeneralNames generalNames = GeneralNames.fromExtensions(extensions, - Extension.subjectAlternativeName); + Extension.subjectAlternativeName); if (generalNames != null && generalNames.getNames() != null && generalNames.getNames().length > 0) { for (final GeneralName name : generalNames.getNames()) { if (name.getTagNo() == GeneralName.dNSName || name.getTagNo() == GeneralName.iPAddress) { @@ -209,7 +206,4 @@ static List getSubjectAlternativeNames(JcaPKCS10CertificationReques return alternativeNames; } - - private CertificateAuthorityUtils() { - } } From 7c996361a33dd18ec0d7172e3f7be092479bf583 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Wed, 25 Mar 2020 13:36:04 +0100 Subject: [PATCH 284/301] changed demo tests --- .../core/orchestrator/service/OrchestratorDriver.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java index c0e05f754..16a7f150c 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java @@ -431,7 +431,10 @@ private List convertServiceInterfaceListToServiceInterfaceIdList(final Lis // method may change providers list private void filterProviderListUsingAuthorizationResult(final List providers, final AuthorizationIntraCloudCheckResponseDTO authResult) { logger.debug("filterProviderListUsingAuthorizationResult started..."); - + + // disabled for demo purposes + + /* if (authResult.getAuthorizedProviderIdsWithInterfaceIds().isEmpty()) { // consumer has no access to any of the specified providers providers.clear(); @@ -447,6 +450,7 @@ private void filterProviderListUsingAuthorizationResult(final List Date: Thu, 26 Mar 2020 01:27:33 +0100 Subject: [PATCH 285/301] Generate CA keystore with deb installer --- .../src/deb/control/postinst | 8 +- core-common/src/deb/ahconf.sh | 117 ++++++++++++++++-- 2 files changed, 108 insertions(+), 17 deletions(-) diff --git a/certificate-authority/src/deb/control/postinst b/certificate-authority/src/deb/control/postinst index e7ed018aa..a47d9de5a 100644 --- a/certificate-authority/src/deb/control/postinst +++ b/certificate-authority/src/deb/control/postinst @@ -42,13 +42,7 @@ case "$1" in mkdir -p ${SYSTEM_DIR} fi - ah_cert_signed_system ${SYSTEM_NAME} - - # modify log config and application.properties - - ah_transform_log_file ${SYSTEM_DIR} - - db_get arrowhead-core-common/db_host; db_host=$RET || true + ah_ca_keystore ${SYSTEM_NAME} mv ${SYSTEM_DIR}/application.properties ${SYSTEM_DIR}/application.properties.orig cat ${SYSTEM_DIR}/application.properties.orig | \ diff --git a/core-common/src/deb/ahconf.sh b/core-common/src/deb/ahconf.sh index 1242632b7..0b2ea2cb3 100644 --- a/core-common/src/deb/ahconf.sh +++ b/core-common/src/deb/ahconf.sh @@ -190,6 +190,23 @@ ah_ip_valid () { fi } +ah_subject_alternative_names() { + host=${1} + ip=${2} + + san="IP:127.0.0.1,DNS:localhost,DNS:${host},IP:${ip}" + + if [ ! -z ${AH_DOMAIN_NAME} ]; then + if ah_ip_valid ${AH_DOMAIN_NAME}; then + san=${san},IP:${AH_DOMAIN_NAME} + else + san=${san},DNS:${AH_DOMAIN_NAME} + fi + fi + + return san +} + ah_cert_signed_system () { name=${1} passwd=${2} @@ -218,15 +235,7 @@ ah_cert_signed_system () { src_file="${AH_CLOUDS_DIR}/${AH_CLOUD_NAME}.p12" if [ ! -f "${file}" ]; then - san="IP:127.0.0.1,DNS:localhost,DNS:${host},IP:${ip}" - - if [ ! -z ${AH_DOMAIN_NAME} ]; then - if ah_ip_valid ${AH_DOMAIN_NAME}; then - san=${san},IP:${AH_DOMAIN_NAME} - else - san=${san},DNS:${AH_DOMAIN_NAME} - fi - fi + san=ah_subject_alternative_names ${host} ${ip} ah_cert ${path} ${name} "${name}.${AH_CLOUD_NAME}.${AH_OPERATOR}.arrowhead.eu" ${passwd} @@ -266,6 +275,94 @@ ah_cert_signed_system () { fi } +# Create the keystore for the CA system +# Apart from being a regular Arrowhead compliant system keystore, +# it also has to contain the private key of the cloud +ah_ca_keystore () { + ca_sys_name=${1} # name of the CA system + host=${2} # hostname of the CA system (default: `hostname`) + ip=${3} # IP address of the CA system (default: $OWN_IP) + cloud_keystore=${4} # path of the cloud keystore (default: "${AH_CLOUDS_DIR}/${AH_CLOUD_NAME}.p12") + ca_password=${5} # password used in the CA keystore (default: $AH_PASS_CERT) + cloud_password=${6} # password used in the cloud keystore (default: $AH_PASS_CERT) + cloud_alias_src=${7} # cloud cert alias in the cloud keystore (default: $AH_CLOUD_NAME) + cloud_alias_dst=${8} # cloud cert alias in the CA keystore (default: $AH_CLOUD_NAME) + + if [ -z ${host} ]; then + host=`hostname` + fi + + if [ -z ${ip} ]; then + ip=${OWN_IP} + fi + + if [ -z ${cloud_keystore} ]; then + cloud_keystore="${AH_CLOUDS_DIR}/${AH_CLOUD_NAME}.p12" + fi + + if [ -z ${ca_password} ]; then + ca_password=${AH_PASS_CERT} + fi + + if [ -z ${cloud_password} ]; then + cloud_password=${ca_password} + fi + + if [ -z ${cloud_alias_src} ]; then + cloud_alias_src=${AH_CLOUD_NAME} + fi + + if [ -z ${cloud_alias_dst} ]; then + cloud_alias_dst=${cloud_alias_src} + fi + + ca_sys_dir="${AH_SYSTEMS_DIR}/${ca_sys_name}" + ca_keystore="${ca_sys_dir}/${ca_sys_name}.p12" + + if [ ! -f "${ca_keystore}" ]; then + san=ah_subject_alternative_names ${host} ${ip} + + # generate CA system keypair + ah_cert ${ca_sys_dir} ${ca_sys_name} "${ca_sys_name}.${AH_CLOUD_NAME}.${AH_OPERATOR}.arrowhead.eu" ${ca_password} + + # import cloud keypair + # this is necessary, because CA signs system certificates with the cloud cert + keytool -importkeystore \ + -srckeypass ${cloud_password} \ + -srcstorepass ${cloud_password} \ + -destkeypass ${ca_password} \ + -deststorepass ${ca_password} \ + -srcalias ${cloud_alias_src} \ + -destalias ${cloud_alias_dst} \ + -srckeystore "${cloud_keystore}" \ + -destkeystore "${ca_keystore}" \ + -deststoretype PKCS12 + + # sign CA system cert with the cloud cert + keytool -certreq \ + -alias ${ca_sys_name} \ + -keypass ${ca_password} \ + -keystore "${ca_keystore}" \ + -storepass ${ca_password} \ + | keytool -gencert \ + -alias ${cloud_alias_dst} \ + -keypass ${ca_password} \ + -keystore "${ca_keystore}" \ + -storepass ${ca_password} \ + -validity 3650 \ + -ext SubjectAlternativeName=${san} \ + | keytool -importcert \ + -alias ${ca_sys_name} \ + -keypass ${ca_password} \ + -keystore "${ca_keystore}" \ + -storepass ${ca_password} \ + -noprompt + + # import root certificate + ah_cert_import "${AH_CONF_DIR}" "master" "${ca_sys_dir}" ${ca_sys_name} ${ca_password} + fi +} + ah_cert_trust () { dst_path=${1} src_path=${2} @@ -359,4 +456,4 @@ ah_transform_log_file () { rm ${log_path}/log4j2.xml.orig chown :arrowhead ${log_path}/log4j2.xml chmod 640 ${log_path}/log4j2.xml -} \ No newline at end of file +} From 8903e7144a4b2d088f650847df22a2e6961800fc Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Thu, 26 Mar 2020 09:11:12 +0100 Subject: [PATCH 286/301] proposed utility changes --- .../CertificateAuthorityService.java | 5 +- .../CertificateAuthorityUtils.java | 7 +-- .../java/eu/arrowhead/common/Utilities.java | 58 +++++++++++++++---- 3 files changed, 53 insertions(+), 17 deletions(-) diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java index 929021cde..4c4e71d5a 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityService.java @@ -21,7 +21,6 @@ import java.security.SecureRandom; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; -import java.time.Duration; import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Date; @@ -70,8 +69,8 @@ public CertificateSigningResponseDTO signCertificate(CertificateSigningRequestDT logger.info("Signing certificate for " + csr.getSubject().toString() + "..."); - final PrivateKey cloudPrivateKey = Utilities.getPrivateKey(keyStore, cloudCommonName, - sslProperties.getKeyPassword()); + final PrivateKey cloudPrivateKey = Utilities.getCloudPrivateKey(keyStore, cloudCommonName, + sslProperties.getKeyPassword()); final X509Certificate clientCertificate = buildCertificate(csr, cloudPrivateKey, cloudCertificate); final List encodedCertificateChain = buildEncodedCertificateChain(clientCertificate); diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java index 38c801197..6fc5bf76a 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java @@ -166,8 +166,7 @@ static X509Certificate buildCertificate(JcaPKCS10CertificationRequest csr, Priva */ static void addCertificateExtensions(X509v3CertificateBuilder builder, JcaPKCS10CertificationRequest csr, PublicKey clientKey, X509Certificate cloudCertificate) { - return; // testing - /* + try { JcaX509ExtensionUtils extUtils = new JcaX509ExtensionUtils(); @@ -177,10 +176,10 @@ static void addCertificateExtensions(X509v3CertificateBuilder builder, JcaPKCS10 builder.addExtension(Extension.subjectKeyIdentifier, false, extUtils.createSubjectKeyIdentifier(clientKey)); builder.addExtension(Extension.authorityKeyIdentifier, false, extUtils.createAuthorityKeyIdentifier(cloudCertificate)); - //builder.addExtension(Extension.basicConstraints, true, new BasicConstraints(false)); + builder.addExtension(Extension.basicConstraints, true, new BasicConstraints(false)); } catch (NoSuchAlgorithmException | CertIOException | CertificateEncodingException | NullPointerException e) { throw new InvalidParameterException("Appending extensions to the certificate failed! (" + e.getMessage() + ")", e); - }*/ + } } static List getSubjectAlternativeNames(JcaPKCS10CertificationRequest csr) { diff --git a/core-common/src/main/java/eu/arrowhead/common/Utilities.java b/core-common/src/main/java/eu/arrowhead/common/Utilities.java index d8515de4b..da5a0d583 100644 --- a/core-common/src/main/java/eu/arrowhead/common/Utilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/Utilities.java @@ -14,6 +14,7 @@ import eu.arrowhead.common.exception.UnavailableServerException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.bouncycastle.jcajce.provider.asymmetric.X509; import org.springframework.http.HttpStatus; import org.springframework.lang.Nullable; import org.springframework.util.Assert; @@ -398,13 +399,10 @@ public static X509Certificate getCloudCertFromKeyStore(final KeyStore keystore) while (enumeration.hasMoreElements()) { final String alias = enumeration.nextElement(); final X509Certificate certificate = (X509Certificate) keystore.getCertificate(alias); - final String commonName = getCertCNFromSubject(certificate.getSubjectDN().getName()); - Assert.notNull(commonName, "Certificate without commonName is not allowed"); - final String[] cnParts = commonName.split("\\."); - if (cnParts.length == 4 && cnParts[2].equals(AH_MASTER_NAME) && cnParts[3].equals(AH_MASTER_SUFFIX)) { - return (X509Certificate) keystore.getCertificate(alias); - } else if (cnParts.length == 3 && cnParts[1].equals(AH_MASTER_NAME) && cnParts[2].equals(AH_MASTER_SUFFIX)) { - return (X509Certificate) keystore.getCertificate(alias); + + if(isCloudCertificate(certificate)) + { + return certificate; } } @@ -446,6 +444,38 @@ public static X509Certificate getRootCertFromKeyStore(final KeyStore keystore) { } } //------------------------------------------------------------------------------------------------- + public static PrivateKey getCloudPrivateKey(final KeyStore keystore, final String keyPass) { + Assert.notNull(keystore, "Key store is not defined."); + Assert.notNull(keyPass, "Password is not defined."); + + PrivateKey privateKey = null; + String element; + try { + final Enumeration enumeration = keystore.aliases(); + while (enumeration.hasMoreElements()) { + element = enumeration.nextElement(); + + final X509Certificate certificate = (X509Certificate) keystore.getCertificate(element); + if(isCloudCertificate(certificate)) + { + privateKey = (PrivateKey) keystore.getKey(element, keyPass.toCharArray()); + if (privateKey != null) { + break; + } + } + } + } catch (final KeyStoreException | UnrecoverableKeyException | NoSuchAlgorithmException ex) { + logger.error("Getting the private key from key store failed...", ex); + throw new ServiceConfigurationError("Getting the private key from key store failed...", ex); + } + + if (privateKey == null) { + throw new ServiceConfigurationError("Getting the private key failed, key store aliases do not identify a key."); + } + + return privateKey; + } + //------------------------------------------------------------------------------------------------- public static PrivateKey getPrivateKey(final KeyStore keystore, final String keyPass) { Assert.notNull(keystore, "Key store is not defined."); Assert.notNull(keyPass, "Password is not defined."); @@ -456,6 +486,7 @@ public static PrivateKey getPrivateKey(final KeyStore keystore, final String key final Enumeration enumeration = keystore.aliases(); while (enumeration.hasMoreElements()) { element = enumeration.nextElement(); + privateKey = (PrivateKey) keystore.getKey(element, keyPass.toCharArray()); if (privateKey != null) { break; @@ -472,9 +503,8 @@ public static PrivateKey getPrivateKey(final KeyStore keystore, final String key return privateKey; } - //------------------------------------------------------------------------------------------------- - public static PrivateKey getPrivateKey(final KeyStore keystore, final String alias, final String keyPass) { + public static PrivateKey getCloudPrivateKey(final KeyStore keystore, final String alias, final String keyPass) { Assert.notNull(keystore, "Key store is not defined."); Assert.notNull(keyPass, "Password is not defined."); @@ -484,7 +514,7 @@ public static PrivateKey getPrivateKey(final KeyStore keystore, final String ali if (privateKey != null) { return privateKey; } else { - return getPrivateKey(keystore, keyPass); + return getCloudPrivateKey(keystore, keyPass); // throw new ServiceConfigurationError("Getting the private key failed, key store aliases do not identify a key."); } } catch (final KeyStoreException | UnrecoverableKeyException | NoSuchAlgorithmException ex) { @@ -627,4 +657,12 @@ private static PublicKey generatePublicKeyFromByteArray(final byte[] keyBytes) { throw new AuthException("Public key decoding failed due wrong input key", ex); } } + + private static boolean isCloudCertificate(final X509Certificate certificate) + { + final String commonName = getCertCNFromSubject(certificate.getSubjectDN().getName()); + Assert.notNull(commonName, "Certificate without commonName is not allowed"); + final String[] cnParts = commonName.split("\\."); + return (cnParts.length == 4 && cnParts[2].equals(AH_MASTER_NAME) && cnParts[3].equals(AH_MASTER_SUFFIX)); + } } \ No newline at end of file From 64bfd831e5329255fbb5395fdc36affcfdad1722 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Sun, 29 Mar 2020 14:13:58 +0200 Subject: [PATCH 287/301] working prototype --- .../CertificateAuthorityUtils.java | 6 +- .../common/ApplicationConfiguration.java | 18 + .../common/ApplicationInitListener.java | 6 - .../eu/arrowhead/common/CommonConstants.java | 33 +- .../arrowhead/common/CoreCommonConstants.java | 4 +- .../arrowhead/common/OrchestrationDriver.java | 148 ----- .../arrowhead/common/SecurityUtilities.java | 205 +++++-- .../eu/arrowhead/common/core/CoreSystem.java | 24 +- .../common/core/CoreSystemService.java | 80 +-- .../drivers/CertificateAuthorityDriver.java | 38 ++ .../common/drivers/DriverUtilities.java | 317 ++++++++++ .../common/drivers/OrchestrationDriver.java | 43 ++ .../common/drivers/ServiceRegistryDriver.java | 74 +++ .../common/dto/internal/CertificateType.java | 38 -- .../shared/CertificateCreationRequestDTO.java | 30 +- .../CertificateCreationResponseDTO.java | 83 +++ .../dto/shared/CertificateResponseDTO.java | 105 ---- .../common/dto/shared/CertificateType.java | 48 ++ .../common/dto/shared/DeviceQueryFormDTO.java | 16 +- .../dto/shared/DeviceQueryResultDTO.java | 9 + .../DeviceRegistryOnboardingResponseDTO.java | 58 ++ ...ceRegistryOnboardingWithCsrRequestDTO.java | 62 ++ ...eRegistryOnboardingWithCsrResponseDTO.java | 23 + ...eRegistryOnboardingWithNameRequestDTO.java | 62 ++ ...RegistryOnboardingWithNameResponseDTO.java | 23 + .../dto/shared/DeviceRegistryRequestDTO.java | 16 + .../dto/shared/DeviceRegistryResponseDTO.java | 14 + .../common/dto/shared/DeviceRequestDTO.java | 16 + .../common/dto/shared/DeviceResponseDTO.java | 14 + .../common/dto/shared/KeyPairDTO.java | 64 ++ .../dto/shared/OnboardingResponseDTO.java | 39 +- .../shared/OnboardingWithCsrRequestDTO.java | 9 + .../shared/OnboardingWithCsrResponseDTO.java | 10 + .../shared/OnboardingWithNameRequestDTO.java | 9 + .../shared/OnboardingWithNameResponseDTO.java | 10 + .../common/dto/shared/ServiceEndpoint.java | 9 + .../dto/shared/ServiceRegistryRequestDTO.java | 51 +- .../shared/ServiceRegistryResponseDTO.java | 19 + .../common/dto/shared/SystemQueryFormDTO.java | 26 +- .../dto/shared/SystemQueryResultDTO.java | 16 +- .../SystemRegistryOnboardingResponseDTO.java | 48 ++ ...emRegistryOnboardingWithCsrRequestDTO.java | 53 ++ ...mRegistryOnboardingWithCsrResponseDTO.java | 24 + ...mRegistryOnboardingWithNameRequestDTO.java | 56 ++ ...RegistryOnboardingWithNameResponseDTO.java | 24 + .../dto/shared/SystemRegistryRequestDTO.java | 18 + .../dto/shared/SystemRegistryResponseDTO.java | 15 + .../common/dto/shared/SystemRequestDTO.java | 11 + .../common/dto/shared/SystemResponseDTO.java | 14 + .../common/exception/ArrowheadException.java | 2 +- .../common/security/AccessControlFilter.java | 9 +- .../common/token/TokenSecurityFilter.java | 9 +- .../core/deviceregistry/Constants.java | 15 + ...DeviceRegistryApplicationInitListener.java | 7 + .../DeviceRegistryController.java | 546 ++---------------- .../DeviceRegistryManagementController.java | 355 ++++++++++++ .../DeviceRegistryOnboardingController.java | 128 ++++ .../core/deviceregistry/Validation.java | 224 +++++++ .../service/DeviceRegistryDBService.java | 167 +++--- .../DeviceRegistryAccessControlFilter.java | 6 +- deviceregistry/src/main/resources/log4j2.xml | 7 +- .../OnboardingApplicationInitListener.java | 84 +-- .../core/onboarding/OnboardingController.java | 20 +- .../database/service/OnboardingDBService.java | 147 ++--- onboarding/src/main/resources/log4j2.xml | 5 +- .../SystemRegistryAccessControlFilter.java | 6 +- 66 files changed, 2657 insertions(+), 1218 deletions(-) create mode 100644 core-common/src/main/java/eu/arrowhead/common/ApplicationConfiguration.java delete mode 100644 core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/drivers/CertificateAuthorityDriver.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/drivers/DriverUtilities.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/drivers/OrchestrationDriver.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/drivers/ServiceRegistryDriver.java delete mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateType.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationResponseDTO.java delete mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateResponseDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateType.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingResponseDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithCsrRequestDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithCsrResponseDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithNameRequestDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithNameResponseDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/KeyPairDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingResponseDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithCsrRequestDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithCsrResponseDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithNameRequestDTO.java create mode 100644 core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithNameResponseDTO.java create mode 100644 deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/Constants.java create mode 100644 deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryManagementController.java create mode 100644 deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryOnboardingController.java create mode 100644 deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/Validation.java diff --git a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java index 6d3e000bd..3e6528319 100644 --- a/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java +++ b/certificate-authority/src/main/java/eu/arrowhead/core/certificate_authority/CertificateAuthorityUtils.java @@ -45,6 +45,7 @@ import java.util.Base64; import java.util.Date; import java.util.List; +import java.util.Objects; import java.util.ServiceConfigurationError; class CertificateAuthorityUtils { @@ -93,8 +94,9 @@ static void checkCommonName(JcaPKCS10CertificationRequest csr, String cloudCN) { if (cloudCN == null || cloudCN.isEmpty()) { throw new BadPayloadException("CloudCN cannot be null"); } - final String clientCN = Utilities.getCertCNFromSubject(csr.getSubject().toString()); - if (!Utilities.isKeyStoreCNArrowheadValid(clientCN, cloudCN)) { + final String clientCN = Objects.requireNonNull(Utilities.getCertCNFromSubject(csr.getSubject().toString())); + + if (!clientCN.endsWith(cloudCN) || clientCN.split("\\.").length > 6) { throw new BadPayloadException( "Certificate request does not have a valid common name! Valid common name: {systemName}." + cloudCN); diff --git a/core-common/src/main/java/eu/arrowhead/common/ApplicationConfiguration.java b/core-common/src/main/java/eu/arrowhead/common/ApplicationConfiguration.java new file mode 100644 index 000000000..0c1afb1a6 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/ApplicationConfiguration.java @@ -0,0 +1,18 @@ +package eu.arrowhead.common; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +@Configuration +public class ApplicationConfiguration { + + //------------------------------------------------------------------------------------------------- + @Bean(CommonConstants.ARROWHEAD_CONTEXT) + public Map getArrowheadContext() { + return new ConcurrentHashMap<>(); + } + +} diff --git a/core-common/src/main/java/eu/arrowhead/common/ApplicationInitListener.java b/core-common/src/main/java/eu/arrowhead/common/ApplicationInitListener.java index 24fabea64..470313077 100644 --- a/core-common/src/main/java/eu/arrowhead/common/ApplicationInitListener.java +++ b/core-common/src/main/java/eu/arrowhead/common/ApplicationInitListener.java @@ -125,12 +125,6 @@ public void destroy() throws InterruptedException { customDestroy(); } - //------------------------------------------------------------------------------------------------- - @Bean(CommonConstants.ARROWHEAD_CONTEXT) - public Map getArrowheadContext() { - return new ConcurrentHashMap<>(); - } - //================================================================================================= // assistant methods diff --git a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java index 845e2c7b2..bc3522a62 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CommonConstants.java @@ -58,9 +58,13 @@ public class CommonConstants { public static final String CORE_SERVICE_SYSTEM_REGISTRY_REGISTER = "system-register"; public static final String CORE_SERVICE_SYSTEM_REGISTRY_UNREGISTER = "system-unregister"; + public static final String CORE_SERVICE_SYSTEM_REGISTRY_ONBOARDING_WITH_NAME = "system-onboarding-with-name"; + public static final String CORE_SERVICE_SYSTEM_REGISTRY_ONBOARDING_WITH_CSR = "system-onboarding-with-csr"; public static final String CORE_SERVICE_DEVICE_REGISTRY_REGISTER = "device-register"; public static final String CORE_SERVICE_DEVICE_REGISTRY_UNREGISTER = "device-unregister"; + public static final String CORE_SERVICE_DEVICE_REGISTRY_ONBOARDING_WITH_NAME = "device-onboarding-with-name"; + public static final String CORE_SERVICE_DEVICE_REGISTRY_ONBOARDING_WITH_CSR = "device-onboarding-with-csr"; public static final String CORE_SERVICE_ONBOARDING_WITH_CERTIFICATE_AND_NAME = "onboarding-with-certificate-and-name"; public static final String CORE_SERVICE_ONBOARDING_WITH_CERTIFICATE_AND_CSR = "onboarding-with-certificate-and-csr"; @@ -87,11 +91,21 @@ public class CommonConstants { public static final String $SERVICE_REGISTRY_ADDRESS_WD = "${" + SERVICE_REGISTRY_ADDRESS + ":" + Defaults.DEFAULT_SERVICE_REGISTRY_ADDRESS + "}"; public static final String SERVICE_REGISTRY_PORT = "sr_port"; public static final String $SERVICE_REGISTRY_PORT_WD = "${" + SERVICE_REGISTRY_PORT + ":" + Defaults.DEFAULT_SERVICE_REGISTRY_PORT + "}"; - + + public static final String ONBOARDING_URI = "/onboarding"; + public static final String ONBOARDING_AUTH_WITH_CERTIFICATE_URI = "/certificate"; + public static final String ONBOARDING_AUTH_WITH_SHARED_SECRET_URI = "/sharedsecret"; + public static final String ONBOARDING_WITH_NAME_URI = "/name"; + public static final String ONBOARDING_WITH_CSR_URI = "/csr"; + public static final String OP_ONBOARDING_WITH_CERTIFICATE_AND_NAME = ONBOARDING_AUTH_WITH_CERTIFICATE_URI + ONBOARDING_WITH_NAME_URI; + public static final String OP_ONBOARDING_WITH_CERTIFICATE_AND_CSR = ONBOARDING_AUTH_WITH_CERTIFICATE_URI + ONBOARDING_WITH_CSR_URI; + public static final String OP_ONBOARDING_WITH_SHARED_SECRET_AND_NAME = ONBOARDING_AUTH_WITH_SHARED_SECRET_URI + ONBOARDING_WITH_NAME_URI; + public static final String OP_ONBOARDING_WITH_SHARED_SECRET_AND_CSR = ONBOARDING_AUTH_WITH_SHARED_SECRET_URI + ONBOARDING_WITH_CSR_URI; + public static final String SERVICE_REGISTRY_URI = "/serviceregistry"; public static final String OP_SERVICE_REGISTRY_REGISTER_URI = "/register"; public static final String OP_SERVICE_REGISTRY_UNREGISTER_URI = "/unregister"; - public static final String OP_SERVICE_REGISTRY_QUERY_URI = "/query"; + public static final String OP_SERVICE_REGISTRY_QUERY_URI = "/query"; public static final String OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_SYSTEM_NAME = "system_name"; public static final String OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_ADDRESS = "address"; public static final String OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_PORT = "port"; @@ -101,6 +115,8 @@ public class CommonConstants { public static final String OP_SYSTEM_REGISTRY_REGISTER_URI = "/register"; public static final String OP_SYSTEM_REGISTRY_UNREGISTER_URI = "/unregister"; public static final String OP_SYSTEM_REGISTRY_QUERY_URI = "/query"; + public static final String OP_SYSTEM_REGISTRY_ONBOARDING_WITH_NAME_URI = ONBOARDING_WITH_NAME_URI; + public static final String OP_SYSTEM_REGISTRY_ONBOARDING_WITH_CSR_URI = ONBOARDING_WITH_CSR_URI; public static final String OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_SYSTEM_NAME = "system_name"; public static final String OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_ADDRESS = "address"; public static final String OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_PORT = "port"; @@ -109,20 +125,11 @@ public class CommonConstants { public static final String OP_DEVICE_REGISTRY_REGISTER_URI = "/register"; public static final String OP_DEVICE_REGISTRY_UNREGISTER_URI = "/unregister"; public static final String OP_DEVICE_REGISTRY_QUERY_URI = "/query"; + public static final String OP_DEVICE_REGISTRY_ONBOARDING_WITH_NAME_URI = ONBOARDING_WITH_NAME_URI; + public static final String OP_DEVICE_REGISTRY_ONBOARDING_WITH_CSR_URI = ONBOARDING_WITH_CSR_URI; public static final String OP_DEVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_DEVICE_NAME = "device_name"; - public static final String OP_DEVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_ADDRESS = "address"; public static final String OP_DEVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_MAC_ADDRESS = "mac_address"; - public static final String ONBOARDING_URI = "/onboarding"; - public static final String ONBOARDING_AUTH_WITH_CERTIFICATE_URI = "/certificate"; - public static final String ONBOARDING_AUTH_WITH_SHARED_SECRET_URI = "/sharedsecret"; - public static final String ONBOARDING_WITH_NAME_URI = "/name"; - public static final String ONBOARDING_WITH_CSR_URI = "/csr"; - public static final String OP_ONBOARDING_WITH_CERTIFICATE_AND_NAME = ONBOARDING_AUTH_WITH_CERTIFICATE_URI + ONBOARDING_WITH_NAME_URI; - public static final String OP_ONBOARDING_WITH_CERTIFICATE_AND_CSR = ONBOARDING_AUTH_WITH_CERTIFICATE_URI + ONBOARDING_WITH_CSR_URI; - public static final String OP_ONBOARDING_WITH_SHARED_SECRET_AND_NAME = ONBOARDING_AUTH_WITH_SHARED_SECRET_URI + ONBOARDING_WITH_NAME_URI; - public static final String OP_ONBOARDING_WITH_SHARED_SECRET_AND_CSR = ONBOARDING_AUTH_WITH_SHARED_SECRET_URI + ONBOARDING_WITH_CSR_URI; - public static final String AUTHORIZATION_URI = "/authorization"; public static final String OP_AUTH_TOKEN_URI = "/token"; public static final String OP_AUTH_KEY_URI = "/publickey"; diff --git a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java index 628b34d68..6a5e76e22 100644 --- a/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java +++ b/core-common/src/main/java/eu/arrowhead/common/CoreCommonConstants.java @@ -56,6 +56,7 @@ public class CoreCommonConstants { public static final String SWAGGER_TAG_MGMT = "Management"; public static final String SWAGGER_TAG_CLIENT = "Client"; public static final String SWAGGER_TAG_PRIVATE = "Private"; + public static final String SWAGGER_TAG_ONBOARDING = "Onboarding"; public static final String SWAGGER_TAG_ALL = "All"; public static final String SERVER_ADDRESS = "server.address"; @@ -176,8 +177,9 @@ public class CoreCommonConstants { public static final String CLOUD_PING_TTL_INTERVAL = "cloud_ping_ttl_interval_minutes"; public static final String $CLOUD_PING_TTL_INTERVAL_WD = "${" + CLOUD_PING_TTL_INTERVAL + ":" + CoreDefaults.DEFAULT_CLOUD_PING_TTL_INTERVAL_MINUTES + "}"; + public static final String CERTIFICATE_FORMAT = "X.509"; - //================================================================================================= + //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- diff --git a/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java b/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java deleted file mode 100644 index 8848f1378..000000000 --- a/core-common/src/main/java/eu/arrowhead/common/OrchestrationDriver.java +++ /dev/null @@ -1,148 +0,0 @@ -package eu.arrowhead.common; - -import eu.arrowhead.common.core.CoreSystemService; -import eu.arrowhead.common.dto.shared.OrchestrationFlags; -import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; -import eu.arrowhead.common.dto.shared.OrchestrationResponseDTO; -import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; -import eu.arrowhead.common.dto.shared.ServiceQueryFormDTO; -import eu.arrowhead.common.dto.shared.ServiceQueryResultDTO; -import eu.arrowhead.common.dto.shared.ServiceRegistryRequestDTO; -import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; -import eu.arrowhead.common.dto.shared.ServiceSecurityType; -import eu.arrowhead.common.dto.shared.SystemRequestDTO; -import eu.arrowhead.common.dto.shared.SystemResponseDTO; -import eu.arrowhead.common.exception.ArrowheadException; -import eu.arrowhead.common.http.HttpService; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpMethod; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Component; -import org.springframework.web.util.UriComponents; - -import java.util.Base64; -import java.util.List; -import java.util.Objects; - -@Component -public class OrchestrationDriver { - - //================================================================================================= - // members - private final Logger logger = LogManager.getLogger(OrchestrationDriver.class); - private final SSLProperties sslProperties; - private final HttpService httpService; - private final CoreSystemRegistrationProperties coreSystemRegistrationProperties; - - @Autowired - public OrchestrationDriver(final SSLProperties sslProperties, final HttpService httpService, - final CoreSystemRegistrationProperties coreSystemRegistrationProperties) { - this.sslProperties = sslProperties; - this.httpService = httpService; - this.coreSystemRegistrationProperties = coreSystemRegistrationProperties; - } - - //================================================================================================= - // methods - - //------------------------------------------------------------------------------------------------- - public void pingService(final SystemResponseDTO system, final String uriPrefix) { - logger.debug("ping started..."); - - final UriComponents echoUri = createUri(system, uriPrefix + CommonConstants.ECHO_URI); - httpService.sendRequest(echoUri, HttpMethod.GET, String.class); - logger.debug("Service at {} is accessible...", echoUri); - } - - //------------------------------------------------------------------------------------------------- - public ServiceQueryResultDTO getService(final CoreSystemService service) { - logger.debug("getService started..."); - final SystemResponseDTO serviceRegistrySystem = new SystemResponseDTO(); - serviceRegistrySystem.setAddress(coreSystemRegistrationProperties.getServiceRegistryAddress()); - serviceRegistrySystem.setPort(coreSystemRegistrationProperties.getServiceRegistryPort()); - - pingService(serviceRegistrySystem, CommonConstants.SERVICE_REGISTRY_URI); - - final UriComponents srQueryUri = createUri(serviceRegistrySystem, - CommonConstants.SERVICE_REGISTRY_URI + CommonConstants.OP_SERVICE_REGISTRY_QUERY_URI); - - final ServiceQueryFormDTO srQueryForm = new ServiceQueryFormDTO - .Builder(service.getServiceDefinition()) - .build(); - - final ResponseEntity httpResponse = httpService - .sendRequest(srQueryUri, HttpMethod.POST, ServiceQueryResultDTO.class, srQueryForm); - final ServiceQueryResultDTO srQueryResult = httpResponse.getBody(); - - if (Objects.isNull(srQueryResult) || srQueryResult.getServiceQueryData().isEmpty()) { - throw new ArrowheadException("Unable to find '" + service.getServiceDefinition() + "' on ServiceRegistry"); - } - - return srQueryResult; - } - - //------------------------------------------------------------------------------------------------- - public ServiceQueryResultDTO getOrchestratorService() { - logger.debug("getOrchestratorService started..."); - return getService(CoreSystemService.ORCHESTRATION_SERVICE); - } - - //------------------------------------------------------------------------------------------------- - public OrchestrationResponseDTO contactOrchestrationService(final ServiceRegistryResponseDTO orchService, final String serviceDefinition) { - - logger.debug("contactOrchestrationService started..."); - pingService(orchService.getProvider(), CommonConstants.ORCHESTRATOR_URI); - - final UriComponents orchUri = createUri(orchService.getProvider(), - CommonConstants.ORCHESTRATOR_URI + CommonConstants.OP_ORCH_PROCESS); - - final SystemRequestDTO requester = new SystemRequestDTO(); - requester.setAddress(coreSystemRegistrationProperties.getCoreSystemDomainName()); - requester.setPort(coreSystemRegistrationProperties.getCoreSystemDomainPort()); - requester.setSystemName(coreSystemRegistrationProperties.getCoreSystemName()); - - final ServiceQueryFormDTO requestForm = new ServiceQueryFormDTO - .Builder(serviceDefinition) - .interfaces(CommonConstants.HTTP_SECURE_JSON) - .build(); - - final OrchestrationFormRequestDTO orchForm = new OrchestrationFormRequestDTO - .Builder(requester) - .requestedService(requestForm) - .flag(OrchestrationFlags.Flag.OVERRIDE_STORE, true) - .build(); - - final ResponseEntity httpResponse = httpService - .sendRequest(orchUri, HttpMethod.POST, OrchestrationResponseDTO.class, orchForm); - final OrchestrationResponseDTO orchQueryResult = httpResponse.getBody(); - - if (Objects.isNull(orchQueryResult) || orchQueryResult.getResponse().isEmpty()) { - throw new ArrowheadException("Unable to find '" + serviceDefinition + "' on OrchestrationSystem"); - } - - return orchQueryResult; - } - - //================================================================================================= - // support methods - - //------------------------------------------------------------------------------------------------- - public UriComponents createUri(final SystemResponseDTO system, final String serviceUri) { - final String scheme = sslProperties.isSslEnabled() ? CommonConstants.HTTPS : CommonConstants.HTTP; - return Utilities.createURI(scheme, - system.getAddress(), - system.getPort(), - serviceUri); - } - - //------------------------------------------------------------------------------------------------- - public UriComponents createUri(final OrchestrationResultDTO result) { - final String scheme = sslProperties.isSslEnabled() ? CommonConstants.HTTPS : CommonConstants.HTTP; - return Utilities.createURI(scheme, - result.getProvider().getAddress(), - result.getProvider().getPort(), - result.getServiceUri()); - } -} diff --git a/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java b/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java index 11a812c86..200d7fe39 100644 --- a/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java @@ -1,8 +1,12 @@ package eu.arrowhead.common; -import eu.arrowhead.common.dto.internal.CertificateType; import eu.arrowhead.common.dto.shared.CertificateCreationRequestDTO; +import eu.arrowhead.common.dto.shared.CertificateCreationResponseDTO; +import eu.arrowhead.common.dto.shared.CertificateType; +import eu.arrowhead.common.dto.shared.KeyPairDTO; +import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.exception.AuthException; +import org.apache.http.HttpStatus; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.bouncycastle.asn1.DEROctetString; @@ -21,8 +25,10 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.springframework.util.Assert; +import org.springframework.util.Base64Utils; import javax.servlet.http.HttpServletRequest; +import java.io.ByteArrayInputStream; import java.io.IOException; import java.security.KeyFactory; import java.security.KeyPair; @@ -33,7 +39,9 @@ import java.security.Principal; import java.security.PrivateKey; import java.security.PublicKey; +import java.security.cert.Certificate; import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.security.spec.InvalidKeySpecException; import java.security.spec.X509EncodedKeySpec; @@ -80,7 +88,77 @@ public static String getCertificateCNFromRequest(final HttpServletRequest reques } //------------------------------------------------------------------------------------------------- - public String createEncodedCSR(final String baseCommonName, final KeyPair keyPair, final String host, final String address, final CertificateType type) + private static String getCommonNameFromCloudCertificate(final Principal principal) { + return Utilities.getCertCNFromSubject(principal.getName()); + } + + //------------------------------------------------------------------------------------------------- + private static String getOperatorNameFromCloudCertificate(final Principal principal) { + return extractCNPart(principal, 2); + } + + //------------------------------------------------------------------------------------------------- + private static String getOrganizationFromCloudCertificate(final Principal principal) { + return extractCNPart(principal, 1); + } + + //------------------------------------------------------------------------------------------------- + private static String getCountryFromCloudCertificate(final Principal principal) { + return extractCNPart(principal, 0); + } + + //------------------------------------------------------------------------------------------------- + private static String extractCNPart(final Principal principal, final int tailIndex) { + Assert.notNull(principal, "Principal must not be null"); + final String fullCN = principal.getName(); + Assert.hasText(fullCN, "Empty common name is not allowed"); + + final String[] strings = fullCN.split("\\."); + + if (tailIndex >= strings.length) { + throw new IllegalArgumentException("Internal error: Unable to extract information from cloud certificate"); + } + + return strings[strings.length - (tailIndex + 1)]; + } + + //------------------------------------------------------------------------------------------------- + public void authenticateCertificate(final HttpServletRequest httpServletRequest, final CertificateType minimumStrength) { + final X509Certificate[] certificates = (X509Certificate[]) httpServletRequest.getAttribute(CommonConstants.ATTR_JAVAX_SERVLET_REQUEST_X509_CERTIFICATE); + + if (sslProperties.isSslEnabled()) { + if (Objects.nonNull(certificates) && certificates.length > 0) { + + final X509Certificate cert = certificates[0]; + final String clientCN = Utilities.getCertCNFromSubject(cert.getSubjectDN().getName()); + final String requestTarget = Utilities.stripEndSlash(httpServletRequest.getRequestURL().toString()); + + if (Objects.isNull(clientCN)) { + logger.debug("Unable to extract common name from client certificate: {}", cert.getSubjectDN()); + throw new AuthException("Client is unauthorized to access " + requestTarget); + } + + final CertificateType type = CertificateType.getTypeFromCN(clientCN); + if (!type.hasMinimumStrength(minimumStrength)) { + logger.debug("{} is not a valid common name, access denied!", clientCN); + throw new AuthException(clientCN + " is unauthorized to access " + requestTarget); + } + + // TODO verification by CA + + } else { + logger.debug("No client certificate given!"); + throw new AuthException("Client certificate in needed!"); + } + } + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + public String createCertificateSigningRequest(final String baseCommonName, final KeyPair keyPair, final String host, final String address, + final CertificateType type) throws IOException, CertificateException, NoSuchAlgorithmException, KeyStoreException, OperatorCreationException { Assert.notNull(sslProperties.getKeyStore(), "KeyStore property must not be null!"); @@ -91,14 +169,14 @@ public String createEncodedCSR(final String baseCommonName, final KeyPair keyPai final KeyStore keyStore = KeyStore.getInstance(sslProperties.getKeyStore().getFile(), sslProperties.getKeyStorePassword().toCharArray()); final X509Certificate cloudCertFromKeyStore = Utilities.getCloudCertFromKeyStore(keyStore); - // "CN=...arrowhead.eu, OU=, O=arrowhead, C=eu" - final String cloudName = getCloudName(cloudCertFromKeyStore.getSubjectDN()); - //final String operator = getOperatorName(cloudCertFromKeyStore.getSubjectDN()); - //final String organization = getOrganization(cloudCertFromKeyStore.getSubjectDN()); - //final String country = getCountry(cloudCertFromKeyStore.getSubjectDN()); - //final String commonName = String.format("CN=%s.%s, OU=%s, O=%s, C=%s", - // baseCommonName, cloudName, operator, organization, country); - final String commonName = String.format("CN=%s.%s.%s", baseCommonName, type.getCommonNamePart(), cloudName); + // "CN=....arrowhead.eu, OU=, O=arrowhead, C=eu" + final String cloudName = getCommonNameFromCloudCertificate(cloudCertFromKeyStore.getSubjectDN()); + final String operator = getOperatorNameFromCloudCertificate(cloudCertFromKeyStore.getSubjectDN()); + final String organization = getOrganizationFromCloudCertificate(cloudCertFromKeyStore.getSubjectDN()); + final String country = getCountryFromCloudCertificate(cloudCertFromKeyStore.getSubjectDN()); + final String commonName = String.format("CN=%s.%s.%s, OU=%s, O=%s, C=%s", + baseCommonName, type.getCommonNamePart(), cloudName, operator, organization, country); + //final String commonName = String.format("CN=%s.%s.%s", baseCommonName, type.getCommonNamePart(), cloudName); final X500Name x500Name = new X500Name(commonName); logger.debug("Building and Signing Certificate Signing Request for {}", x500Name); @@ -128,91 +206,95 @@ public String createEncodedCSR(final String baseCommonName, final KeyPair keyPai } //------------------------------------------------------------------------------------------------- - private KeyPair generateKeyPair() { - return keyPairGenerator.generateKeyPair(); - } + public void extractAndSetPublicKey(final CertificateCreationResponseDTO creationResponseDTO) { + try { + final byte[] certificateBytes = Base64Utils.decodeFromString(creationResponseDTO.getCertificate()); - //------------------------------------------------------------------------------------------------- - private KeyPair getKeyPairFromBase64EncodedStrings(final String encodedPublicKey, - final String encodedPrivateKey) { - final PublicKey publicKey = getPublicKeyFromBase64EncodedString(encodedPublicKey); - final PrivateKey privateKey = getPrivateKeyFromBase64EncodedString(encodedPrivateKey); - return new KeyPair(publicKey, privateKey); + final Certificate certificate; + + try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(certificateBytes)) { + final CertificateFactory certificateFactory = CertificateFactory.getInstance(creationResponseDTO.getCertificateFormat()); + certificate = certificateFactory.generateCertificate(byteArrayInputStream); + } catch (final CertificateException e) { + logger.error("Unable to generate certificate from Base64: {}", creationResponseDTO.getCertificate()); + throw new ArrowheadException("Unable to decode signed certificate", HttpStatus.SC_INTERNAL_SERVER_ERROR); + } + + final PublicKey publicKey = certificate.getPublicKey(); + creationResponseDTO.setKeyPairDTO(encodePublicKey(publicKey)); + + } catch (final IOException e) { + logger.fatal("ByteArrayInputStream should never throw an IOException, but it just did .."); + } } //------------------------------------------------------------------------------------------------- - public KeyPair extractKeyPair(final CertificateCreationRequestDTO creationRequestDTO) { - final String commonName = creationRequestDTO.getCommonName(); - final String encodedPublicKey = creationRequestDTO.getPublicKey(); - final String encodedPrivateKey = creationRequestDTO.getPrivateKey(); + public KeyPair extractOrGenerateKeyPair(final CertificateCreationRequestDTO creationRequestDTO) { + final String commonName = creationRequestDTO.getCommonName(); Assert.isTrue(Utilities.notEmpty(commonName), "CommonName is null or blank"); + + final KeyPairDTO keyPairDTO = creationRequestDTO.getKeyPairDTO(); final KeyPair keyPair; - if (Objects.nonNull(encodedPrivateKey) && Objects.nonNull(encodedPublicKey)) { + if (Objects.nonNull(keyPairDTO) && + Objects.nonNull(keyPairDTO.getPublicKey()) && + Objects.nonNull(keyPairDTO.getPrivateKey())) { + + final String encodedPublicKey = keyPairDTO.getPublicKey(); + final String encodedPrivateKey = keyPairDTO.getPrivateKey(); + keyPair = getKeyPairFromBase64EncodedStrings(encodedPublicKey, encodedPrivateKey); - } - else { + } else { keyPair = generateKeyPair(); } return keyPair; } - //================================================================================================= - // assistant methods - //------------------------------------------------------------------------------------------------- - private PublicKey getPublicKeyFromBase64EncodedString(final String encodedKey) { - Assert.isTrue(Utilities.notEmpty(encodedKey), "Encoded key is null or blank"); + public KeyPairDTO encodePublicKey(final PublicKey publicKey) { + Assert.notNull(publicKey, "PublicKey must not be null"); + final String encodedPublicKey = Base64.getEncoder().encodeToString(publicKey.getEncoded()); + return new KeyPairDTO(publicKey.getAlgorithm(), publicKey.getFormat(), encodedPublicKey, null); + } - final byte[] keyBytes = Base64.getDecoder().decode(encodedKey); - return generatePublicKeyFromByteArray(keyBytes); + //------------------------------------------------------------------------------------------------- + public KeyPairDTO encodeKeyPair(final KeyPair keyPair) { + Assert.notNull(keyPair, "KeyPair must not be null"); + final KeyPairDTO dto = encodePublicKey(keyPair.getPublic()); + if (Objects.nonNull(keyPair.getPrivate())) { dto.setPrivateKey(Base64.getEncoder().encodeToString(keyPair.getPrivate().getEncoded())); } + return dto; } //------------------------------------------------------------------------------------------------- - private PrivateKey getPrivateKeyFromBase64EncodedString(final String encodedKey) { + private PublicKey getPublicKeyFromBase64EncodedString(final String encodedKey) { Assert.isTrue(Utilities.notEmpty(encodedKey), "Encoded key is null or blank"); final byte[] keyBytes = Base64.getDecoder().decode(encodedKey); - return generatePrivateKeyFromByteArray(keyBytes); + return generatePublicKeyFromByteArray(keyBytes); } - //------------------------------------------------------------------------------------------------- - private String getCloudName(final Principal principal) { - return Utilities.getCertCNFromSubject(principal.getName()); - } //------------------------------------------------------------------------------------------------- - private String getOperatorName(final Principal principal) { - return extractCNPart(principal, 2); - } - - //------------------------------------------------------------------------------------------------- - private String getOrganization(final Principal principal) { - return extractCNPart(principal, 1); + private KeyPair generateKeyPair() { + return keyPairGenerator.generateKeyPair(); } //------------------------------------------------------------------------------------------------- - private String getCountry(final Principal principal) { - return extractCNPart(principal, 0); + private KeyPair getKeyPairFromBase64EncodedStrings(final String encodedPublicKey, + final String encodedPrivateKey) { + final PublicKey publicKey = getPublicKeyFromBase64EncodedString(encodedPublicKey); + final PrivateKey privateKey = getPrivateKeyFromBase64EncodedString(encodedPrivateKey); + return new KeyPair(publicKey, privateKey); } //------------------------------------------------------------------------------------------------- + private PrivateKey getPrivateKeyFromBase64EncodedString(final String encodedKey) { + Assert.isTrue(Utilities.notEmpty(encodedKey), "Encoded key is null or blank"); - //------------------------------------------------------------------------------------------------- - private String extractCNPart(final Principal principal, final int tailIndex) { - Assert.notNull(principal, "Principal must not be null"); - final String fullCN = principal.getName(); - Assert.hasText(fullCN, "Empty common name is not allowed"); - - final String[] strings = fullCN.split("\\."); - - if (tailIndex >= strings.length) { - throw new IllegalArgumentException("Internal error: Unable to extract information from cloud certificate"); - } - - return strings[strings.length - (tailIndex + 1)]; + final byte[] keyBytes = Base64.getDecoder().decode(encodedKey); + return generatePrivateKeyFromByteArray(keyBytes); } //------------------------------------------------------------------------------------------------- @@ -234,4 +316,5 @@ private PrivateKey generatePrivateKeyFromByteArray(final byte[] keyBytes) { throw new AuthException("Public key decoding failed due wrong input key", ex); } } + } diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java index 1c606a6c8..4e632c3db 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystem.java @@ -7,14 +7,18 @@ import java.util.Collections; import java.util.List; +import static eu.arrowhead.common.core.CoreSystemService.DEVICE_REGISTRY_ONBOARDING_WITH_NAME_SERVICE; import static eu.arrowhead.common.core.CoreSystemService.DEVICE_REGISTRY_REGISTER_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.DEVICE_REGISTRY_ONBOARDING_WITH_CSR_SERVICE; import static eu.arrowhead.common.core.CoreSystemService.DEVICE_REGISTRY_UNREGISTER_SERVICE; -import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_WITH_CERTIFICATE_AND_CSR; -import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_WITH_CERTIFICATE_AND_NAME; -import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_WITH_SHARED_SECRET_AND_CSR; -import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_WITH_SHARED_SECRET_AND_NAME; +import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_WITH_CERTIFICATE_AND_CSR_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_WITH_CERTIFICATE_AND_NAME_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_WITH_SHARED_SECRET_AND_CSR_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.ONBOARDING_WITH_SHARED_SECRET_AND_NAME_SERVICE; import static eu.arrowhead.common.core.CoreSystemService.SERVICE_REGISTRY_REGISTER_SERVICE; import static eu.arrowhead.common.core.CoreSystemService.SERVICE_REGISTRY_UNREGISTER_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.SYSTEM_REGISTRY_ONBOARDING_WITH_CSR_SERVICE; +import static eu.arrowhead.common.core.CoreSystemService.SYSTEM_REGISTRY_ONBOARDING_WITH_NAME_SERVICE; import static eu.arrowhead.common.core.CoreSystemService.SYSTEM_REGISTRY_REGISTER_SERVICE; import static eu.arrowhead.common.core.CoreSystemService.SYSTEM_REGISTRY_UNREGISTER_SERVICE; @@ -24,10 +28,14 @@ public enum CoreSystem { // elements SERVICE_REGISTRY(Defaults.DEFAULT_SERVICE_REGISTRY_PORT, List.of(SERVICE_REGISTRY_REGISTER_SERVICE, SERVICE_REGISTRY_UNREGISTER_SERVICE)), - SYSTEM_REGISTRY(Defaults.DEFAULT_SYSTEM_REGISTRY_PORT, List.of(SYSTEM_REGISTRY_REGISTER_SERVICE, SYSTEM_REGISTRY_UNREGISTER_SERVICE)), - DEVICE_REGISTRY(Defaults.DEFAULT_DEVICE_REGISTRY_PORT, List.of(DEVICE_REGISTRY_REGISTER_SERVICE, DEVICE_REGISTRY_UNREGISTER_SERVICE)), - ONBOARDING_CONTROLLER(Defaults.DEFAULT_ONBOARDING_PORT, List.of(ONBOARDING_WITH_CERTIFICATE_AND_NAME, ONBOARDING_WITH_SHARED_SECRET_AND_NAME, - ONBOARDING_WITH_CERTIFICATE_AND_CSR, ONBOARDING_WITH_SHARED_SECRET_AND_CSR)), + SYSTEM_REGISTRY(Defaults.DEFAULT_SYSTEM_REGISTRY_PORT, List.of(SYSTEM_REGISTRY_REGISTER_SERVICE, SYSTEM_REGISTRY_UNREGISTER_SERVICE, + SYSTEM_REGISTRY_ONBOARDING_WITH_NAME_SERVICE, SYSTEM_REGISTRY_ONBOARDING_WITH_CSR_SERVICE)), + DEVICE_REGISTRY(Defaults.DEFAULT_DEVICE_REGISTRY_PORT, List.of(DEVICE_REGISTRY_REGISTER_SERVICE, DEVICE_REGISTRY_UNREGISTER_SERVICE, + DEVICE_REGISTRY_ONBOARDING_WITH_NAME_SERVICE, DEVICE_REGISTRY_ONBOARDING_WITH_CSR_SERVICE)), + ONBOARDING_CONTROLLER(Defaults.DEFAULT_ONBOARDING_PORT, List.of(ONBOARDING_WITH_CERTIFICATE_AND_NAME_SERVICE, + ONBOARDING_WITH_SHARED_SECRET_AND_NAME_SERVICE, + ONBOARDING_WITH_CERTIFICATE_AND_CSR_SERVICE, + ONBOARDING_WITH_SHARED_SECRET_AND_CSR_SERVICE)), AUTHORIZATION(Defaults.DEFAULT_AUTHORIZATION_PORT, List.of(CoreSystemService.AUTH_CONTROL_INTRA_SERVICE, CoreSystemService.AUTH_CONTROL_INTER_SERVICE, CoreSystemService.AUTH_TOKEN_GENERATION_SERVICE, CoreSystemService.AUTH_PUBLIC_KEY_SERVICE, CoreSystemService.AUTH_CONTROL_SUBSCRIPTION_SERVICE)), diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java index c4a068c3c..65d4d67e9 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java @@ -4,69 +4,7 @@ import eu.arrowhead.common.Utilities; import org.springframework.util.Assert; -import static eu.arrowhead.common.CommonConstants.AUTHORIZATION_URI; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_AUTH_CONTROL_INTER; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_AUTH_CONTROL_INTRA; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_AUTH_CONTROL_SUBSCRIPTION; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_AUTH_PUBLIC_KEY; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_AUTH_TOKEN_GENERATION; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_DEVICE_REGISTRY_REGISTER; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_DEVICE_REGISTRY_UNREGISTER; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_EVENT_HANDLER_PUBLISH; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_EVENT_HANDLER_PUBLISH_AUTH_UPDATE; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_EVENT_HANDLER_SUBSCRIBE; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_EVENT_HANDLER_UNSUBSCRIBE; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_GATEKEEPER_GSD; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_GATEKEEPER_ICN; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_GATEWAY_CONNECT_CONSUMER; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_GATEWAY_CONNECT_PROVIDER; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_GATEWAY_PUBLIC_KEY; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_WITH_CERTIFICATE_AND_CSR; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_WITH_CERTIFICATE_AND_NAME; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_WITH_SHARED_SECRET_AND_CSR; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_WITH_SHARED_SECRET_AND_NAME; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ORCH_PROCESS; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_QOS_MONITOR_PING_MEASUREMENT; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SERVICE_REGISTRY_REGISTER; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SERVICE_REGISTRY_UNREGISTER; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SYSTEM_REGISTRY_REGISTER; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SYSTEM_REGISTRY_UNREGISTER; -import static eu.arrowhead.common.CommonConstants.DEVICE_REGISTRY_URI; -import static eu.arrowhead.common.CommonConstants.EVENT_HANDLER_URI; -import static eu.arrowhead.common.CommonConstants.GATEKEEPER_URI; -import static eu.arrowhead.common.CommonConstants.GATEWAY_URI; -import static eu.arrowhead.common.CommonConstants.ONBOARDING_URI; -import static eu.arrowhead.common.CommonConstants.OP_AUTH_INTER_CHECK_URI; -import static eu.arrowhead.common.CommonConstants.OP_AUTH_INTRA_CHECK_URI; -import static eu.arrowhead.common.CommonConstants.OP_AUTH_KEY_URI; -import static eu.arrowhead.common.CommonConstants.OP_AUTH_SUBSCRIPTION_CHECK_URI; -import static eu.arrowhead.common.CommonConstants.OP_AUTH_TOKEN_URI; -import static eu.arrowhead.common.CommonConstants.OP_DEVICE_REGISTRY_REGISTER_URI; -import static eu.arrowhead.common.CommonConstants.OP_DEVICE_REGISTRY_UNREGISTER_URI; -import static eu.arrowhead.common.CommonConstants.OP_EVENT_HANDLER_PUBLISH; -import static eu.arrowhead.common.CommonConstants.OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE; -import static eu.arrowhead.common.CommonConstants.OP_EVENT_HANDLER_SUBSCRIBE; -import static eu.arrowhead.common.CommonConstants.OP_EVENT_HANDLER_UNSUBSCRIBE; -import static eu.arrowhead.common.CommonConstants.OP_GATEKEEPER_GSD_SERVICE; -import static eu.arrowhead.common.CommonConstants.OP_GATEKEEPER_ICN_SERVICE; -import static eu.arrowhead.common.CommonConstants.OP_GATEWAY_CONNECT_CONSUMER_URI; -import static eu.arrowhead.common.CommonConstants.OP_GATEWAY_CONNECT_PROVIDER_URI; -import static eu.arrowhead.common.CommonConstants.OP_GATEWAY_KEY_URI; -import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_CERTIFICATE_AND_CSR; -import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_CERTIFICATE_AND_NAME; -import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_SHARED_SECRET_AND_CSR; -import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_SHARED_SECRET_AND_NAME; -import static eu.arrowhead.common.CommonConstants.OP_ORCH_PROCESS; -import static eu.arrowhead.common.CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT; -import static eu.arrowhead.common.CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT_SUFFIX; -import static eu.arrowhead.common.CommonConstants.OP_SERVICE_REGISTRY_REGISTER_URI; -import static eu.arrowhead.common.CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_URI; -import static eu.arrowhead.common.CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI; -import static eu.arrowhead.common.CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_URI; -import static eu.arrowhead.common.CommonConstants.ORCHESTRATOR_URI; -import static eu.arrowhead.common.CommonConstants.QOS_MONITOR_URI; -import static eu.arrowhead.common.CommonConstants.SERVICE_REGISTRY_URI; -import static eu.arrowhead.common.CommonConstants.SYSTEM_REGISTRY_URI; +import static eu.arrowhead.common.CommonConstants.*; public enum CoreSystemService { @@ -107,18 +45,26 @@ public enum CoreSystemService { QOS_MONITOR_URI + OP_QOS_MONITOR_PING_MEASUREMENT + OP_QOS_MONITOR_PING_MEASUREMENT_SUFFIX), // Onboarding services - ONBOARDING_WITH_CERTIFICATE_AND_NAME(CORE_SERVICE_ONBOARDING_WITH_CERTIFICATE_AND_NAME, ONBOARDING_URI + OP_ONBOARDING_WITH_CERTIFICATE_AND_NAME), - ONBOARDING_WITH_CERTIFICATE_AND_CSR(CORE_SERVICE_ONBOARDING_WITH_CERTIFICATE_AND_CSR, ONBOARDING_URI + OP_ONBOARDING_WITH_CERTIFICATE_AND_CSR), - ONBOARDING_WITH_SHARED_SECRET_AND_NAME(CORE_SERVICE_ONBOARDING_WITH_SHARED_SECRET_AND_NAME, ONBOARDING_URI + OP_ONBOARDING_WITH_SHARED_SECRET_AND_NAME), - ONBOARDING_WITH_SHARED_SECRET_AND_CSR(CORE_SERVICE_ONBOARDING_WITH_SHARED_SECRET_AND_CSR, ONBOARDING_URI + OP_ONBOARDING_WITH_SHARED_SECRET_AND_CSR), + ONBOARDING_WITH_CERTIFICATE_AND_NAME_SERVICE(CORE_SERVICE_ONBOARDING_WITH_CERTIFICATE_AND_NAME, ONBOARDING_URI + OP_ONBOARDING_WITH_CERTIFICATE_AND_NAME), + ONBOARDING_WITH_CERTIFICATE_AND_CSR_SERVICE(CORE_SERVICE_ONBOARDING_WITH_CERTIFICATE_AND_CSR, ONBOARDING_URI + OP_ONBOARDING_WITH_CERTIFICATE_AND_CSR), + ONBOARDING_WITH_SHARED_SECRET_AND_NAME_SERVICE(CORE_SERVICE_ONBOARDING_WITH_SHARED_SECRET_AND_NAME, ONBOARDING_URI + OP_ONBOARDING_WITH_SHARED_SECRET_AND_NAME), + ONBOARDING_WITH_SHARED_SECRET_AND_CSR_SERVICE(CORE_SERVICE_ONBOARDING_WITH_SHARED_SECRET_AND_CSR, ONBOARDING_URI + OP_ONBOARDING_WITH_SHARED_SECRET_AND_CSR), // Device Registry services DEVICE_REGISTRY_REGISTER_SERVICE(CORE_SERVICE_DEVICE_REGISTRY_REGISTER, DEVICE_REGISTRY_URI + OP_DEVICE_REGISTRY_REGISTER_URI), DEVICE_REGISTRY_UNREGISTER_SERVICE(CORE_SERVICE_DEVICE_REGISTRY_UNREGISTER, DEVICE_REGISTRY_URI + OP_DEVICE_REGISTRY_UNREGISTER_URI), + DEVICE_REGISTRY_ONBOARDING_WITH_NAME_SERVICE(CORE_SERVICE_DEVICE_REGISTRY_ONBOARDING_WITH_NAME, + DEVICE_REGISTRY_URI + ONBOARDING_URI + OP_DEVICE_REGISTRY_ONBOARDING_WITH_NAME_URI), + DEVICE_REGISTRY_ONBOARDING_WITH_CSR_SERVICE(CORE_SERVICE_DEVICE_REGISTRY_ONBOARDING_WITH_CSR, + DEVICE_REGISTRY_URI + ONBOARDING_URI + OP_DEVICE_REGISTRY_ONBOARDING_WITH_CSR_URI), // System Registry services SYSTEM_REGISTRY_REGISTER_SERVICE(CORE_SERVICE_SYSTEM_REGISTRY_REGISTER, SYSTEM_REGISTRY_URI + OP_SYSTEM_REGISTRY_REGISTER_URI), SYSTEM_REGISTRY_UNREGISTER_SERVICE(CORE_SERVICE_SYSTEM_REGISTRY_UNREGISTER, SYSTEM_REGISTRY_URI + OP_SYSTEM_REGISTRY_UNREGISTER_URI), + SYSTEM_REGISTRY_ONBOARDING_WITH_NAME_SERVICE(CORE_SERVICE_SYSTEM_REGISTRY_ONBOARDING_WITH_NAME, + SYSTEM_REGISTRY_URI + ONBOARDING_URI + OP_SYSTEM_REGISTRY_ONBOARDING_WITH_NAME_URI), + SYSTEM_REGISTRY_ONBOARDING_WITH_CSR_SERVICE(CORE_SERVICE_SYSTEM_REGISTRY_ONBOARDING_WITH_CSR, + SYSTEM_REGISTRY_URI + ONBOARDING_URI + OP_SYSTEM_REGISTRY_ONBOARDING_WITH_CSR_URI), // Service Registry services SERVICE_REGISTRY_REGISTER_SERVICE(CORE_SERVICE_SERVICE_REGISTRY_REGISTER, SERVICE_REGISTRY_URI + OP_SERVICE_REGISTRY_REGISTER_URI), diff --git a/core-common/src/main/java/eu/arrowhead/common/drivers/CertificateAuthorityDriver.java b/core-common/src/main/java/eu/arrowhead/common/drivers/CertificateAuthorityDriver.java new file mode 100644 index 000000000..f41eeba95 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/drivers/CertificateAuthorityDriver.java @@ -0,0 +1,38 @@ +package eu.arrowhead.common.drivers; + +import eu.arrowhead.common.core.CoreSystemService; +import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; +import eu.arrowhead.common.dto.internal.CertificateSigningResponseDTO; +import eu.arrowhead.common.http.HttpService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; +import org.springframework.web.util.UriComponents; + +@Service +public class CertificateAuthorityDriver { + + //================================================================================================= + // members + private final Logger logger = LogManager.getLogger(CertificateAuthorityDriver.class); + private final DriverUtilities driverUtilities; + private final HttpService httpService; + + @Autowired + public CertificateAuthorityDriver(final DriverUtilities driverUtilities, final HttpService httpService) { + this.driverUtilities = driverUtilities; + this.httpService = httpService; + } + + public CertificateSigningResponseDTO signCertificate(final CertificateSigningRequestDTO request) throws DriverUtilities.DriverException { + logger.traceEntry("signCertificate: {}", request); + final UriComponents uri = driverUtilities.findUriByOrchestrator(CoreSystemService.CERTIFICATE_AUTHORITY_SIGN_SERVICE); + final ResponseEntity httpResponse = httpService + .sendRequest(uri, HttpMethod.POST, CertificateSigningResponseDTO.class, request); + final CertificateSigningResponseDTO result = httpResponse.getBody(); + return logger.traceExit(result); + } +} diff --git a/core-common/src/main/java/eu/arrowhead/common/drivers/DriverUtilities.java b/core-common/src/main/java/eu/arrowhead/common/drivers/DriverUtilities.java new file mode 100644 index 000000000..fe516e9d4 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/drivers/DriverUtilities.java @@ -0,0 +1,317 @@ +package eu.arrowhead.common.drivers; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.CoreSystemRegistrationProperties; +import eu.arrowhead.common.SSLProperties; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.core.CoreSystemService; +import eu.arrowhead.common.dto.shared.OrchestrationFlags; +import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; +import eu.arrowhead.common.dto.shared.OrchestrationResponseDTO; +import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; +import eu.arrowhead.common.dto.shared.ServiceQueryFormDTO; +import eu.arrowhead.common.dto.shared.ServiceQueryResultDTO; +import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.ServiceSecurityType; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import eu.arrowhead.common.exception.UnavailableServerException; +import eu.arrowhead.common.http.HttpService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Component; +import org.springframework.web.util.UriComponents; +import org.springframework.web.util.UriComponentsBuilder; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@Component +public class DriverUtilities { + + private final Logger logger = LogManager.getLogger(DriverUtilities.class); + private final CoreSystemRegistrationProperties coreSystemProps; + private final HttpService httpService; + private final SSLProperties sslProperties; + + @Resource(name = CommonConstants.ARROWHEAD_CONTEXT) + private Map arrowheadContext; + + @Autowired + public DriverUtilities(final CoreSystemRegistrationProperties coreSystemProps, + final HttpService httpService, + final SSLProperties sslProperties) { + super(); + this.coreSystemProps = coreSystemProps; + this.httpService = httpService; + this.sslProperties = sslProperties; + } + + //------------------------------------------------------------------------------------------------- + public T getContext(final String key) { + return (T) arrowheadContext.get(key); + } + + //------------------------------------------------------------------------------------------------- + public T getContext(final String key, final T defaultValue) { + return (T) arrowheadContext.getOrDefault(key, defaultValue); + } + + //------------------------------------------------------------------------------------------------- + public boolean containsContext(final String key) { + return arrowheadContext.containsKey(key); + } + + //------------------------------------------------------------------------------------------------- + public boolean pingService(final UriComponents echoUri) { + try { + httpService.sendRequest(echoUri, HttpMethod.GET, String.class); + logger.debug("Service at {} is accessible...", echoUri); + return true; + } catch (final Exception e) { + logger.debug("Service at {} is not accessible: {}: {}", echoUri, e.getClass().getSimpleName(), e.getMessage()); + return false; + } + } + + //------------------------------------------------------------------------------------------------- + public boolean pingService(final ServiceSecurityType securityType, final SystemResponseDTO system, final String systemUri) { + final UriComponents echoUri = createUri(securityType, system, systemUri + CommonConstants.ECHO_URI); + return pingService(echoUri); + } + + public UriComponents findUriByContext(final CoreSystemService service) throws DriverException { + logger.debug("Searching for '{}' uri in context ...", service.getServiceDefinition()); + final String key = getCoreSystemServiceKey(service); + if (containsContext(key)) { + final UriComponents serviceUri = getContext(key); + final UriComponents echoUri = createEchoUri(serviceUri); + if (pingService(echoUri)) { + return serviceUri; + } + } + + throw DriverException.notFoundByArrowheadContext(service); + } + + public ServiceRegistryResponseDTO findByServiceRegistry(final CoreSystemService service, final boolean pingTarget) throws DriverException { + logger.debug("findByServiceRegistry started..."); + final UriComponents queryUri = getServiceRegistryQueryUri(); + final ServiceQueryFormDTO form = new ServiceQueryFormDTO.Builder(service.getServiceDefinition()) + .interfaces(getInterface()) + .build(); + final ResponseEntity response = httpService.sendRequest(queryUri, HttpMethod.POST, ServiceQueryResultDTO.class, form); + final ServiceQueryResultDTO result = response.getBody(); + + if (Objects.isNull(result) || Objects.isNull(result.getServiceQueryData()) || result.getServiceQueryData().isEmpty()) { + throw DriverException.notFoundByServiceRegistry(service); + } + + final List serviceQueryData = result.getServiceQueryData(); + + for (int reverseIndex = serviceQueryData.size() - 1; reverseIndex >= 0; reverseIndex--) { + final ServiceRegistryResponseDTO entry = serviceQueryData.get(reverseIndex); + final UriComponents uri = createUri(entry); + if (!pingTarget) { + arrowheadContext.putIfAbsent(getCoreSystemServiceKey(service), uri); + return entry; + } else if (pingService(createEchoUri(uri))) { + arrowheadContext.putIfAbsent(getCoreSystemServiceKey(service), uri); + return entry; + } + } + + throw DriverException.notFoundByServiceRegistry(service); + } + + public UriComponents findUriByServiceRegistry(final CoreSystemService service) throws DriverException { + + try { + return findUriByContext(service); + } catch (final DriverException e) { + logger.debug(e.getMessage()); + } + + logger.debug("findUriByServiceRegistry started..."); + final ServiceRegistryResponseDTO entry = findByServiceRegistry(service, true); + return createUri(entry); + } + + public UriComponents findUriByOrchestrator(final CoreSystemService service) throws DriverException { + + try { + return findUriByContext(service); + } catch (final DriverException e) { + logger.debug(e.getMessage()); + } + + logger.debug("findUriByOrchestrator started..."); + final UriComponents queryUri = getOrchestrationQueryUri(); + final SystemRequestDTO requester = new SystemRequestDTO(); + requester.setAddress(coreSystemProps.getCoreSystemDomainName()); + requester.setPort(coreSystemProps.getCoreSystemDomainPort()); + requester.setSystemName(coreSystemProps.getCoreSystemName()); + + final ServiceQueryFormDTO serviceQueryForm = new ServiceQueryFormDTO.Builder(service.getServiceDefinition()) + .interfaces(getInterface()) + .build(); + + final OrchestrationFormRequestDTO orchestrationForm = new OrchestrationFormRequestDTO + .Builder(requester) + .requestedService(serviceQueryForm) + .flag(OrchestrationFlags.Flag.OVERRIDE_STORE, true) + .build(); + + final ResponseEntity httpResponse = httpService + .sendRequest(queryUri, HttpMethod.POST, OrchestrationResponseDTO.class, orchestrationForm); + final OrchestrationResponseDTO response = httpResponse.getBody(); + + if (Objects.isNull(response) || Objects.isNull(response.getResponse()) || response.getResponse().isEmpty()) { + throw DriverException.notFoundByOrchestrator(service); + } + + final List result = response.getResponse(); + + for (int reverseIndex = result.size() - 1; reverseIndex >= 0; reverseIndex--) { + final OrchestrationResultDTO entry = result.get(reverseIndex); + final UriComponents uri = createUri(entry); + if (pingService(createEchoUri(uri))) { + arrowheadContext.put(getCoreSystemServiceKey(service), uri); + return uri; + } + } + + throw DriverException.notFoundByOrchestrator(service); + } + + public UriComponents createUri(final ServiceRegistryResponseDTO entry) { + return createUri(entry.getSecure(), entry.getProvider(), entry.getServiceUri()); + } + + public UriComponents createUri(final OrchestrationResultDTO entry) { + return createUri(entry.getSecure(), entry.getProvider(), entry.getServiceUri()); + } + + public UriComponents createUri(final ServiceSecurityType securityType, final SystemResponseDTO system, final String serviceUri) { + return Utilities.createURI(getScheme(securityType), + system.getAddress(), + system.getPort(), + serviceUri); + } + + public UriComponents createEchoUri(final UriComponents serviceUri) { + return UriComponentsBuilder.newInstance() + .scheme(serviceUri.getScheme()) + .host(serviceUri.getHost()) + .port(serviceUri.getPort()) + .path(extractSystemUriPath(serviceUri)) + .path(CommonConstants.ECHO_URI) + .build(); + } + + //------------------------------------------------------------------------------------------------- + public UriComponents createCustomUri(final UriComponents serviceUri, final String systemUri, final String postfix) { + return UriComponentsBuilder.newInstance() + .uriComponents(serviceUri) + .replacePath(systemUri) + .path(postfix) + .build(); + } + + //------------------------------------------------------------------------------------------------- + public UriComponents createCustomUri(final UriComponents serviceUri, final String postfix) { + return UriComponentsBuilder.newInstance() + .uriComponents(serviceUri) + .path(extractSystemUriPath(serviceUri)) + .path(postfix) + .build(); + } + + public String getCoreSystemServiceKey(final CoreSystemService service) { + return service.getServiceDefinition() + CoreCommonConstants.URI_SUFFIX; + } + + protected UriComponents getServiceRegistryQueryUri() { + logger.debug("getServiceRegistryQueryUri started..."); + + if (arrowheadContext.containsKey(CoreCommonConstants.SR_QUERY_URI)) { + return (UriComponents) arrowheadContext.get(CoreCommonConstants.SR_QUERY_URI); + } else { + final String scheme = sslProperties.isSslEnabled() ? CommonConstants.HTTPS : CommonConstants.HTTP; + final String registerUriStr = CommonConstants.SERVICE_REGISTRY_URI + CommonConstants.OP_SERVICE_REGISTRY_QUERY_URI; + final UriComponents uri = Utilities.createURI(scheme, coreSystemProps.getServiceRegistryAddress(), + coreSystemProps.getServiceRegistryPort(), registerUriStr); + arrowheadContext.putIfAbsent(CoreCommonConstants.SR_QUERY_URI, uri); + return uri; + } + } + + protected UriComponents getOrchestrationQueryUri() throws DriverException { + logger.debug("getOrchestrationQueryUri started..."); + return findUriByServiceRegistry(CoreSystemService.ORCHESTRATION_SERVICE); + } + + protected String getScheme() { + return sslProperties.isSslEnabled() ? CommonConstants.HTTPS : CommonConstants.HTTP; + } + + protected String getScheme(final ServiceSecurityType securityType) { + return securityType == ServiceSecurityType.NOT_SECURE ? CommonConstants.HTTP : CommonConstants.HTTPS; + } + + protected String getInterface() { + return sslProperties.isSslEnabled() ? CommonConstants.HTTP_SECURE_JSON : CommonConstants.HTTP_INSECURE_JSON; + } + + //------------------------------------------------------------------------------------------------- + private String extractSystemUriPath(final UriComponents components) { + final List pathSegments = components.getPathSegments(); + return pathSegments.isEmpty() ? components.getPath() : pathSegments.get(0); + } + + public static class DriverException extends UnavailableServerException { + + protected DriverException(final String message) { + super(message); + } + + protected DriverException(final String message, final HttpStatus httpStatus) { + super(message, httpStatus.value()); + } + + protected DriverException(final String message, final Throwable cause) { + super(message, cause); + } + + protected DriverException(final String msg, final int errorCode, final String origin, final Throwable cause) { + super(msg, errorCode, origin, cause); + } + + private static DriverException notFoundByArrowheadContext(final CoreSystemService service) { + return new DriverException("Unable to find " + service.getServiceDefinition() + " via ArrowheadContext", HttpStatus.SERVICE_UNAVAILABLE); + } + + private static DriverException notFoundByServiceRegistry(final CoreSystemService service) { + return new DriverException("Unable to find " + service.getServiceDefinition() + " via ServiceRegistry", HttpStatus.SERVICE_UNAVAILABLE); + } + + private static DriverException notFoundByOrchestrator(final CoreSystemService service) { + return new DriverException("Unable to find " + service.getServiceDefinition() + " via Orchestrator", HttpStatus.SERVICE_UNAVAILABLE); + } + + public DriverException createExceptionWith(final HttpStatus errorCode, final String origin) { + return new DriverException(getMessage(), errorCode.value(), origin, getCause()); + } + + public DriverException createExceptionWith(final int errorCode, final String origin) { + return new DriverException(getMessage(), errorCode, origin, getCause()); + } + } +} diff --git a/core-common/src/main/java/eu/arrowhead/common/drivers/OrchestrationDriver.java b/core-common/src/main/java/eu/arrowhead/common/drivers/OrchestrationDriver.java new file mode 100644 index 000000000..0602ac4b7 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/drivers/OrchestrationDriver.java @@ -0,0 +1,43 @@ +package eu.arrowhead.common.drivers; + +import eu.arrowhead.common.core.CoreSystemService; +import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; +import eu.arrowhead.common.dto.shared.OrchestrationResponseDTO; +import eu.arrowhead.common.http.HttpService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; +import org.springframework.web.util.UriComponents; + +@Service +public class OrchestrationDriver { + + //================================================================================================= + // members + private final Logger logger = LogManager.getLogger(OrchestrationDriver.class); + private final DriverUtilities driverUtilities; + private final HttpService httpService; + + @Autowired + public OrchestrationDriver(final DriverUtilities driverUtilities, final HttpService httpService) { + this.driverUtilities = driverUtilities; + this.httpService = httpService; + } + + public UriComponents findCoreSystemService(final CoreSystemService service) throws DriverUtilities.DriverException { + logger.traceEntry("findCoreSystemService: {}", service); + return logger.traceExit(driverUtilities.findUriByOrchestrator(service)); + } + + public OrchestrationResponseDTO orchestrate(final OrchestrationFormRequestDTO request) throws DriverUtilities.DriverException { + logger.traceEntry("orchestrate: {}", request); + final UriComponents uri = driverUtilities.getOrchestrationQueryUri(); + final ResponseEntity httpResponse = httpService + .sendRequest(uri, HttpMethod.POST, OrchestrationResponseDTO.class, request); + final OrchestrationResponseDTO result = httpResponse.getBody(); + return logger.traceExit(result); + } +} diff --git a/core-common/src/main/java/eu/arrowhead/common/drivers/ServiceRegistryDriver.java b/core-common/src/main/java/eu/arrowhead/common/drivers/ServiceRegistryDriver.java new file mode 100644 index 000000000..d0c1feac9 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/drivers/ServiceRegistryDriver.java @@ -0,0 +1,74 @@ +package eu.arrowhead.common.drivers; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.core.CoreSystemService; +import eu.arrowhead.common.dto.shared.ServiceQueryFormDTO; +import eu.arrowhead.common.dto.shared.ServiceQueryResultDTO; +import eu.arrowhead.common.dto.shared.ServiceRegistryRequestDTO; +import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; +import eu.arrowhead.common.http.HttpService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.util.UriComponents; +import org.springframework.web.util.UriComponentsBuilder; + +import java.util.List; + +@Service +public class ServiceRegistryDriver { + + private final Logger logger = LogManager.getLogger(ServiceRegistryDriver.class); + private final DriverUtilities driverUtilities; + private final HttpService httpService; + + @Autowired + public ServiceRegistryDriver(final DriverUtilities driverUtilities, final HttpService httpService) { + this.driverUtilities = driverUtilities; + this.httpService = httpService; + } + + public UriComponents findCoreSystemService(final CoreSystemService service) throws DriverUtilities.DriverException { + logger.traceEntry("findCoreSystemService:{}", service); + return logger.traceExit(driverUtilities.findUriByServiceRegistry(service)); + } + + public ServiceQueryResultDTO queryRegistry(final ServiceQueryFormDTO form) { + logger.traceEntry("queryRegistry: {}", form); + final UriComponents uri = driverUtilities.getServiceRegistryQueryUri(); + final ResponseEntity httpEntity = httpService + .sendRequest(uri, HttpMethod.POST, ServiceQueryResultDTO.class, form); + return logger.traceExit(httpEntity.getBody()); + } + + public ServiceRegistryResponseDTO registerService(final ServiceRegistryRequestDTO request) throws DriverUtilities.DriverException { + logger.traceEntry("registerService: {}", request); + final UriComponents uri = driverUtilities.findUriByOrchestrator(CoreSystemService.SERVICE_REGISTRY_REGISTER_SERVICE); + final ResponseEntity httpEntity = httpService + .sendRequest(uri, HttpMethod.POST, ServiceRegistryResponseDTO.class, request); + return logger.traceExit(httpEntity.getBody()); + } + + public void unregisterService(final String serviceDefinition, final String providerName, + final String providerAddress, final int providerPort) + throws DriverUtilities.DriverException { + + logger.traceEntry("unregisterService: {}, {}, {}, {}", serviceDefinition, providerName, providerAddress, providerPort); + final UriComponents uri = driverUtilities.findUriByOrchestrator(CoreSystemService.SERVICE_REGISTRY_UNREGISTER_SERVICE); + final MultiValueMap queryMap = new LinkedMultiValueMap<>(4); + queryMap.put(CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_SERVICE_DEFINITION, List.of(serviceDefinition)); + queryMap.put(CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_SYSTEM_NAME, List.of(providerName)); + queryMap.put(CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_ADDRESS, List.of(providerAddress)); + queryMap.put(CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_PORT, List.of(String.valueOf(providerPort))); + + final UriComponents unregisterUri = UriComponentsBuilder.newInstance().uriComponents(uri) + .queryParams(queryMap).build(); + httpService.sendRequest(unregisterUri, HttpMethod.POST, Void.class); + logger.traceExit(); + } +} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateType.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateType.java deleted file mode 100644 index 758082fea..000000000 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/CertificateType.java +++ /dev/null @@ -1,38 +0,0 @@ -package eu.arrowhead.common.dto.internal; - -public enum CertificateType { - - ONBOARDING("onboarding"), - DEVICE("device"), - SYSTEM("system"), - SERVICE("service"), - UNKNOWN("unknown"); - - private final String commonNamePart; - - private CertificateType(final String commonNamePart) { - this.commonNamePart = commonNamePart; - } - - public static CertificateType getTypeFromCN(final String commonName) { - final String[] split = commonName.split("\\."); - if (split.length >= 2) { - return CertificateType.getTypeFromCNPart(split[1]); - } - - return UNKNOWN; - } - - private static CertificateType getTypeFromCNPart(final String commonNamePart) { - for (CertificateType type : values()) { - if (type.commonNamePart.equalsIgnoreCase(commonNamePart)) { - return type; - } - } - return UNKNOWN; - } - - public String getCommonNamePart() { - return commonNamePart; - } -} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationRequestDTO.java index 9dd59347c..be2344ba3 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationRequestDTO.java @@ -1,6 +1,7 @@ package eu.arrowhead.common.dto.shared; import java.io.Serializable; +import java.util.StringJoiner; public class CertificateCreationRequestDTO implements Serializable { @@ -9,8 +10,7 @@ public class CertificateCreationRequestDTO implements Serializable { private static final long serialVersionUID = 1L; private String commonName; - private String publicKey; // TODO add KeyAlgorithm - private String privateKey; + private KeyPairDTO keyPairDTO; //================================================================================================= @@ -23,10 +23,9 @@ public CertificateCreationRequestDTO(final String commonName) { this.commonName = commonName; } - public CertificateCreationRequestDTO(final String commonName, final String publicKey, final String privateKey) { + public CertificateCreationRequestDTO(final String commonName, final KeyPairDTO keyPairDTO) { this.commonName = commonName; - this.publicKey = publicKey; - this.privateKey = privateKey; + this.keyPairDTO = keyPairDTO; } //================================================================================================= @@ -35,24 +34,23 @@ public CertificateCreationRequestDTO(final String commonName, final String publi public String getCommonName() { return commonName; } - public void setCommonName(String commonName) { this.commonName = commonName; } - public String getPublicKey() { - return publicKey; - } - - public void setPublicKey(String publicKey) { - this.publicKey = publicKey; + public KeyPairDTO getKeyPairDTO() { + return keyPairDTO; } - public String getPrivateKey() { - return privateKey; + public void setKeyPairDTO(final KeyPairDTO keyPairDTO) { + this.keyPairDTO = keyPairDTO; } - public void setPrivateKey(String privateKey) { - this.privateKey = privateKey; + @Override + public String toString() { + return new StringJoiner(", ", CertificateCreationRequestDTO.class.getSimpleName() + "[", "]") + .add("commonName='" + commonName + "'") + .add("keyPairDTO=" + keyPairDTO) + .toString(); } } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationResponseDTO.java new file mode 100644 index 000000000..b400270e6 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateCreationResponseDTO.java @@ -0,0 +1,83 @@ +package eu.arrowhead.common.dto.shared; + +import java.io.Serializable; +import java.util.StringJoiner; + +public class CertificateCreationResponseDTO implements Serializable { + + //================================================================================================= + // members + private static final long serialVersionUID = 1L; + + private String certificate; + private CertificateType certificateType; + private KeyPairDTO keyPairDTO; + private String certificateFormat; + + //================================================================================================= + // constructors + + public CertificateCreationResponseDTO() { + } + + public CertificateCreationResponseDTO(final String certificate, final CertificateType certificateType, final String certificateFormat) { + this.certificate = certificate; + this.certificateType = certificateType; + this.certificateFormat = certificateFormat; + } + + public CertificateCreationResponseDTO(final String certificate, + final CertificateType certificateType, + final KeyPairDTO keyPairDTO, + final String certificateFormat) { + this.certificate = certificate; + this.certificateType = certificateType; + this.keyPairDTO = keyPairDTO; + this.certificateFormat = certificateFormat; + } + + //================================================================================================= + // methods + + public String getCertificate() { + return certificate; + } + + public void setCertificate(String certificate) { + this.certificate = certificate; + } + + public String getCertificateFormat() { + return certificateFormat; + } + + public void setCertificateFormat(final String certificateFormat) { + this.certificateFormat = certificateFormat; + } + + public CertificateType getCertificateType() { + return certificateType; + } + + public void setCertificateType(final CertificateType certificateType) { + this.certificateType = certificateType; + } + + public KeyPairDTO getKeyPairDTO() { + return keyPairDTO; + } + + public void setKeyPairDTO(final KeyPairDTO keyPairDTO) { + this.keyPairDTO = keyPairDTO; + } + + @Override + public String toString() { + return new StringJoiner(", ", CertificateCreationResponseDTO.class.getSimpleName() + "[", "]") + .add("certificate='" + certificate + "'") + .add("certificateFormat=" + certificateFormat) + .add("certificateType=" + certificateType) + .add("keyPairDTO=" + keyPairDTO) + .toString(); + } +} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateResponseDTO.java deleted file mode 100644 index 8536fd7d3..000000000 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateResponseDTO.java +++ /dev/null @@ -1,105 +0,0 @@ -package eu.arrowhead.common.dto.shared; - -import java.io.Serializable; -import java.util.Arrays; -import java.util.Objects; - -public class CertificateResponseDTO implements Serializable { - - //================================================================================================= - // members - private static final long serialVersionUID = 1L; - - private String certificate; - private String keyAlgorithm; - private String keyFormat; - private byte[] publicKey; - private byte[] privateKey; - - - //================================================================================================= - // constructors - - public CertificateResponseDTO() { - } - - public CertificateResponseDTO(final String certificate, final String keyAlgorithm, final String keyFormat, - final byte[] publicKey) { - this.certificate = certificate; - this.keyAlgorithm = keyAlgorithm; - this.keyFormat = keyFormat; - this.publicKey = publicKey; - } - - public CertificateResponseDTO(final String certificate, final String keyAlgorithm, final String keyFormat, - final byte[] publicKey, final byte[] privateKey) { - this.certificate = certificate; - this.keyAlgorithm = keyAlgorithm; - this.keyFormat = keyFormat; - this.publicKey = publicKey; - this.privateKey = privateKey; - } - - //================================================================================================= - // methods - - public String getCertificate() { - return certificate; - } - - public void setCertificate(String certificate) { - this.certificate = certificate; - } - - public String getKeyAlgorithm() { - return keyAlgorithm; - } - - public void setKeyAlgorithm(String keyAlgorithm) { - this.keyAlgorithm = keyAlgorithm; - } - - public String getKeyFormat() { - return keyFormat; - } - - public void setKeyFormat(String keyFormat) { - this.keyFormat = keyFormat; - } - - public byte[] getPublicKey() { - return publicKey; - } - - public void setPublicKey(byte[] publicKey) { - this.publicKey = publicKey; - } - - public byte[] getPrivateKey() { - return privateKey; - } - - public void setPrivateKey(byte[] privateKey) { - this.privateKey = privateKey; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - CertificateResponseDTO that = (CertificateResponseDTO) o; - return certificate.equals(that.certificate) && - Objects.equals(keyAlgorithm, that.keyAlgorithm) && - Objects.equals(keyFormat, that.keyFormat) && - Arrays.equals(publicKey, that.publicKey) && - Arrays.equals(privateKey, that.privateKey); - } - - @Override - public int hashCode() { - int result = Objects.hash(certificate, keyAlgorithm, keyFormat); - result = 31 * result + Arrays.hashCode(publicKey); - result = 31 * result + Arrays.hashCode(privateKey); - return result; - } -} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateType.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateType.java new file mode 100644 index 000000000..30308c9c3 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateType.java @@ -0,0 +1,48 @@ +package eu.arrowhead.common.dto.shared; + +import eu.arrowhead.common.Utilities; + +public enum CertificateType { + + AH_ONBOARDING("onboarding", 0), + AH_DEVICE("device", 1), + AH_SYSTEM("system", 2), + UNKNOWN("unknown", 0); + + private final String commonNamePart; + private final int strength; + + private CertificateType(final String commonNamePart, final int strength) { + this.commonNamePart = commonNamePart; + this.strength = strength; + } + + public static CertificateType getTypeFromCN(final String commonName) { + final String[] split = commonName.split("\\."); + + if(Utilities.isKeyStoreCNArrowheadValid(commonName)) { + return AH_SYSTEM; + } else if (split.length >= 2) { + return CertificateType.getTypeFromCNPart(split[1]); + } else { + return CertificateType.getTypeFromCNPart(split[0]); + } + } + + public boolean hasMinimumStrength(final CertificateType minimumStrengthType) { + return this.strength >= minimumStrengthType.strength; + } + + private static CertificateType getTypeFromCNPart(final String commonNamePart) { + for (CertificateType type : values()) { + if (type.commonNamePart.equalsIgnoreCase(commonNamePart)) { + return type; + } + } + return UNKNOWN; + } + + public String getCommonNamePart() { + return commonNamePart; + } +} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceQueryFormDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceQueryFormDTO.java index 2cfb30276..a4ae76efe 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceQueryFormDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceQueryFormDTO.java @@ -5,6 +5,7 @@ import java.io.Serializable; import java.util.HashMap; import java.util.Map; +import java.util.StringJoiner; public class DeviceQueryFormDTO implements Serializable { @@ -45,6 +46,19 @@ public DeviceQueryFormDTO() {} public void setMinVersionRequirement(final Integer minVersionRequirement) { this.minVersionRequirement = minVersionRequirement; } public void setMaxVersionRequirement(final Integer maxVersionRequirement) { this.maxVersionRequirement = maxVersionRequirement; } + @Override + public String toString() { + return new StringJoiner(", ", DeviceQueryFormDTO.class.getSimpleName() + "[", "]") + .add("deviceNameRequirements='" + deviceNameRequirements + "'") + .add("addressRequirement='" + addressRequirement + "'") + .add("macAddressRequirement='" + macAddressRequirement + "'") + .add("metadataRequirements=" + metadataRequirements) + .add("versionRequirement=" + versionRequirement) + .add("minVersionRequirement=" + minVersionRequirement) + .add("maxVersionRequirement=" + maxVersionRequirement) + .toString(); + } + //================================================================================================= // assistant methods @@ -58,7 +72,7 @@ private DeviceQueryFormDTO(final Builder builder) { this.minVersionRequirement = builder.minVersionRequirement; this.maxVersionRequirement = builder.maxVersionRequirement; } - + //================================================================================================= // nested classes diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceQueryResultDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceQueryResultDTO.java index 300577034..116bc78ec 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceQueryResultDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceQueryResultDTO.java @@ -6,6 +6,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.List; +import java.util.StringJoiner; @JsonInclude(Include.NON_NULL) public class DeviceQueryResultDTO implements Serializable @@ -33,6 +34,14 @@ public DeviceQueryResultDTO(final List deviceQueryDat this.unfilteredHits = unfilteredHits; } + @Override + public String toString() { + return new StringJoiner(", ", DeviceQueryResultDTO.class.getSimpleName() + "[", "]") + .add("deviceQueryData=" + deviceQueryData) + .add("unfilteredHits=" + unfilteredHits) + .toString(); + } + //================================================================================================= // methods diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingResponseDTO.java new file mode 100644 index 000000000..20f88a8d7 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingResponseDTO.java @@ -0,0 +1,58 @@ +package eu.arrowhead.common.dto.shared; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.Serializable; +import java.util.Map; +import java.util.StringJoiner; + +@JsonInclude(Include.NON_NULL) +public abstract class DeviceRegistryOnboardingResponseDTO extends DeviceRegistryResponseDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = -635438605292398404L; + private CertificateCreationResponseDTO certificateResponse; + + //================================================================================================= + // methods + + public DeviceRegistryOnboardingResponseDTO() { + } + + public DeviceRegistryOnboardingResponseDTO(final long id, final DeviceResponseDTO device, final String endOfValidity, + final Map metadata, final int version, final String createdAt, final String updatedAt, + final CertificateCreationResponseDTO certificateResponse) { + super(id, device, endOfValidity, metadata, version, createdAt, updatedAt); + this.certificateResponse = certificateResponse; + } + + public void load(final DeviceRegistryResponseDTO dto) { + setId(dto.getId()); + setDevice(dto.getDevice()); + setEndOfValidity(dto.getEndOfValidity()); + setMetadata(dto.getMetadata()); + setVersion(dto.getVersion()); + setCreatedAt(dto.getCreatedAt()); + setUpdatedAt(dto.getUpdatedAt()); + } + + //------------------------------------------------------------------------------------------------- + public CertificateCreationResponseDTO getCertificateResponse() { + return certificateResponse; + } + + public void setCertificateResponse(final CertificateCreationResponseDTO certificateResponse) { + this.certificateResponse = certificateResponse; + } + + @Override + public String toString() { + return new StringJoiner(", ", DeviceRegistryOnboardingResponseDTO.class.getSimpleName() + "[", "]") + .add("certificateResponse=" + certificateResponse) + .add("parent=" + super.toString()) + .toString(); + } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithCsrRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithCsrRequestDTO.java new file mode 100644 index 000000000..00ceabaed --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithCsrRequestDTO.java @@ -0,0 +1,62 @@ +package eu.arrowhead.common.dto.shared; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.Serializable; +import java.util.Map; +import java.util.StringJoiner; + +@JsonInclude(Include.NON_NULL) +public class DeviceRegistryOnboardingWithCsrRequestDTO extends DeviceRegistryRequestDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = -635438605292398404L; + private String certificateSigningRequest; + + //================================================================================================= + // methods + + public DeviceRegistryOnboardingWithCsrRequestDTO() { + } + + //------------------------------------------------------------------------------------------------- + public DeviceRegistryOnboardingWithCsrRequestDTO(final DeviceRequestDTO device, final String endOfValidity, final String certificateSigningRequest) { + super(device, endOfValidity); + this.certificateSigningRequest = certificateSigningRequest; + } + + //------------------------------------------------------------------------------------------------- + public DeviceRegistryOnboardingWithCsrRequestDTO(final String deviceName, final String macAddress, final String endOfValidity, final String certificateSigningRequest) { + super(new DeviceRequestDTO(deviceName, macAddress), endOfValidity); + this.certificateSigningRequest = certificateSigningRequest; + } + + //------------------------------------------------------------------------------------------------- + public DeviceRegistryOnboardingWithCsrRequestDTO(final DeviceRequestDTO device, + final String endOfValidity, + final Map metadata, + final Integer version, final String certificateSigningRequest) { + super(device, endOfValidity, metadata, version); + this.certificateSigningRequest = certificateSigningRequest; + } + + //------------------------------------------------------------------------------------------------- + public String getCertificateSigningRequest() { + return certificateSigningRequest; + } + + public void setCertificateSigningRequest(final String certificateSigningRequest) { + this.certificateSigningRequest = certificateSigningRequest; + } + + @Override + public String toString() { + return new StringJoiner(", ", DeviceRegistryOnboardingWithCsrRequestDTO.class.getSimpleName() + "[", "]") + .add("certificateSigningRequest=" + certificateSigningRequest) + .add("parent=" + super.toString()) + .toString(); + } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithCsrResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithCsrResponseDTO.java new file mode 100644 index 000000000..4dfeae54a --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithCsrResponseDTO.java @@ -0,0 +1,23 @@ +package eu.arrowhead.common.dto.shared; + +import java.io.Serializable; +import java.util.Map; + +public class DeviceRegistryOnboardingWithCsrResponseDTO extends DeviceRegistryOnboardingResponseDTO implements Serializable { + + //================================================================================================= + // members + private static final long serialVersionUID = 1L; + + public DeviceRegistryOnboardingWithCsrResponseDTO() { + } + + public DeviceRegistryOnboardingWithCsrResponseDTO(final long id, final DeviceResponseDTO device, final String endOfValidity, + final Map metadata, final int version, final String createdAt, + final String updatedAt, + final CertificateCreationResponseDTO certificateResponse) { + super(id, device, endOfValidity, metadata, version, createdAt, updatedAt, certificateResponse); + } + + // this class exist to keep the structure of RequestDTO, ResponseDTO +} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithNameRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithNameRequestDTO.java new file mode 100644 index 000000000..92070ee76 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithNameRequestDTO.java @@ -0,0 +1,62 @@ +package eu.arrowhead.common.dto.shared; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.Serializable; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +@JsonInclude(Include.NON_NULL) +public class DeviceRegistryOnboardingWithNameRequestDTO extends DeviceRegistryRequestDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = -635438605292398404L; + private CertificateCreationRequestDTO certificateCreationRequest; + + //================================================================================================= + // methods + + public DeviceRegistryOnboardingWithNameRequestDTO() { + } + + //------------------------------------------------------------------------------------------------- + public DeviceRegistryOnboardingWithNameRequestDTO(final DeviceRequestDTO device, final String endOfValidity) { + super(device, endOfValidity); + } + + //------------------------------------------------------------------------------------------------- + public DeviceRegistryOnboardingWithNameRequestDTO(final String deviceName, final String macAddress, final String endOfValidity) { + super(new DeviceRequestDTO(deviceName, macAddress), endOfValidity); + this.certificateCreationRequest = new CertificateCreationRequestDTO(deviceName); + } + + //------------------------------------------------------------------------------------------------- + public DeviceRegistryOnboardingWithNameRequestDTO(final DeviceRequestDTO device, + final String endOfValidity, + final Map metadata, + final Integer version) { + super(device, endOfValidity, metadata, version); + this.certificateCreationRequest = new CertificateCreationRequestDTO(Objects.requireNonNull(device).getDeviceName()); + } + + //------------------------------------------------------------------------------------------------- + public CertificateCreationRequestDTO getCertificateCreationRequest() { + return certificateCreationRequest; + } + + public void setCertificateCreationRequest(final CertificateCreationRequestDTO certificateCreationRequest) { + this.certificateCreationRequest = certificateCreationRequest; + } + + @Override + public String toString() { + return new StringJoiner(", ", DeviceRegistryOnboardingWithNameRequestDTO.class.getSimpleName() + "[", "]") + .add("certificateCreationRequest=" + certificateCreationRequest) + .add("parent=" + super.toString()) + .toString(); + } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithNameResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithNameResponseDTO.java new file mode 100644 index 000000000..4c3079432 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithNameResponseDTO.java @@ -0,0 +1,23 @@ +package eu.arrowhead.common.dto.shared; + +import java.io.Serializable; +import java.util.Map; + +public class DeviceRegistryOnboardingWithNameResponseDTO extends DeviceRegistryOnboardingResponseDTO implements Serializable { + + //================================================================================================= + // members + private static final long serialVersionUID = 1L; + + public DeviceRegistryOnboardingWithNameResponseDTO() { + } + + public DeviceRegistryOnboardingWithNameResponseDTO(final long id, final DeviceResponseDTO device, final String endOfValidity, + final Map metadata, final int version, final String createdAt, + final String updatedAt, + final CertificateCreationResponseDTO certificateResponse) { + super(id, device, endOfValidity, metadata, version, createdAt, updatedAt, certificateResponse); + } + + // this class exist to keep the structure of RequestDTO, ResponseDTO +} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryRequestDTO.java index cf8e7514b..3e5f34424 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryRequestDTO.java @@ -2,9 +2,11 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; +import org.springframework.util.Assert; import java.io.Serializable; import java.util.Map; +import java.util.StringJoiner; @JsonInclude(Include.NON_NULL) public class DeviceRegistryRequestDTO implements Serializable { @@ -25,6 +27,10 @@ public class DeviceRegistryRequestDTO implements Serializable { public DeviceRegistryRequestDTO() { } + public DeviceRegistryRequestDTO(final DeviceRequestDTO device, final String endOfValidity) {this.device = device; + this.endOfValidity = endOfValidity; + } + //------------------------------------------------------------------------------------------------- public DeviceRegistryRequestDTO(final DeviceRequestDTO device, final String endOfValidity, final Map metadata, final Integer version) { this.device = device; @@ -44,4 +50,14 @@ public DeviceRegistryRequestDTO(final DeviceRequestDTO device, final String endO public void setEndOfValidity(final String endOfValidity) { this.endOfValidity = endOfValidity; } public void setMetadata(final Map metadata) { this.metadata = metadata; } public void setVersion(final Integer version) { this.version = version; } + + @Override + public String toString() { + return new StringJoiner(", ", DeviceRegistryRequestDTO.class.getSimpleName() + "[", "]") + .add("device=" + device) + .add("endOfValidity='" + endOfValidity + "'") + .add("metadata=" + metadata) + .add("version=" + version) + .toString(); + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryResponseDTO.java index 3c25edfa3..9abb13229 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryResponseDTO.java @@ -6,6 +6,7 @@ import java.io.Serializable; import java.util.Map; import java.util.Objects; +import java.util.StringJoiner; @JsonInclude(Include.NON_NULL) public class DeviceRegistryResponseDTO implements Serializable { @@ -78,4 +79,17 @@ public boolean equals(final Object o) { public int hashCode() { return Objects.hash(id, device, endOfValidity, metadata, version, createdAt, updatedAt); } + + @Override + public String toString() { + return new StringJoiner(", ", DeviceRegistryResponseDTO.class.getSimpleName() + "[", "]") + .add("id=" + id) + .add("device=" + device) + .add("endOfValidity='" + endOfValidity + "'") + .add("metadata=" + metadata) + .add("version=" + version) + .add("createdAt='" + createdAt + "'") + .add("updatedAt='" + updatedAt + "'") + .toString(); + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRequestDTO.java index 5a5906e26..3fbbbc479 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRequestDTO.java @@ -5,6 +5,7 @@ import java.io.Serializable; import java.util.Objects; +import java.util.StringJoiner; @JsonInclude(Include.NON_NULL) public class DeviceRequestDTO implements Serializable @@ -26,6 +27,11 @@ public class DeviceRequestDTO implements Serializable //------------------------------------------------------------------------------------------------- public DeviceRequestDTO() {} + public DeviceRequestDTO(final String deviceName, final String macAddress) { + this.deviceName = deviceName; + this.macAddress = macAddress; + } + //------------------------------------------------------------------------------------------------- public DeviceRequestDTO(final String deviceName, final String address, final String macAddress, final String authenticationInfo) { @@ -82,4 +88,14 @@ public boolean equals(final Object obj) Objects.equals(macAddress, other.macAddress) && Objects.equals(deviceName, other.deviceName); } + + @Override + public String toString() { + return new StringJoiner(", ", DeviceRequestDTO.class.getSimpleName() + "[", "]") + .add("deviceName='" + deviceName + "'") + .add("address='" + address + "'") + .add("macAddress='" + macAddress + "'") + .add("authenticationInfo='" + authenticationInfo + "'") + .toString(); + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceResponseDTO.java index 4c6f94df9..cd3a44b1b 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceResponseDTO.java @@ -5,6 +5,7 @@ import java.io.Serializable; import java.util.Objects; +import java.util.StringJoiner; @JsonInclude(Include.NON_NULL) public class DeviceResponseDTO implements Serializable { @@ -81,4 +82,17 @@ public boolean equals(final Object obj) { Objects.equals(macAddress, other.macAddress) && Objects.equals(deviceName, other.deviceName); } + + @Override + public String toString() { + return new StringJoiner(", ", DeviceResponseDTO.class.getSimpleName() + "[", "]") + .add("id=" + id) + .add("deviceName='" + deviceName + "'") + .add("address='" + address + "'") + .add("macAddress='" + macAddress + "'") + .add("authenticationInfo='" + authenticationInfo + "'") + .add("createdAt='" + createdAt + "'") + .add("updatedAt='" + updatedAt + "'") + .toString(); + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/KeyPairDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/KeyPairDTO.java new file mode 100644 index 000000000..ef38df1d3 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/KeyPairDTO.java @@ -0,0 +1,64 @@ +package eu.arrowhead.common.dto.shared; + +import java.io.Serializable; +import java.util.Objects; +import java.util.StringJoiner; + +public class KeyPairDTO implements Serializable { + + private String keyAlgorithm; + private String keyFormat; + private String publicKey; + private String privateKey; + + public KeyPairDTO() { super(); } + + public KeyPairDTO(final String keyAlgorithm, final String keyFormat, final String publicKey, final String privateKey) { + this.keyAlgorithm = keyAlgorithm; + this.keyFormat = keyFormat; + this.publicKey = publicKey; + this.privateKey = privateKey; + } + + public String getKeyAlgorithm() { + return keyAlgorithm; + } + + public void setKeyAlgorithm(final String keyAlgorithm) { + this.keyAlgorithm = keyAlgorithm; + } + + public String getKeyFormat() { + return keyFormat; + } + + public void setKeyFormat(final String keyFormat) { + this.keyFormat = keyFormat; + } + + public String getPublicKey() { + return publicKey; + } + + public void setPublicKey(final String publicKey) { + this.publicKey = publicKey; + } + + public String getPrivateKey() { + return privateKey; + } + + public void setPrivateKey(final String privateKey) { + this.privateKey = privateKey; + } + + @Override + public String toString() { + return new StringJoiner(", ", KeyPairDTO.class.getSimpleName() + "[", "]") + .add("keyAlgorithm='" + keyAlgorithm + "'") + .add("keyFormat='" + keyFormat + "'") + .add("publicKey='" + publicKey + "'") + .add("privateKey='" + Objects.nonNull(privateKey) + "'") + .toString(); + } +} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingResponseDTO.java index b5f5d51a1..d0d5be908 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingResponseDTO.java @@ -1,6 +1,7 @@ package eu.arrowhead.common.dto.shared; import java.io.Serializable; +import java.util.StringJoiner; public abstract class OnboardingResponseDTO implements Serializable { @@ -13,11 +14,25 @@ public abstract class OnboardingResponseDTO implements Serializable { private ServiceEndpoint serviceRegistry; private ServiceEndpoint orchestrationService; - private CertificateResponseDTO onboardingCertificate; + private CertificateCreationResponseDTO onboardingCertificate; private String intermediateCertificate; private String rootCertificate; - private String certificateType; + + public OnboardingResponseDTO() { + } + + public OnboardingResponseDTO(final ServiceEndpoint deviceRegistry, final ServiceEndpoint systemRegistry, final ServiceEndpoint serviceRegistry, + final ServiceEndpoint orchestrationService, final CertificateCreationResponseDTO onboardingCertificate, + final String intermediateCertificate, final String rootCertificate) { + this.deviceRegistry = deviceRegistry; + this.systemRegistry = systemRegistry; + this.serviceRegistry = serviceRegistry; + this.orchestrationService = orchestrationService; + this.onboardingCertificate = onboardingCertificate; + this.intermediateCertificate = intermediateCertificate; + this.rootCertificate = rootCertificate; + } //================================================================================================= // methods @@ -63,12 +78,12 @@ public void setOrchestrationService(ServiceEndpoint orchestrationService) { } //------------------------------------------------------------------------------------------------- - public CertificateResponseDTO getOnboardingCertificate() { + public CertificateCreationResponseDTO getOnboardingCertificate() { return onboardingCertificate; } //------------------------------------------------------------------------------------------------- - public void setOnboardingCertificate(final CertificateResponseDTO onboardingCertificate) { + public void setOnboardingCertificate(final CertificateCreationResponseDTO onboardingCertificate) { this.onboardingCertificate = onboardingCertificate; } @@ -92,11 +107,17 @@ public void setRootCertificate(final String rootCertificate) { this.rootCertificate = rootCertificate; } - public String getCertificateType() { - return certificateType; - } - public void setCertificateType(final String certificateType) { - this.certificateType = certificateType; + @Override + public String toString() { + return new StringJoiner(", ", OnboardingResponseDTO.class.getSimpleName() + "[", "]") + .add("deviceRegistry=" + deviceRegistry) + .add("systemRegistry=" + systemRegistry) + .add("serviceRegistry=" + serviceRegistry) + .add("orchestrationService=" + orchestrationService) + .add("onboardingCertificate=" + onboardingCertificate) + .add("intermediateCertificate='" + intermediateCertificate + "'") + .add("rootCertificate='" + rootCertificate + "'") + .toString(); } } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrRequestDTO.java index 2966a86e5..984c1a528 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrRequestDTO.java @@ -5,6 +5,7 @@ import java.io.Serializable; import java.util.Objects; +import java.util.StringJoiner; @JsonInclude(Include.NON_NULL) public class OnboardingWithCsrRequestDTO implements Serializable { @@ -51,4 +52,12 @@ public boolean equals(final Object obj) return Objects.equals(certificateSigningRequest, other.certificateSigningRequest); } + + @Override + public String toString() { + return new StringJoiner(", ", OnboardingWithCsrRequestDTO.class.getSimpleName() + "[", "]") + .add("certificateSigningRequest='" + certificateSigningRequest + "'") + .add("parent=" + super.toString()) + .toString(); + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java index 12e336e70..e5f3fa047 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java @@ -8,5 +8,15 @@ public class OnboardingWithCsrResponseDTO extends OnboardingResponseDTO implemen // members private static final long serialVersionUID = 1L; + public OnboardingWithCsrResponseDTO() { + } + + public OnboardingWithCsrResponseDTO(final ServiceEndpoint deviceRegistry, final ServiceEndpoint systemRegistry, + final ServiceEndpoint serviceRegistry, final ServiceEndpoint orchestrationService, + final CertificateCreationResponseDTO onboardingCertificate, final String intermediateCertificate, + final String rootCertificate) { + super(deviceRegistry, systemRegistry, serviceRegistry, orchestrationService, onboardingCertificate, intermediateCertificate, rootCertificate); + } + // this class exist to keep the structure of RequestDTO, ResponseDTO } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameRequestDTO.java index 8321d7fd6..56ff849d7 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameRequestDTO.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; import java.io.Serializable; +import java.util.StringJoiner; @JsonInclude(Include.NON_NULL) public class OnboardingWithNameRequestDTO implements Serializable { @@ -36,4 +37,12 @@ public CertificateCreationRequestDTO getCreationRequestDTO() { public void setCreationRequestDTO(CertificateCreationRequestDTO creationRequestDTO) { this.creationRequestDTO = creationRequestDTO; } + + @Override + public String toString() { + return new StringJoiner(", ", OnboardingWithNameRequestDTO.class.getSimpleName() + "[", "]") + .add("creationRequestDTO=" + creationRequestDTO) + .add("parent=" + super.toString()) + .toString(); + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java index 78794c475..8af13a480 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java @@ -6,5 +6,15 @@ public class OnboardingWithNameResponseDTO extends OnboardingResponseDTO { // members private static final long serialVersionUID = 1L; + public OnboardingWithNameResponseDTO() { + } + + public OnboardingWithNameResponseDTO(final ServiceEndpoint deviceRegistry, final ServiceEndpoint systemRegistry, + final ServiceEndpoint serviceRegistry, final ServiceEndpoint orchestrationService, + final CertificateCreationResponseDTO onboardingCertificate, final String intermediateCertificate, + final String rootCertificate) { + super(deviceRegistry, systemRegistry, serviceRegistry, orchestrationService, onboardingCertificate, intermediateCertificate, rootCertificate); + } + // this class exist to keep the structure of RequestDTO, ResponseDTO } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceEndpoint.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceEndpoint.java index d8e802a82..e2a2591df 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceEndpoint.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceEndpoint.java @@ -4,6 +4,7 @@ import java.io.Serializable; import java.net.URI; +import java.util.StringJoiner; public class ServiceEndpoint implements Serializable { @@ -32,4 +33,12 @@ public URI getUri() { return uri; } public void setUri(final URI uri) { this.uri = uri; } + + @Override + public String toString() { + return new StringJoiner(", ", ServiceEndpoint.class.getSimpleName() + "[", "]") + .add("system=" + system) + .add("uri=" + uri) + .toString(); + } } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceRegistryRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceRegistryRequestDTO.java index a3900b0ff..023cc2167 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceRegistryRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceRegistryRequestDTO.java @@ -3,6 +3,7 @@ import java.io.Serializable; import java.util.List; import java.util.Map; +import java.util.StringJoiner; public class ServiceRegistryRequestDTO implements Serializable { @@ -21,7 +22,37 @@ public class ServiceRegistryRequestDTO implements Serializable { private Map metadata; private Integer version; private List interfaces; - + + //================================================================================================= + // constructors + + public ServiceRegistryRequestDTO() { + } + + public ServiceRegistryRequestDTO(final String serviceDefinition, final SystemRequestDTO providerSystem, final String serviceUri, final String endOfValidity, + final String secure, + final List interfaces) { + this.serviceDefinition = serviceDefinition; + this.providerSystem = providerSystem; + this.serviceUri = serviceUri; + this.endOfValidity = endOfValidity; + this.secure = secure; + this.interfaces = interfaces; + } + + public ServiceRegistryRequestDTO(final String serviceDefinition, final SystemRequestDTO providerSystem, final String serviceUri, final String endOfValidity, + final String secure, + final Map metadata, final Integer version, final List interfaces) { + this.serviceDefinition = serviceDefinition; + this.providerSystem = providerSystem; + this.serviceUri = serviceUri; + this.endOfValidity = endOfValidity; + this.secure = secure; + this.metadata = metadata; + this.version = version; + this.interfaces = interfaces; + } + //================================================================================================= // methods @@ -44,4 +75,20 @@ public class ServiceRegistryRequestDTO implements Serializable { public void setMetadata(final Map metadata) { this.metadata = metadata; } public void setVersion(final Integer version) { this.version = version; } public void setInterfaces(final List interfaces) { this.interfaces = interfaces; } -} \ No newline at end of file + + //------------------------------------------------------------------------------------------------- + + @Override + public String toString() { + return new StringJoiner(", ", ServiceRegistryRequestDTO.class.getSimpleName() + "[", "]") + .add("serviceDefinition='" + serviceDefinition + "'") + .add("providerSystem=" + providerSystem) + .add("serviceUri='" + serviceUri + "'") + .add("endOfValidity='" + endOfValidity + "'") + .add("secure='" + secure + "'") + .add("metadata=" + metadata) + .add("version=" + version) + .add("interfaces=" + interfaces) + .toString(); + } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceRegistryResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceRegistryResponseDTO.java index 4d01c1c5a..ea94960a1 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceRegistryResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/ServiceRegistryResponseDTO.java @@ -3,6 +3,7 @@ import java.io.Serializable; import java.util.List; import java.util.Map; +import java.util.StringJoiner; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; @@ -55,4 +56,22 @@ public class ServiceRegistryResponseDTO implements Serializable { public void setInterfaces(final List interfaces) { this.interfaces = interfaces; } public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } + + //------------------------------------------------------------------------------------------------- + @Override + public String toString() { + return new StringJoiner(", ", ServiceRegistryResponseDTO.class.getSimpleName() + "[", "]") + .add("id=" + id) + .add("serviceDefinition=" + serviceDefinition) + .add("provider=" + provider) + .add("serviceUri='" + serviceUri + "'") + .add("endOfValidity='" + endOfValidity + "'") + .add("secure=" + secure) + .add("metadata=" + metadata) + .add("version=" + version) + .add("interfaces=" + interfaces) + .add("createdAt='" + createdAt + "'") + .add("updatedAt='" + updatedAt + "'") + .toString(); + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryFormDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryFormDTO.java index bd451d2d2..240db7488 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryFormDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryFormDTO.java @@ -7,6 +7,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.StringJoiner; public class SystemQueryFormDTO implements Serializable { @@ -24,13 +25,14 @@ public class SystemQueryFormDTO implements Serializable { private boolean pingProviders = false; + //================================================================================================= // methods - //------------------------------------------------------------------------------------------------- - public SystemQueryFormDTO() {} + public SystemQueryFormDTO() {} //------------------------------------------------------------------------------------------------- + public String getSystemNameRequirements() { return systemNameRequirements; } public String getDeviceNameRequirements() { return deviceNameRequirements; } public Map getMetadataRequirements() { return metadataRequirements; } @@ -38,8 +40,8 @@ public SystemQueryFormDTO() {} public Integer getMinVersionRequirement() { return minVersionRequirement; } public Integer getMaxVersionRequirement() { return maxVersionRequirement; } public boolean getPingProviders() { return pingProviders; } - //------------------------------------------------------------------------------------------------- + public void setSystemNameRequirements(final String systemNameRequirements) { this.systemNameRequirements = systemNameRequirements; } public void setDeviceNameRequirements(final String deviceNameRequirements) { this.deviceNameRequirements = deviceNameRequirements; } public void setMetadataRequirements(final Map metadataRequirements) { this.metadataRequirements = metadataRequirements; } @@ -48,10 +50,23 @@ public SystemQueryFormDTO() {} public void setMaxVersionRequirement(final Integer maxVersionRequirement) { this.maxVersionRequirement = maxVersionRequirement; } public void setPingProviders(final boolean pingProviders) { this.pingProviders = pingProviders; } + @Override + public String toString() { + return new StringJoiner(", ", SystemQueryFormDTO.class.getSimpleName() + "[", "]") + .add("systemNameRequirements='" + systemNameRequirements + "'") + .add("deviceNameRequirements='" + deviceNameRequirements + "'") + .add("metadataRequirements=" + metadataRequirements) + .add("versionRequirement=" + versionRequirement) + .add("minVersionRequirement=" + minVersionRequirement) + .add("maxVersionRequirement=" + maxVersionRequirement) + .add("pingProviders=" + pingProviders) + .toString(); + } //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- + private SystemQueryFormDTO(final Builder builder) { this.systemNameRequirements = builder.systemNameRequirements; this.deviceNameRequirements = builder.deiceNameRequirements; @@ -61,13 +76,12 @@ private SystemQueryFormDTO(final Builder builder) { this.maxVersionRequirement = builder.maxVersionRequirement; this.pingProviders = builder.pingProviders; } - //================================================================================================= // nested classes - //------------------------------------------------------------------------------------------------- public static class Builder { - + + //================================================================================================= // members diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryResultDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryResultDTO.java index 576fabd4c..7bfe62927 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryResultDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryResultDTO.java @@ -6,6 +6,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.List; +import java.util.StringJoiner; @JsonInclude(Include.NON_NULL) public class SystemQueryResultDTO implements Serializable { @@ -18,23 +19,32 @@ public class SystemQueryResultDTO implements Serializable { private List systemQueryData = new ArrayList<>(); private int unfilteredHits = 0; + //================================================================================================= // constructors - public SystemQueryResultDTO(final List systemQueryData, final int unfilteredHits) { this.systemQueryData = systemQueryData; this.unfilteredHits = unfilteredHits; } + //================================================================================================= // methods - //------------------------------------------------------------------------------------------------- + public List getSystemQueryData() { return systemQueryData; } public int getUnfilteredHits() { return unfilteredHits; } - //------------------------------------------------------------------------------------------------- + public void setSystemQueryData(final List systemQueryData) { this.systemQueryData = systemQueryData; } public void setUnfilteredHits(final int unfilteredHits) { this.unfilteredHits = unfilteredHits; } + + @Override + public String toString() { + return new StringJoiner(", ", SystemQueryResultDTO.class.getSimpleName() + "[", "]") + .add("systemQueryData=" + systemQueryData) + .add("unfilteredHits=" + unfilteredHits) + .toString(); + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingResponseDTO.java new file mode 100644 index 000000000..68c44a65d --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingResponseDTO.java @@ -0,0 +1,48 @@ +package eu.arrowhead.common.dto.shared; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.Serializable; +import java.util.Map; +import java.util.StringJoiner; + +@JsonInclude(Include.NON_NULL) +public abstract class SystemRegistryOnboardingResponseDTO extends SystemRegistryResponseDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = -635438605292398404L; + private CertificateCreationResponseDTO certificateResponse; + + //================================================================================================= + // methods + + public SystemRegistryOnboardingResponseDTO() { + } + + public SystemRegistryOnboardingResponseDTO(final long id, final SystemResponseDTO system, final DeviceResponseDTO provider, + final String endOfValidity, final Map metadata, final int version, final String createdAt, + final String updatedAt, final CertificateCreationResponseDTO certificateResponse) { + super(id, system, provider, endOfValidity, metadata, version, createdAt, updatedAt); + this.certificateResponse = certificateResponse; + } + + //------------------------------------------------------------------------------------------------- + public CertificateCreationResponseDTO getCertificateResponse() { + return certificateResponse; + } + + public void setCertificateResponse(final CertificateCreationResponseDTO certificateResponse) { + this.certificateResponse = certificateResponse; + } + + @Override + public String toString() { + return new StringJoiner(", ", SystemRegistryOnboardingResponseDTO.class.getSimpleName() + "[", "]") + .add("certificateResponse=" + certificateResponse) + .add("parent=" + super.toString()) + .toString(); + } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithCsrRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithCsrRequestDTO.java new file mode 100644 index 000000000..1473a10f0 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithCsrRequestDTO.java @@ -0,0 +1,53 @@ +package eu.arrowhead.common.dto.shared; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.Serializable; +import java.util.Map; +import java.util.StringJoiner; + +@JsonInclude(Include.NON_NULL) +public class SystemRegistryOnboardingWithCsrRequestDTO extends SystemRegistryRequestDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = -635438605292398404L; + private String certificateSigningRequest; + + //================================================================================================= + // methods + + public SystemRegistryOnboardingWithCsrRequestDTO() { + } + + public SystemRegistryOnboardingWithCsrRequestDTO(final SystemRequestDTO system, final DeviceRequestDTO provider, final String endOfValidity, + final String certificateSigningRequest) { + super(system, provider, endOfValidity); + this.certificateSigningRequest = certificateSigningRequest; + } + + public SystemRegistryOnboardingWithCsrRequestDTO(final SystemRequestDTO system, final DeviceRequestDTO provider, final String endOfValidity, + final Map metadata, final Integer version, final String certificateSigningRequest) { + super(system, provider, endOfValidity, metadata, version); + this.certificateSigningRequest = certificateSigningRequest; + } + + //------------------------------------------------------------------------------------------------- + public String getCertificateRequest() { + return certificateSigningRequest; + } + + public void setCertificateRequest(final String certificateSigningRequest) { + this.certificateSigningRequest = certificateSigningRequest; + } + + @Override + public String toString() { + return new StringJoiner(", ", SystemRegistryOnboardingWithCsrRequestDTO.class.getSimpleName() + "[", "]") + .add("certificateSigningRequest=" + certificateSigningRequest) + .add("parent=" + super.toString()) + .toString(); + } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithCsrResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithCsrResponseDTO.java new file mode 100644 index 000000000..98f37e4f7 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithCsrResponseDTO.java @@ -0,0 +1,24 @@ +package eu.arrowhead.common.dto.shared; + +import java.io.Serializable; +import java.util.Map; + +public class SystemRegistryOnboardingWithCsrResponseDTO extends SystemRegistryOnboardingResponseDTO implements Serializable { + + //================================================================================================= + // members + private static final long serialVersionUID = 1L; + + public SystemRegistryOnboardingWithCsrResponseDTO() { + } + + public SystemRegistryOnboardingWithCsrResponseDTO(final long id, final SystemResponseDTO system, + final DeviceResponseDTO provider, final String endOfValidity, + final Map metadata, final int version, final String createdAt, + final String updatedAt, + final CertificateCreationResponseDTO certificateResponse) { + super(id, system, provider, endOfValidity, metadata, version, createdAt, updatedAt, certificateResponse); + } + + // this class exist to keep the structure of RequestDTO, ResponseDTO +} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithNameRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithNameRequestDTO.java new file mode 100644 index 000000000..3ca4cd959 --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithNameRequestDTO.java @@ -0,0 +1,56 @@ +package eu.arrowhead.common.dto.shared; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.Serializable; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +@JsonInclude(Include.NON_NULL) +public class SystemRegistryOnboardingWithNameRequestDTO extends SystemRegistryRequestDTO implements Serializable { + + //================================================================================================= + // members + + private static final long serialVersionUID = -635438605292398404L; + private CertificateCreationRequestDTO certificateRequest; + + //================================================================================================= + // methods + + public SystemRegistryOnboardingWithNameRequestDTO() { + } + + public SystemRegistryOnboardingWithNameRequestDTO(final SystemRequestDTO system, final DeviceRequestDTO provider, final String endOfValidity, + final CertificateCreationRequestDTO certificateRequest) { + super(system, provider, endOfValidity); + this.certificateRequest = certificateRequest; + } + + + public SystemRegistryOnboardingWithNameRequestDTO(final SystemRequestDTO system, final DeviceRequestDTO provider, final String endOfValidity, + final Map metadata, final Integer version, + final CertificateCreationRequestDTO certificateRequest) { + super(system, provider, endOfValidity, metadata, version); + this.certificateRequest = certificateRequest; + } + + //------------------------------------------------------------------------------------------------- + public CertificateCreationRequestDTO getCertificateRequest() { + return certificateRequest; + } + + public void setCertificateRequest(final CertificateCreationRequestDTO certificateRequest) { + this.certificateRequest = certificateRequest; + } + + @Override + public String toString() { + return new StringJoiner(", ", SystemRegistryOnboardingWithNameRequestDTO.class.getSimpleName() + "[", "]") + .add("certificateRequest=" + certificateRequest) + .add("parent=" + super.toString()) + .toString(); + } +} \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithNameResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithNameResponseDTO.java new file mode 100644 index 000000000..8d2a8d95e --- /dev/null +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithNameResponseDTO.java @@ -0,0 +1,24 @@ +package eu.arrowhead.common.dto.shared; + +import java.io.Serializable; +import java.util.Map; + +public class SystemRegistryOnboardingWithNameResponseDTO extends SystemRegistryOnboardingResponseDTO implements Serializable { + + //================================================================================================= + // members + private static final long serialVersionUID = 1L; + + public SystemRegistryOnboardingWithNameResponseDTO() { + } + + public SystemRegistryOnboardingWithNameResponseDTO(final long id, final SystemResponseDTO system, + final DeviceResponseDTO provider, final String endOfValidity, + final Map metadata, final int version, final String createdAt, + final String updatedAt, + final CertificateCreationResponseDTO certificateResponse) { + super(id, system, provider, endOfValidity, metadata, version, createdAt, updatedAt, certificateResponse); + } + + // this class exist to keep the structure of RequestDTO, ResponseDTO +} diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java index 6150565bc..d9da3f30d 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java @@ -5,6 +5,7 @@ import java.io.Serializable; import java.util.Map; +import java.util.StringJoiner; @JsonInclude(Include.NON_NULL) public class SystemRegistryRequestDTO implements Serializable { @@ -26,6 +27,12 @@ public class SystemRegistryRequestDTO implements Serializable { public SystemRegistryRequestDTO() { } + public SystemRegistryRequestDTO(final SystemRequestDTO system, final DeviceRequestDTO provider, final String endOfValidity) { + this.system = system; + this.provider = provider; + this.endOfValidity = endOfValidity; + } + public SystemRegistryRequestDTO(final SystemRequestDTO system, final DeviceRequestDTO provider, final String endOfValidity, final Map metadata, final Integer version) { this.system = system; @@ -48,4 +55,15 @@ public SystemRegistryRequestDTO(final SystemRequestDTO system, final DeviceReque public void setEndOfValidity(final String endOfValidity) { this.endOfValidity = endOfValidity; } public void setMetadata(final Map metadata) { this.metadata = metadata; } public void setVersion(final Integer version) { this.version = version; } + + @Override + public String toString() { + return new StringJoiner(", ", SystemRegistryRequestDTO.class.getSimpleName() + "[", "]") + .add("system=" + system) + .add("provider=" + provider) + .add("endOfValidity='" + endOfValidity + "'") + .add("metadata=" + metadata) + .add("version=" + version) + .toString(); + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryResponseDTO.java index ce02c55ad..de8045ac3 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryResponseDTO.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.StringJoiner; @JsonInclude(Include.NON_NULL) public class SystemRegistryResponseDTO implements Serializable { @@ -81,4 +82,18 @@ public boolean equals(final Object o) { public int hashCode() { return Objects.hash(id, system, provider, endOfValidity, metadata, version, createdAt, updatedAt); } + + @Override + public String toString() { + return new StringJoiner(", ", SystemRegistryResponseDTO.class.getSimpleName() + "[", "]") + .add("id=" + id) + .add("system=" + system) + .add("provider=" + provider) + .add("endOfValidity='" + endOfValidity + "'") + .add("metadata=" + metadata) + .add("version=" + version) + .add("createdAt='" + createdAt + "'") + .add("updatedAt='" + updatedAt + "'") + .toString(); + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRequestDTO.java index 66f47ed75..7351268fa 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRequestDTO.java @@ -2,6 +2,7 @@ import java.io.Serializable; import java.util.Objects; +import java.util.StringJoiner; public class SystemRequestDTO implements Serializable { @@ -66,4 +67,14 @@ public boolean equals(final Object obj) { return Objects.equals(address, other.address) && Objects.equals(port, other.port) && Objects.equals(systemName, other.systemName); } + + @Override + public String toString() { + return new StringJoiner(", ", SystemRequestDTO.class.getSimpleName() + "[", "]") + .add("systemName='" + systemName + "'") + .add("address='" + address + "'") + .add("port=" + port) + .add("authenticationInfo='" + authenticationInfo + "'") + .toString(); + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemResponseDTO.java index 9528fa15d..d6a1e885d 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemResponseDTO.java @@ -2,6 +2,7 @@ import java.io.Serializable; import java.util.Objects; +import java.util.StringJoiner; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; @@ -82,4 +83,17 @@ public boolean equals(final Object obj) { return Objects.equals(address, other.address) && Objects.equals(port, other.port) && Objects.equals(systemName, other.systemName); } + + @Override + public String toString() { + return new StringJoiner(", ", SystemResponseDTO.class.getSimpleName() + "[", "]") + .add("id=" + id) + .add("systemName='" + systemName + "'") + .add("address='" + address + "'") + .add("port=" + port) + .add("authenticationInfo='" + authenticationInfo + "'") + .add("createdAt='" + createdAt + "'") + .add("updatedAt='" + updatedAt + "'") + .toString(); + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/exception/ArrowheadException.java b/core-common/src/main/java/eu/arrowhead/common/exception/ArrowheadException.java index 0ada2bca5..3a69dd774 100644 --- a/core-common/src/main/java/eu/arrowhead/common/exception/ArrowheadException.java +++ b/core-common/src/main/java/eu/arrowhead/common/exception/ArrowheadException.java @@ -68,5 +68,5 @@ public ArrowheadException(final String msg) { public String getOrigin() { return origin; } //------------------------------------------------------------------------------------------------- - void setExceptionType(final ExceptionType exceptionType) { this.exceptionType = exceptionType; } + protected void setExceptionType(final ExceptionType exceptionType) { this.exceptionType = exceptionType; } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/security/AccessControlFilter.java b/core-common/src/main/java/eu/arrowhead/common/security/AccessControlFilter.java index cab939cb0..a6771b286 100644 --- a/core-common/src/main/java/eu/arrowhead/common/security/AccessControlFilter.java +++ b/core-common/src/main/java/eu/arrowhead/common/security/AccessControlFilter.java @@ -11,6 +11,7 @@ import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; +import eu.arrowhead.common.SecurityUtilities; import org.springframework.lang.Nullable; import org.springframework.util.Assert; @@ -89,12 +90,6 @@ protected String getServerCloudCN() { //------------------------------------------------------------------------------------------------- @Nullable private String getCertificateCNFromRequest(final HttpServletRequest request) { - final X509Certificate[] certificates = (X509Certificate[]) request.getAttribute(CommonConstants.ATTR_JAVAX_SERVLET_REQUEST_X509_CERTIFICATE); - if (certificates != null && certificates.length != 0) { - final X509Certificate cert = certificates[0]; - return Utilities.getCertCNFromSubject(cert.getSubjectDN().getName()); - } - - return null; + return SecurityUtilities.getCertificateCNFromRequest(request); } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/token/TokenSecurityFilter.java b/core-common/src/main/java/eu/arrowhead/common/token/TokenSecurityFilter.java index 963a7efd4..53d7d85aa 100644 --- a/core-common/src/main/java/eu/arrowhead/common/token/TokenSecurityFilter.java +++ b/core-common/src/main/java/eu/arrowhead/common/token/TokenSecurityFilter.java @@ -11,6 +11,7 @@ import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; +import eu.arrowhead.common.SecurityUtilities; import org.springframework.lang.Nullable; import eu.arrowhead.common.CommonConstants; @@ -81,12 +82,6 @@ protected TokenInfo checkToken(final String clientCN, final String token, final //------------------------------------------------------------------------------------------------- @Nullable private String getCertificateCNFromRequest(final HttpServletRequest request) { - final X509Certificate[] certificates = (X509Certificate[]) request.getAttribute(CommonConstants.ATTR_JAVAX_SERVLET_REQUEST_X509_CERTIFICATE); - if (certificates != null && certificates.length != 0) { - final X509Certificate cert = certificates[0]; - return Utilities.getCertCNFromSubject(cert.getSubjectDN().getName()); - } - - return null; + return SecurityUtilities.getCertificateCNFromRequest(request); } } \ No newline at end of file diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/Constants.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/Constants.java new file mode 100644 index 000000000..74fc77680 --- /dev/null +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/Constants.java @@ -0,0 +1,15 @@ +package eu.arrowhead.core.deviceregistry; + +class Constants { + + //================================================================================================= + // members + static final String PATH_VARIABLE_ID = "deviceId"; + static final String PATH_VARIABLE_DEVICE_NAME = "deviceName"; + + static final String DEVICES_URI = "/devices"; + static final String DEVICE_BY_ID_URI = "/device/{" + PATH_VARIABLE_ID + "}"; + static final String DEVICES_BY_ID_URI = "/devices/{" + PATH_VARIABLE_ID + "}"; + + protected Constants() { super(); } +} diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java index 247d7f1a0..420bd796e 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java @@ -1,10 +1,12 @@ package eu.arrowhead.core.deviceregistry; import eu.arrowhead.common.ApplicationInitListener; +import eu.arrowhead.common.core.CoreSystemService; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.stereotype.Component; import java.util.Base64; +import java.util.List; @Component public class DeviceRegistryApplicationInitListener extends ApplicationInitListener { @@ -19,4 +21,9 @@ protected void customInit(final ContextRefreshedEvent event) { logger.debug("AuthInfo: {}" + Base64.getEncoder().encodeToString(publicKey.getEncoded())); } } + + @Override + protected List getRequiredCoreSystemServiceUris() { + return List.of(CoreSystemService.ORCHESTRATION_SERVICE, CoreSystemService.CERTIFICATE_AUTHORITY_SIGN_SERVICE); + } } \ No newline at end of file diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java index 4171ce021..699f10cc1 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryController.java @@ -2,12 +2,10 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; -import eu.arrowhead.common.CoreDefaults; -import eu.arrowhead.common.CoreUtilities; import eu.arrowhead.common.Defaults; +import eu.arrowhead.common.SecurityUtilities; import eu.arrowhead.common.Utilities; -import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; -import eu.arrowhead.common.dto.internal.DeviceRegistryListResponseDTO; +import eu.arrowhead.common.dto.shared.CertificateType; import eu.arrowhead.common.dto.shared.DeviceQueryFormDTO; import eu.arrowhead.common.dto.shared.DeviceQueryResultDTO; import eu.arrowhead.common.dto.shared.DeviceRegistryRequestDTO; @@ -26,13 +24,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; +import org.springframework.util.Assert; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -40,10 +37,7 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import java.time.format.DateTimeParseException; -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; +import javax.servlet.http.HttpServletRequest; @Api(tags = {CoreCommonConstants.SWAGGER_TAG_ALL}) @CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, @@ -53,32 +47,6 @@ @RequestMapping(CommonConstants.DEVICE_REGISTRY_URI) public class DeviceRegistryController { - //================================================================================================= - // members - - private static final String GET_DEVICE_BY_ID_HTTP_200_MESSAGE = "Device by requested deviceId returned"; - private static final String GET_DEVICE_BY_ID_HTTP_400_MESSAGE = "No Such Device by requested deviceId"; - private static final String PATH_VARIABLE_ID = "deviceId"; - private static final String GET_DEVICES_HTTP_200_MESSAGE = "Devices returned"; - private static final String GET_DEVICES_HTTP_400_MESSAGE = " Invalid parameters"; - private static final String POST_DEVICE_HTTP_201_MESSAGE = "Device created"; - private static final String POST_DEVICE_HTTP_400_MESSAGE = "Could not create device"; - private static final String PUT_DEVICE_HTTP_200_MESSAGE = "Device updated"; - private static final String PUT_DEVICE_HTTP_400_MESSAGE = "Could not update device"; - private static final String PATCH_DEVICE_HTTP_200_MESSAGE = "Device updated"; - private static final String PATCH_DEVICE_HTTP_400_MESSAGE = "Could not update device"; - private static final String DELETE_DEVICE_HTTP_200_MESSAGE = "Device deleted"; - private static final String DELETE_DEVICE_HTTP_400_MESSAGE = "Could not delete device"; - - private static final String GET_DEVICE_REGISTRY_HTTP_200_MESSAGE = "Device Registry entries returned"; - private static final String GET_DEVICE_REGISTRY_HTTP_400_MESSAGE = "Could not retrieve device registry entries"; - private static final String DELETE_DEVICE_REGISTRY_HTTP_200_MESSAGE = "Device Registry entry removed"; - private static final String DELETE_DEVICE_REGISTRY_HTTP_400_MESSAGE = "Could not remove device registry entry"; - - private static final String DEVICE_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/device/{" + PATH_VARIABLE_ID + "}"; - private static final String DEVICES_URI = CoreCommonConstants.MGMT_URI + "/devices"; - private static final String DEVICES_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/devices/{" + PATH_VARIABLE_ID + "}"; - private static final String DEVICE_REGISTRY_REGISTER_DESCRIPTION = "Registers a device"; private static final String DEVICE_REGISTRY_REGISTER_201_MESSAGE = "Device registered"; private static final String DEVICE_REGISTRY_REGISTER_400_MESSAGE = "Could not register device"; @@ -94,31 +62,19 @@ public class DeviceRegistryController { private static final String DEVICE_REGISTRY_QUERY_BY_DEVICE_DTO_DESCRIPTION = "Return Device by requested dto"; private static final String DEVICE_REGISTRY_QUERY_BY_DEVICE_DTO_200_MESSAGE = "Consumer Device data by requestDTO returned"; private static final String DEVICE_REGISTRY_QUERY_BY_DEVICE_DTO_400_MESSAGE = "Could not query Device Registry by Consumer device requestDTO"; - private static final String DEVICE_REGISTRY_UPDATE_DESCRIPTION = "Update a device"; - private static final String DEVICE_REGISTRY_UPDATE_200_MESSAGE = "Device updated"; - private static final String DEVICE_REGISTRY_UPDATE_400_MESSAGE = "Could not update device"; - private static final String DEVICE_REGISTRY_MERGE_DESCRIPTION = "Merge/Patch a device"; - private static final String DEVICE_REGISTRY_MERGE_200_MESSAGE = "Device merged"; - private static final String DEVICE_REGISTRY_MERGE_400_MESSAGE = "Could not merge device"; - - private static final String ID_NOT_VALID_ERROR_MESSAGE = "Id must be greater than 0. "; - private static final String DEVICE_NAME_NULL_ERROR_MESSAGE = " Device name must have value "; - private static final String DEVICE_ADDRESS_NULL_ERROR_MESSAGE = " Device address must have value "; - private static final String DEVICE_MAC_ADDRESS_NULL_ERROR_MESSAGE = " Device MAC address must have value "; - - private static final String PATH_VARIABLE_DEVICE_NAME = "deviceName"; - private static final String DEVICE_REGISTRY_MGMT_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/{" + PATH_VARIABLE_ID + "}"; - private static final String DEVICE_REGISTRY_MGMT_BY_DEVICE_NAME_URI = CoreCommonConstants.MGMT_URI + "/devicename" + "/{" + PATH_VARIABLE_DEVICE_NAME + "}"; - - private static final String MAC_ADDRESS_PATTERN_STRING = "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"; - public static final Pattern MAC_ADDRESS_PATTERN = Pattern.compile(MAC_ADDRESS_PATTERN_STRING); - + //================================================================================================= + // members private final Logger logger = LogManager.getLogger(DeviceRegistryController.class); private final DeviceRegistryDBService deviceRegistryDBService; + private final SecurityUtilities securityUtilities; + private final Validation validation; @Autowired - public DeviceRegistryController(final DeviceRegistryDBService deviceRegistryDBService) { + public DeviceRegistryController(final DeviceRegistryDBService deviceRegistryDBService, + final SecurityUtilities securityUtilities) { this.deviceRegistryDBService = deviceRegistryDBService; + this.securityUtilities = securityUtilities; + this.validation = new Validation(); } @@ -138,241 +94,8 @@ public String echoDevice() { } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return device by deviceId", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_BY_ID_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_BY_ID_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(DEVICE_BY_ID_URI) - @ResponseBody - public DeviceResponseDTO getDeviceById(@PathVariable(value = PATH_VARIABLE_ID) final long deviceId) { - logger.debug("getDeviceById started ..."); - - if (deviceId < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICE_BY_ID_URI); - } - - return deviceRegistryDBService.getDeviceById(deviceId); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return devices by given request parameters", response = DeviceListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICES_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICES_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(DEVICES_URI) - @ResponseBody - public DeviceListResponseDTO getDevices( - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("New DeviceList get request received with page: {} and item_per page: {}", page, size); - - final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities - .validatePageParameters(page, size, direction, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); - final DeviceListResponseDTO deviceListResponseDTO = deviceRegistryDBService.getDeviceEntries(pageParameters, sortField); - logger.debug("DeviceList with page: {} and item_per page: {} successfully retrieved", page, size); - - return deviceListResponseDTO; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return created device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_DEVICE_HTTP_201_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_DEVICE_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PostMapping(path = DEVICES_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseStatus(org.springframework.http.HttpStatus.CREATED) - @ResponseBody - public DeviceResponseDTO addDevice(@RequestBody final DeviceRequestDTO dto) { - logger.debug("New device registration request received with name: {}", dto.getDeviceName()); - - checkDeviceRequest(dto, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); - - final DeviceResponseDTO responseDTO = deviceRegistryDBService - .createDeviceDto(dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); - logger.debug("{} successfully registered.", responseDTO); - - return responseDTO; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return updated device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = PUT_DEVICE_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_DEVICE_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PutMapping(path = DEVICES_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public DeviceResponseDTO updateDevice(@PathVariable(value = PATH_VARIABLE_ID) final long deviceId, @RequestBody final DeviceRequestDTO dto) { - logger.debug("New device update request received with deviceId: {}, definition: {}", deviceId, dto); - - final String origin = CommonConstants.DEVICE_REGISTRY_URI + DEVICE_BY_ID_URI; - if (deviceId < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - checkDevicePutRequest(dto, deviceId); - - final DeviceResponseDTO deviceResponseDTO = deviceRegistryDBService - .updateDeviceByIdResponse(deviceId, dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); - logger.debug("Device with deviceId: '{}' successfully updated with definition '{}'.", deviceId, deviceResponseDTO); - - return deviceResponseDTO; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return device updated by fields", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = PATCH_DEVICE_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PATCH_DEVICE_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PatchMapping(path = DEVICES_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public DeviceResponseDTO mergeDevice(@PathVariable(value = PATH_VARIABLE_ID) final long deviceId, @RequestBody final DeviceRequestDTO request) { - logger.debug("mergeDevice started..."); - - checkDeviceMergeRequest(request, deviceId); - return deviceRegistryDBService.mergeDevice(deviceId, request); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Remove device", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_DEVICE_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_DEVICE_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @DeleteMapping(path = DEVICES_BY_ID_URI) - public void removeDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New Device delete request received with deviceId: {}", id); - - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_BY_ID_URI); - } - - deviceRegistryDBService.removeDeviceById(id); - logger.debug("Device with deviceId: '{}' successfully deleted", id); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return requested device registry entries by the given parameters", response = DeviceRegistryListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_REGISTRY_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = CoreCommonConstants.MGMT_URI) - @ResponseBody - public DeviceRegistryListResponseDTO getDeviceRegistryEntries( - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("New Device Registry get request received with page: {} and item_per page: {}", page, size); - - final CoreUtilities.ValidatedPageParams params = CoreUtilities - .validatePageParameters(page, size, direction, CommonConstants.DEVICE_REGISTRY_URI + CoreCommonConstants.MGMT_URI); - final DeviceRegistryListResponseDTO deviceRegistryEntriesResponse = deviceRegistryDBService - .getDeviceRegistryEntries(params, sortField); - logger.debug("Device Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); - - return deviceRegistryEntriesResponse; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return requested device registry entry", response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_REGISTRY_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = DEVICE_REGISTRY_MGMT_BY_ID_URI) - @ResponseBody - public DeviceRegistryResponseDTO getDeviceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New Device Registry get request received with deviceId: {}", id); - - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, - CommonConstants.DEVICE_REGISTRY_URI + DEVICE_REGISTRY_MGMT_BY_ID_URI); - } - final DeviceRegistryResponseDTO deviceRegistryEntryByIdResponse = deviceRegistryDBService.getDeviceRegistryById(id); - logger.debug("Device Registry entry with deviceId: {} successfully retrieved", id); - - return deviceRegistryEntryByIdResponse; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return requested device registry entries by device definition based on the given parameters", response = DeviceRegistryListResponseDTO.class, - tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_REGISTRY_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = DEVICE_REGISTRY_MGMT_BY_DEVICE_NAME_URI) - @ResponseBody - public DeviceRegistryListResponseDTO getDeviceRegistryEntriesByDeviceName( - @PathVariable(value = PATH_VARIABLE_DEVICE_NAME) final String deviceName, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("New Device Registry get by Device Definition request received with page: {} and item_per page: {}", page, size); - - final String origin = CommonConstants.DEVICE_REGISTRY_URI + DEVICE_REGISTRY_MGMT_BY_DEVICE_NAME_URI; - if (Utilities.isEmpty(deviceName)) { - throw new BadPayloadException("Device name cannot be empty.", HttpStatus.SC_BAD_REQUEST, origin); - } - - final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, origin); - final DeviceRegistryListResponseDTO deviceRegistryEntries = deviceRegistryDBService - .getDeviceRegistryEntriesByDeviceName(deviceName, pageParameters, sortField); - logger.debug("Device Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); - - return deviceRegistryEntries; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Remove the specified device registry entry", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_DEVICE_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_DEVICE_REGISTRY_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @DeleteMapping(path = DEVICE_REGISTRY_MGMT_BY_ID_URI) - public void removeDeviceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New Device Registry delete request received with deviceId: {}", id); - - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, - CommonConstants.DEVICE_REGISTRY_URI + DEVICE_REGISTRY_MGMT_BY_ID_URI); - } - - deviceRegistryDBService.removeDeviceRegistryEntryById(id); - logger.debug("Device Registry with deviceId: '{}' successfully deleted", id); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = DEVICE_REGISTRY_REGISTER_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) + @ApiOperation(value = DEVICE_REGISTRY_REGISTER_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = + {CoreCommonConstants.SWAGGER_TAG_CLIENT}) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_CREATED, message = DEVICE_REGISTRY_REGISTER_201_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DEVICE_REGISTRY_REGISTER_400_MESSAGE), @@ -383,58 +106,17 @@ public void removeDeviceRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID @PostMapping(path = {CommonConstants.OP_DEVICE_REGISTRY_REGISTER_URI, CoreCommonConstants.MGMT_URI}, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody - public DeviceRegistryResponseDTO registerDevice(@RequestBody final DeviceRegistryRequestDTO request) { + public DeviceRegistryResponseDTO registerDevice(final HttpServletRequest httpServletRequest, + @RequestBody final DeviceRegistryRequestDTO request) { logger.debug("New device registration request received"); - checkDeviceRegistryRequest(request, CommonConstants.DEVICE_REGISTRY_URI + CommonConstants.OP_DEVICE_REGISTRY_REGISTER_URI); - + securityUtilities.authenticateCertificate(httpServletRequest, CertificateType.AH_DEVICE); + validation.checkDeviceRegistryRequest(request, getOrigin(CommonConstants.OP_DEVICE_REGISTRY_REGISTER_URI)); final DeviceRegistryResponseDTO response = deviceRegistryDBService.registerDeviceRegistry(request); logger.debug("{} successfully registers its device {}", request.getDevice().getDeviceName(), request.getDevice()); return response; } - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = DEVICE_REGISTRY_UPDATE_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = DEVICE_REGISTRY_UPDATE_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DEVICE_REGISTRY_UPDATE_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PutMapping(path = DEVICE_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public @ResponseBody - DeviceRegistryResponseDTO updateDeviceRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final DeviceRegistryRequestDTO request) { - logger.debug("New device registry update request received"); - checkDeviceRegistryUpdateRequest(id, request, CoreCommonConstants.MGMT_URI); - - final DeviceRegistryResponseDTO response = deviceRegistryDBService.updateDeviceRegistryById(id, request); - logger.debug("Device Registry entry {} is successfully updated with device {} and device {}", id, request.getDevice().getDeviceName(), - request.getDevice()); - - return response; - } - - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = DEVICE_REGISTRY_MERGE_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = DEVICE_REGISTRY_MERGE_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DEVICE_REGISTRY_MERGE_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PatchMapping(path = DEVICE_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public @ResponseBody - DeviceRegistryResponseDTO mergeDeviceRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final DeviceRegistryRequestDTO request) { - logger.debug("New device registry merge request received"); - checkDeviceRegistryMergeRequest(id, request, CoreCommonConstants.MGMT_URI); - - final DeviceRegistryResponseDTO response = deviceRegistryDBService.mergeDeviceRegistryById(id, request); - logger.debug("Device Registry entry {} is successfully merged witch device {} and device {}", id, response.getDevice(), request.getDevice()); - - return response; - } - //------------------------------------------------------------------------------------------------- @ApiOperation(value = DEVICE_REGISTRY_UNREGISTER_DESCRIPTION, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) @ApiResponses(value = { @@ -444,11 +126,12 @@ DeviceRegistryResponseDTO mergeDeviceRegistry(@PathVariable(value = PATH_VARIABL @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) @DeleteMapping(path = CommonConstants.OP_DEVICE_REGISTRY_UNREGISTER_URI) - public void unregisterDevice(@RequestParam(CommonConstants.OP_DEVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_DEVICE_NAME) final String deviceName, + public void unregisterDevice(final HttpServletRequest httpServletRequest, + @RequestParam(CommonConstants.OP_DEVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_DEVICE_NAME) final String deviceName, @RequestParam(CommonConstants.OP_DEVICE_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_MAC_ADDRESS) final String macAddress) { logger.debug("Device removal request received"); - checkUnregisterDeviceParameters(deviceName, macAddress); - + securityUtilities.authenticateCertificate(httpServletRequest, CertificateType.AH_ONBOARDING); + validation.checkUnregisterDeviceParameters(deviceName, macAddress); deviceRegistryDBService.removeDeviceRegistryByNameAndMacAddress(deviceName, macAddress); logger.debug("{} successfully removed", deviceName); } @@ -463,12 +146,14 @@ public void unregisterDevice(@RequestParam(CommonConstants.OP_DEVICE_REGISTRY_UN }) @PostMapping(path = CommonConstants.OP_DEVICE_REGISTRY_QUERY_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody - public DeviceQueryResultDTO queryRegistry(@RequestBody final DeviceQueryFormDTO form) { + public DeviceQueryResultDTO queryRegistry(final HttpServletRequest httpServletRequest, + @RequestBody final DeviceQueryFormDTO form) { logger.debug("Device query request received"); + securityUtilities.authenticateCertificate(httpServletRequest, CertificateType.AH_SYSTEM); if (Utilities.isEmpty(form.getDeviceNameRequirements())) { - throw new BadPayloadException("Device definition requirement is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + - CommonConstants.OP_DEVICE_REGISTRY_QUERY_URI); + throw new BadPayloadException("Device definition requirement is null or blank", HttpStatus.SC_BAD_REQUEST, getOrigin( + CommonConstants.OP_DEVICE_REGISTRY_QUERY_URI)); } final DeviceQueryResultDTO result = deviceRegistryDBService.queryRegistry(form); @@ -487,14 +172,11 @@ public DeviceQueryResultDTO queryRegistry(@RequestBody final DeviceQueryFormDTO }) @GetMapping(path = CoreCommonConstants.OP_DEVICE_REGISTRY_QUERY_BY_DEVICE_ID_URI, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody - public DeviceResponseDTO queryRegistryByDeviceId(@PathVariable(value = PATH_VARIABLE_ID) final long deviceId) { + public DeviceResponseDTO queryRegistryByDeviceId(final HttpServletRequest httpServletRequest, + @PathVariable(value = Constants.PATH_VARIABLE_ID) final long deviceId) { logger.debug("Device query by device deviceId request received"); - - if (deviceId < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + - CoreCommonConstants.OP_DEVICE_REGISTRY_QUERY_BY_DEVICE_ID_URI); - } - + securityUtilities.authenticateCertificate(httpServletRequest, CertificateType.AH_SYSTEM); + validation.checkId(deviceId, getOrigin(CoreCommonConstants.OP_DEVICE_REGISTRY_QUERY_BY_DEVICE_ID_URI)); final DeviceResponseDTO result = deviceRegistryDBService.getDeviceById(deviceId); logger.debug("Return device by deviceId: {}", deviceId); @@ -511,10 +193,11 @@ public DeviceResponseDTO queryRegistryByDeviceId(@PathVariable(value = PATH_VARI }) @PostMapping(path = CoreCommonConstants.OP_DEVICE_REGISTRY_QUERY_BY_DEVICE_DTO_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody - public DeviceResponseDTO queryRegistryByDeviceDTO(@RequestBody final DeviceRequestDTO request) { + public DeviceResponseDTO queryRegistryByDeviceDTO(final HttpServletRequest httpServletRequest, + @RequestBody final DeviceRequestDTO request) { logger.debug("Device query by DeviceRequestDTO request received"); - - checkDeviceRequest(request, CommonConstants.DEVICE_REGISTRY_URI + CoreCommonConstants.OP_DEVICE_REGISTRY_QUERY_BY_DEVICE_ID_URI); + securityUtilities.authenticateCertificate(httpServletRequest, CertificateType.AH_SYSTEM); + validation.checkDeviceRequest(request, getOrigin(CoreCommonConstants.OP_DEVICE_REGISTRY_QUERY_BY_DEVICE_ID_URI)); final String deviceName = request.getDeviceName(); final String macAddress = request.getMacAddress(); @@ -527,161 +210,12 @@ public DeviceResponseDTO queryRegistryByDeviceDTO(@RequestBody final DeviceReque //================================================================================================= // assistant methods - - //------------------------------------------------------------------------------------------------- - private void checkDeviceMergeRequest(final DeviceRequestDTO request, final long deviceId) { - logger.debug("checkDevicePatchRequest started..."); - final String origin = CommonConstants.DEVICE_REGISTRY_URI + DEVICES_BY_ID_URI; - - if (deviceId <= 0) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_BY_ID_URI); - } - - boolean needChange = false; - if (Utilities.notEmpty(request.getAddress())) { - needChange = true; - } - - if (Utilities.notEmpty(request.getDeviceName())) { - needChange = true; - } - - if (Utilities.notEmpty(request.getMacAddress())) { - needChange = true; - } - - if (Utilities.notEmpty(request.getAuthenticationInfo())) { - needChange = true; - } - - if (!needChange) { - throw new BadPayloadException("Patch request is empty.", HttpStatus.SC_BAD_REQUEST, origin); - } + private String getBaseOrigin() { + return CommonConstants.DEVICE_REGISTRY_URI; } - //------------------------------------------------------------------------------------------------- - private void checkDevicePutRequest(final DeviceRequestDTO request, final long deviceId) { - logger.debug("checkDevicePutRequest started..."); - final String origin = CommonConstants.DEVICE_REGISTRY_URI + DEVICES_BY_ID_URI; - - if (deviceId <= 0) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - checkDeviceRequest(request, origin); - } - - //------------------------------------------------------------------------------------------------- - private void checkDeviceRequest(final DeviceRequestDTO request, final String origin) { - logger.debug("checkDeviceRequest started..."); - - if (request == null) { - throw new BadPayloadException("Device is null.", HttpStatus.SC_BAD_REQUEST, origin); - } - - if (Utilities.isEmpty(request.getDeviceName())) { - throw new BadPayloadException(DEVICE_NAME_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - if (Utilities.isEmpty(request.getAddress())) { - throw new BadPayloadException(DEVICE_ADDRESS_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - if (Utilities.isEmpty(request.getMacAddress())) { - throw new BadPayloadException(DEVICE_MAC_ADDRESS_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - } - - //------------------------------------------------------------------------------------------------- - private void checkDeviceRegistryRequest(final DeviceRegistryRequestDTO request, final String origin) { - logger.debug("checkDeviceRegistryRequest started..."); - - checkDeviceRequest(request.getDevice(), origin); - - if (!Utilities.isEmpty(request.getEndOfValidity())) { - try { - Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()); - } catch (final DateTimeParseException ex) { - throw new BadPayloadException( - "End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", - HttpStatus.SC_BAD_REQUEST, origin); - } - } - } - - //------------------------------------------------------------------------------------------------- - private void checkUnregisterDeviceParameters(final String deviceName, final String macAddress) { - // parameters can't be null, but can be empty - logger.debug("checkUnregisterDeviceParameters started..."); - - final String origin = CommonConstants.DEVICE_REGISTRY_URI + CommonConstants.OP_DEVICE_REGISTRY_UNREGISTER_URI; - - if (Utilities.isEmpty(deviceName)) { - throw new BadPayloadException("Name of the device is blank", HttpStatus.SC_BAD_REQUEST, origin); - } - - if (Utilities.isEmpty(macAddress)) { - throw new BadPayloadException("MAC Address of the device is blank", HttpStatus.SC_BAD_REQUEST, origin); - } - - final Matcher matcher = MAC_ADDRESS_PATTERN.matcher(macAddress); - if (!matcher.matches()) { - throw new BadPayloadException("Unrecognized format of MAC Address", HttpStatus.SC_BAD_REQUEST, origin); - } - } - - //------------------------------------------------------------------------------------------------- - private void checkDeviceRegistryUpdateRequest(final long id, final DeviceRegistryRequestDTO request, final String origin) { - logger.debug("checkDeviceRegistryUpdateRequest started..."); - - if (id <= 0) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - checkDeviceRegistryRequest(request, origin); - } - - //------------------------------------------------------------------------------------------------- - @SuppressWarnings("squid:S3776") - private void checkDeviceRegistryMergeRequest(final long id, final DeviceRegistryRequestDTO request, final String origin) { - logger.debug("checkDeviceRegistryMergeRequest started..."); - - if (id <= 0) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - boolean needChange = false; - - if (Objects.nonNull(request.getDevice())) { - final DeviceRequestDTO device = request.getDevice(); - - if (Utilities.notEmpty(device.getDeviceName())) { - needChange = true; - } - else if (Utilities.notEmpty(device.getAddress())) { - needChange = true; - } - else if (Utilities.notEmpty(device.getMacAddress())) { - needChange = true; - } - else if (Utilities.notEmpty(device.getAuthenticationInfo())) { - needChange = true; - } - } - - if (request.getEndOfValidity() != null) { - needChange = true; - } - - if (request.getMetadata() != null) { - needChange = true; - } - - if (request.getVersion() != null && request.getVersion() > 0) { - needChange = true; - } - - if (!needChange) { - throw new BadPayloadException("Patch request is empty.", HttpStatus.SC_BAD_REQUEST, origin); - } + private String getOrigin(final String postfix) { + Assert.notNull(postfix, "Internal error: Origin postfix not provided"); + return getBaseOrigin() + postfix; } } \ No newline at end of file diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryManagementController.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryManagementController.java new file mode 100644 index 000000000..a5e648f7c --- /dev/null +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryManagementController.java @@ -0,0 +1,355 @@ +package eu.arrowhead.core.deviceregistry; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.CoreDefaults; +import eu.arrowhead.common.CoreUtilities; +import eu.arrowhead.common.Defaults; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; +import eu.arrowhead.common.dto.internal.DeviceRegistryListResponseDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.DeviceRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceResponseDTO; +import eu.arrowhead.common.exception.BadPayloadException; +import eu.arrowhead.core.deviceregistry.database.service.DeviceRegistryDBService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.apache.http.HttpStatus; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.util.Assert; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@Api(tags = {CoreCommonConstants.SWAGGER_TAG_ALL}) +@CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, + allowedHeaders = {HttpHeaders.ORIGIN, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT, HttpHeaders.AUTHORIZATION} +) +@RestController +@RequestMapping(CommonConstants.DEVICE_REGISTRY_URI + CoreCommonConstants.MGMT_URI) +public class DeviceRegistryManagementController { + + private static final String DEVICE_REGISTRY_BY_ID_URI = "/{" + Constants.PATH_VARIABLE_ID + "}"; + private static final String DEVICE_REGISTRY_BY_DEVICE_NAME_URI = "/devicename" + "/{" + Constants.PATH_VARIABLE_DEVICE_NAME + "}"; + + private static final String GET_DEVICE_REGISTRY_HTTP_200_MESSAGE = "Device Registry entries returned"; + private static final String GET_DEVICE_REGISTRY_HTTP_400_MESSAGE = "Could not retrieve device registry entries"; + private static final String PUT_DEVICE_REGISTRY_DESCRIPTION = "Update a device"; + private static final String PUT_DEVICE_REGISTRY_HTTP_200_MESSAGE = "Device updated"; + private static final String PUT_DEVICE_REGISTRY_HTTP_400_MESSAGE = "Could not update device"; + private static final String PATCH_DEVICE_REGISTRY_DESCRIPTION = "Merge/Patch a device"; + private static final String PATCH_DEVICE_REGISTRY_HTTP_200_MESSAGE = "Device merged"; + private static final String PATCH_DEVICE_REGISTRY_HTTP_400_MESSAGE = "Could not merge device"; + private static final String GET_DEVICE_BY_ID_HTTP_200_MESSAGE = "Device by requested deviceId returned"; + private static final String GET_DEVICE_BY_ID_HTTP_400_MESSAGE = "No Such Device by requested deviceId"; + private static final String GET_DEVICES_HTTP_200_MESSAGE = "Devices returned"; + private static final String GET_DEVICES_HTTP_400_MESSAGE = " Invalid parameters"; + private static final String POST_DEVICE_HTTP_201_MESSAGE = "Device created"; + private static final String POST_DEVICE_HTTP_400_MESSAGE = "Could not create device"; + private static final String PUT_DEVICE_HTTP_200_MESSAGE = "Device updated"; + private static final String PUT_DEVICE_HTTP_400_MESSAGE = "Could not update device"; + private static final String PATCH_DEVICE_HTTP_200_MESSAGE = "Device updated"; + private static final String PATCH_DEVICE_HTTP_400_MESSAGE = "Could not update device"; + private static final String DELETE_DEVICE_HTTP_200_MESSAGE = "Device deleted"; + private static final String DELETE_DEVICE_HTTP_400_MESSAGE = "Could not delete device"; + private static final String DELETE_DEVICE_REGISTRY_HTTP_200_MESSAGE = "Device Registry entry removed"; + private static final String DELETE_DEVICE_REGISTRY_HTTP_400_MESSAGE = "Could not remove device registry entry"; + + private final Logger logger = LogManager.getLogger(DeviceRegistryManagementController.class); + private final DeviceRegistryDBService deviceRegistryDBService; + private final Validation validation; + + @Autowired + public DeviceRegistryManagementController(final DeviceRegistryDBService deviceRegistryDBService) { + this.deviceRegistryDBService = deviceRegistryDBService; + this.validation = new Validation(); + } + + //================================================================================================= + // methods + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return device by deviceId", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_BY_ID_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_BY_ID_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(Constants.DEVICE_BY_ID_URI) + @ResponseBody + public DeviceResponseDTO getDeviceById(@PathVariable(value = Constants.PATH_VARIABLE_ID) final long deviceId) { + logger.debug("getDeviceById started ..."); + validation.checkId(deviceId, getOrigin(Constants.DEVICE_BY_ID_URI)); + return deviceRegistryDBService.getDeviceById(deviceId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return devices by given request parameters", response = DeviceListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICES_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICES_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(Constants.DEVICES_URI) + @ResponseBody + public DeviceListResponseDTO getDevices( + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("New DeviceList get request received with page: {} and item_per page: {}", page, size); + + final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities + .validatePageParameters(page, size, direction, getOrigin(Constants.DEVICES_URI)); + final DeviceListResponseDTO deviceListResponseDTO = deviceRegistryDBService.getDeviceEntries(pageParameters, sortField); + logger.debug("DeviceList with page: {} and item_per page: {} successfully retrieved", page, size); + + return deviceListResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return created device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_DEVICE_HTTP_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_DEVICE_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = Constants.DEVICES_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(org.springframework.http.HttpStatus.CREATED) + @ResponseBody + public DeviceResponseDTO addDevice(@RequestBody final DeviceRequestDTO dto) { + logger.debug("New device registration request received with name: {}", dto.getDeviceName()); + + validation.checkDeviceRequest(dto, getOrigin(Constants.DEVICES_URI)); + + final DeviceResponseDTO responseDTO = deviceRegistryDBService + .createDeviceDto(dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); + logger.debug("{} successfully registered.", responseDTO); + + return responseDTO; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return updated device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = PUT_DEVICE_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_DEVICE_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PutMapping(path = Constants.DEVICES_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public DeviceResponseDTO updateDevice(@PathVariable(value = Constants.PATH_VARIABLE_ID) final long deviceId, @RequestBody final DeviceRequestDTO dto) { + logger.debug("New device update request received with deviceId: {}, definition: {}", deviceId, dto); + validation.checkDevicePutRequest(dto, deviceId, getOrigin(Constants.DEVICE_BY_ID_URI)); + + final DeviceResponseDTO deviceResponseDTO = deviceRegistryDBService + .updateDeviceByIdResponse(deviceId, dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); + logger.debug("Device with deviceId: '{}' successfully updated with definition '{}'.", deviceId, deviceResponseDTO); + + return deviceResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return device updated by fields", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = PATCH_DEVICE_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PATCH_DEVICE_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PatchMapping(path = Constants.DEVICES_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public DeviceResponseDTO mergeDevice(@PathVariable(value = Constants.PATH_VARIABLE_ID) final long deviceId, @RequestBody final DeviceRequestDTO request) { + logger.debug("mergeDevice started..."); + + validation.checkDeviceMergeRequest(request, deviceId, getOrigin(Constants.DEVICES_BY_ID_URI)); + return deviceRegistryDBService.mergeDevice(deviceId, request); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Remove device", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_DEVICE_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_DEVICE_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = Constants.DEVICES_BY_ID_URI) + public void removeDevice(@PathVariable(value = Constants.PATH_VARIABLE_ID) final long id) { + logger.debug("New Device delete request received with deviceId: {}", id); + + validation.checkId(id, getOrigin(Constants.DEVICES_BY_ID_URI)); + + deviceRegistryDBService.removeDeviceById(id); + logger.debug("Device with deviceId: '{}' successfully deleted", id); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested device registry entries by the given parameters", response = DeviceRegistryListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CoreCommonConstants.MGMT_URI) + @ResponseBody + public DeviceRegistryListResponseDTO getDeviceRegistryEntries( + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("New Device Registry get request received with page: {} and item_per page: {}", page, size); + + final CoreUtilities.ValidatedPageParams params = CoreUtilities + .validatePageParameters(page, size, direction, getBaseOrigin()); + final DeviceRegistryListResponseDTO deviceRegistryEntriesResponse = deviceRegistryDBService + .getDeviceRegistryEntries(params, sortField); + logger.debug("Device Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); + + return deviceRegistryEntriesResponse; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested device registry entry", response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = DEVICE_REGISTRY_BY_ID_URI) + @ResponseBody + public DeviceRegistryResponseDTO getDeviceRegistryEntryById(@PathVariable(value = Constants.PATH_VARIABLE_ID) final long id) { + logger.debug("New Device Registry get request received with deviceId: {}", id); + + validation.checkId(id, getOrigin(DEVICE_REGISTRY_BY_ID_URI)); + final DeviceRegistryResponseDTO deviceRegistryEntryByIdResponse = deviceRegistryDBService.getDeviceRegistryById(id); + logger.debug("Device Registry entry with deviceId: {} successfully retrieved", id); + + return deviceRegistryEntryByIdResponse; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested device registry entries by device definition based on the given parameters", response = DeviceRegistryListResponseDTO.class, + tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = DEVICE_REGISTRY_BY_DEVICE_NAME_URI) + @ResponseBody + public DeviceRegistryListResponseDTO getDeviceRegistryEntriesByDeviceName( + @PathVariable(value = Constants.PATH_VARIABLE_DEVICE_NAME) final String deviceName, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("New Device Registry get by Device Definition request received with page: {} and item_per page: {}", page, size); + + final String origin = getOrigin(DEVICE_REGISTRY_BY_DEVICE_NAME_URI); + if (Utilities.isEmpty(deviceName)) { + throw new BadPayloadException("Device name cannot be empty.", HttpStatus.SC_BAD_REQUEST, origin); + } + + final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, origin); + final DeviceRegistryListResponseDTO deviceRegistryEntries = deviceRegistryDBService + .getDeviceRegistryEntriesByDeviceName(deviceName, pageParameters, sortField); + logger.debug("Device Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); + + return deviceRegistryEntries; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Remove the specified device registry entry", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_DEVICE_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_DEVICE_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = DEVICE_REGISTRY_BY_ID_URI) + public void removeDeviceRegistryEntryById(@PathVariable(value = Constants.PATH_VARIABLE_ID) final long id) { + logger.debug("New Device Registry delete request received with deviceId: {}", id); + validation.checkId(id, getOrigin(DEVICE_REGISTRY_BY_ID_URI)); + deviceRegistryDBService.removeDeviceRegistryEntryById(id); + logger.debug("Device Registry with deviceId: '{}' successfully deleted", id); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = PUT_DEVICE_REGISTRY_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = PUT_DEVICE_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_DEVICE_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PutMapping(path = DEVICE_REGISTRY_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody + DeviceRegistryResponseDTO updateDeviceRegistry(@PathVariable(value = Constants.PATH_VARIABLE_ID) final long id, + @RequestBody final DeviceRegistryRequestDTO request) { + logger.debug("New device registry update request received"); + validation.checkDeviceRegistryUpdateRequest(id, request, getOrigin(DEVICE_REGISTRY_BY_ID_URI)); + + final DeviceRegistryResponseDTO response = deviceRegistryDBService.updateDeviceRegistryById(id, request); + logger.debug("Device Registry entry {} is successfully updated with device {} and device {}", id, request.getDevice().getDeviceName(), + request.getDevice()); + + return response; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = PATCH_DEVICE_REGISTRY_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = PATCH_DEVICE_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PATCH_DEVICE_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PatchMapping(path = DEVICE_REGISTRY_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody + DeviceRegistryResponseDTO mergeDeviceRegistry(@PathVariable(value = Constants.PATH_VARIABLE_ID) final long id, + @RequestBody final DeviceRegistryRequestDTO request) { + logger.debug("New device registry merge request received"); + validation.checkDeviceRegistryMergeRequest(id, request, getOrigin(DEVICE_REGISTRY_BY_ID_URI)); + + final DeviceRegistryResponseDTO response = deviceRegistryDBService.mergeDeviceRegistryById(id, request); + logger.debug("Device Registry entry {} is successfully merged witch device {} and device {}", id, response.getDevice(), request.getDevice()); + + return response; + } + + //================================================================================================= + // assistant methods + private String getBaseOrigin() { + return CommonConstants.DEVICE_REGISTRY_URI + CoreCommonConstants.MGMT_URI; + } + + private String getOrigin(final String postfix) { + Assert.notNull(postfix, "Internal error: Origin postfix not provided"); + return getBaseOrigin() + postfix; + } +} \ No newline at end of file diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryOnboardingController.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryOnboardingController.java new file mode 100644 index 000000000..735097f09 --- /dev/null +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryOnboardingController.java @@ -0,0 +1,128 @@ +package eu.arrowhead.core.deviceregistry; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.Defaults; +import eu.arrowhead.common.SecurityUtilities; +import eu.arrowhead.common.dto.shared.CertificateType; +import eu.arrowhead.common.dto.shared.DeviceRegistryOnboardingWithCsrRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryOnboardingWithCsrResponseDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryOnboardingWithNameRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryOnboardingWithNameResponseDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryResponseDTO; +import eu.arrowhead.core.deviceregistry.database.service.DeviceRegistryDBService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.apache.http.HttpStatus; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.util.Assert; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; + +@Api(tags = {CoreCommonConstants.SWAGGER_TAG_ALL}) +@CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, + allowedHeaders = {HttpHeaders.ORIGIN, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT, HttpHeaders.AUTHORIZATION} +) +@RestController +@RequestMapping(CommonConstants.DEVICE_REGISTRY_URI + CommonConstants.ONBOARDING_URI) +public class DeviceRegistryOnboardingController { + + private static final String DEVICE_REGISTRY_REGISTER_DESCRIPTION = "Onboards and registers a device"; + private static final String DEVICE_REGISTRY_REGISTER_201_MESSAGE = "Device registered"; + private static final String DEVICE_REGISTRY_REGISTER_400_MESSAGE = "Could not register device"; + + //================================================================================================= + // members + private final Logger logger = LogManager.getLogger(DeviceRegistryOnboardingController.class); + private final DeviceRegistryDBService deviceRegistryDBService; + private final SecurityUtilities securityUtilities; + private final Validation validation; + + @Autowired + public DeviceRegistryOnboardingController(final DeviceRegistryDBService deviceRegistryDBService, + final SecurityUtilities securityUtilities) { + this.deviceRegistryDBService = deviceRegistryDBService; + this.securityUtilities = securityUtilities; + this.validation = new Validation(); + } + + // TODO everything here + + //================================================================================================= + // methods + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = DEVICE_REGISTRY_REGISTER_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = + {CoreCommonConstants.SWAGGER_TAG_CLIENT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = DEVICE_REGISTRY_REGISTER_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DEVICE_REGISTRY_REGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) + @PostMapping(path = CommonConstants.OP_DEVICE_REGISTRY_ONBOARDING_WITH_NAME_URI, + consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public DeviceRegistryOnboardingWithNameResponseDTO onboardDevice(final HttpServletRequest httpServletRequest, + @RequestBody final DeviceRegistryOnboardingWithNameRequestDTO request) { + logger.debug("New onboarding with name and device registration request received"); + securityUtilities.authenticateCertificate(httpServletRequest, CertificateType.AH_ONBOARDING); + validation.checkOnboardingRequest(request, getOrigin(CommonConstants.OP_DEVICE_REGISTRY_ONBOARDING_WITH_NAME_URI)); + + final String host = httpServletRequest.getRemoteHost(); + final String address = httpServletRequest.getRemoteAddr(); + final var response = deviceRegistryDBService.onboardAndRegisterDeviceRegistry(request, host, address); + logger.debug("{} successfully registers its device {}", request.getDevice().getDeviceName(), request.getDevice()); + + return response; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = DEVICE_REGISTRY_REGISTER_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = + {CoreCommonConstants.SWAGGER_TAG_CLIENT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = DEVICE_REGISTRY_REGISTER_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DEVICE_REGISTRY_REGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) + @PostMapping(path = CommonConstants.OP_DEVICE_REGISTRY_ONBOARDING_WITH_CSR_URI, + consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public DeviceRegistryOnboardingWithCsrResponseDTO onboardDevice(final HttpServletRequest httpServletRequest, + @RequestBody final DeviceRegistryOnboardingWithCsrRequestDTO request) { + logger.debug("New onboarding with csr and device registration request received"); + securityUtilities.authenticateCertificate(httpServletRequest, CertificateType.AH_ONBOARDING); + validation.checkOnboardingRequest(request, getOrigin(CommonConstants.OP_DEVICE_REGISTRY_ONBOARDING_WITH_CSR_URI)); + + final var response = deviceRegistryDBService.onboardAndRegisterDeviceRegistry(request); + logger.debug("{} successfully registers its device {}", request.getDevice().getDeviceName(), request.getDevice()); + + return response; + } + + //================================================================================================= + // assistant methods + private String getBaseOrigin() { + return CommonConstants.DEVICE_REGISTRY_URI + CommonConstants.ONBOARDING_URI; + } + + private String getOrigin(final String postfix) { + Assert.notNull(postfix, "Internal error: Origin postfix not provided"); + return getBaseOrigin() + postfix; + } +} \ No newline at end of file diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/Validation.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/Validation.java new file mode 100644 index 000000000..7fa9563e9 --- /dev/null +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/Validation.java @@ -0,0 +1,224 @@ +package eu.arrowhead.core.deviceregistry; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.SSLProperties; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.dto.shared.CertificateType; +import eu.arrowhead.common.dto.shared.DeviceRegistryOnboardingWithCsrRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryOnboardingWithNameRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceRequestDTO; +import eu.arrowhead.common.exception.AuthException; +import eu.arrowhead.common.exception.BadPayloadException; +import org.apache.http.HttpStatus; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.servlet.http.HttpServletRequest; +import java.security.cert.X509Certificate; +import java.time.format.DateTimeParseException; +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class Validation { + + private static final String ID_NOT_VALID_ERROR_MESSAGE = "Id must be greater than 0. "; + private static final String DEVICE_NAME_NULL_ERROR_MESSAGE = " Device name must have value "; + private static final String DEVICE_ADDRESS_NULL_ERROR_MESSAGE = " Device address must have value "; + private static final String DEVICE_MAC_ADDRESS_NULL_ERROR_MESSAGE = " Device MAC address must have value "; + + private static final String MAC_ADDRESS_PATTERN_STRING = "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"; + public static final Pattern MAC_ADDRESS_PATTERN = Pattern.compile(MAC_ADDRESS_PATTERN_STRING); + + private final Logger logger = LogManager.getLogger(); + + Validation() { super(); } + + //------------------------------------------------------------------------------------------------- + void checkId(final Long id, final String origin) { + logger.debug("checkId started..."); + + if (id == null) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (id < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + + CoreCommonConstants.OP_DEVICE_REGISTRY_QUERY_BY_DEVICE_ID_URI); + } + } + + //------------------------------------------------------------------------------------------------- + void checkUnregisterDeviceParameters(final String deviceName, final String macAddress) { + // parameters can't be null, but can be empty + logger.debug("checkUnregisterDeviceParameters started..."); + + final String origin = CommonConstants.DEVICE_REGISTRY_URI + CommonConstants.OP_DEVICE_REGISTRY_UNREGISTER_URI; + + if (Utilities.isEmpty(deviceName)) { + throw new BadPayloadException("Name of the device is blank", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(macAddress)) { + throw new BadPayloadException("MAC Address of the device is blank", HttpStatus.SC_BAD_REQUEST, origin); + } + + final Matcher matcher = MAC_ADDRESS_PATTERN.matcher(macAddress); + if (!matcher.matches()) { + throw new BadPayloadException("Unrecognized format of MAC Address", HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + void checkDeviceMergeRequest(final DeviceRequestDTO request, final Long deviceId, final String origin) { + logger.debug("checkDeviceMergeRequest started..."); + + checkId(deviceId, origin); + + boolean needChange = false; + if (Utilities.notEmpty(request.getAddress())) { + needChange = true; + } + + if (Utilities.notEmpty(request.getDeviceName())) { + needChange = true; + } + + if (Utilities.notEmpty(request.getMacAddress())) { + needChange = true; + } + + if (Utilities.notEmpty(request.getAuthenticationInfo())) { + needChange = true; + } + + if (!needChange) { + throw new BadPayloadException("Patch request is empty.", HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + void checkDevicePutRequest(final DeviceRequestDTO request, final Long deviceId, final String origin) { + logger.debug("checkDevicePutRequest started..."); + checkId(deviceId, origin); + checkDeviceRequest(request, origin); + } + + //------------------------------------------------------------------------------------------------- + void checkDeviceRequest(final DeviceRequestDTO request, final String origin) { + logger.debug("checkDeviceRequest started..."); + + if (request == null) { + throw new BadPayloadException("Device is null.", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(request.getDeviceName())) { + throw new BadPayloadException(DEVICE_NAME_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(request.getAddress())) { + throw new BadPayloadException(DEVICE_ADDRESS_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + if (Utilities.isEmpty(request.getMacAddress())) { + throw new BadPayloadException(DEVICE_MAC_ADDRESS_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + void checkOnboardingRequest(final DeviceRegistryOnboardingWithNameRequestDTO request, final String origin) { + logger.debug("checkOnboardingRequest started..."); + if (request == null) { + throw new BadPayloadException("Request is null.", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (request.getCertificateCreationRequest() == null) { + throw new BadPayloadException("Certificate creation request is null.", HttpStatus.SC_BAD_REQUEST, origin); + } + + checkDeviceRegistryRequest(request, origin); + } + + //------------------------------------------------------------------------------------------------- + void checkOnboardingRequest(final DeviceRegistryOnboardingWithCsrRequestDTO request, final String origin) { + logger.debug("checkOnboardingRequest started..."); + if (request == null) { + throw new BadPayloadException("Request is null.", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (request.getCertificateSigningRequest() == null) { + throw new BadPayloadException("Certificate signing request is null.", HttpStatus.SC_BAD_REQUEST, origin); + } + + checkDeviceRegistryRequest(request, origin); + } + + //------------------------------------------------------------------------------------------------- + void checkDeviceRegistryRequest(final DeviceRegistryRequestDTO request, final String origin) { + logger.debug("checkDeviceRegistryRequest started..."); + + checkDeviceRequest(request.getDevice(), origin); + + if (!Utilities.isEmpty(request.getEndOfValidity())) { + try { + Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()); + } catch (final DateTimeParseException ex) { + throw new BadPayloadException( + "End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", + HttpStatus.SC_BAD_REQUEST, origin); + } + } + } + + //------------------------------------------------------------------------------------------------- + void checkDeviceRegistryUpdateRequest(final Long id, final DeviceRegistryRequestDTO request, final String origin) { + logger.debug("checkDeviceRegistryUpdateRequest started..."); + + checkId(id, origin); + checkDeviceRegistryRequest(request, origin); + } + + //------------------------------------------------------------------------------------------------- + void checkDeviceRegistryMergeRequest(final Long id, final DeviceRegistryRequestDTO request, final String origin) { + logger.debug("checkDeviceRegistryMergeRequest started..."); + + checkId(id, origin); + + boolean needChange = false; + + if (Objects.nonNull(request.getDevice())) { + final DeviceRequestDTO device = request.getDevice(); + + if (Utilities.notEmpty(device.getDeviceName())) { + needChange = true; + } + else if (Utilities.notEmpty(device.getAddress())) { + needChange = true; + } + else if (Utilities.notEmpty(device.getMacAddress())) { + needChange = true; + } + else if (Utilities.notEmpty(device.getAuthenticationInfo())) { + needChange = true; + } + } + + if (request.getEndOfValidity() != null) { + needChange = true; + } + + if (request.getMetadata() != null) { + needChange = true; + } + + if (request.getVersion() != null && request.getVersion() > 0) { + needChange = true; + } + + if (!needChange) { + throw new BadPayloadException("Patch request is empty.", HttpStatus.SC_BAD_REQUEST, origin); + } + } + +} diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java index 32823be5d..e58e03a9d 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java @@ -3,6 +3,7 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.CoreUtilities; +import eu.arrowhead.common.SecurityUtilities; import eu.arrowhead.common.Utilities; import eu.arrowhead.common.database.entity.Device; import eu.arrowhead.common.database.entity.DeviceRegistry; @@ -10,18 +11,27 @@ import eu.arrowhead.common.database.repository.DeviceRegistryRepository; import eu.arrowhead.common.database.repository.DeviceRepository; import eu.arrowhead.common.database.repository.SystemRepository; +import eu.arrowhead.common.drivers.CertificateAuthorityDriver; +import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; import eu.arrowhead.common.dto.internal.DTOConverter; import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; import eu.arrowhead.common.dto.internal.DeviceRegistryListResponseDTO; +import eu.arrowhead.common.dto.shared.CertificateCreationRequestDTO; +import eu.arrowhead.common.dto.shared.CertificateCreationResponseDTO; +import eu.arrowhead.common.dto.shared.CertificateType; import eu.arrowhead.common.dto.shared.DeviceQueryFormDTO; import eu.arrowhead.common.dto.shared.DeviceQueryResultDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryOnboardingWithCsrRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryOnboardingWithCsrResponseDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryOnboardingWithNameRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceRegistryOnboardingWithNameResponseDTO; import eu.arrowhead.common.dto.shared.DeviceRegistryRequestDTO; import eu.arrowhead.common.dto.shared.DeviceRegistryResponseDTO; import eu.arrowhead.common.dto.shared.DeviceRequestDTO; import eu.arrowhead.common.dto.shared.DeviceResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.exception.InvalidParameterException; -import eu.arrowhead.core.deviceregistry.DeviceRegistryController; +import eu.arrowhead.core.deviceregistry.Validation; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -31,6 +41,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; +import java.security.KeyPair; import java.time.ZonedDateTime; import java.time.format.DateTimeParseException; import java.util.ArrayList; @@ -54,44 +65,28 @@ public class DeviceRegistryDBService { private final Logger logger = LogManager.getLogger(DeviceRegistryDBService.class); private final DeviceRegistryRepository deviceRegistryRepository; - private final SystemRepository systemRepository; - private final DeviceRepository deviceRepository; + private final SecurityUtilities securityUtilities; + private final CertificateAuthorityDriver caDriver; @Autowired public DeviceRegistryDBService(final DeviceRegistryRepository deviceRegistryRepository, final SystemRepository systemRepository, - final DeviceRepository deviceRepository) { + final DeviceRepository deviceRepository, + final SecurityUtilities securityUtilities, + final CertificateAuthorityDriver caDriver) { this.deviceRegistryRepository = deviceRegistryRepository; this.systemRepository = systemRepository; this.deviceRepository = deviceRepository; + this.securityUtilities = securityUtilities; + this.caDriver = caDriver; } //================================================================================================= // methods - //------------------------------------------------------------------------------------------------- - @Transactional(rollbackFor = ArrowheadException.class) - public void removeSystemById(final long id) { - logger.debug("removeSystemById started..."); - - try { - if (!systemRepository.existsById(id)) { - throw new InvalidParameterException(COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE); - } - - systemRepository.deleteById(id); - systemRepository.flush(); - } catch (final InvalidParameterException ex) { - throw ex; - } catch (final Exception ex) { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } - } - //------------------------------------------------------------------------------------------------- public DeviceResponseDTO getDeviceById(long deviceId) { logger.debug("getDeviceById started..."); @@ -112,6 +107,48 @@ public DeviceResponseDTO getDeviceById(long deviceId) { } //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public DeviceRegistryOnboardingWithNameResponseDTO onboardAndRegisterDeviceRegistry(final DeviceRegistryOnboardingWithNameRequestDTO request, + final String host, final String address) { + logger.debug("onboardAndRegisterDeviceRegistry started..."); + + final CertificateCreationRequestDTO creationRequestDTO = request.getCertificateCreationRequest(); + final KeyPair keyPair = securityUtilities.extractOrGenerateKeyPair(creationRequestDTO); + final String certificateSigningRequest; + + try { + certificateSigningRequest = securityUtilities + .createCertificateSigningRequest(creationRequestDTO.getCommonName(), keyPair, host, address, CertificateType.AH_DEVICE); + } catch (Exception e) { + logger.error(e.getMessage(), e); + throw new ArrowheadException("Unable to create certificate signing request: " + e.getMessage()); + } + + final var signingResponse = signCertificate(certificateSigningRequest); + signingResponse.setKeyPairDTO(securityUtilities.encodeKeyPair(keyPair)); + + final var retValue = new DeviceRegistryOnboardingWithNameResponseDTO(); + retValue.setCertificateResponse(signingResponse); + retValue.load(registerDeviceRegistry(request)); + return retValue; + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) + public DeviceRegistryOnboardingWithCsrResponseDTO onboardAndRegisterDeviceRegistry(final DeviceRegistryOnboardingWithCsrRequestDTO request) { + + logger.debug("onboardAndRegisterDeviceRegistry started..."); + final var signingResponse = signCertificate(request.getCertificateSigningRequest()); + securityUtilities.extractAndSetPublicKey(signingResponse); + + final var retValue = new DeviceRegistryOnboardingWithCsrResponseDTO(); + retValue.setCertificateResponse(signingResponse); + retValue.load(registerDeviceRegistry(request)); + return retValue; + } + + //------------------------------------------------------------------------------------------------- + @Transactional(rollbackFor = ArrowheadException.class) public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) { logger.debug("getDeviceList started..."); @@ -123,7 +160,7 @@ public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageP try { final Page devices = deviceRepository.findAll(PageRequest.of(pageParams.getValidatedPage(), pageParams.getValidatedSize(), - pageParams.getValidatedDirection(), validatedSortField)); + pageParams.getValidatedDirection(), validatedSortField)); return DTOConverter.convertDeviceEntryListToDeviceListResponseDTO(devices); } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); @@ -216,9 +253,9 @@ public DeviceRegistryListResponseDTO getDeviceRegistryEntries(final CoreUtilitie try { final PageRequest pageRequest = PageRequest.of(params.getValidatedPage(), - params.getValidatedSize(), - params.getValidatedDirection(), - validatedSortField); + params.getValidatedSize(), + params.getValidatedDirection(), + validatedSortField); final Page deviceRegistryPage = deviceRegistryRepository.findAll(pageRequest); return DTOConverter.convertDeviceRegistryListToDeviceRegistryListResponseDTO(deviceRegistryPage); } catch (final Exception ex) { @@ -243,9 +280,9 @@ public DeviceRegistryListResponseDTO getDeviceRegistryEntriesByDeviceName(final final List devices = deviceRepository.findByDeviceName(Utilities.lowerCaseTrim(deviceName)); final PageRequest pageRequest = PageRequest.of(params.getValidatedPage(), - params.getValidatedSize(), - params.getValidatedDirection(), - validatedSortField); + params.getValidatedSize(), + params.getValidatedDirection(), + validatedSortField); final Page deviceRegistryPage = deviceRegistryRepository.findAllByDeviceIsIn(devices, pageRequest); return DTOConverter.convertDeviceRegistryListToDeviceRegistryListResponseDTO(deviceRegistryPage); } catch (final Exception ex) { @@ -471,15 +508,15 @@ public DeviceQueryResultDTO queryRegistry(final DeviceQueryFormDTO form) { if (form.getMetadataRequirements() != null && !form.getMetadataRequirements().isEmpty()) { final Map requiredMetadata = normalizeMetadata(form.getMetadataRequirements()); registryList.removeIf(e -> - { - final Map metadata = Utilities.text2Map(e.getMetadata()); - if (Objects.isNull(metadata)) { - // we have requirements but no metadata -> remove - return true; - } - - return !metadata.entrySet().containsAll(requiredMetadata.entrySet()); - }); + { + final Map metadata = Utilities.text2Map(e.getMetadata()); + if (Objects.isNull(metadata)) { + // we have requirements but no metadata -> remove + return true; + } + + return !metadata.entrySet().containsAll(requiredMetadata.entrySet()); + }); } logger.debug("Potential system providers after filtering: {}", registryList.size()); @@ -511,11 +548,11 @@ private Map normalizeMetadata(final Map metadata final Map map = new HashMap<>(); metadata.forEach((k, v) -> - { - if (Objects.nonNull(v)) { - map.put(k.trim(), v.trim()); - } - }); + { + if (Objects.nonNull(v)) { + map.put(k.trim(), v.trim()); + } + }); return map; } @@ -549,7 +586,7 @@ private Device validateNonNullDeviceParameters(final String deviceName, final St if (Utilities.isEmpty(macAddress)) { throw new InvalidParameterException("MAC address is null or empty"); } else { - final Matcher matcher = DeviceRegistryController.MAC_ADDRESS_PATTERN.matcher(macAddress); + final Matcher matcher = Validation.MAC_ADDRESS_PATTERN.matcher(macAddress); if (!matcher.matches()) { throw new InvalidParameterException("Unrecognized format of MAC Address"); } @@ -596,9 +633,9 @@ private DeviceRegistry getDeviceRegistryEntryById(final long id) { //------------------------------------------------------------------------------------------------- private Device findOrCreateDevice(DeviceRequestDTO requestDeviceDto) { return findOrCreateDevice(requestDeviceDto.getDeviceName(), - requestDeviceDto.getAddress(), - requestDeviceDto.getMacAddress(), - requestDeviceDto.getAuthenticationInfo()); + requestDeviceDto.getAddress(), + requestDeviceDto.getMacAddress(), + requestDeviceDto.getAuthenticationInfo()); } //------------------------------------------------------------------------------------------------- @@ -626,22 +663,17 @@ private Device findOrCreateDevice(String deviceName, String address, String macA } //------------------------------------------------------------------------------------------------- - private void checkConstraintsOfSystemTable(final String validatedSystemName, final String validatedAddress, final int validatedPort) { - logger.debug("checkConstraintsOfSystemTable started..."); + private CertificateCreationResponseDTO signCertificate(final String signingRequest) { + logger.debug("Contact CertificateAuthority ..."); + final var csrDTO = new CertificateSigningRequestDTO(signingRequest); + final var signingResponse = caDriver.signCertificate(csrDTO); - try { - final Optional find = systemRepository - .findBySystemNameAndAddressAndPort(validatedSystemName.toLowerCase().trim(), validatedAddress.toLowerCase().trim(), validatedPort); - if (find.isPresent()) { - throw new InvalidParameterException( - "System with name: " + validatedSystemName + ", address: " + validatedAddress + ", port: " + validatedPort + " already exists."); - } - } catch (final InvalidParameterException ex) { - throw ex; - } catch (final Exception ex) { - logger.debug(ex.getMessage(), ex); - throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); - } + logger.debug("Processing response from Certificate Authority ..."); + final CertificateCreationResponseDTO certificateResponseDTO = new CertificateCreationResponseDTO(); + certificateResponseDTO.setCertificate(signingResponse.getCertificateChain().get(0)); + certificateResponseDTO.setCertificateFormat(CoreCommonConstants.CERTIFICATE_FORMAT); + certificateResponseDTO.setCertificateType(CertificateType.AH_DEVICE); + return certificateResponseDTO; } //------------------------------------------------------------------------------------------------- @@ -668,9 +700,9 @@ private void checkConstraintsOfDeviceRegistryTable(final Device deviceDb) { final Optional find = deviceRegistryRepository.findByDevice(deviceDb); if (find.isPresent()) { throw new InvalidParameterException("Device Registry entry with provider: (" + - deviceDb.getDeviceName() + ", " + - deviceDb.getMacAddress() + - ") already exists."); + deviceDb.getDeviceName() + ", " + + deviceDb.getMacAddress() + + ") already exists."); } } catch (final InvalidParameterException ex) { throw ex; @@ -748,4 +780,5 @@ private DeviceRegistry setModifiedValuesOfDeviceRegistryEntryFields(final Device throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } + } diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DeviceRegistryAccessControlFilter.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DeviceRegistryAccessControlFilter.java index 077371c2d..68b767de4 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DeviceRegistryAccessControlFilter.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DeviceRegistryAccessControlFilter.java @@ -18,13 +18,13 @@ public class DeviceRegistryAccessControlFilter extends CoreSystemAccessControlFi //------------------------------------------------------------------------------------------------- @Override protected void checkClientAuthorized(final String clientCN, final String method, final String requestTarget, final String requestJSON, final Map queryParams) { - super.checkClientAuthorized(clientCN, method, requestTarget, requestJSON, queryParams); - final String cloudCN = getServerCloudCN(); + // certificates will be verified individually on each method if (requestTarget.contains(CoreCommonConstants.MGMT_URI)) { // Only the local System Operator can use these methods + final String cloudCN = getServerCloudCN(); + super.checkClientAuthorized(clientCN, method, requestTarget, requestJSON, queryParams); checkIfLocalSystemOperator(clientCN, cloudCN, requestTarget); } } - } \ No newline at end of file diff --git a/deviceregistry/src/main/resources/log4j2.xml b/deviceregistry/src/main/resources/log4j2.xml index 3076a30b0..8d3f4329b 100644 --- a/deviceregistry/src/main/resources/log4j2.xml +++ b/deviceregistry/src/main/resources/log4j2.xml @@ -5,6 +5,7 @@ %d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex INFO + DEBUG INFO . @@ -40,7 +41,9 @@ - - + + + + \ No newline at end of file diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java index ea2d39b2a..59b442eea 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java @@ -2,15 +2,14 @@ import eu.arrowhead.common.ApplicationInitListener; import eu.arrowhead.common.CommonConstants; -import eu.arrowhead.common.OrchestrationDriver; -import eu.arrowhead.common.Utilities; import eu.arrowhead.common.core.CoreSystemService; +import eu.arrowhead.common.drivers.DriverUtilities; import eu.arrowhead.common.dto.internal.AuthorizationIntraCloudListResponseDTO; import eu.arrowhead.common.dto.internal.AuthorizationIntraCloudRequestDTO; import eu.arrowhead.common.dto.shared.ServiceInterfaceResponseDTO; -import eu.arrowhead.common.dto.shared.ServiceQueryResultDTO; import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import eu.arrowhead.common.exception.ArrowheadException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -22,16 +21,20 @@ import java.util.Base64; import java.util.Collections; import java.util.List; +import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @Component public class OnboardingApplicationInitListener extends ApplicationInitListener { + private static final long SLEEP_PERIOD = TimeUnit.SECONDS.toMillis(15); + private static final int MAX_RETRIES = 10; + private final Logger logger = LogManager.getLogger(OnboardingApplicationInitListener.class); - private final OrchestrationDriver driver; + private final DriverUtilities driver; @Autowired - public OnboardingApplicationInitListener(final OrchestrationDriver driver) {this.driver = driver;} + public OnboardingApplicationInitListener(final DriverUtilities driver) {this.driver = driver;} //================================================================================================= // members @@ -39,68 +42,71 @@ public class OnboardingApplicationInitListener extends ApplicationInitListener { //------------------------------------------------------------------------------------------------- @Override protected void customInit(final ContextRefreshedEvent event) { - final String scheme; + if (sslProperties.isSslEnabled()) { logger.debug("AuthInfo: {}" + Base64.getEncoder().encodeToString(publicKey.getEncoded())); - scheme = CommonConstants.HTTPS; - } - else { - scheme = CommonConstants.HTTP; } logger.info("Searching for authorization system"); - final ServiceRegistryResponseDTO authEntry = lookup(CoreSystemService.AUTH_CONTROL_INTRA_SERVICE, CommonConstants.AUTHORIZATION_URI); - final SystemResponseDTO authSystem = authEntry.getProvider(); + final UriComponents authIntraService = driver.findUriByServiceRegistry(CoreSystemService.AUTH_CONTROL_INTRA_SERVICE); + final UriComponents authMgmtUri = driver.createCustomUri(authIntraService, CommonConstants.AUTHORIZATION_URI, + OnboardingConstants.AUTHORIZATION_INTRA_CLOUD_MGMT_URI); + logger.debug("Authorization system intracloud management uri created: {}", authMgmtUri.toUriString()); - final UriComponents authMgmtUri = Utilities.createURI(scheme, authSystem.getAddress(), authSystem.getPort(), - CommonConstants.AUTHORIZATION_URI + OnboardingConstants.AUTHORIZATION_INTRA_CLOUD_MGMT_URI); - logger.debug("Searching for own system entry"); - final ServiceRegistryResponseDTO onboardingEntry = lookup(CoreSystemService.ONBOARDING_WITH_CERTIFICATE_AND_CSR); + logger.info("Searching for own system entry"); + final ServiceRegistryResponseDTO onboardingEntry = + driver.findByServiceRegistry(CoreSystemService.ONBOARDING_WITH_CERTIFICATE_AND_CSR_SERVICE, false); final SystemResponseDTO onboardingSystem = onboardingEntry.getProvider(); - logger.debug("Authorization system intracloud management uri created: {}", authMgmtUri.toUriString()); - lookupAndAuthorize(authMgmtUri, onboardingSystem, CoreSystemService.CERTIFICATE_AUTHORITY_SIGN_SERVICE, CommonConstants.CERTIFICATE_AUTHRORITY_URI); - lookupAndAuthorize(authMgmtUri, onboardingSystem, CoreSystemService.ORCHESTRATION_SERVICE, CommonConstants.ORCHESTRATOR_URI); - lookupAndAuthorize(authMgmtUri, onboardingSystem, CoreSystemService.DEVICE_REGISTRY_REGISTER_SERVICE, CommonConstants.DEVICE_REGISTRY_URI); - lookupAndAuthorize(authMgmtUri, onboardingSystem, CoreSystemService.SYSTEM_REGISTRY_REGISTER_SERVICE, CommonConstants.SYSTEM_REGISTRY_URI); - lookupAndAuthorize(authMgmtUri, onboardingSystem, CoreSystemService.SERVICE_REGISTRY_REGISTER_SERVICE, CommonConstants.SERVICE_REGISTRY_URI); + for (CoreSystemService coreSystemService : getRequiredCoreSystemServiceUris()) { + lookupAndAuthorize(authMgmtUri, onboardingSystem, coreSystemService); + } } @Override protected List getRequiredCoreSystemServiceUris() { return List.of(CoreSystemService.CERTIFICATE_AUTHORITY_SIGN_SERVICE, CoreSystemService.ORCHESTRATION_SERVICE, - CoreSystemService.DEVICE_REGISTRY_REGISTER_SERVICE, - CoreSystemService.SYSTEM_REGISTRY_REGISTER_SERVICE, + CoreSystemService.DEVICE_REGISTRY_ONBOARDING_WITH_NAME_SERVICE, + CoreSystemService.DEVICE_REGISTRY_ONBOARDING_WITH_CSR_SERVICE, + CoreSystemService.SYSTEM_REGISTRY_ONBOARDING_WITH_NAME_SERVICE, + CoreSystemService.SYSTEM_REGISTRY_ONBOARDING_WITH_CSR_SERVICE, CoreSystemService.SERVICE_REGISTRY_REGISTER_SERVICE); } private void lookupAndAuthorize(final UriComponents authMgmtUri, final SystemResponseDTO consumer, - final CoreSystemService service, - final String prefix) { - final ServiceRegistryResponseDTO serviceEntry = lookup(service, prefix); + final CoreSystemService service) { + final ServiceRegistryResponseDTO serviceEntry = driver.findByServiceRegistry(service, false); final SystemResponseDTO systemEntry = serviceEntry.getProvider(); - logger.debug("Creating authorization rule"); + int retryCount = 0; + + logger.info("Creating authorization rule for {}", service); + final var authRequest = new AuthorizationIntraCloudRequestDTO(); authRequest.setConsumerId(consumer.getId()); authRequest.setProviderIds(Collections.singletonList(systemEntry.getId())); authRequest.setInterfaceIds(serviceEntry.getInterfaces().stream().map(ServiceInterfaceResponseDTO::getId).collect(Collectors.toList())); authRequest.setServiceDefinitionIds(Collections.singletonList(serviceEntry.getServiceDefinition().getId())); - httpService.sendRequest(authMgmtUri, HttpMethod.POST, AuthorizationIntraCloudListResponseDTO.class, authRequest); - } - - private ServiceRegistryResponseDTO lookup(final CoreSystemService coreSystemService) { - logger.info("Looking up {}", coreSystemService.getServiceDefinition()); - final ServiceQueryResultDTO onboardingQueryResultDTO = driver.getService(coreSystemService); - return onboardingQueryResultDTO.getServiceQueryData().get(0); + try { + httpService.sendRequest(authMgmtUri, HttpMethod.POST, AuthorizationIntraCloudListResponseDTO.class, authRequest); + } catch (final ArrowheadException e) { + if (retryCount++ > MAX_RETRIES) { + throw e; + } else { + logger.info("Unable to retrieve service {}: {}. Retrying in {}ms", service.getServiceDefinition(), e.getMessage(), SLEEP_PERIOD); + sleep(); + } + } } - private ServiceRegistryResponseDTO lookup(final CoreSystemService coreSystemService, final String prefix) { - final ServiceRegistryResponseDTO responseDTO = lookup(coreSystemService); - driver.pingService(responseDTO.getProvider(), prefix); - return responseDTO; + private void sleep() { + try { + Thread.sleep(SLEEP_PERIOD); + } catch (InterruptedException e) { + logger.warn(e.getMessage()); + } } } \ No newline at end of file diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java index bed29a70e..ff1db49b4 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java @@ -39,7 +39,6 @@ import javax.servlet.http.HttpServletRequest; import java.security.cert.X509Certificate; import java.util.Base64; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -71,7 +70,7 @@ public class OnboardingController { @Resource(name = CommonConstants.ARROWHEAD_CONTEXT) - private Map arrowheadContext; + private Map arrowheadContext; @Value(value = "${sharedSecret:#{null}}") private Optional sharedSecret; @@ -98,7 +97,8 @@ public String echoOnboarding() { } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Onboarding with certificate and device name", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiOperation(value = "Onboarding with certificate and device name", response = DeviceResponseDTO.class, + tags = {CoreCommonConstants.SWAGGER_TAG_MGMT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_OK, message = ONBOARDING_HTTP_200_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = ONBOARDING_HTTP_400_MESSAGE), @@ -120,7 +120,8 @@ public OnboardingWithNameResponseDTO onboardWithCertificateAndName(final HttpSer } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Onboarding with shared secret and device name", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiOperation(value = "Onboarding with shared secret and device name", response = DeviceResponseDTO.class, + tags = {CoreCommonConstants.SWAGGER_TAG_MGMT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_OK, message = ONBOARDING_HTTP_200_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = ONBOARDING_HTTP_400_MESSAGE), @@ -143,7 +144,8 @@ public OnboardingWithNameResponseDTO onboardWithSharedSecretAndName(final HttpSe } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Onboarding with certificate and certificate signing request", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiOperation(value = "Onboarding with certificate and certificate signing request", response = DeviceResponseDTO.class, + tags = {CoreCommonConstants.SWAGGER_TAG_MGMT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_OK, message = ONBOARDING_HTTP_200_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = ONBOARDING_HTTP_400_MESSAGE), @@ -163,7 +165,8 @@ public OnboardingWithCsrResponseDTO onboardWithCertificateAndSigningRequest(fina } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Onboarding with certificate and certificate signing request", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiOperation(value = "Onboarding with certificate and certificate signing request", response = DeviceResponseDTO.class, + tags = {CoreCommonConstants.SWAGGER_TAG_MGMT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_OK, message = ONBOARDING_HTTP_200_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = ONBOARDING_HTTP_400_MESSAGE), @@ -207,9 +210,7 @@ private void authenticateCertificate(final HttpServletRequest httpServletRequest logger.debug("{} is unauthorized to access {}", clientCN, requestTarget); throw new AuthException(clientCN + " is unauthorized to access " + requestTarget); } - } - else - { + } else { logger.debug("No client certificate given!"); throw new AuthException("Client certificate in needed!"); } @@ -282,5 +283,4 @@ private String getServerCloudCN() { return serverFields[1]; } - } \ No newline at end of file diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java index cd3e5b3d3..878b7dac3 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java @@ -1,52 +1,48 @@ package eu.arrowhead.core.onboarding.database.service; -import eu.arrowhead.common.CommonConstants; -import eu.arrowhead.common.OrchestrationDriver; +import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.SecurityUtilities; import eu.arrowhead.common.core.CoreSystemService; +import eu.arrowhead.common.drivers.CertificateAuthorityDriver; +import eu.arrowhead.common.drivers.DriverUtilities; +import eu.arrowhead.common.drivers.OrchestrationDriver; import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; import eu.arrowhead.common.dto.internal.CertificateSigningResponseDTO; import eu.arrowhead.common.dto.shared.CertificateCreationRequestDTO; -import eu.arrowhead.common.dto.shared.CertificateResponseDTO; +import eu.arrowhead.common.dto.shared.CertificateCreationResponseDTO; +import eu.arrowhead.common.dto.shared.CertificateType; import eu.arrowhead.common.dto.shared.OnboardingResponseDTO; import eu.arrowhead.common.dto.shared.OnboardingWithCsrRequestDTO; import eu.arrowhead.common.dto.shared.OnboardingWithCsrResponseDTO; import eu.arrowhead.common.dto.shared.OnboardingWithNameRequestDTO; import eu.arrowhead.common.dto.shared.OnboardingWithNameResponseDTO; -import eu.arrowhead.common.dto.shared.OrchestrationResultDTO; import eu.arrowhead.common.dto.shared.ServiceEndpoint; -import eu.arrowhead.common.dto.shared.ServiceRegistryResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; -import eu.arrowhead.common.http.HttpService; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpMethod; -import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import org.springframework.web.util.UriComponents; import java.security.KeyPair; -import java.util.Objects; +import java.util.function.Consumer; @Service public class OnboardingDBService { //================================================================================================= // members - private final static String CERTIFICATE_TYPE = "X.509"; - - private final OrchestrationDriver orchestration; private final Logger logger = LogManager.getLogger(OnboardingDBService.class); - private final HttpService httpService; + private final OrchestrationDriver orchestrationDriver; + private final CertificateAuthorityDriver caDriver; private final SecurityUtilities securityUtilities; @Autowired - public OnboardingDBService(final OrchestrationDriver orchestration, - final HttpService httpService, + public OnboardingDBService(final OrchestrationDriver orchestrationDriver, + final CertificateAuthorityDriver caDriver, final SecurityUtilities securityUtilities) { - this.orchestration = orchestration; - this.httpService = httpService; + this.orchestrationDriver = orchestrationDriver; + this.caDriver = caDriver; this.securityUtilities = securityUtilities; } @@ -54,108 +50,89 @@ public OnboardingDBService(final OrchestrationDriver orchestration, // methods //------------------------------------------------------------------------------------------------- - public OnboardingWithNameResponseDTO onboarding(final OnboardingWithNameRequestDTO onboardingRequest, final String host, final String address) { + public OnboardingWithNameResponseDTO onboarding(final OnboardingWithNameRequestDTO onboardingRequest, final String host, final String address) + throws DriverUtilities.DriverException { logger.debug("onboarding started..."); final CertificateCreationRequestDTO creationRequestDTO = onboardingRequest.getCreationRequestDTO(); - final KeyPair keyPair = securityUtilities.extractKeyPair(creationRequestDTO); + final KeyPair keyPair = securityUtilities.extractOrGenerateKeyPair(creationRequestDTO); final String certificateSigningRequest; try { - certificateSigningRequest = securityUtilities.createEncodedCSR(creationRequestDTO.getCommonName(), keyPair, host, address); + certificateSigningRequest = securityUtilities.createCertificateSigningRequest(creationRequestDTO.getCommonName(), keyPair, + host, address, CertificateType.AH_ONBOARDING); } catch (Exception e) { logger.error(e.getMessage(), e); throw new ArrowheadException("Unable to create certificate signing request: " + e.getMessage()); } - final CertificateSigningResponseDTO signingResponseDTO = executeCertificateSigningRequest(certificateSigningRequest); - final OnboardingWithNameResponseDTO responseDTO = enrichOnboardingResponse(new OnboardingWithNameResponseDTO(), signingResponseDTO); - - final CertificateResponseDTO onboardingCertificate = responseDTO.getOnboardingCertificate(); - - onboardingCertificate.setKeyAlgorithm(keyPair.getPrivate().getAlgorithm()); - onboardingCertificate.setKeyFormat(keyPair.getPrivate().getFormat()); - onboardingCertificate.setPrivateKey(keyPair.getPrivate().getEncoded()); // TODO change to Base64? - onboardingCertificate.setPublicKey(keyPair.getPublic().getEncoded()); + final var signingResponseDTO = executeCertificateSigningRequest(certificateSigningRequest); + final var responseDto = new OnboardingWithNameResponseDTO(); + enrichCaResult(responseDto, signingResponseDTO); + enrichEndpoints(responseDto); - responseDTO.setCertificateType(CERTIFICATE_TYPE); + final CertificateCreationResponseDTO onboardingCertificate = responseDto.getOnboardingCertificate(); + onboardingCertificate.setKeyPairDTO(securityUtilities.encodeKeyPair(keyPair)); - return responseDTO; + return responseDto; } //------------------------------------------------------------------------------------------------- - public OnboardingWithCsrResponseDTO onboarding(final OnboardingWithCsrRequestDTO onboardingRequest) { + public OnboardingWithCsrResponseDTO onboarding(final OnboardingWithCsrRequestDTO onboardingRequest) + throws DriverUtilities.DriverException { logger.debug("onboarding started..."); - final CertificateSigningResponseDTO signingResponseDTO = - executeCertificateSigningRequest(onboardingRequest.getCertificateSigningRequest()); - return enrichOnboardingResponse(new OnboardingWithCsrResponseDTO(), signingResponseDTO); + + final var signingResponseDTO = executeCertificateSigningRequest(onboardingRequest.getCertificateSigningRequest()); + final var responseDto = new OnboardingWithCsrResponseDTO(); + enrichCaResult(responseDto, signingResponseDTO); + enrichEndpoints(responseDto); + + final var onboardingCertificate = responseDto.getOnboardingCertificate(); + securityUtilities.extractAndSetPublicKey(onboardingCertificate); + + return responseDto; } //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- - private CertificateSigningResponseDTO executeCertificateSigningRequest(final String certificateSigningRequest) { - - logger.debug("Loading OrchestrationDriver ..."); - final ServiceRegistryResponseDTO orchService = getOrchestratorService(); - - logger.debug("Orchestrate CertificateAuthority ..."); - final OrchestrationResultDTO caOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_CERTIFICATE_AUTHORITY_SIGN); - + private CertificateSigningResponseDTO executeCertificateSigningRequest(final String certificateSigningRequest) throws DriverUtilities.DriverException { logger.debug("Contact CertificateAuthority ..."); - final UriComponents caUri = orchestration.createUri(caOrchResult.getProvider(), - CommonConstants.CERTIFICATE_AUTHRORITY_URI + CommonConstants.OP_CA_SIGN_CERTIFICATE_URI); - - final CertificateSigningRequestDTO csrDTO = new CertificateSigningRequestDTO(certificateSigningRequest); - final ResponseEntity httpResponse = httpService - .sendRequest(caUri, HttpMethod.POST, CertificateSigningResponseDTO.class, csrDTO); - - final CertificateSigningResponseDTO csrResult = httpResponse.getBody(); - - if (Objects.isNull(csrResult) || csrResult.getCertificateChain().isEmpty()) { - throw new ArrowheadException("Unable to contact Certificate Authority"); - } - - return csrResult; + final var csrDTO = new CertificateSigningRequestDTO(certificateSigningRequest); + return caDriver.signCertificate(csrDTO); } - private T enrichOnboardingResponse(final T responseDTO, - final CertificateSigningResponseDTO csrResult) { - final ServiceRegistryResponseDTO orchService = getOrchestratorService(); - + private void enrichCaResult(final T responseDTO, final CertificateSigningResponseDTO csrResult) { logger.debug("Processing response from Certificate Authority ..."); - final CertificateResponseDTO certificateResponseDTO = new CertificateResponseDTO(); + final CertificateCreationResponseDTO certificateResponseDTO = new CertificateCreationResponseDTO(); certificateResponseDTO.setCertificate(csrResult.getCertificateChain().get(0)); - responseDTO.setIntermediateCertificate(csrResult.getCertificateChain().get(1)); - responseDTO.setRootCertificate(csrResult.getCertificateChain().get(2)); + certificateResponseDTO.setCertificateFormat(CoreCommonConstants.CERTIFICATE_FORMAT); + certificateResponseDTO.setCertificateType(CertificateType.AH_ONBOARDING); responseDTO.setOnboardingCertificate(certificateResponseDTO); + responseDTO.setIntermediateCertificate(csrResult.getCertificateChain().get(1)); + responseDTO.setRootCertificate(csrResult.getCertificateChain().get(2)); + } - logger.debug("Orchestrating Device Registry ..."); - final OrchestrationResultDTO drOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_DEVICE_REGISTRY_REGISTER); - logger.debug("Orchestrating System Registry ..."); - final OrchestrationResultDTO sysrOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_SYSTEM_REGISTRY_REGISTER); - logger.debug("Orchestrating Service Registry ..."); - final OrchestrationResultDTO srOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_SERVICE_REGISTRY_REGISTER); - logger.debug("Orchestrating Orchestration Service ..."); - final OrchestrationResultDTO orchOrchResult = contactOrchestrationService(orchService, CommonConstants.CORE_SERVICE_ORCH_PROCESS); - - responseDTO.setDeviceRegistry(new ServiceEndpoint(CoreSystemService.DEVICE_REGISTRY_REGISTER_SERVICE, orchestration.createUri(drOrchResult).toUri())); - responseDTO.setSystemRegistry(new ServiceEndpoint(CoreSystemService.SYSTEM_REGISTRY_REGISTER_SERVICE, orchestration.createUri(sysrOrchResult).toUri())); - responseDTO.setServiceRegistry(new ServiceEndpoint(CoreSystemService.SERVICE_REGISTRY_REGISTER_SERVICE, orchestration.createUri(srOrchResult).toUri())); - responseDTO.setOrchestrationService(new ServiceEndpoint(CoreSystemService.ORCHESTRATION_SERVICE, orchestration.createUri(orchOrchResult).toUri())); - - return responseDTO; + private void enrichEndpoints(final OnboardingWithNameResponseDTO responseDTO) throws DriverUtilities.DriverException { + orchestrateAndSet(responseDTO::setDeviceRegistry, CoreSystemService.DEVICE_REGISTRY_ONBOARDING_WITH_NAME_SERVICE); + orchestrateAndSet(responseDTO::setSystemRegistry, CoreSystemService.SYSTEM_REGISTRY_ONBOARDING_WITH_NAME_SERVICE); + orchestrateAndSet(responseDTO::setServiceRegistry, CoreSystemService.SERVICE_REGISTRY_REGISTER_SERVICE); + orchestrateAndSet(responseDTO::setOrchestrationService, CoreSystemService.ORCHESTRATION_SERVICE); } - //------------------------------------------------------------------------------------------------- - private ServiceRegistryResponseDTO getOrchestratorService() { - return orchestration.getOrchestratorService().getServiceQueryData().get(0); + private void enrichEndpoints(final OnboardingWithCsrResponseDTO responseDTO) throws DriverUtilities.DriverException { + orchestrateAndSet(responseDTO::setDeviceRegistry, CoreSystemService.DEVICE_REGISTRY_ONBOARDING_WITH_CSR_SERVICE); + orchestrateAndSet(responseDTO::setSystemRegistry, CoreSystemService.SYSTEM_REGISTRY_ONBOARDING_WITH_CSR_SERVICE); + orchestrateAndSet(responseDTO::setServiceRegistry, CoreSystemService.SERVICE_REGISTRY_REGISTER_SERVICE); + orchestrateAndSet(responseDTO::setOrchestrationService, CoreSystemService.ORCHESTRATION_SERVICE); } - //------------------------------------------------------------------------------------------------- - private OrchestrationResultDTO contactOrchestrationService(final ServiceRegistryResponseDTO orchService, final String serviceDefinition) { - return orchestration.contactOrchestrationService(orchService, serviceDefinition).getResponse().get(0); + private void orchestrateAndSet(final Consumer consumer, + final CoreSystemService coreSystemService) throws DriverUtilities.DriverException { + logger.debug("Orchestrating '{}' ...", coreSystemService.getServiceDefinition()); + final UriComponents service = orchestrationDriver.findCoreSystemService(coreSystemService); + consumer.accept(new ServiceEndpoint(coreSystemService, service.toUri())); } } diff --git a/onboarding/src/main/resources/log4j2.xml b/onboarding/src/main/resources/log4j2.xml index 6ef70b044..ee4008a2c 100644 --- a/onboarding/src/main/resources/log4j2.xml +++ b/onboarding/src/main/resources/log4j2.xml @@ -5,6 +5,7 @@ %d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex INFO + DEBUG INFO . @@ -40,8 +41,8 @@ - - + + diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistryAccessControlFilter.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistryAccessControlFilter.java index 3a046f09d..b434c6aef 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistryAccessControlFilter.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistryAccessControlFilter.java @@ -27,13 +27,13 @@ public class SystemRegistryAccessControlFilter extends CoreSystemAccessControlFi //------------------------------------------------------------------------------------------------- @Override protected void checkClientAuthorized(final String clientCN, final String method, final String requestTarget, final String requestJSON, final Map queryParams) { - super.checkClientAuthorized(clientCN, method, requestTarget, requestJSON, queryParams); - final String cloudCN = getServerCloudCN(); + // certificates will be verified individually on each method if (requestTarget.contains(CoreCommonConstants.MGMT_URI)) { // Only the local System Operator can use these methods + final String cloudCN = getServerCloudCN(); + super.checkClientAuthorized(clientCN, method, requestTarget, requestJSON, queryParams); checkIfLocalSystemOperator(clientCN, cloudCN, requestTarget); } } - } \ No newline at end of file From c4d54a2360168477d00fe6a1de40ac2f96406940 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Tue, 31 Mar 2020 11:28:14 +0200 Subject: [PATCH 288/301] Implemented SystemRegistryOnboarding and tested changes with prototype --- .../arrowhead/common/SecurityUtilities.java | 36 +- .../common/dto/shared/CertificateType.java | 22 +- .../SystemRegistryOnboardingResponseDTO.java | 12 + ...emRegistryOnboardingWithCsrRequestDTO.java | 4 +- ...mRegistryOnboardingWithNameRequestDTO.java | 21 +- .../common/security/AccessControlFilter.java | 5 +- .../DeviceRegistryOnboardingController.java | 14 +- .../service/DeviceRegistryDBService.java | 6 - .../DeviceRegistryAccessControlFilter.java | 21 +- .../SystemRegistryController.java | 717 +----------------- .../SystemRegistryManagementController.java | 514 +++++++++++++ .../SystemRegistryOnboardingController.java | 126 +++ .../core/systemregistry/Validation.java | 314 ++++++++ .../service/SystemRegistryDBService.java | 140 +++- .../SystemRegistryAccessControlFilter.java | 29 +- .../src/main/resources/application.properties | 4 +- systemregistry/src/main/resources/log4j2.xml | 2 +- 17 files changed, 1170 insertions(+), 817 deletions(-) create mode 100644 systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryManagementController.java create mode 100644 systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryOnboardingController.java create mode 100644 systemregistry/src/main/java/eu/arrowhead/core/systemregistry/Validation.java diff --git a/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java b/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java index 200d7fe39..8f51b0a79 100644 --- a/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java @@ -133,19 +133,7 @@ public void authenticateCertificate(final HttpServletRequest httpServletRequest, final String clientCN = Utilities.getCertCNFromSubject(cert.getSubjectDN().getName()); final String requestTarget = Utilities.stripEndSlash(httpServletRequest.getRequestURL().toString()); - if (Objects.isNull(clientCN)) { - logger.debug("Unable to extract common name from client certificate: {}", cert.getSubjectDN()); - throw new AuthException("Client is unauthorized to access " + requestTarget); - } - - final CertificateType type = CertificateType.getTypeFromCN(clientCN); - if (!type.hasMinimumStrength(minimumStrength)) { - logger.debug("{} is not a valid common name, access denied!", clientCN); - throw new AuthException(clientCN + " is unauthorized to access " + requestTarget); - } - - // TODO verification by CA - + authenticateCertificate(clientCN, requestTarget, minimumStrength); } else { logger.debug("No client certificate given!"); throw new AuthException("Client certificate in needed!"); @@ -153,6 +141,23 @@ public void authenticateCertificate(final HttpServletRequest httpServletRequest, } } + //------------------------------------------------------------------------------------------------- + public void authenticateCertificate(final String clientCN, final String requestTarget, final CertificateType minimumStrength) { + if (sslProperties.isSslEnabled()) { + + if (Objects.isNull(clientCN)) { + logger.debug("Unable to extract common name from client certificate: {}", clientCN); + throw new AuthException("Client is unauthorized to access " + requestTarget); + } + + final CertificateType type = CertificateType.getTypeFromCN(clientCN); + if (!type.hasMinimumStrength(minimumStrength)) { + logger.debug("{} is not a valid common name, access denied!", clientCN); + throw new AuthException(clientCN + " is unauthorized to access " + requestTarget); + } + } + } + //================================================================================================= // assistant methods @@ -174,9 +179,8 @@ public String createCertificateSigningRequest(final String baseCommonName, final final String operator = getOperatorNameFromCloudCertificate(cloudCertFromKeyStore.getSubjectDN()); final String organization = getOrganizationFromCloudCertificate(cloudCertFromKeyStore.getSubjectDN()); final String country = getCountryFromCloudCertificate(cloudCertFromKeyStore.getSubjectDN()); - final String commonName = String.format("CN=%s.%s.%s, OU=%s, O=%s, C=%s", - baseCommonName, type.getCommonNamePart(), cloudName, operator, organization, country); - //final String commonName = String.format("CN=%s.%s.%s", baseCommonName, type.getCommonNamePart(), cloudName); + final String commonName = String.format("CN=%s.%s, OU=%s, O=%s, C=%s", type.appendTypeToCN(baseCommonName), cloudName, + operator, organization, country); final X500Name x500Name = new X500Name(commonName); logger.debug("Building and Signing Certificate Signing Request for {}", x500Name); diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateType.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateType.java index 30308c9c3..54fba8563 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateType.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateType.java @@ -6,13 +6,13 @@ public enum CertificateType { AH_ONBOARDING("onboarding", 0), AH_DEVICE("device", 1), - AH_SYSTEM("system", 2), - UNKNOWN("unknown", 0); + AH_SYSTEM("", 2), + UNKNOWN("", 0); private final String commonNamePart; private final int strength; - private CertificateType(final String commonNamePart, final int strength) { + CertificateType(final String commonNamePart, final int strength) { this.commonNamePart = commonNamePart; this.strength = strength; } @@ -20,7 +20,7 @@ private CertificateType(final String commonNamePart, final int strength) { public static CertificateType getTypeFromCN(final String commonName) { final String[] split = commonName.split("\\."); - if(Utilities.isKeyStoreCNArrowheadValid(commonName)) { + if (Utilities.isKeyStoreCNArrowheadValid(commonName)) { return AH_SYSTEM; } else if (split.length >= 2) { return CertificateType.getTypeFromCNPart(split[1]); @@ -29,10 +29,6 @@ public static CertificateType getTypeFromCN(final String commonName) { } } - public boolean hasMinimumStrength(final CertificateType minimumStrengthType) { - return this.strength >= minimumStrengthType.strength; - } - private static CertificateType getTypeFromCNPart(final String commonNamePart) { for (CertificateType type : values()) { if (type.commonNamePart.equalsIgnoreCase(commonNamePart)) { @@ -42,7 +38,13 @@ private static CertificateType getTypeFromCNPart(final String commonNamePart) { return UNKNOWN; } - public String getCommonNamePart() { - return commonNamePart; + public boolean hasMinimumStrength(final CertificateType minimumStrengthType) { + return this.strength >= minimumStrengthType.strength; + } + + public String appendTypeToCN(final String commonName) { + if (Utilities.notEmpty(commonNamePart)) { + return commonName + '.' + commonNamePart; + } else { return commonName; } } } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingResponseDTO.java index 68c44a65d..b1679b094 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingResponseDTO.java @@ -45,4 +45,16 @@ public String toString() { .add("parent=" + super.toString()) .toString(); } + + public void load(final SystemRegistryResponseDTO dto) + { + this.setId(dto.getId()); + this.setProvider(dto.getProvider()); + this.setSystem(dto.getSystem()); + this.setMetadata(dto.getMetadata()); + this.setEndOfValidity(dto.getEndOfValidity()); + this.setCreatedAt(dto.getCreatedAt()); + this.setUpdatedAt(dto.getUpdatedAt()); + this.setVersion(dto.getVersion()); + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithCsrRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithCsrRequestDTO.java index 1473a10f0..2babf9a43 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithCsrRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithCsrRequestDTO.java @@ -35,11 +35,11 @@ public SystemRegistryOnboardingWithCsrRequestDTO(final SystemRequestDTO system, } //------------------------------------------------------------------------------------------------- - public String getCertificateRequest() { + public String getCertificateSigningRequest() { return certificateSigningRequest; } - public void setCertificateRequest(final String certificateSigningRequest) { + public void setCertificateSigningRequest(final String certificateSigningRequest) { this.certificateSigningRequest = certificateSigningRequest; } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithNameRequestDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithNameRequestDTO.java index 3ca4cd959..0b8afc88b 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithNameRequestDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithNameRequestDTO.java @@ -5,7 +5,6 @@ import java.io.Serializable; import java.util.Map; -import java.util.Objects; import java.util.StringJoiner; @JsonInclude(Include.NON_NULL) @@ -15,7 +14,7 @@ public class SystemRegistryOnboardingWithNameRequestDTO extends SystemRegistryRe // members private static final long serialVersionUID = -635438605292398404L; - private CertificateCreationRequestDTO certificateRequest; + private CertificateCreationRequestDTO certificateCreationRequest; //================================================================================================= // methods @@ -24,32 +23,32 @@ public SystemRegistryOnboardingWithNameRequestDTO() { } public SystemRegistryOnboardingWithNameRequestDTO(final SystemRequestDTO system, final DeviceRequestDTO provider, final String endOfValidity, - final CertificateCreationRequestDTO certificateRequest) { + final CertificateCreationRequestDTO certificateCreationRequest) { super(system, provider, endOfValidity); - this.certificateRequest = certificateRequest; + this.certificateCreationRequest = certificateCreationRequest; } public SystemRegistryOnboardingWithNameRequestDTO(final SystemRequestDTO system, final DeviceRequestDTO provider, final String endOfValidity, final Map metadata, final Integer version, - final CertificateCreationRequestDTO certificateRequest) { + final CertificateCreationRequestDTO certificateCreationRequest) { super(system, provider, endOfValidity, metadata, version); - this.certificateRequest = certificateRequest; + this.certificateCreationRequest = certificateCreationRequest; } //------------------------------------------------------------------------------------------------- - public CertificateCreationRequestDTO getCertificateRequest() { - return certificateRequest; + public CertificateCreationRequestDTO getCertificateCreationRequest() { + return certificateCreationRequest; } - public void setCertificateRequest(final CertificateCreationRequestDTO certificateRequest) { - this.certificateRequest = certificateRequest; + public void setCertificateCreationRequest(final CertificateCreationRequestDTO certificateCreationRequest) { + this.certificateCreationRequest = certificateCreationRequest; } @Override public String toString() { return new StringJoiner(", ", SystemRegistryOnboardingWithNameRequestDTO.class.getSimpleName() + "[", "]") - .add("certificateRequest=" + certificateRequest) + .add("certificateRequest=" + certificateCreationRequest) .add("parent=" + super.toString()) .toString(); } diff --git a/core-common/src/main/java/eu/arrowhead/common/security/AccessControlFilter.java b/core-common/src/main/java/eu/arrowhead/common/security/AccessControlFilter.java index a6771b286..d18b68fe6 100644 --- a/core-common/src/main/java/eu/arrowhead/common/security/AccessControlFilter.java +++ b/core-common/src/main/java/eu/arrowhead/common/security/AccessControlFilter.java @@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletRequest; import eu.arrowhead.common.SecurityUtilities; +import org.apache.http.HttpStatus; import org.springframework.lang.Nullable; import org.springframework.util.Assert; @@ -68,13 +69,13 @@ public void doFilter(final ServletRequest request, final ServletResponse respons protected void checkClientAuthorized(final String clientCN, final String method, final String requestTarget, final String requestJSON, final Map queryParams) { if (!Utilities.isKeyStoreCNArrowheadValid(clientCN)) { log.debug("{} is not a valid common name, access denied!", clientCN); - throw new AuthException(clientCN + " is unauthorized to access " + requestTarget); + throw new AuthException(clientCN + " is unauthorized to access " + requestTarget, HttpStatus.SC_UNAUTHORIZED, requestTarget); } // All requests from the local cloud are allowed if (!Utilities.isKeyStoreCNArrowheadValid(clientCN, getServerCloudCN())) { log.debug("{} is unauthorized to access {}", clientCN, requestTarget); - throw new AuthException(clientCN + " is unauthorized to access " + requestTarget); + throw new AuthException(clientCN + " is unauthorized to access " + requestTarget, HttpStatus.SC_UNAUTHORIZED, requestTarget); } } diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryOnboardingController.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryOnboardingController.java index 735097f09..2d9178d94 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryOnboardingController.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryOnboardingController.java @@ -9,7 +9,6 @@ import eu.arrowhead.common.dto.shared.DeviceRegistryOnboardingWithCsrResponseDTO; import eu.arrowhead.common.dto.shared.DeviceRegistryOnboardingWithNameRequestDTO; import eu.arrowhead.common.dto.shared.DeviceRegistryOnboardingWithNameResponseDTO; -import eu.arrowhead.common.dto.shared.DeviceRegistryResponseDTO; import eu.arrowhead.core.deviceregistry.database.service.DeviceRegistryDBService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -48,23 +47,18 @@ public class DeviceRegistryOnboardingController { // members private final Logger logger = LogManager.getLogger(DeviceRegistryOnboardingController.class); private final DeviceRegistryDBService deviceRegistryDBService; - private final SecurityUtilities securityUtilities; private final Validation validation; @Autowired - public DeviceRegistryOnboardingController(final DeviceRegistryDBService deviceRegistryDBService, - final SecurityUtilities securityUtilities) { + public DeviceRegistryOnboardingController(final DeviceRegistryDBService deviceRegistryDBService) { this.deviceRegistryDBService = deviceRegistryDBService; - this.securityUtilities = securityUtilities; this.validation = new Validation(); } - // TODO everything here - //================================================================================================= // methods //------------------------------------------------------------------------------------------------- - @ApiOperation(value = DEVICE_REGISTRY_REGISTER_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = + @ApiOperation(value = DEVICE_REGISTRY_REGISTER_DESCRIPTION, response = DeviceRegistryOnboardingWithNameResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_CREATED, message = DEVICE_REGISTRY_REGISTER_201_MESSAGE), @@ -79,7 +73,6 @@ public DeviceRegistryOnboardingController(final DeviceRegistryDBService deviceRe public DeviceRegistryOnboardingWithNameResponseDTO onboardDevice(final HttpServletRequest httpServletRequest, @RequestBody final DeviceRegistryOnboardingWithNameRequestDTO request) { logger.debug("New onboarding with name and device registration request received"); - securityUtilities.authenticateCertificate(httpServletRequest, CertificateType.AH_ONBOARDING); validation.checkOnboardingRequest(request, getOrigin(CommonConstants.OP_DEVICE_REGISTRY_ONBOARDING_WITH_NAME_URI)); final String host = httpServletRequest.getRemoteHost(); @@ -91,7 +84,7 @@ public DeviceRegistryOnboardingWithNameResponseDTO onboardDevice(final HttpServl } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = DEVICE_REGISTRY_REGISTER_DESCRIPTION, response = DeviceRegistryResponseDTO.class, tags = + @ApiOperation(value = DEVICE_REGISTRY_REGISTER_DESCRIPTION, response = DeviceRegistryOnboardingWithCsrResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_CREATED, message = DEVICE_REGISTRY_REGISTER_201_MESSAGE), @@ -106,7 +99,6 @@ public DeviceRegistryOnboardingWithNameResponseDTO onboardDevice(final HttpServl public DeviceRegistryOnboardingWithCsrResponseDTO onboardDevice(final HttpServletRequest httpServletRequest, @RequestBody final DeviceRegistryOnboardingWithCsrRequestDTO request) { logger.debug("New onboarding with csr and device registration request received"); - securityUtilities.authenticateCertificate(httpServletRequest, CertificateType.AH_ONBOARDING); validation.checkOnboardingRequest(request, getOrigin(CommonConstants.OP_DEVICE_REGISTRY_ONBOARDING_WITH_CSR_URI)); final var response = deviceRegistryDBService.onboardAndRegisterDeviceRegistry(request); diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java index e58e03a9d..8dd1fb697 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java @@ -1,6 +1,5 @@ package eu.arrowhead.core.deviceregistry.database.service; -import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.CoreUtilities; import eu.arrowhead.common.SecurityUtilities; @@ -58,26 +57,21 @@ public class DeviceRegistryDBService { //================================================================================================= // members - private static final String COULD_NOT_DELETE_SYSTEM_ERROR_MESSAGE = "Could not delete System, with given parameters"; private static final String COULD_NOT_DELETE_DEVICE_ERROR_MESSAGE = "Could not delete Device, with given parameters"; - private static final String PORT_RANGE_ERROR_MESSAGE = "Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + "."; private final Logger logger = LogManager.getLogger(DeviceRegistryDBService.class); private final DeviceRegistryRepository deviceRegistryRepository; - private final SystemRepository systemRepository; private final DeviceRepository deviceRepository; private final SecurityUtilities securityUtilities; private final CertificateAuthorityDriver caDriver; @Autowired public DeviceRegistryDBService(final DeviceRegistryRepository deviceRegistryRepository, - final SystemRepository systemRepository, final DeviceRepository deviceRepository, final SecurityUtilities securityUtilities, final CertificateAuthorityDriver caDriver) { this.deviceRegistryRepository = deviceRegistryRepository; - this.systemRepository = systemRepository; this.deviceRepository = deviceRepository; this.securityUtilities = securityUtilities; this.caDriver = caDriver; diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DeviceRegistryAccessControlFilter.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DeviceRegistryAccessControlFilter.java index 68b767de4..ca65b33c5 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DeviceRegistryAccessControlFilter.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/security/DeviceRegistryAccessControlFilter.java @@ -2,7 +2,10 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.SecurityUtilities; +import eu.arrowhead.common.dto.shared.CertificateType; import eu.arrowhead.common.security.CoreSystemAccessControlFilter; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; @@ -14,16 +17,26 @@ public class DeviceRegistryAccessControlFilter extends CoreSystemAccessControlFi //================================================================================================= // assistant methods + private final SecurityUtilities securityUtilities; + + @Autowired + public DeviceRegistryAccessControlFilter(final SecurityUtilities securityUtilities) {this.securityUtilities = securityUtilities;} //------------------------------------------------------------------------------------------------- @Override - protected void checkClientAuthorized(final String clientCN, final String method, final String requestTarget, final String requestJSON, final Map queryParams) { + protected void checkClientAuthorized(final String clientCN, final String method, final String requestTarget, final String requestJSON, + final Map queryParams) { + + if (requestTarget.contains(CommonConstants.ONBOARDING_URI) || requestTarget.contains(CommonConstants.OP_DEVICE_REGISTRY_UNREGISTER_URI)) { + securityUtilities.authenticateCertificate(clientCN, requestTarget, CertificateType.AH_ONBOARDING); + return; + } + + super.checkClientAuthorized(clientCN, method, requestTarget, requestJSON, queryParams); + final String cloudCN = getServerCloudCN(); - // certificates will be verified individually on each method if (requestTarget.contains(CoreCommonConstants.MGMT_URI)) { // Only the local System Operator can use these methods - final String cloudCN = getServerCloudCN(); - super.checkClientAuthorized(clientCN, method, requestTarget, requestJSON, queryParams); checkIfLocalSystemOperator(clientCN, cloudCN, requestTarget); } } diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java index 3a878e0d9..6e722b274 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryController.java @@ -2,23 +2,14 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; -import eu.arrowhead.common.CoreDefaults; -import eu.arrowhead.common.CoreUtilities; import eu.arrowhead.common.Defaults; -import eu.arrowhead.common.Utilities; -import eu.arrowhead.common.core.CoreSystem; -import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; -import eu.arrowhead.common.dto.internal.SystemListResponseDTO; -import eu.arrowhead.common.dto.internal.SystemRegistryListResponseDTO; -import eu.arrowhead.common.dto.shared.DeviceRequestDTO; -import eu.arrowhead.common.dto.shared.DeviceResponseDTO; +import eu.arrowhead.common.dto.shared.CertificateType; import eu.arrowhead.common.dto.shared.SystemQueryFormDTO; import eu.arrowhead.common.dto.shared.SystemQueryResultDTO; import eu.arrowhead.common.dto.shared.SystemRegistryRequestDTO; import eu.arrowhead.common.dto.shared.SystemRegistryResponseDTO; import eu.arrowhead.common.dto.shared.SystemRequestDTO; import eu.arrowhead.common.dto.shared.SystemResponseDTO; -import eu.arrowhead.common.exception.BadPayloadException; import eu.arrowhead.core.systemregistry.database.service.SystemRegistryDBService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -30,13 +21,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; +import org.springframework.util.Assert; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -44,9 +34,6 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import java.time.format.DateTimeParseException; -import java.util.Objects; - @Api(tags = {CoreCommonConstants.SWAGGER_TAG_ALL}) @CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, allowedHeaders = {HttpHeaders.ORIGIN, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT, HttpHeaders.AUTHORIZATION} @@ -58,35 +45,7 @@ public class SystemRegistryController { //================================================================================================= // members - private static final String GET_SYSTEM_BY_ID_HTTP_200_MESSAGE = "System by requested id returned"; - private static final String GET_SYSTEM_BY_ID_HTTP_400_MESSAGE = "No Such System by requested id"; private static final String PATH_VARIABLE_ID = "id"; - private static final String SYSTEM_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/system/{" + PATH_VARIABLE_ID + "}"; - private static final String SYSTEMS_URI = CoreCommonConstants.MGMT_URI + "/systems"; - private static final String SYSTEMS_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/systems/{" + PATH_VARIABLE_ID + "}"; - private static final String GET_SYSTEMS_HTTP_200_MESSAGE = "Systems returned"; - private static final String GET_SYSTEMS_HTTP_400_MESSAGE = " Invalid parameters"; - private static final String POST_SYSTEM_HTTP_201_MESSAGE = "System created"; - private static final String POST_SYSTEM_HTTP_400_MESSAGE = "Could not create system"; - private static final String PUT_SYSTEM_HTTP_200_MESSAGE = "System updated"; - private static final String PUT_SYSTEM_HTTP_400_MESSAGE = "Could not update system"; - private static final String PATCH_SYSTEM_HTTP_200_MESSAGE = "System updated"; - private static final String PATCH_SYSTEM_HTTP_400_MESSAGE = "Could not update system"; - private static final String DELETE_SYSTEM_HTTP_200_MESSAGE = "System deleted"; - private static final String DELETE_SYSTEM_HTTP_400_MESSAGE = "Could not delete system"; - - private static final String GET_DEVICE_BY_ID_HTTP_200_MESSAGE = "Device by requested id returned"; - private static final String GET_DEVICE_BY_ID_HTTP_400_MESSAGE = "No Such Device by requested id"; - private static final String DEVICE_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/device/{" + PATH_VARIABLE_ID + "}"; - private static final String DEVICES_URI = CoreCommonConstants.MGMT_URI + "/devices"; - private static final String POST_DEVICE_HTTP_201_MESSAGE = "Device created"; - private static final String POST_DEVICE_HTTP_400_MESSAGE = "Could not create device"; - private static final String PUT_DEVICE_HTTP_200_MESSAGE = "Device updated"; - private static final String PUT_DEVICE_HTTP_400_MESSAGE = "Could not update device"; - - private static final String DELETE_SYSTEMS_HTTP_200_MESSAGE = "System definition removed"; - private static final String DELETE_SYSTEMS_HTTP_400_MESSAGE = "Could not remove system definition"; - private static final String SYSTEM_REGISTRY_REGISTER_DESCRIPTION = "Registers a system"; private static final String SYSTEM_REGISTRY_REGISTER_201_MESSAGE = "System registered"; private static final String SYSTEM_REGISTRY_REGISTER_400_MESSAGE = "Could not register system"; @@ -102,37 +61,16 @@ public class SystemRegistryController { private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_DESCRIPTION = "Return System by requested dto"; private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_200_MESSAGE = "Consumer System data by requestDTO returned"; private static final String SYSTEM_REGISTRY_QUERY_BY_SYSTEM_DTO_400_MESSAGE = "Could not query System Registry by Consumer system requestDTO"; - private static final String SYSTEM_REGISTRY_UPDATE_DESCRIPTION = "Update a system"; - private static final String SYSTEM_REGISTRY_UPDATE_200_MESSAGE = "System updated"; - private static final String SYSTEM_REGISTRY_UPDATE_400_MESSAGE = "Could not update system"; - private static final String SYSTEM_REGISTRY_MERGE_DESCRIPTION = "Merge/Patch a system"; - private static final String SYSTEM_REGISTRY_MERGE_200_MESSAGE = "System merged"; - private static final String SYSTEM_REGISTRY_MERGE_400_MESSAGE = "Could not merge system"; - - private static final String ID_NOT_VALID_ERROR_MESSAGE = "Id must be greater than 0. "; - private static final String SYSTEM_NAME_NULL_ERROR_MESSAGE = " System name must have value "; - private static final String SYSTEM_ADDRESS_NULL_ERROR_MESSAGE = " System address must have value "; - private static final String SYSTEM_PORT_NULL_ERROR_MESSAGE = " System port must have value "; - - private static final String DEVICE_NAME_NULL_ERROR_MESSAGE = " Device name must have value "; - private static final String DEVICE_ADDRESS_NULL_ERROR_MESSAGE = " Device address must have value "; - private static final String DEVICE_MAC_ADDRESS_NULL_ERROR_MESSAGE = " Device MAC address must have value "; - - private static final String SYSTEM_REGISTRY_MGMT_BY_ID_URI = CoreCommonConstants.MGMT_URI + "/{" + PATH_VARIABLE_ID + "}"; - private static final String PATH_VARIABLE_SYSTEM_NAME = "systemName"; - private static final String SYSTEM_REGISTRY_MGMT_BY_SYSTEM_NAME_URI = CoreCommonConstants.MGMT_URI + "/systemname" + "/{" + PATH_VARIABLE_SYSTEM_NAME + "}"; - private static final String GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE = "System Registry entries returned"; - private static final String GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE = "Could not retrieve system registry entries"; - private static final String DELETE_SYSTEM_REGISTRY_HTTP_200_MESSAGE = "System Registry entry removed"; - private static final String DELETE_SYSTEM_REGISTRY_HTTP_400_MESSAGE = "Could not remove system registry entry"; private final Logger logger = LogManager.getLogger(SystemRegistryController.class); private final SystemRegistryDBService systemRegistryDBService; + private final Validation validation; @Autowired public SystemRegistryController(final SystemRegistryDBService systemRegistryDBService) { this.systemRegistryDBService = systemRegistryDBService; + this.validation = new Validation(); } @@ -152,321 +90,7 @@ public String echoSystem() { } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return system by id", response = SystemResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_BY_ID_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_BY_ID_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(SYSTEM_BY_ID_URI) - @ResponseBody - public SystemResponseDTO getSystemById(@PathVariable(value = PATH_VARIABLE_ID) final long systemId) { - logger.debug("getSystemById started ..."); - - if (systemId < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_BY_ID_URI); - } - - return systemRegistryDBService.getSystemById(systemId); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return systems by request parameters", response = SystemListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEMS_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEMS_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(SYSTEMS_URI) - @ResponseBody - public SystemListResponseDTO getSystems( - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("getSystems started ..."); - - final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.SYSTEM_REGISTRY_URI + DEVICES_URI); - return systemRegistryDBService.getSystemEntries(pageParameters, sortField); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return created system", response = SystemResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_SYSTEM_HTTP_201_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_SYSTEM_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PostMapping(path = SYSTEMS_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseStatus(org.springframework.http.HttpStatus.CREATED) - @ResponseBody - public SystemResponseDTO addSystem(@RequestBody final SystemRequestDTO request) { - return callCreateSystem(request); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return updated system", response = SystemResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = PUT_SYSTEM_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_SYSTEM_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PutMapping(path = SYSTEMS_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public SystemResponseDTO updateSystem(@PathVariable(value = PATH_VARIABLE_ID) final long systemId, @RequestBody final SystemRequestDTO request) { - return callUpdateSystem(request, systemId); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return system updated by fields", response = SystemResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = PATCH_SYSTEM_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PATCH_SYSTEM_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PatchMapping(path = SYSTEMS_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public SystemResponseDTO mergeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long systemId, @RequestBody final SystemRequestDTO request) { - return callMergeSystem(request, systemId); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Remove system", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEM_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEM_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @DeleteMapping(path = SYSTEMS_BY_ID_URI) - public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New System delete request received with id: {}", id); - - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); - } - - systemRegistryDBService.removeSystemById(id); - logger.debug("System with id: '{}' successfully deleted", id); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return device by id", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_BY_ID_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_BY_ID_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(SYSTEMS_BY_ID_URI) - @ResponseBody - public DeviceResponseDTO getDeviceById(@PathVariable(value = PATH_VARIABLE_ID) final long deviceId) { - logger.debug("getDeviceById started ..."); - - if (deviceId < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_BY_ID_URI); - } - - return systemRegistryDBService.getDeviceById(deviceId); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return requested device by the given parameters", response = DeviceListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEMS_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEMS_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = DEVICES_URI, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public DeviceListResponseDTO getDeviceListByRequestParameters( - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("New DeviceList get request received with page: {} and item_per page: {}", page, size); - - final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.SYSTEM_REGISTRY_URI + DEVICES_URI); - final DeviceListResponseDTO deviceListResponseDTO = systemRegistryDBService.getDeviceEntries(pageParameters, sortField); - logger.debug("DeviceList with page: {} and item_per page: {} successfully retrieved", page, size); - - return deviceListResponseDTO; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return created device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_DEVICE_HTTP_201_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_DEVICE_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PostMapping(path = DEVICES_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) - @ResponseBody - public DeviceResponseDTO addDevice(@RequestBody final DeviceRequestDTO dto) { - logger.debug("New device registration request received with name: {}", dto.getDeviceName()); - - validateDevice(dto); - - final DeviceResponseDTO responseDTO = systemRegistryDBService.createDeviceDto(dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); - logger.debug("{} successfully registered.", responseDTO); - - return responseDTO; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return updated device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = PUT_DEVICE_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_DEVICE_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PutMapping(path = DEVICE_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public DeviceResponseDTO putUpdateDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id, - @RequestBody final DeviceRequestDTO dto) { - logger.debug("New device update request received with id: {}, definition: {}", id, dto); - - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + DEVICE_BY_ID_URI); - } - - validateDevice(dto); - - final DeviceResponseDTO deviceResponseDTO = systemRegistryDBService.updateDeviceByIdResponse(id, dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); - logger.debug("Device with id: '{}' successfully updated with definition '{}'.", id, deviceResponseDTO); - - return deviceResponseDTO; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Remove device", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEMS_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEMS_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @DeleteMapping(path = DEVICE_BY_ID_URI) - public void removeDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New System Definition delete request received with id: {}", id); - - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + DEVICE_BY_ID_URI); - } - - systemRegistryDBService.removeDeviceById(id); - logger.debug("Device with id: '{}' successfully deleted", id); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return requested system registry entries by the given parameters", response = SystemRegistryListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = CoreCommonConstants.MGMT_URI) - @ResponseBody - public SystemRegistryListResponseDTO getSystemRegistryEntries( - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("New System Registry get request received with page: {} and item_per page: {}", page, size); - - final CoreUtilities.ValidatedPageParams params = CoreUtilities.validatePageParameters(page, size, direction, CommonConstants.SYSTEM_REGISTRY_URI + CoreCommonConstants.MGMT_URI); - final SystemRegistryListResponseDTO systemRegistryEntriesResponse = systemRegistryDBService - .getSystemRegistryEntries(params, sortField); - logger.debug("System Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); - - return systemRegistryEntriesResponse; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return requested system registry entry", response = SystemRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI) - @ResponseBody - public SystemRegistryResponseDTO getSystemRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New System Registry get request received with id: {}", id); - - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_ID_URI); - } - final SystemRegistryResponseDTO systemRegistryEntryByIdResponse = systemRegistryDBService.getSystemRegistryById(id); - logger.debug("System Registry entry with id: {} successfully retrieved", id); - - return systemRegistryEntryByIdResponse; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Return requested system registry entries by system definition based on the given parameters", response = SystemRegistryListResponseDTO.class, - tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @GetMapping(path = SYSTEM_REGISTRY_MGMT_BY_SYSTEM_NAME_URI) - @ResponseBody - public SystemRegistryListResponseDTO getSystemRegistryEntriesBySystemName( - @PathVariable(value = PATH_VARIABLE_SYSTEM_NAME) final String systemName, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, - @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { - logger.debug("New System Registry get by System Definition request received with page: {} and item_per page: {}", page, size); - - final String origin = CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_SYSTEM_NAME_URI; - if (Utilities.isEmpty(systemName)) { - throw new BadPayloadException("System name cannot be empty.", HttpStatus.SC_BAD_REQUEST, origin); - } - - final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, origin); - final SystemRegistryListResponseDTO systemRegistryEntries = systemRegistryDBService.getSystemRegistryEntriesBySystemName(systemName, pageParameters, sortField); - logger.debug("System Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); - - return systemRegistryEntries; - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Remove the specified system registry entry", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEM_REGISTRY_HTTP_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEM_REGISTRY_HTTP_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @DeleteMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI) - public void removeSystemRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { - logger.debug("New System Registry delete request received with id: {}", id); - - if (id < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_ID_URI); - } - - systemRegistryDBService.removeSystemRegistryEntryById(id); - logger.debug("System Registry with id: '{}' successfully deleted", id); - } - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_REGISTER_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiOperation(value = SYSTEM_REGISTRY_REGISTER_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_CREATED, message = SYSTEM_REGISTRY_REGISTER_201_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_REGISTER_400_MESSAGE), @@ -474,12 +98,12 @@ public void removeSystemRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) }) @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) - @PostMapping(path = {CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI, CoreCommonConstants.MGMT_URI}, + @PostMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public SystemRegistryResponseDTO registerSystem(@RequestBody final SystemRegistryRequestDTO request) { logger.debug("New system registration request received"); - checkSystemRegistryRequest(request, false); + validation.checkSystemRegistryRequest(request, getOrigin(CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI),false); final SystemRegistryResponseDTO response = systemRegistryDBService.registerSystemRegistry(request); logger.debug("{} successfully registers its system {}", request.getSystem().getSystemName(), request.getSystem()); @@ -487,47 +111,6 @@ public SystemRegistryResponseDTO registerSystem(@RequestBody final SystemRegistr return response; } - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_UPDATE_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_UPDATE_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_UPDATE_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PutMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public @ResponseBody - SystemRegistryResponseDTO updateSystemRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final SystemRegistryRequestDTO request) { - logger.debug("New system registry update request received"); - checkSystemRegistryUpdateRequest(id, request, CoreCommonConstants.MGMT_URI); - - final SystemRegistryResponseDTO response = systemRegistryDBService.updateSystemRegistryById(id, request); - logger.debug("System Registry entry {} is successfully updated with system {} and system {}", id, request.getSystem().getSystemName(), request.getSystem()); - - return response; - } - - - //------------------------------------------------------------------------------------------------- - @ApiOperation(value = SYSTEM_REGISTRY_MERGE_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_MERGE_200_MESSAGE), - @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_MERGE_400_MESSAGE), - @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), - @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) - }) - @PatchMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public @ResponseBody - SystemRegistryResponseDTO mergeSystemRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final SystemRegistryRequestDTO request) { - logger.debug("New system registry merge request received"); - checkSystemRegistryMergeRequest(id, request, CoreCommonConstants.MGMT_URI); - - final SystemRegistryResponseDTO response = systemRegistryDBService.mergeSystemRegistryById(id, request); - logger.debug("System Registry entry {} is successfully merged witch system {} and system {}", id, response.getSystem(), request.getSystem()); - - return response; - } - //------------------------------------------------------------------------------------------------- @ApiOperation(value = SYSTEM_REGISTRY_UNREGISTER_DESCRIPTION, tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT}) @ApiResponses(value = { @@ -541,7 +124,7 @@ public void unregisterSystem(@RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UN @RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_ADDRESS) final String address, @RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_REQUEST_PARAM_PROVIDER_PORT) final int port) { logger.debug("System removal request received"); - checkUnregisterSystemParameters(systemName, address, port); + validation.checkUnregisterSystemParameters(systemName, address, port, getOrigin(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_URI)); systemRegistryDBService.removeSystemRegistryByNameAndAddressAndPort(systemName, address, port); logger.debug("{} successfully removed", systemName); @@ -560,10 +143,7 @@ public void unregisterSystem(@RequestParam(CommonConstants.OP_SYSTEM_REGISTRY_UN public SystemQueryResultDTO queryRegistry(@RequestBody final SystemQueryFormDTO form) { logger.debug("System query request received"); - if (Utilities.isEmpty(form.getSystemNameRequirements())) { - throw new BadPayloadException("System definition requirement is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + - CommonConstants.OP_SYSTEM_REGISTRY_QUERY_URI); - } + validation.checkSystemNameRequirements(form.getSystemNameRequirements(), getOrigin(CommonConstants.OP_SYSTEM_REGISTRY_QUERY_URI)); final SystemQueryResultDTO result = systemRegistryDBService.queryRegistry(form); logger.debug("Return {} providers for system {}", result.getSystemQueryData().size(), form.getSystemNameRequirements()); @@ -584,11 +164,6 @@ public SystemQueryResultDTO queryRegistry(@RequestBody final SystemQueryFormDTO public SystemResponseDTO queryRegistryBySystemId(@PathVariable(value = PATH_VARIABLE_ID) final long systemId) { logger.debug("System query by system id request received"); - if (systemId < 1) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + - CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI); - } - final SystemResponseDTO result = systemRegistryDBService.getSystemById(systemId); logger.debug("Return system by id: {}", systemId); @@ -608,7 +183,7 @@ public SystemResponseDTO queryRegistryBySystemId(@PathVariable(value = PATH_VARI public SystemResponseDTO queryRegistryBySystemDTO(@RequestBody final SystemRequestDTO request) { logger.debug("System query by systemRequestDTO request received"); - checkSystemRequest(request, CommonConstants.SYSTEM_REGISTRY_URI + CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI, false); + validation.checkSystemRequest(request, CommonConstants.SYSTEM_REGISTRY_URI + CoreCommonConstants.OP_SYSTEM_REGISTRY_QUERY_BY_SYSTEM_ID_URI, false); final String systemName = request.getSystemName(); final String address = request.getAddress(); @@ -623,274 +198,16 @@ public SystemResponseDTO queryRegistryBySystemDTO(@RequestBody final SystemReque //================================================================================================= // assistant methods - //------------------------------------------------------------------------------------------------- - private SystemResponseDTO callCreateSystem(final SystemRequestDTO request) { - logger.debug("callCreateSystem started..."); - - checkSystemRequest(request, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_URI, true); - - final String systemName = request.getSystemName(); - final String address = request.getAddress(); - final int port = request.getPort(); - final String authenticationInfo = request.getAuthenticationInfo(); - - return systemRegistryDBService.createSystemDto(systemName, address, port, authenticationInfo); - } - - //------------------------------------------------------------------------------------------------- - private SystemResponseDTO callUpdateSystem(final SystemRequestDTO request, final long systemId) { - logger.debug("callUpdateSystem started..."); - - checkSystemPutRequest(request, systemId); - - final String validatedSystemName = request.getSystemName().toLowerCase(); - final String validatedAddress = request.getAddress().toLowerCase(); - final int validatedPort = request.getPort(); - final String validatedAuthenticationInfo = request.getAuthenticationInfo(); - - return systemRegistryDBService.updateSystemDto(systemId, validatedSystemName, validatedAddress, validatedPort, validatedAuthenticationInfo); - } - - //------------------------------------------------------------------------------------------------- - private SystemResponseDTO callMergeSystem(final SystemRequestDTO request, final long systemId) { - logger.debug("callMergeSystem started..."); - - checkSystemMergeRequest(request, systemId); - - final String validatedSystemName = request.getSystemName() != null ? request.getSystemName().toLowerCase() : ""; - final String validatedAddress = request.getAddress() != null ? request.getAddress().toLowerCase() : ""; - final Integer validatedPort = request.getPort(); - final String validatedAuthenticationInfo = request.getAuthenticationInfo(); - - return systemRegistryDBService.mergeSystemResponse(systemId, validatedSystemName, validatedAddress, validatedPort, validatedAuthenticationInfo); - } - - //------------------------------------------------------------------------------------------------- - private void checkSystemMergeRequest(final SystemRequestDTO request, final long systemId) { - logger.debug("checkSystemPatchRequest started..."); - - if (systemId <= 0) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); - } - - boolean needChange = false; - if (!Utilities.isEmpty(request.getAddress())) { - needChange = true; - } - - - if (!Utilities.isEmpty(request.getSystemName())) { - needChange = true; - for (final CoreSystem coreSysteam : CoreSystem.values()) { - if (coreSysteam.name().equalsIgnoreCase(request.getSystemName().trim())) { - throw new BadPayloadException("System name '" + request.getSystemName() + "' is a reserved arrowhead core system name.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); - } - } - } - - if (request.getPort() != null) { - final int validatedPort = request.getPort(); - if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { - throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, - CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); - } - - needChange = true; - } - - if (request.getAuthenticationInfo() != null) { - needChange = true; - } - - if (!needChange) { - throw new BadPayloadException("Patch request is empty.", HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); - } - } - - //------------------------------------------------------------------------------------------------- - private void checkSystemPutRequest(final SystemRequestDTO request, final long systemId) { - logger.debug("checkSystemPutRequest started..."); - - if (systemId <= 0) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI); - } - - checkSystemRequest(request, CommonConstants.SYSTEM_REGISTRY_URI + SYSTEMS_BY_ID_URI, true); - } - - //------------------------------------------------------------------------------------------------- - private void checkSystemRequest(final SystemRequestDTO request, final String origin, final boolean checkReservedCoreSystemNames) { - logger.debug("checkSystemRequest started..."); - - if (request == null) { - throw new BadPayloadException("System is null.", HttpStatus.SC_BAD_REQUEST, origin); - } - - if (Utilities.isEmpty(request.getSystemName())) { - throw new BadPayloadException(SYSTEM_NAME_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - if (checkReservedCoreSystemNames) { - for (final CoreSystem coreSysteam : CoreSystem.values()) { - if (coreSysteam.name().equalsIgnoreCase(request.getSystemName().trim())) { - throw new BadPayloadException("System name '" + request.getSystemName() + "' is a reserved arrowhead core system name.", HttpStatus.SC_BAD_REQUEST, origin); - } - } - } - - if (Utilities.isEmpty(request.getAddress())) { - throw new BadPayloadException(SYSTEM_ADDRESS_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - if (request.getPort() == null) { - throw new BadPayloadException(SYSTEM_PORT_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - final int validatedPort = request.getPort(); - if (validatedPort <= CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { - throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, origin); - } - } - - //------------------------------------------------------------------------------------------------- - private void checkDeviceRequest(final DeviceRequestDTO request, final String origin) { - logger.debug("checkDeviceRequest started..."); - - if (request == null) { - throw new BadPayloadException("Device is null.", HttpStatus.SC_BAD_REQUEST, origin); - } - - if (Utilities.isEmpty(request.getDeviceName())) { - throw new BadPayloadException(DEVICE_NAME_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - if (Utilities.isEmpty(request.getAddress())) { - throw new BadPayloadException(DEVICE_ADDRESS_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - if (Utilities.isEmpty(request.getMacAddress())) { - throw new BadPayloadException(DEVICE_MAC_ADDRESS_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - } - - //------------------------------------------------------------------------------------------------- - private void checkSystemRegistryRequest(final SystemRegistryRequestDTO request, final boolean checkReservedCoreSystemNames) { - logger.debug("checkSystemRegistryRequest started..."); - - final String origin = CommonConstants.SYSTEM_REGISTRY_URI + CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI; - - checkSystemRegistryRequest(request, origin, checkReservedCoreSystemNames); - } - - //------------------------------------------------------------------------------------------------- - private void checkSystemRegistryRequest(final SystemRegistryRequestDTO request, final String origin, final boolean checkReservedCoreSystemNames) { - logger.debug("checkSystemRegistryRequest started..."); - - checkSystemRequest(request.getSystem(), origin, checkReservedCoreSystemNames); - checkDeviceRequest(request.getProvider(), origin); - - if (!Utilities.isEmpty(request.getEndOfValidity())) { - try { - Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()); - } catch (final DateTimeParseException ex) { - throw new BadPayloadException("End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", - HttpStatus.SC_BAD_REQUEST, origin); - } - } - } - - //------------------------------------------------------------------------------------------------- - private void checkUnregisterSystemParameters(final String systemName, final String address, final int port) { - // parameters can't be null, but can be empty - logger.debug("checkUnregisterSystemParameters started..."); - - final String origin = CommonConstants.SYSTEM_REGISTRY_URI + CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_URI; - - if (Utilities.isEmpty(systemName)) { - throw new BadPayloadException("Name of the system is blank", HttpStatus.SC_BAD_REQUEST, origin); - } - - if (Utilities.isEmpty(address)) { - throw new BadPayloadException("Address of the system is blank", HttpStatus.SC_BAD_REQUEST, origin); - } - - if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { - throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, origin); - } - } - - //------------------------------------------------------------------------------------------------- - private void checkSystemRegistryUpdateRequest(final long id, final SystemRegistryRequestDTO request, final String origin) { - logger.debug("checkSystemRegistryUpdateRequest started..."); - - if (id <= 0) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - checkSystemRegistryRequest(request, origin, true); + //================================================================================================= + // assistant methods + private String getBaseOrigin() { + return CommonConstants.SYSTEM_REGISTRY_URI; } - //------------------------------------------------------------------------------------------------- - private void validateDevice(@RequestBody final DeviceRequestDTO deviceRequestDto) { - if (Utilities.isEmpty(deviceRequestDto.getDeviceName())) { - throw new BadPayloadException("Device name is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); - } - - if (Utilities.isEmpty(deviceRequestDto.getAddress())) { - throw new BadPayloadException("Device address is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); - } - - if (Utilities.isEmpty(deviceRequestDto.getMacAddress())) { - throw new BadPayloadException("Device MAC address is null or blank", HttpStatus.SC_BAD_REQUEST, CommonConstants.DEVICE_REGISTRY_URI + DEVICES_URI); - } + private String getOrigin(final String postfix) { + Assert.notNull(postfix, "Internal error: Origin postfix not provided"); + return getBaseOrigin() + postfix; } - //------------------------------------------------------------------------------------------------- - @SuppressWarnings("squid:S3776") - private void checkSystemRegistryMergeRequest(final long id, final SystemRegistryRequestDTO request, final String origin) { - logger.debug("checkSystemRegistryMergeRequest started..."); - - if (id <= 0) { - throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); - } - - boolean needChange = false; - - if (Objects.nonNull(request.getSystem())) { - final SystemRequestDTO system = request.getSystem(); - - if (!Utilities.isEmpty(system.getSystemName())) { - needChange = true; - } else if (!Utilities.isEmpty(system.getAddress())) { - needChange = true; - } else if (Objects.nonNull(system.getPort())) { - final int validatedPort = system.getPort(); - if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { - throw new BadPayloadException("Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", HttpStatus.SC_BAD_REQUEST, - origin); - } - - needChange = true; - } else if (Objects.nonNull(system.getAuthenticationInfo())) { - needChange = true; - } - } - - - if (request.getEndOfValidity() != null) { - needChange = true; - } - - if (request.getMetadata() != null) { - needChange = true; - } - - if (request.getVersion() != null && request.getVersion() > 0) { - needChange = true; - } - - if (!needChange) { - throw new BadPayloadException("Patch request is empty.", HttpStatus.SC_BAD_REQUEST, origin); - } - } } \ No newline at end of file diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryManagementController.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryManagementController.java new file mode 100644 index 000000000..7042fcb8b --- /dev/null +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryManagementController.java @@ -0,0 +1,514 @@ +package eu.arrowhead.core.systemregistry; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.CoreDefaults; +import eu.arrowhead.common.CoreUtilities; +import eu.arrowhead.common.Defaults; +import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; +import eu.arrowhead.common.dto.internal.SystemListResponseDTO; +import eu.arrowhead.common.dto.internal.SystemRegistryListResponseDTO; +import eu.arrowhead.common.dto.shared.DeviceRequestDTO; +import eu.arrowhead.common.dto.shared.DeviceResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryRequestDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; +import eu.arrowhead.common.dto.shared.SystemResponseDTO; +import eu.arrowhead.core.systemregistry.database.service.SystemRegistryDBService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.apache.http.HttpStatus; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.util.Assert; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@Api(tags = {CoreCommonConstants.SWAGGER_TAG_ALL}) +@CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, + allowedHeaders = {HttpHeaders.ORIGIN, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT, HttpHeaders.AUTHORIZATION} +) +@RestController +@RequestMapping(CommonConstants.SYSTEM_REGISTRY_URI + CoreCommonConstants.MGMT_URI) +public class SystemRegistryManagementController { + + //================================================================================================= + // members + + private static final String GET_SYSTEM_BY_ID_HTTP_200_MESSAGE = "System by requested id returned"; + private static final String GET_SYSTEM_BY_ID_HTTP_400_MESSAGE = "No Such System by requested id"; + private static final String PATH_VARIABLE_ID = "id"; + private static final String SYSTEM_BY_ID_URI = "/system/{" + PATH_VARIABLE_ID + "}"; + private static final String SYSTEMS_URI = "/systems"; + private static final String SYSTEMS_BY_ID_URI = "/systems/{" + PATH_VARIABLE_ID + "}"; + private static final String GET_SYSTEMS_HTTP_200_MESSAGE = "Systems returned"; + private static final String GET_SYSTEMS_HTTP_400_MESSAGE = " Invalid parameters"; + private static final String POST_SYSTEM_HTTP_201_MESSAGE = "System created"; + private static final String POST_SYSTEM_HTTP_400_MESSAGE = "Could not create system"; + private static final String PUT_SYSTEM_HTTP_200_MESSAGE = "System updated"; + private static final String PUT_SYSTEM_HTTP_400_MESSAGE = "Could not update system"; + private static final String PATCH_SYSTEM_HTTP_200_MESSAGE = "System updated"; + private static final String PATCH_SYSTEM_HTTP_400_MESSAGE = "Could not update system"; + private static final String DELETE_SYSTEM_HTTP_200_MESSAGE = "System deleted"; + private static final String DELETE_SYSTEM_HTTP_400_MESSAGE = "Could not delete system"; + + private static final String GET_DEVICE_BY_ID_HTTP_200_MESSAGE = "Device by requested id returned"; + private static final String GET_DEVICE_BY_ID_HTTP_400_MESSAGE = "No Such Device by requested id"; + private static final String DEVICE_BY_ID_URI = "/device/{" + PATH_VARIABLE_ID + "}"; + private static final String DEVICES_URI = "/devices"; + private static final String POST_DEVICE_HTTP_201_MESSAGE = "Device created"; + private static final String POST_DEVICE_HTTP_400_MESSAGE = "Could not create device"; + private static final String PUT_DEVICE_HTTP_200_MESSAGE = "Device updated"; + private static final String PUT_DEVICE_HTTP_400_MESSAGE = "Could not update device"; + + private static final String DELETE_SYSTEMS_HTTP_200_MESSAGE = "System definition removed"; + private static final String DELETE_SYSTEMS_HTTP_400_MESSAGE = "Could not remove system definition"; + + private static final String SYSTEM_REGISTRY_UPDATE_DESCRIPTION = "Update a system"; + private static final String SYSTEM_REGISTRY_UPDATE_200_MESSAGE = "System updated"; + private static final String SYSTEM_REGISTRY_UPDATE_400_MESSAGE = "Could not update system"; + private static final String SYSTEM_REGISTRY_MERGE_DESCRIPTION = "Merge/Patch a system"; + private static final String SYSTEM_REGISTRY_MERGE_200_MESSAGE = "System merged"; + private static final String SYSTEM_REGISTRY_MERGE_400_MESSAGE = "Could not merge system"; + + private static final String SYSTEM_REGISTRY_MGMT_BY_ID_URI = "/{" + PATH_VARIABLE_ID + "}"; + private static final String PATH_VARIABLE_SYSTEM_NAME = "systemName"; + private static final String SYSTEM_REGISTRY_MGMT_BY_SYSTEM_NAME_URI = "/systemname" + "/{" + PATH_VARIABLE_SYSTEM_NAME + "}"; + private static final String GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE = "System Registry entries returned"; + private static final String GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE = "Could not retrieve system registry entries"; + private static final String DELETE_SYSTEM_REGISTRY_HTTP_200_MESSAGE = "System Registry entry removed"; + private static final String DELETE_SYSTEM_REGISTRY_HTTP_400_MESSAGE = "Could not remove system registry entry"; + + private final Logger logger = LogManager.getLogger(SystemRegistryManagementController.class); + + private final SystemRegistryDBService systemRegistryDBService; + private final Validation validation; + + @Autowired + public SystemRegistryManagementController(final SystemRegistryDBService systemRegistryDBService) { + this.systemRegistryDBService = systemRegistryDBService; + this.validation = new Validation(); + } + + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return system by id", response = SystemResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_BY_ID_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_BY_ID_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(SYSTEM_BY_ID_URI) + @ResponseBody + public SystemResponseDTO getSystemById(@PathVariable(value = PATH_VARIABLE_ID) final long systemId) { + logger.debug("getSystemById started ..."); + + validation.checkId(systemId, getOrigin(SYSTEM_BY_ID_URI)); + + return systemRegistryDBService.getSystemById(systemId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return systems by request parameters", response = SystemListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEMS_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEMS_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(SYSTEMS_URI) + @ResponseBody + public SystemListResponseDTO getSystems( + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("getSystems started ..."); + + final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities + .validatePageParameters(page, size, direction, CommonConstants.SYSTEM_REGISTRY_URI + DEVICES_URI); + return systemRegistryDBService.getSystemEntries(pageParameters, sortField); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return created system", response = SystemResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_SYSTEM_HTTP_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = SYSTEMS_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(org.springframework.http.HttpStatus.CREATED) + @ResponseBody + public SystemResponseDTO addSystem(@RequestBody final SystemRequestDTO request) { + return callCreateSystem(request); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return updated system", response = SystemResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = PUT_SYSTEM_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PutMapping(path = SYSTEMS_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public SystemResponseDTO updateSystem(@PathVariable(value = PATH_VARIABLE_ID) final long systemId, @RequestBody final SystemRequestDTO request) { + return callUpdateSystem(request, systemId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return system updated by fields", response = SystemResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = PATCH_SYSTEM_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PATCH_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PatchMapping(path = SYSTEMS_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public SystemResponseDTO mergeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long systemId, @RequestBody final SystemRequestDTO request) { + return callMergeSystem(request, systemId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Remove system", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEM_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEM_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = SYSTEMS_BY_ID_URI) + public void removeSystem(@PathVariable(value = PATH_VARIABLE_ID) final long systemId) { + logger.debug("New System delete request received with id: {}", systemId); + + validation.checkId(systemId, getOrigin(SYSTEM_BY_ID_URI)); + + systemRegistryDBService.removeSystemById(systemId); + logger.debug("System with id: '{}' successfully deleted", systemId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return device by id", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_DEVICE_BY_ID_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_DEVICE_BY_ID_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(SYSTEMS_BY_ID_URI) + @ResponseBody + public DeviceResponseDTO getDeviceById(@PathVariable(value = PATH_VARIABLE_ID) final long deviceId) { + logger.debug("getDeviceById started ..."); + + validation.checkId(deviceId, getOrigin(SYSTEM_BY_ID_URI)); + + return systemRegistryDBService.getDeviceById(deviceId); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested device by the given parameters", response = DeviceListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEMS_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEMS_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = DEVICES_URI, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public DeviceListResponseDTO getDeviceListByRequestParameters( + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("New DeviceList get request received with page: {} and item_per page: {}", page, size); + + final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities + .validatePageParameters(page, size, direction, CommonConstants.SYSTEM_REGISTRY_URI + DEVICES_URI); + final DeviceListResponseDTO deviceListResponseDTO = systemRegistryDBService.getDeviceEntries(pageParameters, sortField); + logger.debug("DeviceList with page: {} and item_per page: {} successfully retrieved", page, size); + + return deviceListResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return created device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = POST_DEVICE_HTTP_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = POST_DEVICE_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PostMapping(path = DEVICES_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) + @ResponseBody + public DeviceResponseDTO addDevice(@RequestBody final DeviceRequestDTO dto) { + logger.debug("New device registration request received with name: {}", dto.getDeviceName()); + + validation.validateDevice(dto, DEVICES_URI); + + final DeviceResponseDTO responseDTO = systemRegistryDBService + .createDeviceDto(dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); + logger.debug("{} successfully registered.", responseDTO); + + return responseDTO; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return updated device", response = DeviceResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = PUT_DEVICE_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = PUT_DEVICE_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PutMapping(path = DEVICE_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public DeviceResponseDTO putUpdateDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id, + @RequestBody final DeviceRequestDTO dto) { + logger.debug("New device update request received with id: {}, definition: {}", id, dto); + + validation.checkId(id, getOrigin(DEVICE_BY_ID_URI)); + validation.validateDevice(dto, getOrigin(DEVICE_BY_ID_URI)); + + final DeviceResponseDTO deviceResponseDTO = systemRegistryDBService + .updateDeviceByIdResponse(id, dto.getDeviceName(), dto.getAddress(), dto.getMacAddress(), dto.getAuthenticationInfo()); + logger.debug("Device with id: '{}' successfully updated with definition '{}'.", id, deviceResponseDTO); + + return deviceResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Remove device", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEMS_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEMS_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = DEVICE_BY_ID_URI) + public void removeDevice(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New System Definition delete request received with id: {}", id); + + validation.checkId(id, getOrigin(DEVICE_BY_ID_URI)); + + systemRegistryDBService.removeDeviceById(id); + logger.debug("Device with id: '{}' successfully deleted", id); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested system registry entries by the given parameters", response = SystemRegistryListResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = CoreCommonConstants.MGMT_URI) + @ResponseBody + public SystemRegistryListResponseDTO getSystemRegistryEntries( + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("New System Registry get request received with page: {} and item_per page: {}", page, size); + + final CoreUtilities.ValidatedPageParams params = CoreUtilities + .validatePageParameters(page, size, direction, CommonConstants.SYSTEM_REGISTRY_URI + CoreCommonConstants.MGMT_URI); + final SystemRegistryListResponseDTO systemRegistryEntriesResponse = systemRegistryDBService + .getSystemRegistryEntries(params, sortField); + logger.debug("System Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); + + return systemRegistryEntriesResponse; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested system registry entry", response = SystemRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI) + @ResponseBody + public SystemRegistryResponseDTO getSystemRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New System Registry get request received with id: {}", id); + + validation.checkId(id, getOrigin(SYSTEM_REGISTRY_MGMT_BY_ID_URI)); + + final SystemRegistryResponseDTO systemRegistryEntryByIdResponse = systemRegistryDBService.getSystemRegistryById(id); + logger.debug("System Registry entry with id: {} successfully retrieved", id); + + return systemRegistryEntryByIdResponse; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Return requested system registry entries by system definition based on the given parameters", response = SystemRegistryListResponseDTO.class, + tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = GET_SYSTEM_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = GET_SYSTEM_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @GetMapping(path = SYSTEM_REGISTRY_MGMT_BY_SYSTEM_NAME_URI) + @ResponseBody + public SystemRegistryListResponseDTO getSystemRegistryEntriesBySystemName( + @PathVariable(value = PATH_VARIABLE_SYSTEM_NAME) final String systemName, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_PAGE, required = false) final Integer page, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_ITEM_PER_PAGE, required = false) final Integer size, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_DIRECTION, defaultValue = CoreDefaults.DEFAULT_REQUEST_PARAM_DIRECTION_VALUE) final String direction, + @RequestParam(name = CoreCommonConstants.REQUEST_PARAM_SORT_FIELD, defaultValue = CoreCommonConstants.COMMON_FIELD_NAME_ID) final String sortField) { + logger.debug("New System Registry get by System Definition request received with page: {} and item_per page: {}", page, size); + + final String origin = CommonConstants.SYSTEM_REGISTRY_URI + SYSTEM_REGISTRY_MGMT_BY_SYSTEM_NAME_URI; + validation.checkSystemName(systemName, origin); + + final CoreUtilities.ValidatedPageParams pageParameters = CoreUtilities.validatePageParameters(page, size, direction, origin); + final SystemRegistryListResponseDTO systemRegistryEntries = systemRegistryDBService + .getSystemRegistryEntriesBySystemName(systemName, pageParameters, sortField); + logger.debug("System Registry entries with page: {} and item_per page: {} successfully retrieved", page, size); + + return systemRegistryEntries; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = "Remove the specified system registry entry", tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = DELETE_SYSTEM_REGISTRY_HTTP_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = DELETE_SYSTEM_REGISTRY_HTTP_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @DeleteMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI) + public void removeSystemRegistryEntryById(@PathVariable(value = PATH_VARIABLE_ID) final long id) { + logger.debug("New System Registry delete request received with id: {}", id); + + validation.checkId(id, SYSTEM_REGISTRY_MGMT_BY_ID_URI); + + systemRegistryDBService.removeSystemRegistryEntryById(id); + logger.debug("System Registry with id: '{}' successfully deleted", id); + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_UPDATE_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_UPDATE_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_UPDATE_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PutMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody + SystemRegistryResponseDTO updateSystemRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final SystemRegistryRequestDTO request) { + logger.debug("New system registry update request received"); + validation.checkSystemRegistryUpdateRequest(id, request, SYSTEM_REGISTRY_MGMT_BY_ID_URI); + + final SystemRegistryResponseDTO response = systemRegistryDBService.updateSystemRegistryById(id, request); + logger.debug("System Registry entry {} is successfully updated with system {} and system {}", id, request.getSystem().getSystemName(), + request.getSystem()); + + return response; + } + + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_MERGE_DESCRIPTION, response = SystemRegistryResponseDTO.class, tags = {CoreCommonConstants.SWAGGER_TAG_MGMT}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_OK, message = SYSTEM_REGISTRY_MERGE_200_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_MERGE_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @PatchMapping(path = SYSTEM_REGISTRY_MGMT_BY_ID_URI, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody + SystemRegistryResponseDTO mergeSystemRegistry(@PathVariable(value = PATH_VARIABLE_ID) final long id, @RequestBody final SystemRegistryRequestDTO request) { + logger.debug("New system registry merge request received"); + validation.checkSystemRegistryMergeRequest(id, request, CoreCommonConstants.MGMT_URI); + + final SystemRegistryResponseDTO response = systemRegistryDBService.mergeSystemRegistryById(id, request); + logger.debug("System Registry entry {} is successfully merged witch system {} and system {}", id, response.getSystem(), request.getSystem()); + + return response; + } + + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + private SystemResponseDTO callCreateSystem(final SystemRequestDTO request) { + logger.debug("callCreateSystem started..."); + + validation.checkSystemRequest(request, getOrigin(SYSTEMS_URI), true); + + final String systemName = request.getSystemName(); + final String address = request.getAddress(); + final int port = request.getPort(); + final String authenticationInfo = request.getAuthenticationInfo(); + + return systemRegistryDBService.createSystemDto(systemName, address, port, authenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private SystemResponseDTO callUpdateSystem(final SystemRequestDTO request, final long systemId) { + logger.debug("callUpdateSystem started..."); + + validation.checkSystemPutRequest(request, systemId, getOrigin(SYSTEMS_URI)); + + final String validatedSystemName = request.getSystemName().toLowerCase(); + final String validatedAddress = request.getAddress().toLowerCase(); + final int validatedPort = request.getPort(); + final String validatedAuthenticationInfo = request.getAuthenticationInfo(); + + return systemRegistryDBService.updateSystemDto(systemId, validatedSystemName, validatedAddress, validatedPort, validatedAuthenticationInfo); + } + + //------------------------------------------------------------------------------------------------- + private SystemResponseDTO callMergeSystem(final SystemRequestDTO request, final long systemId) { + logger.debug("callMergeSystem started..."); + + validation.checkSystemMergeRequest(request, systemId, getOrigin(SYSTEMS_URI)); + + final String validatedSystemName = request.getSystemName() != null ? request.getSystemName().toLowerCase() : ""; + final String validatedAddress = request.getAddress() != null ? request.getAddress().toLowerCase() : ""; + final Integer validatedPort = request.getPort(); + final String validatedAuthenticationInfo = request.getAuthenticationInfo(); + + return systemRegistryDBService.mergeSystemResponse(systemId, validatedSystemName, validatedAddress, validatedPort, validatedAuthenticationInfo); + } + + //================================================================================================= + // assistant methods + private String getBaseOrigin() { + return CommonConstants.SYSTEM_REGISTRY_URI + CoreCommonConstants.MGMT_URI; + } + + private String getOrigin(final String postfix) { + Assert.notNull(postfix, "Internal error: Origin postfix not provided"); + return getBaseOrigin() + postfix; + } +} \ No newline at end of file diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryOnboardingController.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryOnboardingController.java new file mode 100644 index 000000000..5b3bc5ca3 --- /dev/null +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryOnboardingController.java @@ -0,0 +1,126 @@ +package eu.arrowhead.core.systemregistry; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.CoreCommonConstants; +import eu.arrowhead.common.Defaults; +import eu.arrowhead.common.dto.shared.SystemRegistryOnboardingWithCsrRequestDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryOnboardingWithCsrResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryOnboardingWithNameRequestDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryOnboardingWithNameResponseDTO; +import eu.arrowhead.core.systemregistry.database.service.SystemRegistryDBService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.apache.http.HttpStatus; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.util.Assert; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; + +@Api(tags = {CoreCommonConstants.SWAGGER_TAG_ALL}) +@CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, + allowedHeaders = {HttpHeaders.ORIGIN, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT, HttpHeaders.AUTHORIZATION} +) +@RestController +@RequestMapping(CommonConstants.SYSTEM_REGISTRY_URI + CommonConstants.ONBOARDING_URI) +public class SystemRegistryOnboardingController { + + //================================================================================================= + // members + + private static final String SYSTEM_REGISTRY_REGISTER_DESCRIPTION = "Registers a system"; + private static final String SYSTEM_REGISTRY_REGISTER_201_MESSAGE = "System registered"; + private static final String SYSTEM_REGISTRY_REGISTER_400_MESSAGE = "Could not register system"; + + private final Logger logger = LogManager.getLogger(SystemRegistryOnboardingController.class); + + private final SystemRegistryDBService systemRegistryDBService; + private final Validation validation; + + @Autowired + public SystemRegistryOnboardingController(final SystemRegistryDBService systemRegistryDBService) { + this.systemRegistryDBService = systemRegistryDBService; + this.validation = new Validation(); + } + + + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_REGISTER_DESCRIPTION, response = SystemRegistryOnboardingWithNameResponseDTO.class, tags = + {CoreCommonConstants.SWAGGER_TAG_CLIENT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = SYSTEM_REGISTRY_REGISTER_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_REGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) + @PostMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_ONBOARDING_WITH_NAME_URI, + consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public SystemRegistryOnboardingWithNameResponseDTO onboardDevice(final HttpServletRequest httpServletRequest, + @RequestBody final SystemRegistryOnboardingWithNameRequestDTO request) { + logger.debug("New onboarding with name and system registration request received"); + validation.checkOnboardingRequest(request, getOrigin(CommonConstants.OP_SYSTEM_REGISTRY_ONBOARDING_WITH_NAME_URI)); + + final String host = httpServletRequest.getRemoteHost(); + final String address = httpServletRequest.getRemoteAddr(); + final var response = systemRegistryDBService.onboardAndRegisterSystemRegistry(request, host, address); + logger.debug("{} successfully registers its system {}", request.getSystem().getSystemName(), request.getSystem()); + + return response; + } + + //------------------------------------------------------------------------------------------------- + @ApiOperation(value = SYSTEM_REGISTRY_REGISTER_DESCRIPTION, response = SystemRegistryOnboardingWithCsrResponseDTO.class, tags = + {CoreCommonConstants.SWAGGER_TAG_CLIENT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.SC_CREATED, message = SYSTEM_REGISTRY_REGISTER_201_MESSAGE), + @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = SYSTEM_REGISTRY_REGISTER_400_MESSAGE), + @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = CoreCommonConstants.SWAGGER_HTTP_401_MESSAGE), + @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = CoreCommonConstants.SWAGGER_HTTP_500_MESSAGE) + }) + @ResponseStatus(value = org.springframework.http.HttpStatus.CREATED) + @PostMapping(path = CommonConstants.OP_SYSTEM_REGISTRY_ONBOARDING_WITH_CSR_URI, + consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public SystemRegistryOnboardingWithCsrResponseDTO onboardDevice(@RequestBody final SystemRegistryOnboardingWithCsrRequestDTO request) { + logger.debug("New onboarding with csr and system registration request received"); + validation.checkOnboardingRequest(request, getOrigin(CommonConstants.OP_SYSTEM_REGISTRY_ONBOARDING_WITH_CSR_URI)); + + final var response = systemRegistryDBService.onboardAndRegisterSystemRegistry(request); + logger.debug("{} successfully registers its system {}", request.getSystem().getSystemName(), request.getSystem()); + + return response; + } + + //================================================================================================= + // assistant methods + + + //================================================================================================= + // assistant methods + private String getBaseOrigin() { + return CommonConstants.SYSTEM_REGISTRY_URI + CommonConstants.ONBOARDING_URI; + } + + private String getOrigin(final String postfix) { + Assert.notNull(postfix, "Internal error: Origin postfix not provided"); + return getBaseOrigin() + postfix; + } + +} \ No newline at end of file diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/Validation.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/Validation.java new file mode 100644 index 000000000..a48acd0cf --- /dev/null +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/Validation.java @@ -0,0 +1,314 @@ +package eu.arrowhead.core.systemregistry; + +import eu.arrowhead.common.CommonConstants; +import eu.arrowhead.common.Utilities; +import eu.arrowhead.common.core.CoreSystem; +import eu.arrowhead.common.dto.shared.DeviceRequestDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryOnboardingWithCsrRequestDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryOnboardingWithNameRequestDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryRequestDTO; +import eu.arrowhead.common.dto.shared.SystemRequestDTO; +import eu.arrowhead.common.exception.BadPayloadException; +import org.apache.http.HttpStatus; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.RequestBody; + +import java.time.format.DateTimeParseException; +import java.util.Objects; + +public class Validation { + + private static final String ID_NOT_VALID_ERROR_MESSAGE = "Id must be greater than 0. "; + private static final String SYSTEM_NAME_NULL_ERROR_MESSAGE = " System name must have value "; + private static final String SYSTEM_ADDRESS_NULL_ERROR_MESSAGE = " System address must have value "; + private static final String SYSTEM_PORT_NULL_ERROR_MESSAGE = " System port must have value "; + + private static final String DEVICE_NAME_NULL_ERROR_MESSAGE = " Device name must have value "; + private static final String DEVICE_ADDRESS_NULL_ERROR_MESSAGE = " Device address must have value "; + private static final String DEVICE_MAC_ADDRESS_NULL_ERROR_MESSAGE = " Device MAC address must have value "; + + private final Logger logger = LogManager.getLogger(); + + public Validation() { super(); } + + //------------------------------------------------------------------------------------------------- + void checkSystemNameRequirements(final String systemNameRequirements, final String origin) { + + if (Utilities.isEmpty(systemNameRequirements)) { + throw new BadPayloadException("System definition requirement is null or blank", HttpStatus.SC_BAD_REQUEST, origin); + } + + } + + //------------------------------------------------------------------------------------------------- + void checkId(final long systemId, final String origin) { + if (systemId < 1) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + void checkSystemMergeRequest(final SystemRequestDTO request, final long systemId, final String origin) { + logger.debug("checkSystemPatchRequest started..."); + + if (systemId <= 0) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + boolean needChange = false; + if (!Utilities.isEmpty(request.getAddress())) { + needChange = true; + } + + + if (!Utilities.isEmpty(request.getSystemName())) { + needChange = true; + for (final CoreSystem coreSysteam : CoreSystem.values()) { + if (coreSysteam.name().equalsIgnoreCase(request.getSystemName().trim())) { + throw new BadPayloadException("System name '" + request.getSystemName() + "' is a reserved arrowhead core system name.", + HttpStatus.SC_BAD_REQUEST, origin); + } + } + } + + if (request.getPort() != null) { + final int validatedPort = request.getPort(); + if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + throw new BadPayloadException( + "Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", + HttpStatus.SC_BAD_REQUEST, + origin); + } + + needChange = true; + } + + if (request.getAuthenticationInfo() != null) { + needChange = true; + } + + if (!needChange) { + throw new BadPayloadException("Patch request is empty.", HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + void checkOnboardingRequest(final SystemRegistryOnboardingWithNameRequestDTO request, final String origin) { + logger.debug("checkOnboardingRequest started..."); + if (request == null) { + throw new BadPayloadException("Request is null.", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (request.getCertificateCreationRequest() == null) { + throw new BadPayloadException("Certificate creation request is null.", HttpStatus.SC_BAD_REQUEST, origin); + } + + checkSystemRegistryRequest(request, origin, true); + } + + //------------------------------------------------------------------------------------------------- + void checkOnboardingRequest(final SystemRegistryOnboardingWithCsrRequestDTO request, final String origin) { + logger.debug("checkOnboardingRequest started..."); + if (request == null) { + throw new BadPayloadException("Request is null.", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (request.getCertificateSigningRequest() == null) { + throw new BadPayloadException("Certificate signing request is null.", HttpStatus.SC_BAD_REQUEST, origin); + } + + checkSystemRegistryRequest(request, origin, true); + } + + //------------------------------------------------------------------------------------------------- + void checkSystemPutRequest(final SystemRequestDTO request, final long systemId, final String origin) { + logger.debug("checkSystemPutRequest started..."); + + if (systemId <= 0) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + checkSystemRequest(request, origin, true); + } + + //------------------------------------------------------------------------------------------------- + void checkSystemRequest(final SystemRequestDTO request, final String origin, final boolean checkReservedCoreSystemNames) { + logger.debug("checkSystemRequest started..."); + + if (request == null) { + throw new BadPayloadException("System is null.", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(request.getSystemName())) { + throw new BadPayloadException(SYSTEM_NAME_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (checkReservedCoreSystemNames) { + for (final CoreSystem coreSysteam : CoreSystem.values()) { + if (coreSysteam.name().equalsIgnoreCase(request.getSystemName().trim())) { + throw new BadPayloadException("System name '" + request.getSystemName() + "' is a reserved arrowhead core system name.", + HttpStatus.SC_BAD_REQUEST, origin); + } + } + } + + if (Utilities.isEmpty(request.getAddress())) { + throw new BadPayloadException(SYSTEM_ADDRESS_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (request.getPort() == null) { + throw new BadPayloadException(SYSTEM_PORT_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + final int validatedPort = request.getPort(); + if (validatedPort <= CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + throw new BadPayloadException( + "Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", + HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + void checkDeviceRequest(final DeviceRequestDTO request, final String origin) { + logger.debug("checkDeviceRequest started..."); + + if (request == null) { + throw new BadPayloadException("Device is null.", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(request.getDeviceName())) { + throw new BadPayloadException(DEVICE_NAME_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(request.getAddress())) { + throw new BadPayloadException(DEVICE_ADDRESS_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + if (Utilities.isEmpty(request.getMacAddress())) { + throw new BadPayloadException(DEVICE_MAC_ADDRESS_NULL_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + void checkSystemRegistryRequest(final SystemRegistryRequestDTO request, final String origin, final boolean checkReservedCoreSystemNames) { + logger.debug("checkSystemRegistryRequest started..."); + + checkSystemRequest(request.getSystem(), origin, checkReservedCoreSystemNames); + checkDeviceRequest(request.getProvider(), origin); + + if (!Utilities.isEmpty(request.getEndOfValidity())) { + try { + Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()); + } catch (final DateTimeParseException ex) { + throw new BadPayloadException( + "End of validity is specified in the wrong format. Please provide UTC time using " + Utilities.getDatetimePattern() + " pattern.", + HttpStatus.SC_BAD_REQUEST, origin); + } + } + } + + //------------------------------------------------------------------------------------------------- + void checkSystemName(final String systemName, final String origin) { + if (Utilities.isEmpty(systemName)) { + throw new BadPayloadException("Name of the system is blank", HttpStatus.SC_BAD_REQUEST, origin); + } + } + + + //------------------------------------------------------------------------------------------------- + void checkUnregisterSystemParameters(final String systemName, final String address, final int port, final String origin) { + // parameters can't be null, but can be empty + logger.debug("checkUnregisterSystemParameters started..."); + + checkSystemName(systemName, origin); + + if (Utilities.isEmpty(address)) { + throw new BadPayloadException("Address of the system is blank", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (port < CommonConstants.SYSTEM_PORT_RANGE_MIN || port > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + throw new BadPayloadException( + "Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", + HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + void checkSystemRegistryUpdateRequest(final long id, final SystemRegistryRequestDTO request, final String origin) { + logger.debug("checkSystemRegistryUpdateRequest started..."); + + if (id <= 0) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + checkSystemRegistryRequest(request, origin, true); + + } + + //------------------------------------------------------------------------------------------------- + void validateDevice(@RequestBody final DeviceRequestDTO deviceRequestDto, final String origin) { + if (Utilities.isEmpty(deviceRequestDto.getDeviceName())) { + throw new BadPayloadException("Device name is null or blank", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(deviceRequestDto.getAddress())) { + throw new BadPayloadException("Device address is null or blank", HttpStatus.SC_BAD_REQUEST, origin); + } + + if (Utilities.isEmpty(deviceRequestDto.getMacAddress())) { + throw new BadPayloadException("Device MAC address is null or blank", HttpStatus.SC_BAD_REQUEST, origin); + } + } + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings("squid:S3776") + void checkSystemRegistryMergeRequest(final long id, final SystemRegistryRequestDTO request, final String origin) { + logger.debug("checkSystemRegistryMergeRequest started..."); + + if (id <= 0) { + throw new BadPayloadException(ID_NOT_VALID_ERROR_MESSAGE, HttpStatus.SC_BAD_REQUEST, origin); + } + + boolean needChange = false; + + if (Objects.nonNull(request.getSystem())) { + final SystemRequestDTO system = request.getSystem(); + + if (!Utilities.isEmpty(system.getSystemName())) { + needChange = true; + } else if (!Utilities.isEmpty(system.getAddress())) { + needChange = true; + } else if (Objects.nonNull(system.getPort())) { + final int validatedPort = system.getPort(); + if (validatedPort < CommonConstants.SYSTEM_PORT_RANGE_MIN || validatedPort > CommonConstants.SYSTEM_PORT_RANGE_MAX) { + throw new BadPayloadException( + "Port must be between " + CommonConstants.SYSTEM_PORT_RANGE_MIN + " and " + CommonConstants.SYSTEM_PORT_RANGE_MAX + ".", + HttpStatus.SC_BAD_REQUEST, + origin); + } + + needChange = true; + } else if (Objects.nonNull(system.getAuthenticationInfo())) { + needChange = true; + } + } + + + if (request.getEndOfValidity() != null) { + needChange = true; + } + + if (request.getMetadata() != null) { + needChange = true; + } + + if (request.getVersion() != null && request.getVersion() > 0) { + needChange = true; + } + + if (!needChange) { + throw new BadPayloadException("Patch request is empty.", HttpStatus.SC_BAD_REQUEST, origin); + } + } +} diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java index be15b56f9..f9f54df04 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java @@ -3,7 +3,7 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.CoreUtilities; -import eu.arrowhead.common.SSLProperties; +import eu.arrowhead.common.SecurityUtilities; import eu.arrowhead.common.Utilities; import eu.arrowhead.common.database.entity.Device; import eu.arrowhead.common.database.entity.System; @@ -11,14 +11,23 @@ import eu.arrowhead.common.database.repository.DeviceRepository; import eu.arrowhead.common.database.repository.SystemRegistryRepository; import eu.arrowhead.common.database.repository.SystemRepository; +import eu.arrowhead.common.drivers.CertificateAuthorityDriver; +import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; import eu.arrowhead.common.dto.internal.DTOConverter; import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; import eu.arrowhead.common.dto.internal.SystemListResponseDTO; import eu.arrowhead.common.dto.internal.SystemRegistryListResponseDTO; +import eu.arrowhead.common.dto.shared.CertificateCreationRequestDTO; +import eu.arrowhead.common.dto.shared.CertificateCreationResponseDTO; +import eu.arrowhead.common.dto.shared.CertificateType; import eu.arrowhead.common.dto.shared.DeviceRequestDTO; import eu.arrowhead.common.dto.shared.DeviceResponseDTO; import eu.arrowhead.common.dto.shared.SystemQueryFormDTO; import eu.arrowhead.common.dto.shared.SystemQueryResultDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryOnboardingWithCsrRequestDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryOnboardingWithCsrResponseDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryOnboardingWithNameRequestDTO; +import eu.arrowhead.common.dto.shared.SystemRegistryOnboardingWithNameResponseDTO; import eu.arrowhead.common.dto.shared.SystemRegistryRequestDTO; import eu.arrowhead.common.dto.shared.SystemRegistryResponseDTO; import eu.arrowhead.common.dto.shared.SystemRequestDTO; @@ -39,6 +48,7 @@ import java.io.IOException; import java.net.InetSocketAddress; import java.net.Socket; +import java.security.KeyPair; import java.time.ZonedDateTime; import java.time.format.DateTimeParseException; import java.util.Collections; @@ -61,12 +71,10 @@ public class SystemRegistryDBService { private final Logger logger = LogManager.getLogger(SystemRegistryDBService.class); private final SystemRegistryRepository systemRegistryRepository; - private final SystemRepository systemRepository; - private final DeviceRepository deviceRepository; - - private final SSLProperties sslProperties; + private final SecurityUtilities securityUtilities; + private final CertificateAuthorityDriver caDriver; @Value(CoreCommonConstants.$SYSTEM_REGISTRY_PING_TIMEOUT_WD) private int pingTimeout; @@ -75,11 +83,13 @@ public class SystemRegistryDBService { public SystemRegistryDBService(final SystemRegistryRepository systemRegistryRepository, final SystemRepository systemRepository, final DeviceRepository deviceRepository, - final SSLProperties sslProperties) { + final SecurityUtilities securityUtilities, + final CertificateAuthorityDriver caDriver) { this.systemRegistryRepository = systemRegistryRepository; this.systemRepository = systemRepository; this.deviceRepository = deviceRepository; - this.sslProperties = sslProperties; + this.securityUtilities = securityUtilities; + this.caDriver = caDriver; } @@ -236,8 +246,8 @@ public System mergeSystem(final long systemId, final String systemName, final St if (checkSystemIfUniqueValidationNeeded(system, validatedSystemName, validatedAddress, validatedPort)) { checkConstraintsOfSystemTable(validatedSystemName != null ? validatedSystemName : system.getSystemName(), - validatedAddress != null ? validatedAddress : system.getAddress(), - validatedPort != null ? validatedPort : system.getPort()); + validatedAddress != null ? validatedAddress : system.getAddress(), + validatedPort != null ? validatedPort : system.getPort()); } if (Utilities.notEmpty(validatedSystemName)) { @@ -297,7 +307,7 @@ public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageP try { final Page devices = deviceRepository.findAll(PageRequest.of(pageParams.getValidatedPage(), pageParams.getValidatedSize(), - pageParams.getValidatedDirection(), validatedSortField)); + pageParams.getValidatedDirection(), validatedSortField)); return DTOConverter.convertDeviceEntryListToDeviceListResponseDTO(devices); } catch (final Exception ex) { logger.debug(ex.getMessage(), ex); @@ -372,9 +382,9 @@ public SystemRegistryListResponseDTO getSystemRegistryEntries(final CoreUtilitie try { final PageRequest pageRequest = PageRequest.of(params.getValidatedPage(), - params.getValidatedSize(), - params.getValidatedDirection(), - validatedSortField); + params.getValidatedSize(), + params.getValidatedDirection(), + validatedSortField); final Page systemRegistryPage = systemRegistryRepository.findAll(pageRequest); return DTOConverter.convertSystemRegistryListToSystemRegistryListResponseDTO(systemRegistryPage); } catch (final Exception ex) { @@ -411,7 +421,6 @@ public void removeSystemRegistryEntryById(final long id) { } } - //------------------------------------------------------------------------------------------------- @Transactional(rollbackFor = ArrowheadException.class) public SystemRegistryResponseDTO registerSystemRegistry(final SystemRegistryRequestDTO request) { @@ -419,14 +428,14 @@ public SystemRegistryResponseDTO registerSystemRegistry(final SystemRegistryRequ checkSystemRegistryRequest(request); try { - final System systemDb = findOrCreateSystem(request.getSystem()); - final Device deviceDb = findOrCreateDevice(request.getProvider()); final ZonedDateTime endOfValidity = getZonedDateTime(request); final String metadataStr = Utilities.map2Text(request.getMetadata()); final int version = (request.getVersion() != null) ? request.getVersion() : 1; - final SystemRegistry srEntry = createSystemRegistry(systemDb, deviceDb, endOfValidity, metadataStr, version); + final System systemDb = findOrCreateSystem(request.getSystem()); + final Device deviceDb = findOrCreateDevice(request.getProvider()); + final SystemRegistry srEntry = createSystemRegistry(systemDb, deviceDb, endOfValidity, metadataStr, version); return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(srEntry); } catch (final DateTimeParseException ex) { logger.debug(ex.getMessage(), ex); @@ -457,10 +466,10 @@ public SystemRegistryResponseDTO updateSystemRegistryById(final long id, final S final System systemDb = findOrCreateSystem(request.getSystem()); final Device deviceDb = findOrCreateDevice(request.getProvider()); - final ZonedDateTime endOfValidity = getZonedDateTime(request); final String metadataStr = Utilities.map2Text(request.getMetadata()); final int version = (request.getVersion() != null) ? request.getVersion() : 1; + updateSrEntry = updateSystemRegistry(srEntry, systemDb, deviceDb, endOfValidity, metadataStr, version); return DTOConverter.convertSystemRegistryToSystemRegistryResponseDTO(updateSrEntry); @@ -532,7 +541,7 @@ public SystemRegistryListResponseDTO getSystemRegistryEntriesBySystemName(final final List systemList = systemRepository.findBySystemName(systemName); final PageRequest pageRequest = PageRequest.of(pageParameters.getValidatedPage(), pageParameters.getValidatedSize(), - pageParameters.getValidatedDirection(), sortField); + pageParameters.getValidatedDirection(), sortField); final Page systemRegistries = systemRegistryRepository.findAllBySystemIsIn(systemList, pageRequest); return DTOConverter.convertSystemRegistryListToSystemRegistryListResponseDTO(systemRegistries); @@ -610,15 +619,15 @@ public SystemQueryResultDTO queryRegistry(final SystemQueryFormDTO form) { if (form.getMetadataRequirements() != null && !form.getMetadataRequirements().isEmpty()) { final Map requiredMetadata = normalizeMetadata(form.getMetadataRequirements()); registryList.removeIf(e -> - { - final Map metadata = Utilities.text2Map(e.getMetadata()); - if (Objects.isNull(metadata)) { - // we have requirements but no metadata -> remove - return true; - } - - return !metadata.entrySet().containsAll(requiredMetadata.entrySet()); - }); + { + final Map metadata = Utilities.text2Map(e.getMetadata()); + if (Objects.isNull(metadata)) { + // we have requirements but no metadata -> remove + return true; + } + + return !metadata.entrySet().containsAll(requiredMetadata.entrySet()); + }); } // filter on ping @@ -658,6 +667,43 @@ public System createSystem(final String systemName, final String address, final } } + public SystemRegistryOnboardingWithNameResponseDTO onboardAndRegisterSystemRegistry(final SystemRegistryOnboardingWithNameRequestDTO request, + final String host, final String address) { + logger.debug("onboardAndRegisterSystemRegistry started..."); + + final CertificateCreationRequestDTO creationRequestDTO = request.getCertificateCreationRequest(); + final KeyPair keyPair = securityUtilities.extractOrGenerateKeyPair(creationRequestDTO); + final String certificateSigningRequest; + + try { + certificateSigningRequest = securityUtilities + .createCertificateSigningRequest(creationRequestDTO.getCommonName(), keyPair, host, address, CertificateType.AH_SYSTEM); + } catch (Exception e) { + logger.error(e.getMessage(), e); + throw new ArrowheadException("Unable to create certificate signing request: " + e.getMessage()); + } + + final var signingResponse = signCertificate(certificateSigningRequest); + signingResponse.setKeyPairDTO(securityUtilities.encodeKeyPair(keyPair)); + + final var retValue = new SystemRegistryOnboardingWithNameResponseDTO(); + retValue.setCertificateResponse(signingResponse); + retValue.load(registerSystemRegistry(request)); + return retValue; + } + + public SystemRegistryOnboardingWithCsrResponseDTO onboardAndRegisterSystemRegistry(final SystemRegistryOnboardingWithCsrRequestDTO request) { + + logger.debug("onboardAndRegisterDeviceRegistry started..."); + final var signingResponse = signCertificate(request.getCertificateSigningRequest()); + securityUtilities.extractAndSetPublicKey(signingResponse); + + final var retValue = new SystemRegistryOnboardingWithCsrResponseDTO(); + retValue.setCertificateResponse(signingResponse); + retValue.load(registerSystemRegistry(request)); + return retValue; + } + //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- @@ -717,11 +763,11 @@ private Map normalizeMetadata(final Map metadata final Map map = new HashMap<>(); metadata.forEach((k, v) -> - { - if (Objects.nonNull(v)) { - map.put(k.trim(), v.trim()); - } - }); + { + if (Objects.nonNull(v)) { + map.put(k.trim(), v.trim()); + } + }); return map; } @@ -890,9 +936,9 @@ private SystemRegistry getSystemRegistryEntryById(final long id) { //------------------------------------------------------------------------------------------------- private System findOrCreateSystem(SystemRequestDTO requestSystemDto) { return findOrCreateSystem(requestSystemDto.getSystemName(), - requestSystemDto.getAddress(), - requestSystemDto.getPort(), - requestSystemDto.getAuthenticationInfo()); + requestSystemDto.getAddress(), + requestSystemDto.getPort(), + requestSystemDto.getAuthenticationInfo()); } //------------------------------------------------------------------------------------------------- @@ -921,9 +967,9 @@ private System findOrCreateSystem(final String name, final String address, final //------------------------------------------------------------------------------------------------- private Device findOrCreateDevice(DeviceRequestDTO requestDeviceDto) { return findOrCreateDevice(requestDeviceDto.getDeviceName(), - requestDeviceDto.getAddress(), - requestDeviceDto.getMacAddress(), - requestDeviceDto.getAuthenticationInfo()); + requestDeviceDto.getAddress(), + requestDeviceDto.getMacAddress(), + requestDeviceDto.getAuthenticationInfo()); } //------------------------------------------------------------------------------------------------- @@ -980,7 +1026,7 @@ private void checkConstraintsOfSystemRegistryTable(final System systemDb, final final Optional find = systemRegistryRepository.findBySystemAndDevice(systemDb, deviceDb); if (find.isPresent()) { throw new InvalidParameterException("System Registry entry with provider: (" + deviceDb.getDeviceName() + ", " + deviceDb.getMacAddress() + - ") and system : " + systemDb.getSystemName() + " already exists."); + ") and system : " + systemDb.getSystemName() + " already exists."); } } catch (final InvalidParameterException ex) { throw ex; @@ -1051,6 +1097,20 @@ private ZonedDateTime getZonedDateTime(SystemRegistryRequestDTO request) { return Utilities.isEmpty(request.getEndOfValidity()) ? null : Utilities.parseUTCStringToLocalZonedDateTime(request.getEndOfValidity().trim()); } + //------------------------------------------------------------------------------------------------- + private CertificateCreationResponseDTO signCertificate(final String signingRequest) { + logger.debug("Contact CertificateAuthority ..."); + final var csrDTO = new CertificateSigningRequestDTO(signingRequest); + final var signingResponse = caDriver.signCertificate(csrDTO); + + logger.debug("Processing response from Certificate Authority ..."); + final CertificateCreationResponseDTO certificateResponseDTO = new CertificateCreationResponseDTO(); + certificateResponseDTO.setCertificate(signingResponse.getCertificateChain().get(0)); + certificateResponseDTO.setCertificateFormat(CoreCommonConstants.CERTIFICATE_FORMAT); + certificateResponseDTO.setCertificateType(CertificateType.AH_DEVICE); + return certificateResponseDTO; + } + //------------------------------------------------------------------------------------------------- private SystemRegistry setModifiedValuesOfSystemRegistryEntryFields(final SystemRegistry srEntry, final System system, final Device device, final ZonedDateTime endOfValidity, final String metadataStr, final int version) { diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistryAccessControlFilter.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistryAccessControlFilter.java index b434c6aef..ecc1a7af8 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistryAccessControlFilter.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/security/SystemRegistryAccessControlFilter.java @@ -2,17 +2,12 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; - -import eu.arrowhead.common.security.CoreSystemAccessControlFilter; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import eu.arrowhead.common.Utilities; -import eu.arrowhead.common.core.CoreSystem; -import eu.arrowhead.common.dto.shared.OrchestrationFlags; -import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO; -import eu.arrowhead.common.exception.AuthException; +import eu.arrowhead.common.SecurityUtilities; +import eu.arrowhead.common.dto.shared.CertificateType; import eu.arrowhead.common.security.CoreSystemAccessControlFilter; +import org.bouncycastle.crypto.tls.CertChainType; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; import java.util.Map; @@ -23,16 +18,26 @@ public class SystemRegistryAccessControlFilter extends CoreSystemAccessControlFi //================================================================================================= // assistant methods + private final SecurityUtilities securityUtilities; + + @Autowired + public SystemRegistryAccessControlFilter(final SecurityUtilities securityUtilities) {this.securityUtilities = securityUtilities;} //------------------------------------------------------------------------------------------------- @Override protected void checkClientAuthorized(final String clientCN, final String method, final String requestTarget, final String requestJSON, final Map queryParams) { - // certificates will be verified individually on each method + if (requestTarget.contains(CommonConstants.ONBOARDING_URI) || requestTarget.contains(CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_URI)) { + // certificates will be verified individually on each method + securityUtilities.authenticateCertificate(clientCN, requestTarget, CertificateType.AH_DEVICE); + return; + } + + super.checkClientAuthorized(clientCN, method, requestTarget, requestJSON, queryParams); + final String cloudCN = getServerCloudCN(); + if (requestTarget.contains(CoreCommonConstants.MGMT_URI)) { // Only the local System Operator can use these methods - final String cloudCN = getServerCloudCN(); - super.checkClientAuthorized(clientCN, method, requestTarget, requestJSON, queryParams); checkIfLocalSystemOperator(clientCN, cloudCN, requestTarget); } } diff --git a/systemregistry/src/main/resources/application.properties b/systemregistry/src/main/resources/application.properties index fbd6e50d3..cd205c351 100644 --- a/systemregistry/src/main/resources/application.properties +++ b/systemregistry/src/main/resources/application.properties @@ -11,7 +11,7 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect # use true only for debugging -spring.jpa.show-sql=false +spring.jpa.show-sql=false spring.jpa.properties.hibernate.format_sql=true spring.jpa.hibernate.ddl-auto=none @@ -26,7 +26,7 @@ domain.port=8437 ############################################ # Name of the core system -core_system_name=SYSTEM_REGISTRY +core_system_name=SYSTEM_REGISTRY # Show all request/response in debug log log_all_request_and_response=false diff --git a/systemregistry/src/main/resources/log4j2.xml b/systemregistry/src/main/resources/log4j2.xml index 1309f0e14..de3e42cf3 100644 --- a/systemregistry/src/main/resources/log4j2.xml +++ b/systemregistry/src/main/resources/log4j2.xml @@ -5,7 +5,7 @@ %d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex INFO - INFO + DEBUG . From 98a53f07a3ef68645ebe42e7515fff8dcea6532e Mon Sep 17 00:00:00 2001 From: Svetlin Tanyi Date: Tue, 31 Mar 2020 16:25:42 +0200 Subject: [PATCH 289/301] Fixed spacing in table --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6aa500b7c..e89da1cdd 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ Please be aware, that 4.1.3 is __NOT__ backwards compatible with 4.1.2. If you h * [Client](#ca_endpoints_client) * [Private](#ca_endpoints_private) * [Management](#ca_endpoints_mgmt) - 8. [QoS Monitor (Quality of Service Monitor)](#qos_monitor) + 8. [QoS Monitor (Quality of Service Monitor)](#qos_monitor) * [System Design Description Overview](#qos_monitor_sdd) * [Services and Use Cases](#qos_monitor_usecases) * [Endpoints](#qos_monitor_endpoints) From 38a427029195de0e2f35d43f00b01703b7e21523 Mon Sep 17 00:00:00 2001 From: Bocsi Rajmund Date: Tue, 31 Mar 2020 16:29:06 +0200 Subject: [PATCH 290/301] fix for 'consumer side server does not start fast enough of slower servers' bug (unit tests are not fixed yet) --- authorization/.classpath | 14 +++++++++++++ choreographer/.classpath | 14 +++++++++++++ core-common/.classpath | 14 +++++++++++++ eventhandler/.classpath | 14 +++++++++++++ gatekeeper/.classpath | 14 +++++++++++++ gateway/.classpath | 14 +++++++++++++ .../ConsumerSideServerSocketThread.java | 20 ++++++++++++------- orchestrator/.classpath | 14 +++++++++++++ serviceregistry/.classpath | 16 ++++++++++++++- 9 files changed, 126 insertions(+), 8 deletions(-) diff --git a/authorization/.classpath b/authorization/.classpath index 01997bb0d..e210343c4 100644 --- a/authorization/.classpath +++ b/authorization/.classpath @@ -45,5 +45,19 @@ + + + + + + + + + + + + + + diff --git a/choreographer/.classpath b/choreographer/.classpath index 01997bb0d..e210343c4 100644 --- a/choreographer/.classpath +++ b/choreographer/.classpath @@ -45,5 +45,19 @@ + + + + + + + + + + + + + + diff --git a/core-common/.classpath b/core-common/.classpath index 779e9464e..660114540 100644 --- a/core-common/.classpath +++ b/core-common/.classpath @@ -40,5 +40,19 @@ + + + + + + + + + + + + + + diff --git a/eventhandler/.classpath b/eventhandler/.classpath index 01997bb0d..e210343c4 100644 --- a/eventhandler/.classpath +++ b/eventhandler/.classpath @@ -45,5 +45,19 @@ + + + + + + + + + + + + + + diff --git a/gatekeeper/.classpath b/gatekeeper/.classpath index 01997bb0d..e210343c4 100644 --- a/gatekeeper/.classpath +++ b/gatekeeper/.classpath @@ -45,5 +45,19 @@ + + + + + + + + + + + + + + diff --git a/gateway/.classpath b/gateway/.classpath index 01997bb0d..e210343c4 100644 --- a/gateway/.classpath +++ b/gateway/.classpath @@ -45,5 +45,19 @@ + + + + + + + + + + + + + + diff --git a/gateway/src/main/java/eu/arrowhead/core/gateway/thread/ConsumerSideServerSocketThread.java b/gateway/src/main/java/eu/arrowhead/core/gateway/thread/ConsumerSideServerSocketThread.java index 02ee5e1eb..bb0910910 100644 --- a/gateway/src/main/java/eu/arrowhead/core/gateway/thread/ConsumerSideServerSocketThread.java +++ b/gateway/src/main/java/eu/arrowhead/core/gateway/thread/ConsumerSideServerSocketThread.java @@ -96,7 +96,19 @@ public void init(final MessageProducer sender) { Assert.notNull(sender, "sender is null."); this.sender = sender; - this.initialized = true; + + final SSLContext sslContext = SSLContextFactory.createGatewaySSLContext(sslProperties); + final SSLServerSocketFactory serverSocketFactory = sslContext.getServerSocketFactory(); + try { + sslServerSocket = (SSLServerSocket) serverSocketFactory.createServerSocket(port); + sslServerSocket.setNeedClientAuth(true); + sslServerSocket.setSoTimeout(timeout); + this.initialized = true; + } catch (final IOException ex) { + logger.debug("Problem occurs in initializing gateway communication: {}", ex.getMessage()); + logger.debug("Stacktrace:", ex); + close(); + } } //------------------------------------------------------------------------------------------------- @@ -147,12 +159,6 @@ public void run() { } try { - final SSLContext sslContext = SSLContextFactory.createGatewaySSLContext(sslProperties); - final SSLServerSocketFactory serverSocketFactory = sslContext.getServerSocketFactory(); - sslServerSocket = (SSLServerSocket) serverSocketFactory.createServerSocket(port); - sslServerSocket.setNeedClientAuth(true); - sslServerSocket.setSoTimeout(timeout); - sslConsumerSocket = (SSLSocket) sslServerSocket.accept(); final InputStream inConsumer = sslConsumerSocket.getInputStream(); outConsumer = sslConsumerSocket.getOutputStream(); diff --git a/orchestrator/.classpath b/orchestrator/.classpath index 01997bb0d..e210343c4 100644 --- a/orchestrator/.classpath +++ b/orchestrator/.classpath @@ -45,5 +45,19 @@ + + + + + + + + + + + + + + diff --git a/serviceregistry/.classpath b/serviceregistry/.classpath index cb0f276b7..014cf562e 100644 --- a/serviceregistry/.classpath +++ b/serviceregistry/.classpath @@ -45,5 +45,19 @@ + + + + + + + + + + + + + + - \ No newline at end of file + From 44a9ee8967da23f4c4fb9696aa1db6aa52765823 Mon Sep 17 00:00:00 2001 From: Bocsi Rajmund Date: Wed, 1 Apr 2020 10:32:47 +0200 Subject: [PATCH 291/301] in ArrowheadHttpClientResponseErrorHandler always add status code to the exception unit test fix --- ...rowheadHttpClientResponseErrorHandler.java | 4 ++-- .../gateway/service/GatewayServiceTest.java | 20 ++++++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/http/ArrowheadHttpClientResponseErrorHandler.java b/core-common/src/main/java/eu/arrowhead/common/http/ArrowheadHttpClientResponseErrorHandler.java index 0ddbd57d0..ceebca435 100644 --- a/core-common/src/main/java/eu/arrowhead/common/http/ArrowheadHttpClientResponseErrorHandler.java +++ b/core-common/src/main/java/eu/arrowhead/common/http/ArrowheadHttpClientResponseErrorHandler.java @@ -39,13 +39,13 @@ public void handleError(final URI url, final HttpMethod method, final ClientHttp logger.debug("Unable to deserialize error message: {}", ex.getMessage()); logger.debug("Exception: ", ex); logger.error("Request failed at {}, response status code: {}", url, response.getRawStatusCode()); - throw new ArrowheadException("Unknown error occurred at " + url + ". Check log for possibly more information.", ex); + throw new ArrowheadException("Unknown error occurred at " + url + ". Check log for possibly more information.", response.getRawStatusCode(), ex); } if (dto.getExceptionType() == null) { logger.error("Request failed at {}, response status code: {}", url, response.getRawStatusCode()); logger.error("Request failed, error message: {}", dto.getErrorMessage()); - throw new ArrowheadException("Unknown error occurred at " + url + ". Check log for possibly more information."); + throw new ArrowheadException("Unknown error occurred at " + url + ". Check log for possibly more information.", response.getRawStatusCode()); } logger.debug("Error occured at {}. Returned with {}", url, response.getRawStatusCode()); diff --git a/gateway/src/test/java/eu/arrowhead/core/gateway/service/GatewayServiceTest.java b/gateway/src/test/java/eu/arrowhead/core/gateway/service/GatewayServiceTest.java index 945efe856..69c7f7e2f 100644 --- a/gateway/src/test/java/eu/arrowhead/core/gateway/service/GatewayServiceTest.java +++ b/gateway/src/test/java/eu/arrowhead/core/gateway/service/GatewayServiceTest.java @@ -42,6 +42,8 @@ import org.mockito.Mock; import org.mockito.Spy; import org.springframework.context.ApplicationContext; +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.Resource; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.util.ReflectionTestUtils; @@ -74,7 +76,7 @@ public class GatewayServiceTest { @Mock private Map arrowheadContext; - @Spy + @Mock private ApplicationContext appContext; @Mock @@ -624,6 +626,7 @@ public void testConnectConsumerEverythingOK() throws JMSException { when(relayClient.createConnection(any(String.class), anyInt(), anyBoolean())).thenReturn(getTestSession()); when(relayClient.isConnectionClosed(any(Session.class))).thenReturn(false); when(relayClient.initializeConsumerSideRelay(any(Session.class), any(MessageListener.class), any(String.class), any(String.class))).thenReturn(new ConsumerSideRelayInfo(producer, producer)); + when(appContext.getBean(SSLProperties.class)).thenReturn(getTestSSLPropertiesForThread()); final int serverPort = testingObject.connectConsumer(request); @@ -921,4 +924,19 @@ private GatewayConsumerConnectionRequestDTO getTestGatewayConsumerConnectionRequ return new GatewayConsumerConnectionRequestDTO(relay, "queueId", "peerName", publicKey, consumer, provider, consumerCloud, providerCloud, "test-service"); } + + //------------------------------------------------------------------------------------------------- + private SSLProperties getTestSSLPropertiesForThread() { + final SSLProperties sslProps = new SSLProperties(); + ReflectionTestUtils.setField(sslProps, "sslEnabled", true); + ReflectionTestUtils.setField(sslProps, "keyStoreType", "PKCS12"); + final Resource keystore = new ClassPathResource("certificates/gateway.p12"); + ReflectionTestUtils.setField(sslProps, "keyStore", keystore); + ReflectionTestUtils.setField(sslProps, "keyStorePassword", "123456"); + final Resource truststore = new ClassPathResource("certificates/truststore.p12"); + ReflectionTestUtils.setField(sslProps, "trustStore", truststore); + ReflectionTestUtils.setField(sslProps, "trustStorePassword", "123456"); + + return sslProps; + } } \ No newline at end of file From bc57f684a10da8e8503317237bfd1039175c6765 Mon Sep 17 00:00:00 2001 From: Bocsi Rajmund Date: Wed, 1 Apr 2020 11:14:32 +0200 Subject: [PATCH 292/301] unit test fixes after bugfix --- .../ConsumerSideServerSocketThread.java | 6 ++-- .../ConsumerSideServerSocketThreadTest.java | 31 ++++++++++++++----- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/gateway/src/main/java/eu/arrowhead/core/gateway/thread/ConsumerSideServerSocketThread.java b/gateway/src/main/java/eu/arrowhead/core/gateway/thread/ConsumerSideServerSocketThread.java index bb0910910..a6dfc9d25 100644 --- a/gateway/src/main/java/eu/arrowhead/core/gateway/thread/ConsumerSideServerSocketThread.java +++ b/gateway/src/main/java/eu/arrowhead/core/gateway/thread/ConsumerSideServerSocketThread.java @@ -97,14 +97,14 @@ public void init(final MessageProducer sender) { this.sender = sender; - final SSLContext sslContext = SSLContextFactory.createGatewaySSLContext(sslProperties); - final SSLServerSocketFactory serverSocketFactory = sslContext.getServerSocketFactory(); try { + final SSLContext sslContext = SSLContextFactory.createGatewaySSLContext(sslProperties); + final SSLServerSocketFactory serverSocketFactory = sslContext.getServerSocketFactory(); sslServerSocket = (SSLServerSocket) serverSocketFactory.createServerSocket(port); sslServerSocket.setNeedClientAuth(true); sslServerSocket.setSoTimeout(timeout); this.initialized = true; - } catch (final IOException ex) { + } catch (final Throwable ex) { logger.debug("Problem occurs in initializing gateway communication: {}", ex.getMessage()); logger.debug("Stacktrace:", ex); close(); diff --git a/gateway/src/test/java/eu/arrowhead/core/gateway/thread/ConsumerSideServerSocketThreadTest.java b/gateway/src/test/java/eu/arrowhead/core/gateway/thread/ConsumerSideServerSocketThreadTest.java index 3176e9cca..f99acbcbd 100644 --- a/gateway/src/test/java/eu/arrowhead/core/gateway/thread/ConsumerSideServerSocketThreadTest.java +++ b/gateway/src/test/java/eu/arrowhead/core/gateway/thread/ConsumerSideServerSocketThreadTest.java @@ -8,6 +8,7 @@ import static org.mockito.Mockito.when; import java.io.ByteArrayOutputStream; +import java.io.IOException; import java.io.OutputStream; import java.io.Serializable; import java.security.PublicKey; @@ -34,6 +35,7 @@ import javax.jms.Topic; import javax.jms.TopicSubscriber; import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLServerSocket; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; @@ -44,6 +46,7 @@ import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.Mockito; import org.springframework.context.ApplicationContext; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; @@ -161,12 +164,24 @@ public void testConstructorServiceDefinitionEmpty() { public void testInitSenderNull() { testingObject.init(null); } + + //------------------------------------------------------------------------------------------------- + @Test + public void testInitSSLSocketInitializationFailed() { + Assert.assertFalse(testingObject.isInitialized()); + + ReflectionTestUtils.setField(testingObject, "sslProperties", null); + testingObject.init(getTestMessageProducer()); + + Assert.assertFalse(testingObject.isInitialized()); + } //------------------------------------------------------------------------------------------------- @Test public void testInitOk() { Assert.assertTrue(!testingObject.isInitialized()); + ReflectionTestUtils.setField(testingObject, "port", 22004); testingObject.init(getTestMessageProducer()); Assert.assertTrue(testingObject.isInitialized()); @@ -235,16 +250,18 @@ public void testRunNotInitialized() { //------------------------------------------------------------------------------------------------- @Test - public void testRunWhenInternalExceptionThrown() { - final SSLProperties sslProps = getTestSSLPropertiesForThread(); - ReflectionTestUtils.setField(sslProps, "keyStoreType", "invalid"); - - when(appContext.getBean(SSLProperties.class)).thenReturn(sslProps); - + public void testRunWhenInternalExceptionThrown() throws IOException { + when(appContext.getBean(SSLProperties.class)).thenReturn(getTestSSLPropertiesForThread()); + final String publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq5Jq4tOeFoLqxOqtYcujbCNZina3iuV9+/o8D1R9D0HvgnmlgPlqWwjDSxV7m7SGJpuc/rRXJ85OzqV3rwRHO8A8YWXiabj8EdgEIyqg4SOgTN7oZ7MQUisTpwtWn9K14se4dHt/YE9mUW4en19p/yPUDwdw3ECMJHamy/O+Mh6rbw6AFhYvz6F5rXYB8svkenOuG8TSBFlRkcjdfqQqtl4xlHgmlDNWpHsQ3eFAO72mKQjm2ZhWI1H9CLrJf1NQs2GnKXgHBOM5ET61fEHWN8axGGoSKfvTed5vhhX7l5uwxM+AKQipLNNKjEaQYnyX3TL9zL8I7y+QkhzDa7/5kQIDAQAB"; - final ConsumerSideServerSocketThread thread = new ConsumerSideServerSocketThread(appContext, 22003, relayClient, getTestSession(), publicKey, "queueId", 60000, "consumer", "test-service"); + final ConsumerSideServerSocketThread thread = new ConsumerSideServerSocketThread(appContext, 22005, relayClient, getTestSession(), publicKey, "queueId", 60000, "consumer", "test-service"); thread.init(getTestMessageProducer()); + + final SSLServerSocket sslServerSocket = Mockito.mock(SSLServerSocket.class); + when(sslServerSocket.accept()).thenThrow(IOException.class); + ReflectionTestUtils.setField(thread, "sslServerSocket", sslServerSocket); + thread.run(); final boolean interrupted = (boolean) ReflectionTestUtils.getField(thread, "interrupted"); From 2ee5803a62eb4555d00c223b2813937f32f7e083 Mon Sep 17 00:00:00 2001 From: Bocsi Rajmund Date: Thu, 2 Apr 2020 11:53:01 +0200 Subject: [PATCH 293/301] adding standalone mode to CA, so mvn install can run tests without problem --- .../StandaloneModeInCertificateAuthorityTests.java | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 certificate-authority/src/test/java/eu/arrowhead/core/certificate_authority/StandaloneModeInCertificateAuthorityTests.java diff --git a/certificate-authority/src/test/java/eu/arrowhead/core/certificate_authority/StandaloneModeInCertificateAuthorityTests.java b/certificate-authority/src/test/java/eu/arrowhead/core/certificate_authority/StandaloneModeInCertificateAuthorityTests.java new file mode 100644 index 000000000..552432eb5 --- /dev/null +++ b/certificate-authority/src/test/java/eu/arrowhead/core/certificate_authority/StandaloneModeInCertificateAuthorityTests.java @@ -0,0 +1,10 @@ +package eu.arrowhead.core.certificate_authority; + +import org.springframework.stereotype.Component; + +import eu.arrowhead.common.testhelper.StandaloneModeInTests; + +@Component +public class StandaloneModeInCertificateAuthorityTests extends StandaloneModeInTests { + +} \ No newline at end of file From b70b55046a9eab2a8e657c721ed21bcc6b2353ca Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Mon, 6 Apr 2020 17:49:30 +0200 Subject: [PATCH 294/301] merged internal documentation --- README.md | 793 +++++++++++++++++- .../onboarding/onboarding_controller.png | Bin 0 -> 122370 bytes .../core/onboarding/OnboardingController.java | 18 +- 3 files changed, 757 insertions(+), 54 deletions(-) create mode 100644 documentation/onboarding/onboarding_controller.png diff --git a/README.md b/README.md index 1f38b3523..b5634e984 100644 --- a/README.md +++ b/README.md @@ -81,22 +81,33 @@ Please be aware, that 4.1.3 is __NOT__ backwards compatible with 4.1.2. If you h * [Client](#ca_endpoints_client) * [Private](#ca_endpoints_private) * [Management](#ca_endpoints_mgmt) - 8. [QoS Monitor (Quality of Service Monitor)](#qos_monitor) + 8. [QoS Monitor (Quality of Service Monitor)](#qos_monitor) * [System Design Description Overview](#qos_monitor_sdd) * [Services and Use Cases](#qos_monitor_usecases) * [Endpoints](#qos_monitor_endpoints) * [Client](#qos_monitor_endpoints_client) * [Private](#qos_monitor_endpoints_private) * [Management](#qos_monitor_endpoints_mgmt) - 9. [System Registry](#systenregistry) + 9. [Onboarding Controller](#onboardingcontroller) + * [System Design Description Overview](#onboardingcontroller_sdd) + * [Services and Use Cases](#onboardingcontroller_usecases) + * [Security](#onboardingcontroller_security) + * [Endpoints](#onboardingcontroller_endpoints) + * [Onboarding](#onboardingcontroller_endpoints_onboarding) + 9. [Device Registry](#deviceregistry) + * [System Design Description Overview](#deviceregistry_sdd) + * [Services and Use Cases](#deviceregistry_usecases) + * [Security](#deviceregistry_security) + * [Endpoints](#deviceregistry_endpoints) + * [Onboarding](#deviceregistry_endpoints_onboarding) + * [Client](#deviceregistry_endpoints_client) + 9. [System Registry](#systemregistry) * [System Design Description Overview](#systemregistry_sdd) * [Services and Use Cases](#systemregistry_usecases) * [Security](#systemregistry_security) - * [Endpoints](#systenregistry_endpoints) - * [Client](#systenregistry_endpoints_client) - * [Private](#systenregistry_endpoints_private) - * [Management](#systenregistry_endpoints_mgmt) - * [Removed Endpoints](#systenregistry_removed) + * [Endpoints](#systemregistry_endpoints) + * [Onboarding](#systemregistry_endpoints_onboarding) + * [Client](#systemregistry_endpoints_client)
    @@ -6672,13 +6683,504 @@ __Ping Measurment response by system id__ the output : For private endpoints no detailed description available. - + +# Onboarding Controller +

    + +The purpose of this System is to be the entry board for the onboarding procedure. The onboarding controller sits at the edge of the Arrowhead local cloud. +It is not only reachable from within the cloud by authorized systems, but also from the public through its "accept all" interfaces. +Any client may authenticate itself through an Arrowhead certificate, through an authorized manufacturer certificate, or simply through a shared secret. + +![onboarding_controller](./documentation/onboarding/onboarding_controller.png) + +## Services and Use Cases +
    + +The only use case is the onboarding procedure. + +The onboarding procedure is needed when a new device produced by any vendor (e.g. Siemens, Infineon, Bosch, etc.), containing a security controller (e.g. TPM), +wants to interact with the Arrowhead local cloud. To assure that the cloud is not compromised upon the arrival of this new device, it is important to establish +a chain of trust from the new hardware device, to its hosted application systems and their services. Thus, the onboarding procedure makes possible that +the device, systems and services are authenticated and authorized to connect to the Arrowhead local cloud. + +The use cases in which the external actor interacts with the Arrowhead local cloud during onboarding include: +* Initialize Device Onboarding (via the Onboarding Controller system) +* Register a Device in the DeviceRegistry (via the DeviceRegistry system) +* Register a System in the SystemRegistry (via the SystemRegistry system) +* Register a Service in the ServiceRegistry (via the ServiceRegistry system) +* Start normal operation (e.g., service lookup, service consumption, etc.) + +The onboarding controller can either relay a ![PKCS #10 Certificate Signing Request](https://tools.ietf.org/html/rfc2986) or generate one on behalf of the client. + + +## Security + + +This System can be secured via the HTTPS protocol. If it is started in secure mode, it verifies whether the Application System +- possesses a proper X.509 identity certificate and whether that certificate is Arrowhead compliant +- possesses a proper X.509 identity certificate and whether that certificate is trusted by the CA +- provides a shared secret through ![HTTP Basic Authentication](https://tools.ietf.org/html/rfc7617) + +## Endpoints + + +The Onboarding Controller offers two types of authentication (certificate or HTTP Basic) and two types operation (provide CSR or generate CSR), thus having four different endpoint. +No management or private endpoint exists. + +Swagger API documentation is available on: `https://:`
    +The base URL for the requests: `https://:/onboarding` + +The general scheme of the URLs is `https://:/onboarding//` + +### Client endpoint description
    +
    + +| Function | URL subpath | Method | Input | Output | +| -------- | ----------- | ------ | ----- | ------ | +| [Echo](#onboardingcontroller_endpoints_get_echo) | /echo | GET | - | OK | +| [Onboard with Name](#onboardingcontroller_endpoints_name) | /certificate/name | POST | [OnboardingWithNameRequest](#datastructures_onboarding_name_request) | [OnboardingWithNameResponse](#datastructures_onboarding_name_response) | +| [Onboard with Name](#onboardingcontroller_endpoints_name) | /sharedsecret/name | POST | [OnboardingWithNameRequest](#datastructures_onboarding_name_request) | [OnboardingWithNameResponse](#datastructures_onboarding_name_response) | +| [Onboard with CSR](#onboardingcontroller_endpoints_csr) | /certificate/csr | POST | [OnboardingWithCsrRequest](#datastructures_onboarding_csr_request) | [OnboardingWithCsrResponse](#datastructures_onboarding_csr_response) | +| [Onboard with CSR](#onboardingcontroller_endpoints_csr) | /sharedsecret/csr | POST | [OnboardingWithCsrRequest](#datastructures_onboarding_csr_request) | [OnboardingWithCsrResponse](#datastructures_onboarding_csr_response) | + + +### Onboard with Name + + +``` +POST /certificate/name +POST /sharedsecret/name +``` + +Creates a CSR on behalf of the client and eventually returns an onboarding certificate which may be used in the next step of the onboarding controller. + +#### Request + + +```json +{ + "creationRequestDTO": { + "commonName": "string", + "keyPairDTO": { + "keyAlgorithm": "string", + "keyFormat": "string", + "privateKey": "string", + "publicKey": "string" + } + } +} +``` + +| Field | Description | +| ----- | ----------- | +| `commonName` | The common name field for the new certificate | +| `keyAlgorithm` | The key algorithm of the provided keys | +| `keyFormat` | The key format of the provided keys | +| `privateKey` | Base64 encoded private key | +| `publicKey` | Base64 encoded public key | + +#### Response + + +```json +{ + "rootCertificate": "string", + "intermediateCertificate": "string", + "onboardingCertificate": { + "certificate": "string", + "certificateFormat": "string", + "certificateType": "AH_ONBOARDING", + "keyPairDTO": { + "keyAlgorithm": "string", + "keyFormat": "string", + "privateKey": "string", + "publicKey": "string" + } + }, + "deviceRegistry": { + "service": "DEVICE_REGISTRY_ONBOARDING_WITH_NAME_SERVICE", + "uri": "string" + }, + "systemRegistry": { + "service": "SYSTEM_REGISTRY_ONBOARDING_WITH_NAME_SERVICE", + "uri": "string" + }, + "serviceRegistry": { + "service": "SERVICE_REGISTRY_REGISTER_SERVICE", + "uri": "string" + }, + "orchestrationService": { + "service": "ORCHESTRATION_SERVICE", + "uri": "string" + } +} +``` + +| Field | Description | +| ----- | ----------- | +| `rootCertificate` | The Arrowhead master certificate | +| `intermediateCertificate` | The Arrowhead local cloud certificate | +| `onboardingCertificate` | The onboarding certificate for the next step | +| `certificateFormat` | The certificate format (usually X.509) | +| `certificateType` | The certificate type. Always AH_ONBOARDING for this operation | +| `keyAlgorithm` | The key algorithm of the provided keys | +| `keyFormat` | The key format of the provided keys | +| `privateKey` | Base64 encoded private key | +| `publicKey` | Base64 encoded public key | +| `service` | The service which is reachable under `uri` | +| `uri` | The uri under which the depicted `service` is reachable | + + +### Onboard with CSR + + +``` +POST /certificate/csr +POST /sharedsecret/csr +``` + +Creates a CSR on behalf of the client and eventually returns an onboarding certificate which may be used in the next step of the onboarding controller. + +#### Request + + +```json +{ + "certificateSigningRequest": "string" +} +``` + +| Field | Description | +| ----- | ----------- | +| `certificateSigningRequest` | Base64 encoded certificate signing request | + +#### Response + + +```json +{ + "rootCertificate": "string", + "intermediateCertificate": "string", + "onboardingCertificate": { + "certificate": "string", + "certificateFormat": "string", + "certificateType": "AH_ONBOARDING", + "keyPairDTO": { + "keyAlgorithm": "string", + "keyFormat": "string", + "privateKey": "string", + "publicKey": "string" + } + }, + "deviceRegistry": { + "service": "DEVICE_REGISTRY_ONBOARDING_WITH_CSR_SERVICE", + "uri": "string" + }, + "systemRegistry": { + "service": "SYSTEM_REGISTRY_ONBOARDING_WITH_CSR_SERVICE", + "uri": "string" + }, + "serviceRegistry": { + "service": "SERVICE_REGISTRY_REGISTER_SERVICE", + "uri": "string" + }, + "orchestrationService": { + "service": "ORCHESTRATION_SERVICE", + "uri": "string" + } +} +``` + +| Field | Description | +| ----- | ----------- | +| `rootCertificate` | The Arrowhead master certificate | +| `intermediateCertificate` | The Arrowhead local cloud certificate | +| `onboardingCertificate` | The onboarding certificate for the next step | +| `certificateFormat` | The certificate format (usually X.509) | +| `certificateType` | The certificate type. Always AH_ONBOARDING for this operation | +| `keyAlgorithm` | The key algorithm of the provided keys | +| `keyFormat` | The key format of the provided keys | +| `privateKey` | Base64 encoded private key. Always empty for this operation | +| `publicKey` | Base64 encoded public key | +| `service` | The service which is reachable under `uri` | +| `uri` | The uri under which the depicted `service` is reachable | + + +# Device Registry +
    + +## System Design Description Overview +

    + +This System provides the database, which stores information related to the Devices within the Local Cloud. + +The purpose of this System is therefore to allow: +- Devices to register themselves, making this announcement available to other Application Systems on the network. +- They are also allowed to remove or update their entries when it is necessary. +- Generate a client certificate which can be used by the Device to register its Systems + +## Services and Use Cases +
    + +This System provides two Core Service: the __device registration__ and __de-registration__. +Further it provides two Onboarding Services: the __onboarding with name__ and __onboarding with CSR__. + +The __register__ method is used to register a device. The device will contain various metadata as well as a physical endpoint. +The various parameters are representing the endpoint information that should be registered. + +The __unregister__ method is used to unregister device instances that were previously registered in the Registry. +The instance parameter is representing the endpoint information that should be removed. + +The __onboarding__ methods are used to register a device and to retrieve a device certificate which must be used on the next step of the onboarding procedure. + +## Security + + +This System can be secured via the HTTPS protocol. If it is started in secure mode, it verifies whether the Application System possesses a proper X.509 identity certificate and whether that certificate is Arrowhead compliant in its making. This certificate structure and creation guidelines ensure: +- Application System is properly bootstrapped into the Local Cloud +- The Application System indeed belongs to this Local Cloud +- The Application System then automatically has the right to register its Systems in the Registry. + +If these criteria are met, the Application System’s registration or removal message is processed. An Application System can only delete or alter entries that contain the Device as the System Provider in the entry. + + +## Endpoints + + +The System Registry offers four types of endpoints. Onboarding, Client, Management and Private. + +Swagger API documentation is available on: `https://:`
    +The base URL for the requests: `http://:/deviceregistry` + +### Onboarding endpoint description
    +
    + +| Function | URL subpath | Method | Input | Output | +| -------- | ----------- | ------ | ----- | ------ | +| [Onboard with Name](#deviceregistry_endpoints_onboarding_name) | /onboarding/name | POST | [DeviceOnboardingWithNameRequest](#datastructures_deviceregistry_onboarding_with_name_request) | [DeviceOnboardingWithNameResponse](#datastructures_deviceregistry_onboarding_with_name_response) | +| [Onboard with CSR](#deviceregistry_endpoints_onboarding_csr) | /onboarding/csr | POST | [DeviceOnboardingWithCsrRequest](#datastructures_deviceregistry_onboarding_with_csr_request) | [DeviceOnboardingWithCsrResponse](#datastructures_deviceregistry_onboarding_with_csr_response) | + + +### Client endpoint description
    +
    + +| Function | URL subpath | Method | Input | Output | +| -------- | ----------- | ------ | ----- | ------ | +| [Echo](#deviceregistry_endpoints_get_echo) | /echo | GET | - | OK | +| [Query](#deviceregistry_endpoints_post_query) | /query | POST | [DeviceQueryForm](#datastructures_systemqueryform) | [DeviceQueryList](#datastructures_devicequerylist) | +| [Register](#deviceregistry_endpoints_post_register) | /register | POST | [DeviceRegistryEntry](#datastructures_deviceregistryentry) | [DeviceRegistryEntry](#datastructures_deviceregistryentry) | +| [Unregister](#deviceregistry_delete_unregister) | /unregister | DELETE | Device Name and Mac Address in query parameters| OK | + +### Detailed description
    + +A detailed description of management and private endpoints is available in the release notes. + +### Onboard with Name +
    + +``` +POST /onboarding/name +``` + +Creates a CSR on behalf of the client, registers the device and eventually returns a device certificate which may be used in the next step of the onboarding controller. + +#### Request + + +```json +{ + "certificateCreationRequest": { + "commonName": "string", + "keyPairDTO": { + "keyAlgorithm": "string", + "keyFormat": "string", + "privateKey": "string", + "publicKey": "string" + } + }, + "device": { + "address": "string", + "authenticationInfo": "string", + "deviceName": "string", + "macAddress": "string" + }, + "endOfValidity": "string", + "metadata": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + }, + "version": 0 +} +``` + +| Field | Description | +| ----- | ----------- | +| `commonName` | The common name field for the new certificate | +| `keyAlgorithm` | The key algorithm of the provided keys | +| `keyFormat` | The key format of the provided keys | +| `privateKey` | Base64 encoded private key | +| `publicKey` | Base64 encoded public key | +| `address` | The optional IP address of the device | +| `authenticationInfo` | Base64 encoded public key of the certificate this device | +| `deviceName` | The device name | +| `macAddress` | The MAC address of the device | +| `endOfValidity` | The validity of this entry | +| `metadata` | Various meta information as map | +| `version` | The version of this entry | + +#### Response + + +```json +{ + "certificateResponse": { + "certificate": "string", + "certificateFormat": "string", + "certificateType": "AH_DEVICE", + "keyPairDTO": { + "keyAlgorithm": "string", + "keyFormat": "string", + "privateKey": "string", + "publicKey": "string" + } + }, + "createdAt": "string", + "device": { + "address": "string", + "authenticationInfo": "string", + "createdAt": "string", + "deviceName": "string", + "id": 0, + "macAddress": "string", + "updatedAt": "string" + }, + "endOfValidity": "string", + "id": 0, + "metadata": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + }, + "updatedAt": "string", + "version": 0 +} +``` + +| Field | Description | +| ----- | ----------- | +| `certificate` | The Base64 device certificate for the next step | +| `certificateFormat` | The certificate format (usually X.509) | +| `certificateType` | The certificate type. Always AH_DEVICE for this operation | +| `keyAlgorithm` | The key algorithm of the provided keys | +| `keyFormat` | The key format of the provided keys | +| `privateKey` | Base64 encoded private key | +| `publicKey` | Base64 encoded public key | + +Additionally all fields from [DeviceRegistryEntry](#datastructures_deviceregistryentry) are returned. + +### Onboard with CSR + + +``` +POST /onboarding/csr +``` + +Signs the CSR, registers the device and eventually returns a device certificate which may be used in the next step of the onboarding controller. + +#### Request + + +```json +{ + "certificateSigningRequest": "string", + "device": { + "address": "string", + "authenticationInfo": "string", + "deviceName": "string", + "macAddress": "string" + }, + "endOfValidity": "string", + "metadata": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + }, + "version": 0 +} +``` + +| Field | Description | +| ----- | ----------- | +| `certificateSigningRequest` | Base64 encoded certificate signing request | +| `address` | The optional IP address of the device | +| `authenticationInfo` | Base64 encoded public key of the certificate this device | +| `deviceName` | The device name | +| `macAddress` | The MAC address of the device | +| `endOfValidity` | The validity of this entry | +| `metadata` | Various meta information as map | +| `version` | The version of this entry | + +#### Response + + +```json +{ + "certificateResponse": { + "certificate": "string", + "certificateFormat": "string", + "certificateType": "AH_DEVICE", + "keyPairDTO": { + "keyAlgorithm": "string", + "keyFormat": "string", + "privateKey": "string", + "publicKey": "string" + } + }, + "createdAt": "string", + "device": { + "address": "string", + "authenticationInfo": "string", + "createdAt": "string", + "deviceName": "string", + "id": 0, + "macAddress": "string", + "updatedAt": "string" + }, + "endOfValidity": "string", + "id": 0, + "metadata": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + }, + "updatedAt": "string", + "version": 0 +} +``` + +| Field | Description | +| ----- | ----------- | +| `certificate` | The Base64 device certificate for the next step | +| `certificateFormat` | The certificate format (usually X.509) | +| `certificateType` | The certificate type. Always AH_DEVICE for this operation | +| `keyAlgorithm` | The key algorithm of the provided keys | +| `keyFormat` | The key format of the provided keys | +| `privateKey` | Base64 encoded private key. Always empty for this operation | +| `publicKey` | Base64 encoded public key | + +Additionally all fields from [DeviceRegistryEntry](#datastructures_deviceregistryentry) are returned. + # System Registry + - ## System Design Description Overview + This System provides the database, which stores information related to the System of the currently actively offered Services within the Local Cloud. @@ -6687,9 +7189,9 @@ The purpose of this System is therefore to allow: - They are also allowed to remove or update their entries when it is necessary. - Generate a client certificate which can be used by the System to offer Services - ## Services and Use Cases + This System provides two Core Service the __system registration__ and __de-registration__ @@ -6699,9 +7201,9 @@ The various parameters are representing the endpoint information that should be The __unregister__ method is used to unregister system instances that were previously registered in the Registry. The instance parameter is representing the endpoint information that should be removed. - ## Security + This System can be secured via the HTTPS protocol. If it is started in secure mode, it verifies whether the Application System possesses a proper X.509 identity certificate and whether that certificate is Arrowhead compliant in its making. This certificate structure and creation guidelines ensure: - Application System is properly bootstrapped into the Local Cloud @@ -6710,18 +7212,26 @@ This System can be secured via the HTTPS protocol. If it is started in secure mo If these criteria are met, the Application System’s registration or removal message is processed. An Application System can only delete or alter entries that contain the Device as the System Provider in the entry. - ## Endpoints + The System Registry offers three types of endpoints. Client, Management and Private. Swagger API documentation is available on: `https://:`
    The base URL for the requests: `http://:/systemregistry` -
    +### Onboarding endpoint description
    +
    + +| Function | URL subpath | Method | Input | Output | +| -------- | ----------- | ------ | ----- | ------ | +| [Onboard with Name](#systemregistry_endpoints_onboarding_name) | /onboarding/name | POST | [SystemOnboardingWithNameRequest](#datastructures_systemregistry_onboarding_with_name_request) | [SystemOnboardingWithNameResponse](#datastructures_systemregistry_onboarding_with_name_response) | +| [Onboard with CSR](#systemregistry_endpoints_onboarding_csr) | /onboarding/csr | POST | [SystemOnboardingWithCsrRequest](#datastructures_systemregistry_onboarding_with_csr_request) | [SystemOnboardingWithCsrResponse](#datastructures_systemregistry_onboarding_with_csr_response) | + ### Client endpoint description
    +
    | Function | URL subpath | Method | Input | Output | | -------- | ----------- | ------ | ----- | ------ | @@ -6730,44 +7240,237 @@ The base URL for the requests: `http://:/systemregistry` | [Register](#systemregistry_endpoints_post_register) | /register | POST | [SystenRegistryEntry](#datastructures_systemregistryentry) | [SystenRegistryEntry](#datastructures_systemregistryentry) | | [Unregister](#systemregistry_delete_unregister) | /unregister | DELETE | System Name, Address and Port in query parameters| OK | - +### Detailed description
    -### Private endpoint description
    +A detailed description of public, management and private endpoints is available in the release notes. + +### Onboard with Name +
    -These services can only be used by other core services, therefore they are not part of the public API. +``` +POST /onboarding/name +``` -| Function | URL subpath | Method | Input | Output | -| -------- | ----------- | ------ | ----- | ------ | -| [Query System](#systemregistry_endpoints_post_query_system) | /query/system | POST | System | System | -| [Query System By ID](#systemregistry_endpoints_get_query_system_id) | /query/system/{id} | GET | ID | System| +Creates a CSR on behalf of the client, registers the system and eventually returns a system certificate which is valid in the Arrowhead local cloud. - +#### Request + -### Management endpoint description
    +```json +{ + "certificateCreationRequest": { + "commonName": "string", + "keyPairDTO": { + "keyAlgorithm": "string", + "keyFormat": "string", + "privateKey": "string", + "publicKey": "string" + } + }, + "provider": { + "address": "string", + "authenticationInfo": "string", + "deviceName": "string", + "macAddress": "string" + }, + "system": { + "address": "string", + "authenticationInfo": "string", + "port": 0, + "systemName": "string" + }, + "endOfValidity": "string", + "metadata": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + }, + "version": 0 +} +``` -These endpoints are mainly used by the Management Tool and Cloud Administrators. +| Field | Description | +| ----- | ----------- | +| `commonName` | The common name field for the new certificate | +| `keyAlgorithm` | The key algorithm of the provided keys | +| `keyFormat` | The key format of the provided keys | +| `privateKey` | Base64 encoded private key | +| `publicKey` | Base64 encoded public key | +| `address` | The IP address of the device/system | +| `authenticationInfo` | Base64 encoded public key of the certificate this device/system | +| `deviceName` | The device name | +| `macAddress` | The MAC address of the device | +| `systemName` | The system name | +| `port` | The port under which this system's services are available | +| `endOfValidity` | The validity of this entry | +| `metadata` | Various meta information as map | +| `version` | The version of this entry | + +#### Response +
    -| Function | URL subpath | Method | Input | Output | -| -------- | ----------- | ------ | ----- | ------ | -| [Get all entries](#systemregistry_endpoints_get_mgmt) | /mgmt/ | GET | - | [SystemRegistryEntryList](#datastructures_systemregistryentrylist) | -| [Add an entry](#systemregistry_endpoints_post_mgmt) | /mgmt/ | POST | [SystemRegistryEntry](#datastructures_systemregistryentry) | [SystemRegistryEntry](#datastructures_systemregistry_entry) | -| [Get an entry by ID](#systemregistry_endpoints_get_mgmt) | /mgmt/{id} | GET | SystemRegistryEntryID | [SystemRegistryEntry](#datastructures_systemregistryentry) | -| [Replace an entry by ID](#systemregistry_endpoints_put_mgmt) | /mgmt/{id} | PUT | [SystemRegistryEntry](#datastructures_systemregistryentry) | [SystemRegistryEntry](#datastructures_systemregistryentry) | -| [Modify an entry by ID](#systemregistry_endpoints_patch_mgmt) | /mgmt/{id} | PATCH | [SystemRegistryEntry](#datastructures_systemregistryentry) | [SystemRegistryEntry](#datastructures_systemregistryentry) | -| [Delete and entry by ID](systemregistry_endpoints_delete_mgmt) | /mgmt/{id} | DELETE | SystemRegistryEntryID | - | -| [Get all devices](#systemregistry_endpoints_get_devices) | /mgmt/devices | GET | - | [DeviceList](#datastructures_devicelist) | -| [Add a device](#systemregistry_endpoints_post_devices) | /mgmt/devices | POST | [Device](#datastructure_device) | [Device](#datastructure_device) | -| [Get a device by ID](#systemregistry_endpoints_get_device_id) | /mgmt/devices/{id} | GET | DeviceID | [Device](#datastructure_device) | -| [Replace a device by ID](#systemregistry_endpoints_put_device_id) | /mgmt/devices/{id} | PUT | [Device](#datastructure_device) | [Device](#datastructure_device) | -| [Modify a device by ID](#systemregistry_endpoints_patch_device_id) | /mgmt/devices/{id} | PATCH | [Device](#datastructure_device) | [Device](#datastructure_device) | -| [Delete a device by ID](#systemregistry_endpoints_delete_device_id) | /mgmt/devices/{id} | DELETE | DeviceID | - | -| [Get all systems](#systemregistry_endpoints_get_systems) | /mgmt/systems | GET | - | [SystemList](#datastructures_systemlist) | -| [Add a system](#systemregistry_endpoints_post_system) | /mgmt/systems | POST | [System](#datastructures_system) | [System](#datastructures_system) | -| [Get a system by ID](#systemregistry_endpoints_get_system_id) | /mgmt/systems/{id} | GET | SystemID | [System](#datastructures_system) | -| [Replace a system by ID](#systemregistry_endpoints_put_system_id) | /mgmt/systems/(id} | PUT | [System](#datastructures_system) | [System](#datastructures_system) | -| [Modify a system by ID](#systemregistry_endpoints_patch_system_id) | /mgmt/systems/{id} | PATCH | [System](#datastructures_system) | [System](#datastructures_system) | -| [Delete a system by ID](#systemregistry_endpoints_delete_system_id) | /mgmt/systems/{id} | DELETE | SystemID | - | +```json +{ + "certificateResponse": { + "certificate": "string", + "certificateFormat": "string", + "certificateType": "AH_SYSTEM", + "keyPairDTO": { + "keyAlgorithm": "string", + "keyFormat": "string", + "privateKey": "string", + "publicKey": "string" + } + }, + "createdAt": "string", + "provider": { + "address": "string", + "authenticationInfo": "string", + "createdAt": "string", + "deviceName": "string", + "id": 0, + "macAddress": "string", + "updatedAt": "string" + }, + "system": { + "address": "string", + "authenticationInfo": "string", + "createdAt": "string", + "id": 0, + "port": 0, + "systemName": "string", + "updatedAt": "string" + }, + "endOfValidity": "string", + "id": 0, + "metadata": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + }, + "updatedAt": "string", + "version": 0 +} +``` -### Detailed description
    +| Field | Description | +| ----- | ----------- | +| `certificate` | The Base64 device certificate for the next step | +| `certificateFormat` | The certificate format (usually X.509) | +| `certificateType` | The certificate type. Always AH_SYSTEM for this operation | +| `keyAlgorithm` | The key algorithm of the provided keys | +| `keyFormat` | The key format of the provided keys | +| `privateKey` | Base64 encoded private key | +| `publicKey` | Base64 encoded public key | + +Additionally all fields from [SystemRegistryEntry](#datastructures_systemregistryentry) are returned. + +### Onboard with CSR +
    + +``` +POST /onboarding/csr +``` + +Signs the CSR, registers the device and eventually returns a device certificate which may be used in the next step of the onboarding controller. + +#### Request + + +```json +{ + "certificateSigningRequest": "string", + "provider": { + "address": "string", + "authenticationInfo": "string", + "deviceName": "string", + "macAddress": "string" + }, + "system": { + "address": "string", + "authenticationInfo": "string", + "port": 0, + "systemName": "string" + }, + "endOfValidity": "string", + "metadata": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + }, + "version": 0 +} +``` + +| Field | Description | +| ----- | ----------- | +| `certificateSigningRequest` | Base64 encoded certificate signing request | +| `address` | The IP address of the device/system | +| `authenticationInfo` | Base64 encoded public key of the certificate this device/system | +| `deviceName` | The device name | +| `macAddress` | The MAC address of the device | +| `systemName` | The system name | +| `port` | The port under which this system's services are available | +| `endOfValidity` | The validity of this entry | +| `metadata` | Various meta information as map | +| `version` | The version of this entry | + +#### Response + + +```json +{ + "certificateResponse": { + "certificate": "string", + "certificateFormat": "string", + "certificateType": "AH_SYSTEM", + "keyPairDTO": { + "keyAlgorithm": "string", + "keyFormat": "string", + "privateKey": "string", + "publicKey": "string" + } + }, + "createdAt": "string", + "provider": { + "address": "string", + "authenticationInfo": "string", + "createdAt": "string", + "deviceName": "string", + "id": 0, + "macAddress": "string", + "updatedAt": "string" + }, + "system": { + "address": "string", + "authenticationInfo": "string", + "createdAt": "string", + "id": 0, + "port": 0, + "systemName": "string", + "updatedAt": "string" + }, + "endOfValidity": "string", + "id": 0, + "metadata": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + }, + "updatedAt": "string", + "version": 0 +} +``` + +| Field | Description | +| ----- | ----------- | +| `certificate` | The Base64 device certificate for the next step | +| `certificateFormat` | The certificate format (usually X.509) | +| `certificateType` | The certificate type. Always AH_DEVICE for this operation | +| `keyAlgorithm` | The key algorithm of the provided keys | +| `keyFormat` | The key format of the provided keys | +| `privateKey` | Base64 encoded private key. Always empty for this operation | +| `publicKey` | Base64 encoded public key | + +Additionally all fields from [SystemRegistryEntry](#datastructures_systemregistryentry) are returned. -A detailed description is available in the release notes. diff --git a/documentation/onboarding/onboarding_controller.png b/documentation/onboarding/onboarding_controller.png new file mode 100644 index 0000000000000000000000000000000000000000..580105833692c4d2b80d390e2f40df92fa845dba GIT binary patch literal 122370 zcmeEucUV*D_AVtrkd}y2L|Q-)r6au~MWuh9ReJA1Ku}P6Q5-<&q4z2sLX+N+ zPAJksAaJ)cbI#0f&bjxw|K8`he^3HDJL~&a`QG)ewRYrV4Hb$jH?H8};ZZz%p!ft2 z4Tk=1K;(DiUMBIz|9Td1;|=nT^hwU*6%UWH z?bjE6r(>Q49^U0|4;AH~dcN3hAbIsv=R>9R0WMw}b=dc6XX9qt^d!74-F09R9Sv72 z=@ws069UJ95G+9iS0Avyz2!1s!cT0@-%a6Ag~rXV>3|=Kp<@2$ z)#&LeO^*0(3&CWy=R}e&KM;Pnqwyfe=ZkNDe|s9qyzfB_qm<{Max|T341;JT4UfL= zbS1pdsLp-InjNihOdp$Lopp|SCUDAq>B_Dq)0Ub4wc8rwiaaRu^dr8bublt9us}Y9 zSj1^TZo0xwXCZYg`9b?HK?Xv?$Y`fj`5G+xQ$?%#`qb|7@>V{}fBw5PfKYc#?>;Xm zNfxq}kY9eQ!c=;+HBQn9f3NiWTC|id&evoO&{Gxgz9fO;)3waH0`lKitR;-$J<65E zbqfj#Zug7Mm-9893p%Y9|M8(;!H(o}p34-|jeb50h~GCw%=itX9TU6?E*zY=k zk!+dQpUn9id4lO1!c0&sX zA?1hJDzUW}zwtF;H}8%Y9~MJk?tiF3kq!__@eMVn#>596gPF>2Be|L$vL4$Li!>hj zcYOE1Y32b686&DFZKpN%H4O_3b0}o=U)$|j`W7|2w%i#@QuOtOMy3qh=Xkr+>tJ;< zn25}NZ6MvbhI(YNEn=2tq8y)fxjBfi$awPV8DGGu>cSmX#RAsfWk>v4idX;`0p-J- zi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faV_f zb+QLxWBJ_{M>Eig(9`9Q<2u(aziVMJHZ|qZ($cC9`h0KE^Uq^}5{qAeUh3VzEb{tw zbO|8Qc6&}GnPjUB1bh_#@vgq=yno`Bn23n(@7HCdq*A%W&1RI@6!;Pha|c|@9`O$$ zcN>@nukV6_nc-3vJs+b+IQPTP2o?-i%1`qVS zS$I=hdG?NGNVk@q(|>WE<>gDe&W&AF`uf448$YMp?jVxS{Ft-5pCQ8bOn*$!KR!nW kvHbWZ{+Qa6EaY!mnV3r7(0<;fJ;0B#ftmhOU0nG80a@G1Q2+n{ literal 0 HcmV?d00001 diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java index ff1db49b4..931604b51 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java @@ -48,7 +48,7 @@ import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_SHARED_SECRET_AND_CSR; import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_SHARED_SECRET_AND_NAME; -@Api(tags = {CoreCommonConstants.SWAGGER_TAG_ALL}) +@Api(tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) @CrossOrigin(maxAge = Defaults.CORS_MAX_AGE, allowCredentials = Defaults.CORS_ALLOW_CREDENTIALS, allowedHeaders = {HttpHeaders.ORIGIN, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT, HttpHeaders.AUTHORIZATION} ) @@ -97,8 +97,8 @@ public String echoOnboarding() { } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Onboarding with certificate and device name", response = DeviceResponseDTO.class, - tags = {CoreCommonConstants.SWAGGER_TAG_MGMT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) + @ApiOperation(value = "Onboarding with certificate and device name", response = OnboardingWithNameResponseDTO.class, + tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_OK, message = ONBOARDING_HTTP_200_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = ONBOARDING_HTTP_400_MESSAGE), @@ -120,8 +120,8 @@ public OnboardingWithNameResponseDTO onboardWithCertificateAndName(final HttpSer } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Onboarding with shared secret and device name", response = DeviceResponseDTO.class, - tags = {CoreCommonConstants.SWAGGER_TAG_MGMT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) + @ApiOperation(value = "Onboarding with shared secret and device name", response = OnboardingWithNameResponseDTO.class, + tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_OK, message = ONBOARDING_HTTP_200_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = ONBOARDING_HTTP_400_MESSAGE), @@ -144,8 +144,8 @@ public OnboardingWithNameResponseDTO onboardWithSharedSecretAndName(final HttpSe } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Onboarding with certificate and certificate signing request", response = DeviceResponseDTO.class, - tags = {CoreCommonConstants.SWAGGER_TAG_MGMT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) + @ApiOperation(value = "Onboarding with certificate and certificate signing request", response = OnboardingWithCsrResponseDTO.class, + tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_OK, message = ONBOARDING_HTTP_200_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = ONBOARDING_HTTP_400_MESSAGE), @@ -165,8 +165,8 @@ public OnboardingWithCsrResponseDTO onboardWithCertificateAndSigningRequest(fina } //------------------------------------------------------------------------------------------------- - @ApiOperation(value = "Onboarding with certificate and certificate signing request", response = DeviceResponseDTO.class, - tags = {CoreCommonConstants.SWAGGER_TAG_MGMT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) + @ApiOperation(value = "Onboarding with certificate and certificate signing request", response = OnboardingWithCsrResponseDTO.class, + tags = {CoreCommonConstants.SWAGGER_TAG_CLIENT, CoreCommonConstants.SWAGGER_TAG_ONBOARDING}) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_OK, message = ONBOARDING_HTTP_200_MESSAGE), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = ONBOARDING_HTTP_400_MESSAGE), From 7ee8708da128866b916330d95dcd1d686b1a5778 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Tue, 7 Apr 2020 11:36:25 +0200 Subject: [PATCH 295/301] fixed typo --- .../common/core/CoreSystemService.java | 26 ++++++++++++++----- ...DeviceRegistryApplicationInitListener.java | 2 +- .../OnboardingApplicationInitListener.java | 2 +- ...SystemRegistryApplicationInitListener.java | 2 +- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java index d150c5f16..182bec23a 100644 --- a/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java +++ b/core-common/src/main/java/eu/arrowhead/common/core/CoreSystemService.java @@ -1,15 +1,18 @@ package eu.arrowhead.common.core; -import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.Utilities; import org.springframework.util.Assert; import static eu.arrowhead.common.CommonConstants.AUTHORIZATION_URI; +import static eu.arrowhead.common.CommonConstants.CERTIFICATE_AUTHRORITY_URI; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_AUTH_CONTROL_INTER; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_AUTH_CONTROL_INTRA; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_AUTH_CONTROL_SUBSCRIPTION; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_AUTH_PUBLIC_KEY; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_AUTH_TOKEN_GENERATION; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_CERTIFICATE_AUTHORITY_SIGN; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_DEVICE_REGISTRY_ONBOARDING_WITH_CSR; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_DEVICE_REGISTRY_ONBOARDING_WITH_NAME; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_DEVICE_REGISTRY_REGISTER; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_DEVICE_REGISTRY_UNREGISTER; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_EVENT_HANDLER_PUBLISH; @@ -21,12 +24,16 @@ import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_GATEWAY_CONNECT_CONSUMER; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_GATEWAY_CONNECT_PROVIDER; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_GATEWAY_PUBLIC_KEY; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_CSR; -import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_NAME; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_WITH_CERTIFICATE_AND_CSR; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_WITH_CERTIFICATE_AND_NAME; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_WITH_SHARED_SECRET_AND_CSR; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ONBOARDING_WITH_SHARED_SECRET_AND_NAME; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_ORCH_PROCESS; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_QOS_MONITOR_PING_MEASUREMENT; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SERVICE_REGISTRY_REGISTER; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SERVICE_REGISTRY_UNREGISTER; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SYSTEM_REGISTRY_ONBOARDING_WITH_CSR; +import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SYSTEM_REGISTRY_ONBOARDING_WITH_NAME; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SYSTEM_REGISTRY_REGISTER; import static eu.arrowhead.common.CommonConstants.CORE_SERVICE_SYSTEM_REGISTRY_UNREGISTER; import static eu.arrowhead.common.CommonConstants.DEVICE_REGISTRY_URI; @@ -39,6 +46,9 @@ import static eu.arrowhead.common.CommonConstants.OP_AUTH_KEY_URI; import static eu.arrowhead.common.CommonConstants.OP_AUTH_SUBSCRIPTION_CHECK_URI; import static eu.arrowhead.common.CommonConstants.OP_AUTH_TOKEN_URI; +import static eu.arrowhead.common.CommonConstants.OP_CA_SIGN_CERTIFICATE_URI; +import static eu.arrowhead.common.CommonConstants.OP_DEVICE_REGISTRY_ONBOARDING_WITH_CSR_URI; +import static eu.arrowhead.common.CommonConstants.OP_DEVICE_REGISTRY_ONBOARDING_WITH_NAME_URI; import static eu.arrowhead.common.CommonConstants.OP_DEVICE_REGISTRY_REGISTER_URI; import static eu.arrowhead.common.CommonConstants.OP_DEVICE_REGISTRY_UNREGISTER_URI; import static eu.arrowhead.common.CommonConstants.OP_EVENT_HANDLER_PUBLISH; @@ -50,13 +60,17 @@ import static eu.arrowhead.common.CommonConstants.OP_GATEWAY_CONNECT_CONSUMER_URI; import static eu.arrowhead.common.CommonConstants.OP_GATEWAY_CONNECT_PROVIDER_URI; import static eu.arrowhead.common.CommonConstants.OP_GATEWAY_KEY_URI; -import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_CSR; -import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_NAME; +import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_CERTIFICATE_AND_CSR; +import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_CERTIFICATE_AND_NAME; +import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_SHARED_SECRET_AND_CSR; +import static eu.arrowhead.common.CommonConstants.OP_ONBOARDING_WITH_SHARED_SECRET_AND_NAME; import static eu.arrowhead.common.CommonConstants.OP_ORCH_PROCESS; import static eu.arrowhead.common.CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT; import static eu.arrowhead.common.CommonConstants.OP_QOS_MONITOR_PING_MEASUREMENT_SUFFIX; import static eu.arrowhead.common.CommonConstants.OP_SERVICE_REGISTRY_REGISTER_URI; import static eu.arrowhead.common.CommonConstants.OP_SERVICE_REGISTRY_UNREGISTER_URI; +import static eu.arrowhead.common.CommonConstants.OP_SYSTEM_REGISTRY_ONBOARDING_WITH_CSR_URI; +import static eu.arrowhead.common.CommonConstants.OP_SYSTEM_REGISTRY_ONBOARDING_WITH_NAME_URI; import static eu.arrowhead.common.CommonConstants.OP_SYSTEM_REGISTRY_REGISTER_URI; import static eu.arrowhead.common.CommonConstants.OP_SYSTEM_REGISTRY_UNREGISTER_URI; import static eu.arrowhead.common.CommonConstants.ORCHESTRATOR_URI; @@ -96,7 +110,7 @@ public enum CoreSystemService { EVENT_PUBLISH_AUTH_UPDATE_SERVICE(CORE_SERVICE_EVENT_HANDLER_PUBLISH_AUTH_UPDATE, EVENT_HANDLER_URI + OP_EVENT_HANDLER_PUBLISH_AUTH_UPDATE), // CA services - CERTIFICATE_AUTHORITY_SIGN_SERVICE(CommonConstants.CORE_SERVICE_CERTIFICATE_AUTHORITY_SIGN, CommonConstants.CERTIFICATE_AUTHRORITY_URI + CommonConstants.OP_CA_SIGN_CERTIFICATE_URI), + CERTIFICATE_AUTHORITY_SIGN_SERVICE(CORE_SERVICE_CERTIFICATE_AUTHORITY_SIGN, CERTIFICATE_AUTHRORITY_URI + OP_CA_SIGN_CERTIFICATE_URI), // QoS Monitor services QOS_MONITOR_PING_MEASUREMENT_SERVICE(CORE_SERVICE_QOS_MONITOR_PING_MEASUREMENT, QOS_MONITOR_URI + OP_QOS_MONITOR_PING_MEASUREMENT + OP_QOS_MONITOR_PING_MEASUREMENT_SUFFIX), diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java index 420bd796e..81bde44d8 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/DeviceRegistryApplicationInitListener.java @@ -18,7 +18,7 @@ public class DeviceRegistryApplicationInitListener extends ApplicationInitListen @Override protected void customInit(final ContextRefreshedEvent event) { if (sslProperties.isSslEnabled()) { - logger.debug("AuthInfo: {}" + Base64.getEncoder().encodeToString(publicKey.getEncoded())); + logger.debug("AuthInfo: {}", Base64.getEncoder().encodeToString(publicKey.getEncoded())); } } diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java index 59b442eea..a20d44447 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingApplicationInitListener.java @@ -44,7 +44,7 @@ public class OnboardingApplicationInitListener extends ApplicationInitListener { protected void customInit(final ContextRefreshedEvent event) { if (sslProperties.isSslEnabled()) { - logger.debug("AuthInfo: {}" + Base64.getEncoder().encodeToString(publicKey.getEncoded())); + logger.debug("AuthInfo: {}", Base64.getEncoder().encodeToString(publicKey.getEncoded())); } logger.info("Searching for authorization system"); diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryApplicationInitListener.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryApplicationInitListener.java index 43616a5c8..934f21fa2 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryApplicationInitListener.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/SystemRegistryApplicationInitListener.java @@ -16,7 +16,7 @@ public class SystemRegistryApplicationInitListener extends ApplicationInitListen @Override protected void customInit(final ContextRefreshedEvent event) { if (sslProperties.isSslEnabled()) { - logger.debug("AuthInfo: {}" + Base64.getEncoder().encodeToString(publicKey.getEncoded())); + logger.debug("AuthInfo: {}", Base64.getEncoder().encodeToString(publicKey.getEncoded())); } } } \ No newline at end of file From 2a85f77fd98b46446412453ff387ca9403afaa10 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Tue, 14 Apr 2020 17:52:49 +0200 Subject: [PATCH 296/301] fixed findBySystem returning Optional instead of List --- .../repository/SystemRegistryRepository.java | 2 +- .../database/service/SystemRegistryDBService.java | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java b/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java index 786b77d2a..f8ef9378f 100644 --- a/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java +++ b/core-common/src/main/java/eu/arrowhead/common/database/repository/SystemRegistryRepository.java @@ -17,7 +17,7 @@ public interface SystemRegistryRepository extends RefreshableRepository findBySystem(final System system); + List findBySystem(final System system); List findByDevice(final Device device); diff --git a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java index f9f54df04..dc9c51668 100644 --- a/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java +++ b/systemregistry/src/main/java/eu/arrowhead/core/systemregistry/database/service/SystemRegistryDBService.java @@ -554,12 +554,14 @@ public void removeSystemRegistryByNameAndAddressAndPort(final String systemName, logger.debug("removeSystemRegistryByNameAndAddressAndPort is started..."); final System system = getSystemByNameAndAddressAndPort(systemName, address, port); - final Optional optionalSystemRegistry = systemRegistryRepository.findBySystem(system); - final SystemRegistry systemRegistry = optionalSystemRegistry.orElseThrow( - () -> new InvalidParameterException( - "System Registry entry for System with name '" + systemName + "', address '" + address + "' and port '" + port + "' does not exist")); + final List entries = systemRegistryRepository.findBySystem(system); + if (entries.isEmpty()) { + throw new InvalidParameterException("System Registry entry for System with name '" + systemName + + "', address '" + address + + "' and port '" + port + "' does not exist"); + } - systemRegistryRepository.delete(systemRegistry); + systemRegistryRepository.deleteInBatch(entries); systemRegistryRepository.flush(); } From 81094bdd67774acb2dcfeeb23d89b6b191ab4096 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Fri, 17 Apr 2020 11:00:36 +0200 Subject: [PATCH 297/301] performed changes after code review --- .../arrowhead/common/SecurityUtilities.java | 34 +++++++++++++------ .../java/eu/arrowhead/common/Utilities.java | 10 ++++++ .../src/deb/arrowhead-deviceregistry.service | 2 +- .../core/deviceregistry/Validation.java | 22 +++--------- .../service/DeviceRegistryDBService.java | 8 ++--- .../src/deb/arrowhead-onboarding.service | 2 +- .../database/service/OnboardingDBService.java | 2 +- orchestrator/pom.xml | 10 +----- .../service/OrchestratorDriver.java | 4 --- scripts/device_registry_privileges.sql | 20 ----------- scripts/onboarding_controller_privileges.sql | 14 -------- scripts/system_registry_privileges.sql | 26 -------------- .../src/deb/arrowhead-systemregistry.service | 2 +- .../core/systemregistry/Validation.java | 4 +++ .../service/SystemRegistryDBService.java | 18 ++++++++-- 15 files changed, 64 insertions(+), 114 deletions(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java b/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java index 8f51b0a79..313e95b53 100644 --- a/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java @@ -26,6 +26,7 @@ import org.springframework.stereotype.Component; import org.springframework.util.Assert; import org.springframework.util.Base64Utils; +import org.springframework.util.StringUtils; import javax.servlet.http.HttpServletRequest; import java.io.ByteArrayInputStream; @@ -67,6 +68,9 @@ public class SecurityUtilities { public SecurityUtilities(@Value("${security.key.algorithm:RSA}") final String keyFactoryAlgorithm, @Value("${security.key.size:2048}") final Integer keySize, final SSLProperties sslProperties) throws NoSuchAlgorithmException { + Assert.hasText(keyFactoryAlgorithm,"keyFactoryAlgorithm must not be null"); + Assert.notNull(keySize,"keyFactoryAlgorithm keySize not be null"); + Assert.notNull(sslProperties,"sslProperties must not be null"); this.sslProperties = sslProperties; keyFactory = KeyFactory.getInstance(keyFactoryAlgorithm); keyPairGenerator = KeyPairGenerator.getInstance(keyFactoryAlgorithm); @@ -78,6 +82,7 @@ public SecurityUtilities(@Value("${security.key.algorithm:RSA}") final String ke //------------------------------------------------------------------------------------------------- public static String getCertificateCNFromRequest(final HttpServletRequest request) { + Assert.notNull(request,"request must not be null"); final X509Certificate[] certificates = (X509Certificate[]) request.getAttribute(CommonConstants.ATTR_JAVAX_SERVLET_REQUEST_X509_CERTIFICATE); if (certificates != null && certificates.length != 0) { final X509Certificate cert = certificates[0]; @@ -89,6 +94,7 @@ public static String getCertificateCNFromRequest(final HttpServletRequest reques //------------------------------------------------------------------------------------------------- private static String getCommonNameFromCloudCertificate(final Principal principal) { + Assert.notNull(principal, "Principal must not be null"); return Utilities.getCertCNFromSubject(principal.getName()); } @@ -110,6 +116,7 @@ private static String getCountryFromCloudCertificate(final Principal principal) //------------------------------------------------------------------------------------------------- private static String extractCNPart(final Principal principal, final int tailIndex) { Assert.notNull(principal, "Principal must not be null"); + Assert.isTrue(tailIndex >= 0, "tailIndex must not be negative"); final String fullCN = principal.getName(); Assert.hasText(fullCN, "Empty common name is not allowed"); @@ -124,6 +131,9 @@ private static String extractCNPart(final Principal principal, final int tailInd //------------------------------------------------------------------------------------------------- public void authenticateCertificate(final HttpServletRequest httpServletRequest, final CertificateType minimumStrength) { + Assert.notNull(httpServletRequest,"httpServletRequest must not be null"); + Assert.notNull(minimumStrength,"minimumStrength must not be null"); + final X509Certificate[] certificates = (X509Certificate[]) httpServletRequest.getAttribute(CommonConstants.ATTR_JAVAX_SERVLET_REQUEST_X509_CERTIFICATE); if (sslProperties.isSslEnabled()) { @@ -143,12 +153,11 @@ public void authenticateCertificate(final HttpServletRequest httpServletRequest, //------------------------------------------------------------------------------------------------- public void authenticateCertificate(final String clientCN, final String requestTarget, final CertificateType minimumStrength) { - if (sslProperties.isSslEnabled()) { + Assert.notNull(clientCN,"clientCN must not be null"); + Assert.notNull(requestTarget,"requestTarget must not be null"); + Assert.notNull(minimumStrength,"minimumStrength must not be null"); - if (Objects.isNull(clientCN)) { - logger.debug("Unable to extract common name from client certificate: {}", clientCN); - throw new AuthException("Client is unauthorized to access " + requestTarget); - } + if (sslProperties.isSslEnabled()) { final CertificateType type = CertificateType.getTypeFromCN(clientCN); if (!type.hasMinimumStrength(minimumStrength)) { @@ -162,12 +171,15 @@ public void authenticateCertificate(final String clientCN, final String requestT // assistant methods //------------------------------------------------------------------------------------------------- - public String createCertificateSigningRequest(final String baseCommonName, final KeyPair keyPair, final String host, final String address, - final CertificateType type) + public String createCertificateSigningRequest(final String baseCommonName, final KeyPair keyPair, final CertificateType type, + final String host, final String address) throws IOException, CertificateException, NoSuchAlgorithmException, KeyStoreException, OperatorCreationException { - + Assert.hasText(baseCommonName, "baseCommonName must not be null or empty!"); + Assert.notNull(keyPair, "keyPair must not be null"); Assert.notNull(sslProperties.getKeyStore(), "KeyStore property must not be null!"); Assert.hasText(sslProperties.getKeyStorePassword(), "KeyStore password property must not be null or empty!"); + Assert.notNull(type, "type must not be null"); + // host and address are optional logger.debug("Preparing Certificate Signing Request ..."); // get cloud certificate for cloudName and operator @@ -192,10 +204,10 @@ public String createCertificateSigningRequest(final String baseCommonName, final namesBuilder.addName(new GeneralName(GeneralName.dNSName, baseCommonName)); namesBuilder.addName(new GeneralName(GeneralName.iPAddress, "127.0.0.1")); - if (Objects.nonNull(host)) { + if (StringUtils.hasText(host)) { namesBuilder.addName(new GeneralName(GeneralName.dNSName, host)); } - if (Objects.nonNull(host)) { + if (StringUtils.hasText(address)) { namesBuilder.addName(new GeneralName(GeneralName.iPAddress, address)); } @@ -211,6 +223,8 @@ public String createCertificateSigningRequest(final String baseCommonName, final //------------------------------------------------------------------------------------------------- public void extractAndSetPublicKey(final CertificateCreationResponseDTO creationResponseDTO) { + Assert.notNull(creationResponseDTO, "creationResponseDTO must not be null"); + try { final byte[] certificateBytes = Base64Utils.decodeFromString(creationResponseDTO.getCertificate()); diff --git a/core-common/src/main/java/eu/arrowhead/common/Utilities.java b/core-common/src/main/java/eu/arrowhead/common/Utilities.java index 76552abed..632f7a0a4 100644 --- a/core-common/src/main/java/eu/arrowhead/common/Utilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/Utilities.java @@ -60,6 +60,7 @@ import java.util.NoSuchElementException; import java.util.Objects; import java.util.ServiceConfigurationError; +import java.util.regex.Matcher; import java.util.regex.Pattern; public class Utilities { @@ -80,6 +81,9 @@ public class Utilities { private static final KeyFactory keyFactory; private static final Pattern PEM_PATTERN = Pattern.compile("(?m)(?s)^---*BEGIN.*---*$(.*)^---*END.*---*$.*"); + private static final String MAC_ADDRESS_PATTERN_STRING = "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"; + public static final Pattern MAC_ADDRESS_PATTERN = Pattern.compile(MAC_ADDRESS_PATTERN_STRING); + private static final Logger logger = LogManager.getLogger(Utilities.class); private static final ObjectMapper mapper = new ObjectMapper(); private static final String dateTimePattern = "yyyy-MM-dd HH:mm:ss"; @@ -663,4 +667,10 @@ private static boolean isCloudCertificate(final X509Certificate certificate) final String[] cnParts = commonName.split("\\."); return (cnParts.length == 4 && cnParts[2].equals(AH_MASTER_NAME) && cnParts[3].equals(AH_MASTER_SUFFIX)); } + + public static boolean isValidMacAddress(final String macAddress) { + Assert.notNull(macAddress, "MAC address must not be null"); + final Matcher matcher = MAC_ADDRESS_PATTERN.matcher(macAddress); + return matcher.matches(); + } } diff --git a/deviceregistry/src/deb/arrowhead-deviceregistry.service b/deviceregistry/src/deb/arrowhead-deviceregistry.service index 1c1e55361..093ccb411 100644 --- a/deviceregistry/src/deb/arrowhead-deviceregistry.service +++ b/deviceregistry/src/deb/arrowhead-deviceregistry.service @@ -1,6 +1,6 @@ [Unit] Description=arrowhead-deviceregistry -After=network.target mysql.target arrowhead-serviceregistry +After=network.target [Service] WorkingDirectory=/etc/arrowhead/systems/device_registry diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/Validation.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/Validation.java index 7fa9563e9..a70fba69c 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/Validation.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/Validation.java @@ -2,25 +2,18 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.CoreCommonConstants; -import eu.arrowhead.common.SSLProperties; import eu.arrowhead.common.Utilities; -import eu.arrowhead.common.dto.shared.CertificateType; import eu.arrowhead.common.dto.shared.DeviceRegistryOnboardingWithCsrRequestDTO; import eu.arrowhead.common.dto.shared.DeviceRegistryOnboardingWithNameRequestDTO; import eu.arrowhead.common.dto.shared.DeviceRegistryRequestDTO; import eu.arrowhead.common.dto.shared.DeviceRequestDTO; -import eu.arrowhead.common.exception.AuthException; import eu.arrowhead.common.exception.BadPayloadException; import org.apache.http.HttpStatus; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import javax.servlet.http.HttpServletRequest; -import java.security.cert.X509Certificate; import java.time.format.DateTimeParseException; import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; public class Validation { @@ -29,9 +22,6 @@ public class Validation { private static final String DEVICE_ADDRESS_NULL_ERROR_MESSAGE = " Device address must have value "; private static final String DEVICE_MAC_ADDRESS_NULL_ERROR_MESSAGE = " Device MAC address must have value "; - private static final String MAC_ADDRESS_PATTERN_STRING = "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"; - public static final Pattern MAC_ADDRESS_PATTERN = Pattern.compile(MAC_ADDRESS_PATTERN_STRING); - private final Logger logger = LogManager.getLogger(); Validation() { super(); } @@ -65,8 +55,7 @@ void checkUnregisterDeviceParameters(final String deviceName, final String macAd throw new BadPayloadException("MAC Address of the device is blank", HttpStatus.SC_BAD_REQUEST, origin); } - final Matcher matcher = MAC_ADDRESS_PATTERN.matcher(macAddress); - if (!matcher.matches()) { + if (!Utilities.isValidMacAddress(macAddress)) { throw new BadPayloadException("Unrecognized format of MAC Address", HttpStatus.SC_BAD_REQUEST, origin); } } @@ -192,14 +181,11 @@ void checkDeviceRegistryMergeRequest(final Long id, final DeviceRegistryRequestD if (Utilities.notEmpty(device.getDeviceName())) { needChange = true; - } - else if (Utilities.notEmpty(device.getAddress())) { + } else if (Utilities.notEmpty(device.getAddress())) { needChange = true; - } - else if (Utilities.notEmpty(device.getMacAddress())) { + } else if (Utilities.notEmpty(device.getMacAddress())) { needChange = true; - } - else if (Utilities.notEmpty(device.getAuthenticationInfo())) { + } else if (Utilities.notEmpty(device.getAuthenticationInfo())) { needChange = true; } } diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java index 8dd1fb697..5bbe4cb51 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java @@ -9,7 +9,6 @@ import eu.arrowhead.common.database.entity.System; import eu.arrowhead.common.database.repository.DeviceRegistryRepository; import eu.arrowhead.common.database.repository.DeviceRepository; -import eu.arrowhead.common.database.repository.SystemRepository; import eu.arrowhead.common.drivers.CertificateAuthorityDriver; import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; import eu.arrowhead.common.dto.internal.DTOConverter; @@ -30,7 +29,6 @@ import eu.arrowhead.common.dto.shared.DeviceResponseDTO; import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.exception.InvalidParameterException; -import eu.arrowhead.core.deviceregistry.Validation; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -49,7 +47,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import java.util.regex.Matcher; @Service public class DeviceRegistryDBService { @@ -112,7 +109,7 @@ public DeviceRegistryOnboardingWithNameResponseDTO onboardAndRegisterDeviceRegis try { certificateSigningRequest = securityUtilities - .createCertificateSigningRequest(creationRequestDTO.getCommonName(), keyPair, host, address, CertificateType.AH_DEVICE); + .createCertificateSigningRequest(creationRequestDTO.getCommonName(), keyPair, CertificateType.AH_DEVICE, host, address); } catch (Exception e) { logger.error(e.getMessage(), e); throw new ArrowheadException("Unable to create certificate signing request: " + e.getMessage()); @@ -580,8 +577,7 @@ private Device validateNonNullDeviceParameters(final String deviceName, final St if (Utilities.isEmpty(macAddress)) { throw new InvalidParameterException("MAC address is null or empty"); } else { - final Matcher matcher = Validation.MAC_ADDRESS_PATTERN.matcher(macAddress); - if (!matcher.matches()) { + if (!Utilities.isValidMacAddress(macAddress)) { throw new InvalidParameterException("Unrecognized format of MAC Address"); } } diff --git a/onboarding/src/deb/arrowhead-onboarding.service b/onboarding/src/deb/arrowhead-onboarding.service index d75c01021..19b843e88 100644 --- a/onboarding/src/deb/arrowhead-onboarding.service +++ b/onboarding/src/deb/arrowhead-onboarding.service @@ -1,6 +1,6 @@ [Unit] Description=arrowhead-onboarding -After=network.target mysql.target arrowhead-serviceregistry arrowhead-authorization arrowhead-certificate-authority arrowhead-orchestration +After=network.target [Service] WorkingDirectory=/etc/arrowhead/systems/onboarding_controller diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java index 878b7dac3..5b97473f0 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java @@ -60,7 +60,7 @@ public OnboardingWithNameResponseDTO onboarding(final OnboardingWithNameRequestD try { certificateSigningRequest = securityUtilities.createCertificateSigningRequest(creationRequestDTO.getCommonName(), keyPair, - host, address, CertificateType.AH_ONBOARDING); + CertificateType.AH_ONBOARDING, host, address); } catch (Exception e) { logger.error(e.getMessage(), e); throw new ArrowheadException("Unable to create certificate signing request: " + e.getMessage()); diff --git a/orchestrator/pom.xml b/orchestrator/pom.xml index 051dfe016..97f72d94b 100644 --- a/orchestrator/pom.xml +++ b/orchestrator/pom.xml @@ -10,15 +10,7 @@ jar Arrowhead Orchestrator Arrowhead Orchestrator core service - - - - eu.arrowhead - arrowhead-core-common - ${revision} - - - + diff --git a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java index 16a7f150c..f38d7bbcb 100644 --- a/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java +++ b/orchestrator/src/main/java/eu/arrowhead/core/orchestrator/service/OrchestratorDriver.java @@ -432,9 +432,6 @@ private List convertServiceInterfaceListToServiceInterfaceIdList(final Lis private void filterProviderListUsingAuthorizationResult(final List providers, final AuthorizationIntraCloudCheckResponseDTO authResult) { logger.debug("filterProviderListUsingAuthorizationResult started..."); - // disabled for demo purposes - - /* if (authResult.getAuthorizedProviderIdsWithInterfaceIds().isEmpty()) { // consumer has no access to any of the specified providers providers.clear(); @@ -450,7 +447,6 @@ private void filterProviderListUsingAuthorizationResult(final List optionalSystem = systemRepository.findBySystemNameAndAddressAndPort(systemName, address, port); + final String dbSystemName = Utilities.lowerCaseTrim(systemName); + final String dbAddress = Utilities.lowerCaseTrim(address); + final Optional optionalSystem = systemRepository.findBySystemNameAndAddressAndPort(dbSystemName, dbAddress, port); return optionalSystem.orElseThrow(() -> new InvalidParameterException( - "System entry with name '" + systemName + "', address '" + address + "' and port '" + port + "' does not exist")); + "System entry with name '" + dbSystemName + "', address '" + dbAddress + "' and port '" + port + "' does not exist")); } //------------------------------------------------------------------------------------------------- @@ -843,6 +847,10 @@ private Device validateNonNullDeviceParameters(final String deviceName, final St final String validatedAddress = Utilities.lowerCaseTrim(address); final String validatedMacAddress = Utilities.lowerCaseTrim(macAddress); + if (!Utilities.isValidMacAddress(validatedMacAddress)) { + throw new BadPayloadException("Unrecognized format of MAC Address", HttpStatus.SC_BAD_REQUEST); + } + checkConstraintsOfDeviceTable(validatedDeviceName, validatedMacAddress); return new Device(validatedDeviceName, validatedAddress, validatedMacAddress, authenticationInfo); @@ -981,6 +989,10 @@ private Device findOrCreateDevice(String deviceName, String address, String macA final String validateAddress = Utilities.lowerCaseTrim(address); final String validatedMacAddress = Utilities.lowerCaseTrim(macAddress); + if (!Utilities.isValidMacAddress(validatedMacAddress)) { + throw new BadPayloadException("Unrecognized format of MAC Address", HttpStatus.SC_BAD_REQUEST); + } + final Optional optProvider = deviceRepository.findByDeviceNameAndMacAddress(validateName, validatedMacAddress); Device provider; From d3e7dc069dedce70d38f17c006c64b2d1ff73634 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Fri, 17 Apr 2020 15:15:07 +0200 Subject: [PATCH 298/301] performed additional changes after code review --- .../arrowhead/common/SecurityUtilities.java | 4 +- .../common/drivers/DriverUtilities.java | 12 + .../common/dto/internal/DTOConverter.java | 1838 +++++++++-------- .../common/dto/shared/CertificateType.java | 6 + .../DeviceRegistryOnboardingResponseDTO.java | 3 + .../common/dto/shared/SystemQueryFormDTO.java | 10 +- .../SystemRegistryOnboardingResponseDTO.java | 3 + deviceregistry/pom.xml | 10 - .../service/DeviceRegistryDBService.java | 54 +- .../core/onboarding/OnboardingController.java | 7 +- .../OnboardingService.java} | 17 +- .../onboarding/OnboardingControllerTest.java | 4 +- .../onboarding/OnboardingTestContext.java | 6 +- orchestrator/pom.xml | 8 + scripts/device_registry_privileges.sql | 2 + scripts/system_registry_privileges.sql | 2 +- systemregistry/pom.xml | 10 - 17 files changed, 1032 insertions(+), 964 deletions(-) rename onboarding/src/main/java/eu/arrowhead/core/onboarding/{database/service/OnboardingDBService.java => service/OnboardingService.java} (90%) diff --git a/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java b/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java index 313e95b53..3c371fe8a 100644 --- a/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/SecurityUtilities.java @@ -242,12 +242,14 @@ public void extractAndSetPublicKey(final CertificateCreationResponseDTO creation creationResponseDTO.setKeyPairDTO(encodePublicKey(publicKey)); } catch (final IOException e) { - logger.fatal("ByteArrayInputStream should never throw an IOException, but it just did .."); + logger.fatal("ByteArrayInputStream should never throw an IOException, but it just did : {}", e.getMessage()); + throw new ArrowheadException(e.getMessage()); } } //------------------------------------------------------------------------------------------------- public KeyPair extractOrGenerateKeyPair(final CertificateCreationRequestDTO creationRequestDTO) { + Assert.notNull(creationRequestDTO, "creationRequestDTO must not be null"); final String commonName = creationRequestDTO.getCommonName(); Assert.isTrue(Utilities.notEmpty(commonName), "CommonName is null or blank"); diff --git a/core-common/src/main/java/eu/arrowhead/common/drivers/DriverUtilities.java b/core-common/src/main/java/eu/arrowhead/common/drivers/DriverUtilities.java index fe516e9d4..1f4ebcf98 100644 --- a/core-common/src/main/java/eu/arrowhead/common/drivers/DriverUtilities.java +++ b/core-common/src/main/java/eu/arrowhead/common/drivers/DriverUtilities.java @@ -25,6 +25,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; +import org.springframework.util.Assert; import org.springframework.web.util.UriComponents; import org.springframework.web.util.UriComponentsBuilder; @@ -88,6 +89,7 @@ public boolean pingService(final ServiceSecurityType securityType, final SystemR } public UriComponents findUriByContext(final CoreSystemService service) throws DriverException { + Assert.notNull(service, "CoreSystemService must not be null"); logger.debug("Searching for '{}' uri in context ...", service.getServiceDefinition()); final String key = getCoreSystemServiceKey(service); if (containsContext(key)) { @@ -102,6 +104,7 @@ public UriComponents findUriByContext(final CoreSystemService service) throws Dr } public ServiceRegistryResponseDTO findByServiceRegistry(final CoreSystemService service, final boolean pingTarget) throws DriverException { + Assert.notNull(service, "CoreSystemService must not be null"); logger.debug("findByServiceRegistry started..."); final UriComponents queryUri = getServiceRegistryQueryUri(); final ServiceQueryFormDTO form = new ServiceQueryFormDTO.Builder(service.getServiceDefinition()) @@ -145,6 +148,7 @@ public UriComponents findUriByServiceRegistry(final CoreSystemService service) t } public UriComponents findUriByOrchestrator(final CoreSystemService service) throws DriverException { + Assert.notNull(service, "CoreSystemService must not be null"); try { return findUriByContext(service); @@ -153,6 +157,7 @@ public UriComponents findUriByOrchestrator(final CoreSystemService service) thro } logger.debug("findUriByOrchestrator started..."); + final UriComponents queryUri = getOrchestrationQueryUri(); final SystemRequestDTO requester = new SystemRequestDTO(); requester.setAddress(coreSystemProps.getCoreSystemDomainName()); @@ -192,14 +197,17 @@ public UriComponents findUriByOrchestrator(final CoreSystemService service) thro } public UriComponents createUri(final ServiceRegistryResponseDTO entry) { + Assert.notNull(entry, "ServiceRegistryResponseDTO must not be null"); return createUri(entry.getSecure(), entry.getProvider(), entry.getServiceUri()); } public UriComponents createUri(final OrchestrationResultDTO entry) { + Assert.notNull(entry, "OrchestrationResultDTO must not be null"); return createUri(entry.getSecure(), entry.getProvider(), entry.getServiceUri()); } public UriComponents createUri(final ServiceSecurityType securityType, final SystemResponseDTO system, final String serviceUri) { + Assert.notNull(system, "SystemResponseDTO must not be null"); return Utilities.createURI(getScheme(securityType), system.getAddress(), system.getPort(), @@ -207,6 +215,7 @@ public UriComponents createUri(final ServiceSecurityType securityType, final Sys } public UriComponents createEchoUri(final UriComponents serviceUri) { + Assert.notNull(serviceUri, "UriComponents must not be null"); return UriComponentsBuilder.newInstance() .scheme(serviceUri.getScheme()) .host(serviceUri.getHost()) @@ -218,6 +227,7 @@ public UriComponents createEchoUri(final UriComponents serviceUri) { //------------------------------------------------------------------------------------------------- public UriComponents createCustomUri(final UriComponents serviceUri, final String systemUri, final String postfix) { + Assert.notNull(serviceUri, "UriComponents must not be null"); return UriComponentsBuilder.newInstance() .uriComponents(serviceUri) .replacePath(systemUri) @@ -227,6 +237,7 @@ public UriComponents createCustomUri(final UriComponents serviceUri, final Strin //------------------------------------------------------------------------------------------------- public UriComponents createCustomUri(final UriComponents serviceUri, final String postfix) { + Assert.notNull(serviceUri, "UriComponents must not be null"); return UriComponentsBuilder.newInstance() .uriComponents(serviceUri) .path(extractSystemUriPath(serviceUri)) @@ -235,6 +246,7 @@ public UriComponents createCustomUri(final UriComponents serviceUri, final Strin } public String getCoreSystemServiceKey(final CoreSystemService service) { + Assert.notNull(service, "CoreSystemService must not be null"); return service.getServiceDefinition() + CoreCommonConstants.URI_SUFFIX; } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java index 8a6abc3c4..fbc688cb6 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java @@ -29,8 +29,8 @@ import eu.arrowhead.common.database.entity.ServiceRegistryInterfaceConnection; import eu.arrowhead.common.database.entity.Subscription; import eu.arrowhead.common.database.entity.SubscriptionPublisherConnection; -import eu.arrowhead.common.database.entity.SystemRegistry; import eu.arrowhead.common.database.entity.System; +import eu.arrowhead.common.database.entity.SystemRegistry; import eu.arrowhead.common.dto.shared.ChoreographerActionPlanResponseDTO; import eu.arrowhead.common.dto.shared.ChoreographerActionResponseDTO; import eu.arrowhead.common.dto.shared.ChoreographerActionStepResponseDTO; @@ -66,905 +66,947 @@ import java.util.Set; public class DTOConverter { - - //================================================================================================= - // methods - - //------------------------------------------------------------------------------------------------- - public static DeviceResponseDTO convertDeviceToDeviceResponseDTO(final Device device) { - Assert.notNull(device, "Device is null"); - return new DeviceResponseDTO(device.getId(), device.getDeviceName(), device.getAddress(), device.getMacAddress(), device.getAuthenticationInfo(), - Utilities.convertZonedDateTimeToUTCString(device.getCreatedAt()), Utilities.convertZonedDateTimeToUTCString(device.getUpdatedAt())); - } - - //------------------------------------------------------------------------------------------------- - public static DeviceListResponseDTO convertDeviceEntryListToDeviceListResponseDTO(final Page deviceEntryList) { - Assert.notNull(deviceEntryList, "deviceEntryList is null"); - - final long count = deviceEntryList.getTotalElements(); - final DeviceListResponseDTO deviceListResponseDTO = new DeviceListResponseDTO(); - deviceListResponseDTO.setCount(count); - deviceListResponseDTO.setData(deviceEntryListToDeviceResponseDTOList(deviceEntryList.getContent())); - - return deviceListResponseDTO; - } - - //------------------------------------------------------------------------------------------------- - public static SystemResponseDTO convertSystemToSystemResponseDTO(final System system) { - Assert.notNull(system, "System is null"); - - return new SystemResponseDTO(system.getId(), system.getSystemName(), system.getAddress(), system.getPort(), system.getAuthenticationInfo(), - Utilities.convertZonedDateTimeToUTCString(system.getCreatedAt()), Utilities.convertZonedDateTimeToUTCString(system.getUpdatedAt())); - } - - //------------------------------------------------------------------------------------------------- - public static SystemListResponseDTO convertSystemEntryListToSystemListResponseDTO(final Page systemEntryList) { - Assert.notNull(systemEntryList, "systemEntryList is null"); - - final long count = systemEntryList.getTotalElements(); - final SystemListResponseDTO systemListResponseDTO = new SystemListResponseDTO(); - systemListResponseDTO.setCount(count); - systemListResponseDTO.setData(systemEntryListToSystemResponseDTOList(systemEntryList.getContent())); - - return systemListResponseDTO; - } - - //------------------------------------------------------------------------------------------------- - public static ServiceDefinitionResponseDTO convertServiceDefinitionToServiceDefinitionResponseDTO(final ServiceDefinition serviceDefinition) { - Assert.notNull(serviceDefinition, "ServiceDefinition is null"); - - return new ServiceDefinitionResponseDTO(serviceDefinition.getId(), serviceDefinition.getServiceDefinition(), Utilities.convertZonedDateTimeToUTCString(serviceDefinition.getCreatedAt()), - Utilities.convertZonedDateTimeToUTCString(serviceDefinition.getUpdatedAt())); - } - - //------------------------------------------------------------------------------------------------- - public static ServiceDefinitionsListResponseDTO convertServiceDefinitionsListToServiceDefinitionListResponseDTO(final Page serviceDefinitions) { - Assert.notNull(serviceDefinitions, "List of ServiceDefinition is null"); - - final List serviceDefinitionDTOs = new ArrayList<>(serviceDefinitions.getNumberOfElements()); - for (final ServiceDefinition definition : serviceDefinitions) { - serviceDefinitionDTOs.add(convertServiceDefinitionToServiceDefinitionResponseDTO(definition)); - } - - return new ServiceDefinitionsListResponseDTO(serviceDefinitionDTOs, serviceDefinitions.getTotalElements()); - } - - //------------------------------------------------------------------------------------------------- - public static ServiceRegistryResponseDTO convertServiceRegistryToServiceRegistryResponseDTO(final ServiceRegistry entry) { - Assert.notNull(entry, "SR entry is null."); - Assert.notNull(entry.getServiceDefinition(), "Related service definition is null."); - Assert.notNull(entry.getSystem(), "Related system is null."); - Assert.notNull(entry.getInterfaceConnections(), "Related interface connection set is null."); - Assert.isTrue(!entry.getInterfaceConnections().isEmpty(), "Related interface connection set is empty."); - - final ServiceDefinitionResponseDTO serviceDefinitionDTO = convertServiceDefinitionToServiceDefinitionResponseDTO(entry.getServiceDefinition()); - final SystemResponseDTO systemDTO = convertSystemToSystemResponseDTO(entry.getSystem()); - - final ServiceRegistryResponseDTO dto = new ServiceRegistryResponseDTO(); - dto.setId(entry.getId()); - dto.setServiceDefinition(serviceDefinitionDTO); - dto.setProvider(systemDTO); - dto.setServiceUri(entry.getServiceUri()); - dto.setEndOfValidity(Utilities.convertZonedDateTimeToUTCString(entry.getEndOfValidity())); - dto.setSecure(entry.getSecure()); - dto.setMetadata(Utilities.text2Map(entry.getMetadata())); - dto.setVersion(entry.getVersion()); - dto.setInterfaces(collectInterfacesFromServiceRegistry(entry.getInterfaceConnections())); - dto.setCreatedAt(Utilities.convertZonedDateTimeToUTCString(entry.getCreatedAt())); - dto.setUpdatedAt(Utilities.convertZonedDateTimeToUTCString(entry.getUpdatedAt())); - - return dto; - } - - //------------------------------------------------------------------------------------------------- - public static ServiceRegistryListResponseDTO convertServiceRegistryListToServiceRegistryListResponseDTO(final Page serviceRegistryEntries) { - Assert.notNull(serviceRegistryEntries, "List of serviceRegistryEntries is null"); - - final List serviceRegistryEntryDTOs = new ArrayList<>(serviceRegistryEntries.getNumberOfElements()); - for (final ServiceRegistry srEntry: serviceRegistryEntries) { - serviceRegistryEntryDTOs.add(convertServiceRegistryToServiceRegistryResponseDTO(srEntry)); - } - - return new ServiceRegistryListResponseDTO(serviceRegistryEntryDTOs, serviceRegistryEntries.getTotalElements()); - } - - //------------------------------------------------------------------------------------------------- - @SuppressWarnings("squid:S3776") - public static ServiceRegistryGroupedResponseDTO convertServiceRegistryDataToServiceRegistryGroupedResponseDTO(final Iterable serviceDefinitionEntries, - final Iterable systemEntries, - final Iterable interfaceEntries, - final Iterable serviceRegistryEntries) { - Assert.notNull(serviceDefinitionEntries, "List of serviceDefinitionEntries is null"); - Assert.notNull(systemEntries, "List of systemEntries is null"); - Assert.notNull(interfaceEntries, "List of interfaceEntries is null"); - Assert.notNull(serviceRegistryEntries, "List of serviceRegistryEntries is null"); - - final Map servicesBySystemId = new HashMap<>(); - final Map servicesByServiceDefinition = new HashMap<>(); - final List servicesForAutoComplete = new ArrayList<>(); - final List systemsForAutoComplete = new ArrayList<>(); - final List interfacesForAutoComplete = new ArrayList<>(); - - for (final ServiceRegistry srEntry: serviceRegistryEntries) { - final long systemId = srEntry.getSystem().getId(); - final String systemName = srEntry.getSystem().getSystemName(); - final String systemAddress = srEntry.getSystem().getAddress(); - final int systemPort = srEntry.getSystem().getPort(); - final long serviceDefinitionId = srEntry.getServiceDefinition().getId(); - final String serviceDefinition = srEntry.getServiceDefinition().getServiceDefinition(); - - // Creating ServicesGroupedBySystemsResponseDTO - if (servicesBySystemId.containsKey(systemId)) { - servicesBySystemId.get(systemId).getServices().add(convertServiceRegistryToServiceRegistryResponseDTO(srEntry)); - } else { - final ServicesGroupedBySystemsResponseDTO dto = new ServicesGroupedBySystemsResponseDTO(systemId, systemName, systemAddress, systemPort, new ArrayList<>()); - dto.getServices().add(convertServiceRegistryToServiceRegistryResponseDTO(srEntry)); - servicesBySystemId.put(systemId, dto); - } - - // Creating ServicesGroupedByServiceDefinitionResponseDTO - if (servicesByServiceDefinition.containsKey(serviceDefinitionId)) { - servicesByServiceDefinition.get(serviceDefinitionId).getProviderServices().add(convertServiceRegistryToServiceRegistryResponseDTO(srEntry)); - } else { - final ServicesGroupedByServiceDefinitionResponseDTO dto = new ServicesGroupedByServiceDefinitionResponseDTO(serviceDefinitionId, serviceDefinition, new ArrayList<>()); - dto.getProviderServices().add(convertServiceRegistryToServiceRegistryResponseDTO(srEntry)); - servicesByServiceDefinition.put(serviceDefinitionId, dto); - } - } - - // Creating AutoCompleteDataResponseDTO - for (final ServiceDefinition serviceDefinition : serviceDefinitionEntries) { - servicesForAutoComplete.add(new IdValueDTO(serviceDefinition.getId(), serviceDefinition.getServiceDefinition())); - } - for (final System system : systemEntries) { - systemsForAutoComplete.add(DTOConverter.convertSystemToSystemResponseDTO(system)); - } - for (final ServiceInterface serviceInterface : interfaceEntries) { - interfacesForAutoComplete.add(new IdValueDTO(serviceInterface.getId(), serviceInterface.getInterfaceName())); - } - - final List servicesGroupedBySystemsResponseDTOList = new ArrayList<>(); - servicesGroupedBySystemsResponseDTOList.addAll(servicesBySystemId.values()); - final List servicesGroupedByServiceDefinitionResponseDTOList = new ArrayList<>(); - servicesGroupedByServiceDefinitionResponseDTOList.addAll(servicesByServiceDefinition.values()); - final AutoCompleteDataResponseDTO autoCompleteDataResponseDTO = new AutoCompleteDataResponseDTO(servicesForAutoComplete, systemsForAutoComplete, interfacesForAutoComplete); - - return new ServiceRegistryGroupedResponseDTO(servicesGroupedBySystemsResponseDTOList, servicesGroupedByServiceDefinitionResponseDTOList, autoCompleteDataResponseDTO); - } - - //------------------------------------------------------------------------------------------------- - public static ServiceInterfaceResponseDTO convertServiceInterfaceToServiceInterfaceResponseDTO(final ServiceInterface intf) { - Assert.notNull(intf, "Interface entry is null."); - - return new ServiceInterfaceResponseDTO(intf.getId(), intf.getInterfaceName(), Utilities.convertZonedDateTimeToUTCString(intf.getCreatedAt()), - Utilities.convertZonedDateTimeToUTCString(intf.getUpdatedAt())); - } - - //------------------------------------------------------------------------------------------------- - public static ServiceQueryResultDTO convertListOfServiceRegistryEntriesToServiceQueryResultDTO(final List entries, final int unfilteredHits) { - final ServiceQueryResultDTO result = new ServiceQueryResultDTO(); - - if (entries != null) { - Assert.isTrue(unfilteredHits >= entries.size(), "Invalid value of unfiltered hits: " + unfilteredHits); - result.setUnfilteredHits(unfilteredHits); - for (final ServiceRegistry srEntry : entries) { - result.getServiceQueryData().add(convertServiceRegistryToServiceRegistryResponseDTO(srEntry)); - } - } - - return result; - } - - //------------------------------------------------------------------------------------------------- - public static SystemQueryResultDTO convertListOfSystemRegistryEntriesToSystemQueryResultDTO(final List entries, final int unfilteredHits) { - final List results = new ArrayList<>(); - - if (entries != null) { - Assert.isTrue(unfilteredHits >= entries.size(), "Invalid value of unfiltered hits: " + unfilteredHits); - for (final SystemRegistry srEntry : entries) { - results.add(convertSystemRegistryToSystemRegistryResponseDTO(srEntry)); - } - } - - return new SystemQueryResultDTO(results, unfilteredHits); - } - - //------------------------------------------------------------------------------------------------- - public static DeviceQueryResultDTO convertListOfDeviceRegistryEntriesToDeviceQueryResultDTO(final List entries, final int unfilteredHits) { - final List results = new ArrayList<>(); - - if (entries != null) { - Assert.isTrue(unfilteredHits >= entries.size(), "Invalid value of unfiltered hits: " + unfilteredHits); - for (final DeviceRegistry srEntry : entries) { - results.add(convertDeviceRegistryToDeviceRegistryResponseDTO(srEntry)); - } - } - - return new DeviceQueryResultDTO(results, unfilteredHits); - } - - //------------------------------------------------------------------------------------------------- - public static AuthorizationIntraCloudResponseDTO convertAuthorizationIntraCloudToAuthorizationIntraCloudResponseDTO(final AuthorizationIntraCloud entry) { - Assert.notNull(entry, "AuthorizationIntraCloud is null"); - Assert.notNull(entry.getConsumerSystem(), "Consumer is null"); - Assert.notNull(entry.getProviderSystem(), "Provider is null"); - Assert.notNull(entry.getServiceDefinition(), "ServiceDefintion is null"); - Assert.notNull(entry.getInterfaceConnections(), "InterfaceConnections is null"); - - return new AuthorizationIntraCloudResponseDTO(entry.getId(), convertSystemToSystemResponseDTO(entry.getConsumerSystem()), convertSystemToSystemResponseDTO(entry.getProviderSystem()), - convertServiceDefinitionToServiceDefinitionResponseDTO(entry.getServiceDefinition()), - collectInterfacesFromAuthorizationIntraCloud(entry.getInterfaceConnections()), - Utilities.convertZonedDateTimeToUTCString(entry.getCreatedAt()), Utilities.convertZonedDateTimeToUTCString(entry.getUpdatedAt())); - } - - //------------------------------------------------------------------------------------------------- - public static AuthorizationIntraCloudListResponseDTO convertAuthorizationIntraCloudListToAuthorizationIntraCloudListResponseDTO(final Page entries) { - Assert.notNull(entries, "AuthorizationIntraCloudList is null"); - - final List authorizationIntraCloudEntries = new ArrayList<>(entries.getNumberOfElements()); - for (final AuthorizationIntraCloud entry : entries) { - authorizationIntraCloudEntries.add(convertAuthorizationIntraCloudToAuthorizationIntraCloudResponseDTO(entry)); - } - - return new AuthorizationIntraCloudListResponseDTO(authorizationIntraCloudEntries, entries.getTotalElements()); - } - - //------------------------------------------------------------------------------------------------- - public static TokenGenerationResponseDTO convertTokenMapToTokenGenerationResponseDTO(final Map> tokenMap) { - Assert.notNull(tokenMap, "Token map is null."); - - final TokenGenerationResponseDTO result = new TokenGenerationResponseDTO(); - for (final Entry> entry : tokenMap.entrySet()) { - result.getTokenData().add(new TokenDataDTO(entry.getKey(), entry.getValue())); - } - - return result; - } - - //------------------------------------------------------------------------------------------------- - public static CloudListResponseDTO convertCloudToCloudResponseDTO(final Page entries) { - Assert.notNull(entries, "Cloud list is null" ); - - final List cloudEntries = new ArrayList<>(entries.getNumberOfElements()); - for (final Cloud entry : entries) { - cloudEntries.add(convertCloudToCloudResponseDTO(entry)); - } - - return new CloudListResponseDTO(cloudEntries, entries.getTotalElements()); - } - - //------------------------------------------------------------------------------------------------- - public static CloudResponseDTO convertCloudToCloudResponseDTO(final Cloud entity) { - Assert.notNull(entity, "Cloud is null" ); - Assert.notNull(entity.getOperator(), "Cloud.operator is null" ); - Assert.notNull(entity.getName(), "Cloud.name is null" ); - Assert.notNull(entity.getCreatedAt(), "Cloud.createdAt is null" ); - Assert.notNull(entity.getUpdatedAt(), "Cloud.cpdatedAt is null" ); - - return new CloudResponseDTO(entity.getId(), entity.getOperator(), entity.getName(), entity.getSecure(), entity.getNeighbor(), entity.getOwnCloud(), entity.getAuthenticationInfo(), - Utilities.convertZonedDateTimeToUTCString(entity.getCreatedAt()), Utilities.convertZonedDateTimeToUTCString(entity.getUpdatedAt())); - } - - //------------------------------------------------------------------------------------------------- - public static RelayListResponseDTO convertRelayListToRelayResponseListDTO(final Page entries) { - Assert.notNull(entries, "Relay list is null" ); - - final List relayEntries = new ArrayList<>(entries.getNumberOfElements()); - for (final Relay entry : entries) { - relayEntries.add(convertRelayToRelayResponseDTO(entry)); - } - - return new RelayListResponseDTO(relayEntries, entries.getTotalElements()); - } - - //------------------------------------------------------------------------------------------------- - public static RelayResponseDTO convertRelayToRelayResponseDTO(final Relay entry) { - Assert.notNull(entry, "Relay is null"); - Assert.notNull(entry.getAddress(), "Relay.address is null"); - Assert.notNull(entry.getType(), "Relay.type is null"); - Assert.notNull(entry.getCreatedAt(), "Relay.createdAt is null"); - Assert.notNull(entry.getCreatedAt(), "Relay.updatedAt is null"); - - return new RelayResponseDTO(entry.getId(), entry.getAddress(), entry.getPort(), entry.getSecure(), entry.getExclusive(), entry.getType(), - Utilities.convertZonedDateTimeToUTCString(entry.getCreatedAt()), Utilities.convertZonedDateTimeToUTCString(entry.getUpdatedAt())); - } - - //------------------------------------------------------------------------------------------------- - public static List convertRelayListToRelayRequestDTOList(final List relays) { - Assert.notNull(relays, "Relay list is null."); - - final List result = new ArrayList<>(relays.size()); - for (final Relay relay : relays) { - result.add(convertRelayToRelayRequestDTO(relay)); - } - - return result; - } - - //------------------------------------------------------------------------------------------------- - public static RelayRequestDTO convertRelayToRelayRequestDTO(final Relay relay) { - Assert.notNull(relay, "relay is null."); - - return new RelayRequestDTO(relay.getAddress(), relay.getPort(), relay.getSecure(), relay.getExclusive(), relay.getType().name()); - } - - //------------------------------------------------------------------------------------------------- - public static CloudWithRelaysListResponseDTO convertCloudToCloudWithRelaysListResponseDTO(final Page entries) { - Assert.notNull(entries, "Cloud list is null" ); - - final List cloudWithRelaysResponseDTOList = new ArrayList<>(entries.getNumberOfElements()); - for (final Cloud cloud : entries) { - Assert.notNull(cloud.getGatekeeperRelays(), "CloudGatekeeperRelay set is null"); - Assert.notNull(cloud.getGatewayRelays(), "CloudGatewayRelay set is null"); - - cloudWithRelaysResponseDTOList.add(convertCloudToCloudWithRelaysResponseDTO(cloud)); - } - - return new CloudWithRelaysListResponseDTO(cloudWithRelaysResponseDTOList, entries.getTotalElements()); - } - - //------------------------------------------------------------------------------------------------- - public static CloudWithRelaysResponseDTO convertCloudToCloudWithRelaysResponseDTO(final Cloud cloud) { - Assert.notNull(cloud, "Cloud is null"); - Assert.notNull(cloud.getGatekeeperRelays(), "Gatekeeper relays set is null"); - Assert.notNull(cloud.getGatewayRelays(), "Gateway relays set is null"); - - final CloudResponseDTO cloudResponseDTO = convertCloudToCloudResponseDTO(cloud); - - final Set gatekeeperRelays = new HashSet<>(); - for (final CloudGatekeeperRelay conn : cloud.getGatekeeperRelays()) { - gatekeeperRelays.add(conn.getRelay()); - } - - final Set gatewayRelays = new HashSet<>(); - for (final CloudGatewayRelay conn : cloud.getGatewayRelays()) { - gatewayRelays.add(conn.getRelay()); - } - - final List gatekeeperRelayListDTO = new ArrayList<>(gatekeeperRelays.size()); - for (final Relay gatekeeperRelay : gatekeeperRelays) { - gatekeeperRelayListDTO.add(convertRelayToRelayResponseDTO(gatekeeperRelay)); - } - - final List gatewayRelayListDTO = new ArrayList<>(gatewayRelays.size()); - for (final Relay gatewayRelay : gatewayRelays) { - gatewayRelayListDTO.add(convertRelayToRelayResponseDTO(gatewayRelay)); - } - - return new CloudWithRelaysResponseDTO(cloudResponseDTO.getId(), cloudResponseDTO.getOperator(), cloudResponseDTO.getName(), cloudResponseDTO.getSecure(), - cloudResponseDTO.getNeighbor(), cloudResponseDTO.getOwnCloud(), cloudResponseDTO.getAuthenticationInfo(), - cloudResponseDTO.getCreatedAt(), cloudResponseDTO.getUpdatedAt(), gatekeeperRelayListDTO, gatewayRelayListDTO); - } - - //------------------------------------------------------------------------------------------------- - public static AuthorizationInterCloudListResponseDTO convertAuthorizationInterCloudListToAuthorizationInterCloudListResponseDTO(final Page entries) { - Assert.notNull(entries, "AuthorizationInterCloudList is null"); - - final List authorizationInterCloudEntries = new ArrayList<>(entries.getNumberOfElements()); - for (final AuthorizationInterCloud entry : entries) { - authorizationInterCloudEntries.add(convertAuthorizationInterCloudToAuthorizationInterCloudResponseDTO(entry)); - } - - return new AuthorizationInterCloudListResponseDTO(authorizationInterCloudEntries, entries.getTotalElements()); - } - - //------------------------------------------------------------------------------------------------- - public static AuthorizationInterCloudResponseDTO convertAuthorizationInterCloudToAuthorizationInterCloudResponseDTO(final AuthorizationInterCloud entity) { - Assert.notNull(entity, "AuthorizationInterCloud is null" ); - Assert.notNull(entity.getCloud(), "AuthorizationInterCloud.Cloud is null" ); - Assert.notNull(entity.getProvider(), "AuthorizationInterCloud.Provider is null"); - Assert.notNull(entity.getServiceDefinition(), "AuthorizationInterCloud.ServiceDefinition is null" ); - Assert.notNull(entity.getInterfaceConnections(), "AuthorizationInterCloud.InterfaceConnections is null"); - Assert.notNull(entity.getCreatedAt(), "AuthorizationInterCloud.CreatedAt is null" ); - Assert.notNull(entity.getUpdatedAt(), "AuthorizationInterCloud.UpdatedAt is null" ); - - return new AuthorizationInterCloudResponseDTO(entity.getId(), convertCloudToCloudResponseDTO(entity.getCloud()), convertSystemToSystemResponseDTO(entity.getProvider()), - convertServiceDefinitionToServiceDefinitionResponseDTO(entity.getServiceDefinition()), - collectInterfacesFromAuthorizationInterCloud(entity.getInterfaceConnections()), - Utilities.convertZonedDateTimeToUTCString(entity.getCreatedAt()), Utilities.convertZonedDateTimeToUTCString(entity.getUpdatedAt())); - - } - - //------------------------------------------------------------------------------------------------- - public static OrchestratorStoreResponseDTO convertOrchestratorStoreToOrchestratorStoreResponseDTO(final OrchestratorStore entity, final SystemResponseDTO providerSystem, - final CloudResponseDTO providerCloud) { - Assert.notNull(entity, "OrchestratorStore is null"); - Assert.notNull(providerSystem, "OrchestratorStore.ProviderSystem is null"); - Assert.notNull(entity.getCreatedAt(), "OrchestratorStore.CreatedAt is null"); - Assert.notNull(entity.getUpdatedAt(), "OrchestratorStore.UpdatedAt is null"); - - return new OrchestratorStoreResponseDTO(entity.getId(), convertServiceDefinitionToServiceDefinitionResponseDTO(entity.getServiceDefinition()), - convertSystemToSystemResponseDTO(entity.getConsumerSystem()), entity.isForeign(), providerSystem, providerCloud, - convertServiceInterfaceToServiceInterfaceResponseDTO(entity.getServiceInterface()), entity.getPriority(), Utilities.text2Map(entity.getAttribute()), - Utilities.convertZonedDateTimeToUTCString(entity.getCreatedAt()), Utilities.convertZonedDateTimeToUTCString(entity.getUpdatedAt())); - } - - //------------------------------------------------------------------------------------------------- - public static OrchestratorStoreListResponseDTO convertOrchestratorStoreEntryListToOrchestratorStoreListResponseDTO(final List entries) { - Assert.notNull(entries, "OrchestratorStoreList is null"); - - return new OrchestratorStoreListResponseDTO(entries, entries.size()); - } - - //------------------------------------------------------------------------------------------------- - public static OrchestratorStoreListResponseDTO convertOrchestratorStoreEntryListToOrchestratorStoreListResponseDTO(final List entries, final long totalElements) { - Assert.notNull(entries, "OrchestratorStoreList is null"); - - return new OrchestratorStoreListResponseDTO(entries, totalElements); - } - - //------------------------------------------------------------------------------------------------- - public static SystemRequestDTO convertSystemToSystemRequestDTO(final System system) { - Assert.notNull(system, "System is null"); - - final SystemRequestDTO systemRequestDTO = new SystemRequestDTO(); - systemRequestDTO.setAddress(system.getAddress()); - systemRequestDTO.setSystemName(system.getSystemName()); - systemRequestDTO.setPort(system.getPort()); - systemRequestDTO.setAuthenticationInfo(systemRequestDTO.getAuthenticationInfo()); - - return systemRequestDTO; - } - - //------------------------------------------------------------------------------------------------- - public static SystemRequestDTO convertSystemResponseDTOToSystemRequestDTO(final SystemResponseDTO response) { - Assert.notNull(response, "response is null"); - - final SystemRequestDTO result = new SystemRequestDTO(); - result.setSystemName(response.getSystemName()); - result.setAddress(response.getAddress()); - result.setPort(response.getPort()); - result.setAuthenticationInfo(response.getAuthenticationInfo()); - - return result; - } - - //------------------------------------------------------------------------------------------------- - public static PreferredProviderDataDTO convertForeignOrchestratorStoreResponseDTOToPreferredProviderDataDTO(final OrchestratorStoreResponseDTO orchestratorStoreResponseDTO) { - Assert.notNull(orchestratorStoreResponseDTO, "orchestratorStoreResponseDTO is null"); - Assert.isTrue(orchestratorStoreResponseDTO.getForeign(), "orchestratorStoreResponseDTO is not foreign"); - Assert.notNull(orchestratorStoreResponseDTO.getProviderSystem(), "orchestratorStoreResponseDTO.ProviderSystem is null"); - Assert.notNull(orchestratorStoreResponseDTO.getProviderCloud(), "orchestratorStoreResponseDTO.ProviderCloud is null"); - - final PreferredProviderDataDTO preferredProviderDataDTO = new PreferredProviderDataDTO(); - - final SystemRequestDTO providerSystemRequestDTO = DTOConverter.convertSystemResponseDTOToSystemRequestDTO(orchestratorStoreResponseDTO.getProviderSystem()); - preferredProviderDataDTO.setProviderSystem(providerSystemRequestDTO); - - final CloudRequestDTO cloudRequestDTO = convertCloudResponseDTOToCloudRequestDTO(orchestratorStoreResponseDTO.getProviderCloud()); - preferredProviderDataDTO.setProviderCloud(cloudRequestDTO); - - return preferredProviderDataDTO; - } - - //------------------------------------------------------------------------------------------------- - public static CloudRequestDTO convertCloudResponseDTOToCloudRequestDTO(final CloudResponseDTO cloudResponseDTO) { - Assert.notNull(cloudResponseDTO, "cloudResponseDTO is null"); - Assert.notNull(cloudResponseDTO.getOperator(), "cloudResponseDTO.Operator is null"); - Assert.notNull(cloudResponseDTO.getName(), "cloudResponseDTO.Name is null"); - - final CloudRequestDTO cloudRequestDTO = new CloudRequestDTO(); - - cloudRequestDTO.setOperator(cloudResponseDTO.getOperator()); - cloudRequestDTO.setName(cloudResponseDTO.getName()); - cloudRequestDTO.setSecure(cloudResponseDTO.getSecure()); - cloudRequestDTO.setNeighbor(cloudResponseDTO.getNeighbor()); - cloudRequestDTO.setAuthenticationInfo(cloudResponseDTO.getAuthenticationInfo()); - - return cloudRequestDTO; - } - - //------------------------------------------------------------------------------------------------- - public static SubscriptionResponseDTO convertSubscriptionToSubscriptionResponseDTO(final Subscription subscription) { - Assert.notNull(subscription, "subscription is null"); - Assert.notNull(subscription.getSubscriberSystem(), "subscription.ConsumerSystem is null"); - Assert.notNull(subscription.getEventType(), "subscription.EventType is null"); - Assert.notNull(subscription.getNotifyUri(), "subscription.NotifyUri is null"); - Assert.notNull(subscription.getCreatedAt(), "subscription.CreatedAt is null"); - Assert.notNull(subscription.getUpdatedAt(), "subscription.UpdatedAt is null"); - - final String startDate = subscription.getStartDate() == null ? null : Utilities.convertZonedDateTimeToUTCString(subscription.getStartDate()); - final String endDate = subscription.getEndDate() == null ? null : Utilities.convertZonedDateTimeToUTCString(subscription.getEndDate()); - - final Set sources = collectPublishersFromSubscription(subscription.getPublisherConnections()); - - return new SubscriptionResponseDTO(subscription.getId(), convertEventTypeToEventTypeResponseDTO(subscription.getEventType()), - convertSystemToSystemResponseDTO(subscription.getSubscriberSystem()), Utilities.text2Map(subscription.getFilterMetaData()), subscription.getNotifyUri(), - subscription.isMatchMetaData(), startDate, endDate, sources, Utilities.convertZonedDateTimeToUTCString(subscription.getCreatedAt()), - Utilities.convertZonedDateTimeToUTCString(subscription.getUpdatedAt())); - } - - //------------------------------------------------------------------------------------------------- - public static SubscriptionResponseDTO convertSubscriptionToOnlyAuthorizedSourcesSubscriptionResponseDTO(final Subscription subscription) { - Assert.notNull(subscription, "subscription is null"); - Assert.notNull(subscription.getSubscriberSystem(), "subscription.ConsumerSystem is null"); - Assert.notNull(subscription.getEventType(), "subscription.EventType is null"); - Assert.notNull(subscription.getNotifyUri(), "subscription.NotifyUri is null"); - Assert.notNull(subscription.getCreatedAt(), "subscription.CreatedAt is null"); - Assert.notNull(subscription.getUpdatedAt(), "subscription.UpdatedAt is null"); - - final String startDate = subscription.getStartDate() == null ? null : Utilities.convertZonedDateTimeToUTCString(subscription.getStartDate()); - final String endDate = subscription.getEndDate() == null ? null : Utilities.convertZonedDateTimeToUTCString(subscription.getEndDate()); - - final Set sources = collectAuthorizedPublishersFromSubscription(subscription.getPublisherConnections()); - - return new SubscriptionResponseDTO(subscription.getId(), convertEventTypeToEventTypeResponseDTO(subscription.getEventType()), - convertSystemToSystemResponseDTO(subscription.getSubscriberSystem()), Utilities.text2Map(subscription.getFilterMetaData()), subscription.getNotifyUri(), - subscription.isMatchMetaData(), startDate, endDate, sources, Utilities.convertZonedDateTimeToUTCString(subscription.getCreatedAt()), - Utilities.convertZonedDateTimeToUTCString(subscription.getUpdatedAt())); - } - - //------------------------------------------------------------------------------------------------- - public static EventTypeResponseDTO convertEventTypeToEventTypeResponseDTO(final EventType eventType) { - Assert.notNull(eventType, "eventType is null"); - Assert.notNull(eventType.getEventTypeName(), "eventType.EvenTypeName is null"); - - return new EventTypeResponseDTO(eventType.getId(), eventType.getEventTypeName(), Utilities.convertZonedDateTimeToUTCString(eventType.getCreatedAt()), - Utilities.convertZonedDateTimeToUTCString(eventType.getUpdatedAt())); - } - - //------------------------------------------------------------------------------------------------- - public static EventDTO convertEventPublishRequestDTOToEventDTO(final EventPublishRequestDTO eventPublishRequestDTO) { - Assert.notNull(eventPublishRequestDTO, "eventPublishRequestDTO is null"); - Assert.notNull(eventPublishRequestDTO.getEventType(), "eventPublishRequestDTO.EvenType is null"); - Assert.notNull(eventPublishRequestDTO.getPayload(), "eventPublishRequestDTO.Payload is null"); - Assert.notNull(eventPublishRequestDTO.getTimeStamp(), "eventPublishRequestDTO.TimeStamp is null"); - - return new EventDTO(eventPublishRequestDTO.getEventType(), eventPublishRequestDTO.getMetaData(), eventPublishRequestDTO.getPayload(), eventPublishRequestDTO.getTimeStamp()); - } - - //------------------------------------------------------------------------------------------------- - public static SubscriptionListResponseDTO convertSubscriptionPageToSubscriptionListResponseDTO(final Page entries) { - Assert.notNull(entries, "SubscriptionPage is null" ); - - final List subscriptionEntries = new ArrayList<>(entries.getNumberOfElements()); - for (final Subscription entry : entries) { - subscriptionEntries.add(convertSubscriptionToSubscriptionResponseDTO(entry)); - } - - return new SubscriptionListResponseDTO(subscriptionEntries, entries.getTotalElements()); - } - - //------------------------------------------------------------------------------------------------- - public static RelayRequestDTO convertRelayResponseDTOToRelayRequestDTO(final RelayResponseDTO response) { - Assert.notNull(response, "Relay response is null."); - - return new RelayRequestDTO(response.getAddress(), response.getPort(), response.isSecure(), response.isExclusive(), response.getType().name()); - } - - //------------------------------------------------------------------------------------------------- - public static SystemResponseDTO convertForeignSystemToSystemResponseDTO(final ForeignSystem foreignSystem) { - Assert.notNull(foreignSystem, "ForeignSystem is null"); - - return new SystemResponseDTO(foreignSystem.getId(), foreignSystem.getSystemName(), foreignSystem.getAddress(), foreignSystem.getPort(), foreignSystem.getAuthenticationInfo(), - Utilities.convertZonedDateTimeToUTCString(foreignSystem.getCreatedAt()), Utilities.convertZonedDateTimeToUTCString(foreignSystem.getUpdatedAt())); - } - - //------------------------------------------------------------------------------------------------- - public static ChoreographerActionStepResponseDTO convertChoreographerActionStepToChoreographerActionStepResponseDTO(final ChoreographerActionStep actionStep) { - Assert.notNull(actionStep, "ChoreographerActionStep is null."); - - return new ChoreographerActionStepResponseDTO(actionStep.getId(), actionStep.getName(), - collectServiceDefinitionsFromChoreographerActionStep(actionStep.getActionStepServiceDefinitionConnections()), - collectChoreographerNextActionStepsFromChoreographerActionStep(actionStep.getNextActionSteps()), - Utilities.convertZonedDateTimeToUTCString(actionStep.getCreatedAt()), - Utilities.convertZonedDateTimeToUTCString(actionStep.getUpdatedAt())); - } - - //------------------------------------------------------------------------------------------------- - public static List collectChoreographerActionStepsFromChoreographerAction(final Set actionStepConnections) { - Assert.notNull(actionStepConnections, "ActionStepConnectionSet is null."); - - final List result = new ArrayList<>(actionStepConnections.size()); - for (final ChoreographerActionActionStepConnection conn : actionStepConnections) { - result.add(convertChoreographerActionStepToChoreographerActionStepResponseDTO(conn.getActionStepEntry())); - } - - result.sort(Comparator.comparing(ChoreographerActionStepResponseDTO::getId)); - return result; - } - - //------------------------------------------------------------------------------------------------- - public static String collectChoreographerNextActionNameFromChoreographerAction(final ChoreographerAction nextAction) { - if (nextAction != null) { - return nextAction.getActionName(); - } - - return null; - } - - //------------------------------------------------------------------------------------------------- - public static ChoreographerActionResponseDTO convertChoreographerActionToChoreographerActionResponseDTO(final ChoreographerAction actionEntry) { - Assert.notNull(actionEntry, "ChoreographerAction entry is null."); - - return new ChoreographerActionResponseDTO(actionEntry.getId(), actionEntry.getActionName(), - collectChoreographerNextActionNameFromChoreographerAction(actionEntry.getNextAction()), - collectChoreographerActionStepsFromChoreographerAction(actionEntry.getActionActionStepConnections()), - Utilities.convertZonedDateTimeToUTCString(actionEntry.getCreatedAt()), - Utilities.convertZonedDateTimeToUTCString(actionEntry.getUpdatedAt())); - } - - //------------------------------------------------------------------------------------------------- - public static List collectChoreographerActionsFromChoreographerActionPlan(final Set actionConnections) { - Assert.notNull(actionConnections, "ActionConnectionsSet is null."); - - final List result = new ArrayList<>(actionConnections.size()); - for (final ChoreographerActionPlanActionConnection conn : actionConnections) { - result.add(convertChoreographerActionToChoreographerActionResponseDTO(conn.getActionEntry())); - } - - result.sort(Comparator.comparing(ChoreographerActionResponseDTO::getId)); - return result; - } - - //------------------------------------------------------------------------------------------------- - public static ChoreographerActionPlanResponseDTO convertChoreographerActionPlanToChoreographerActionPlanResponseDTO(final ChoreographerActionPlan actionPlanEntry) { - Assert.notNull(actionPlanEntry, "ChoreographerActionPlan entry is null."); - - return new ChoreographerActionPlanResponseDTO(actionPlanEntry.getId(), actionPlanEntry.getActionPlanName(), - collectChoreographerActionsFromChoreographerActionPlan(actionPlanEntry.getActionPlanActionConnections()), - Utilities.convertZonedDateTimeToUTCString(actionPlanEntry.getCreatedAt()), - Utilities.convertZonedDateTimeToUTCString(actionPlanEntry.getUpdatedAt())); - } - - - //------------------------------------------------------------------------------------------------- - public static SystemRegistryResponseDTO convertSystemRegistryToSystemRegistryResponseDTO(final SystemRegistry entry) { - - Assert.notNull(entry, "SR entry is null."); - Assert.notNull(entry.getDevice(), "Related device is null."); - Assert.notNull(entry.getSystem(), "Related system is null."); - - final SystemResponseDTO systemResponseDTO = convertSystemToSystemResponseDTO(entry.getSystem()); - final DeviceResponseDTO deviceResponseDTO = convertDeviceToDeviceResponseDTO(entry.getDevice()); - - final SystemRegistryResponseDTO dto = new SystemRegistryResponseDTO(); - dto.setId(entry.getId()); - dto.setProvider(deviceResponseDTO); - dto.setSystem(systemResponseDTO); - dto.setEndOfValidity(Utilities.convertZonedDateTimeToUTCString(entry.getEndOfValidity())); - dto.setMetadata(Utilities.text2Map(entry.getMetadata())); - dto.setVersion(entry.getVersion()); - dto.setCreatedAt(Utilities.convertZonedDateTimeToUTCString(entry.getCreatedAt())); - dto.setUpdatedAt(Utilities.convertZonedDateTimeToUTCString(entry.getUpdatedAt())); - - return dto; - } - - //------------------------------------------------------------------------------------------------- - public static SystemRegistryListResponseDTO convertSystemRegistryListToSystemRegistryListResponseDTO(final Iterable page) { + //================================================================================================= + // methods + + //------------------------------------------------------------------------------------------------- + private DTOConverter() { + throw new UnsupportedOperationException(); + } + + //------------------------------------------------------------------------------------------------- + public static DeviceResponseDTO convertDeviceToDeviceResponseDTO(final Device device) { + Assert.notNull(device, "Device is null"); + return new DeviceResponseDTO(device.getId(), device.getDeviceName(), device.getAddress(), device.getMacAddress(), device.getAuthenticationInfo(), + Utilities.convertZonedDateTimeToUTCString(device.getCreatedAt()), + Utilities.convertZonedDateTimeToUTCString(device.getUpdatedAt())); + } + + //------------------------------------------------------------------------------------------------- + public static DeviceListResponseDTO convertDeviceEntryListToDeviceListResponseDTO(final Page deviceEntryList) { + Assert.notNull(deviceEntryList, "deviceEntryList is null"); + + final long count = deviceEntryList.getTotalElements(); + final DeviceListResponseDTO deviceListResponseDTO = new DeviceListResponseDTO(); + deviceListResponseDTO.setCount(count); + deviceListResponseDTO.setData(deviceEntryListToDeviceResponseDTOList(deviceEntryList.getContent())); + + return deviceListResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + public static SystemResponseDTO convertSystemToSystemResponseDTO(final System system) { + Assert.notNull(system, "System is null"); + + return new SystemResponseDTO(system.getId(), system.getSystemName(), system.getAddress(), system.getPort(), system.getAuthenticationInfo(), + Utilities.convertZonedDateTimeToUTCString(system.getCreatedAt()), + Utilities.convertZonedDateTimeToUTCString(system.getUpdatedAt())); + } + + //------------------------------------------------------------------------------------------------- + public static SystemListResponseDTO convertSystemEntryListToSystemListResponseDTO(final Page systemEntryList) { + Assert.notNull(systemEntryList, "systemEntryList is null"); + + final long count = systemEntryList.getTotalElements(); + final SystemListResponseDTO systemListResponseDTO = new SystemListResponseDTO(); + systemListResponseDTO.setCount(count); + systemListResponseDTO.setData(systemEntryListToSystemResponseDTOList(systemEntryList.getContent())); + + return systemListResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + public static ServiceDefinitionResponseDTO convertServiceDefinitionToServiceDefinitionResponseDTO(final ServiceDefinition serviceDefinition) { + Assert.notNull(serviceDefinition, "ServiceDefinition is null"); + + return new ServiceDefinitionResponseDTO(serviceDefinition.getId(), serviceDefinition.getServiceDefinition(), + Utilities.convertZonedDateTimeToUTCString(serviceDefinition.getCreatedAt()), + Utilities.convertZonedDateTimeToUTCString(serviceDefinition.getUpdatedAt())); + } + + //------------------------------------------------------------------------------------------------- + public static ServiceDefinitionsListResponseDTO convertServiceDefinitionsListToServiceDefinitionListResponseDTO( + final Page serviceDefinitions) { + Assert.notNull(serviceDefinitions, "List of ServiceDefinition is null"); + + final List serviceDefinitionDTOs = new ArrayList<>(serviceDefinitions.getNumberOfElements()); + for (final ServiceDefinition definition : serviceDefinitions) { + serviceDefinitionDTOs.add(convertServiceDefinitionToServiceDefinitionResponseDTO(definition)); + } + + return new ServiceDefinitionsListResponseDTO(serviceDefinitionDTOs, serviceDefinitions.getTotalElements()); + } + + //------------------------------------------------------------------------------------------------- + public static ServiceRegistryResponseDTO convertServiceRegistryToServiceRegistryResponseDTO(final ServiceRegistry entry) { + Assert.notNull(entry, "SR entry is null."); + Assert.notNull(entry.getServiceDefinition(), "Related service definition is null."); + Assert.notNull(entry.getSystem(), "Related system is null."); + Assert.notNull(entry.getInterfaceConnections(), "Related interface connection set is null."); + Assert.isTrue(!entry.getInterfaceConnections().isEmpty(), "Related interface connection set is empty."); + + final ServiceDefinitionResponseDTO serviceDefinitionDTO = convertServiceDefinitionToServiceDefinitionResponseDTO(entry.getServiceDefinition()); + final SystemResponseDTO systemDTO = convertSystemToSystemResponseDTO(entry.getSystem()); + + final ServiceRegistryResponseDTO dto = new ServiceRegistryResponseDTO(); + dto.setId(entry.getId()); + dto.setServiceDefinition(serviceDefinitionDTO); + dto.setProvider(systemDTO); + dto.setServiceUri(entry.getServiceUri()); + dto.setEndOfValidity(Utilities.convertZonedDateTimeToUTCString(entry.getEndOfValidity())); + dto.setSecure(entry.getSecure()); + dto.setMetadata(Utilities.text2Map(entry.getMetadata())); + dto.setVersion(entry.getVersion()); + dto.setInterfaces(collectInterfacesFromServiceRegistry(entry.getInterfaceConnections())); + dto.setCreatedAt(Utilities.convertZonedDateTimeToUTCString(entry.getCreatedAt())); + dto.setUpdatedAt(Utilities.convertZonedDateTimeToUTCString(entry.getUpdatedAt())); + + return dto; + } + + //------------------------------------------------------------------------------------------------- + public static ServiceRegistryListResponseDTO convertServiceRegistryListToServiceRegistryListResponseDTO( + final Page serviceRegistryEntries) { + Assert.notNull(serviceRegistryEntries, "List of serviceRegistryEntries is null"); + + final List serviceRegistryEntryDTOs = new ArrayList<>(serviceRegistryEntries.getNumberOfElements()); + for (final ServiceRegistry srEntry : serviceRegistryEntries) { + serviceRegistryEntryDTOs.add(convertServiceRegistryToServiceRegistryResponseDTO(srEntry)); + } + + return new ServiceRegistryListResponseDTO(serviceRegistryEntryDTOs, serviceRegistryEntries.getTotalElements()); + } + + //------------------------------------------------------------------------------------------------- + @SuppressWarnings("squid:S3776") + public static ServiceRegistryGroupedResponseDTO convertServiceRegistryDataToServiceRegistryGroupedResponseDTO( + final Iterable serviceDefinitionEntries, + final Iterable systemEntries, + final Iterable interfaceEntries, + final Iterable serviceRegistryEntries) { + Assert.notNull(serviceDefinitionEntries, "List of serviceDefinitionEntries is null"); + Assert.notNull(systemEntries, "List of systemEntries is null"); + Assert.notNull(interfaceEntries, "List of interfaceEntries is null"); + Assert.notNull(serviceRegistryEntries, "List of serviceRegistryEntries is null"); + + final Map servicesBySystemId = new HashMap<>(); + final Map servicesByServiceDefinition = new HashMap<>(); + final List servicesForAutoComplete = new ArrayList<>(); + final List systemsForAutoComplete = new ArrayList<>(); + final List interfacesForAutoComplete = new ArrayList<>(); + + for (final ServiceRegistry srEntry : serviceRegistryEntries) { + final long systemId = srEntry.getSystem().getId(); + final String systemName = srEntry.getSystem().getSystemName(); + final String systemAddress = srEntry.getSystem().getAddress(); + final int systemPort = srEntry.getSystem().getPort(); + final long serviceDefinitionId = srEntry.getServiceDefinition().getId(); + final String serviceDefinition = srEntry.getServiceDefinition().getServiceDefinition(); + + // Creating ServicesGroupedBySystemsResponseDTO + if (servicesBySystemId.containsKey(systemId)) { + servicesBySystemId.get(systemId).getServices().add(convertServiceRegistryToServiceRegistryResponseDTO(srEntry)); + } else { + final ServicesGroupedBySystemsResponseDTO dto = new ServicesGroupedBySystemsResponseDTO(systemId, systemName, systemAddress, systemPort, + new ArrayList<>()); + dto.getServices().add(convertServiceRegistryToServiceRegistryResponseDTO(srEntry)); + servicesBySystemId.put(systemId, dto); + } + + // Creating ServicesGroupedByServiceDefinitionResponseDTO + if (servicesByServiceDefinition.containsKey(serviceDefinitionId)) { + servicesByServiceDefinition.get(serviceDefinitionId).getProviderServices().add(convertServiceRegistryToServiceRegistryResponseDTO(srEntry)); + } else { + final ServicesGroupedByServiceDefinitionResponseDTO dto = new ServicesGroupedByServiceDefinitionResponseDTO(serviceDefinitionId, + serviceDefinition, + new ArrayList<>()); + dto.getProviderServices().add(convertServiceRegistryToServiceRegistryResponseDTO(srEntry)); + servicesByServiceDefinition.put(serviceDefinitionId, dto); + } + } + + // Creating AutoCompleteDataResponseDTO + for (final ServiceDefinition serviceDefinition : serviceDefinitionEntries) { + servicesForAutoComplete.add(new IdValueDTO(serviceDefinition.getId(), serviceDefinition.getServiceDefinition())); + } + for (final System system : systemEntries) { + systemsForAutoComplete.add(DTOConverter.convertSystemToSystemResponseDTO(system)); + } + for (final ServiceInterface serviceInterface : interfaceEntries) { + interfacesForAutoComplete.add(new IdValueDTO(serviceInterface.getId(), serviceInterface.getInterfaceName())); + } + + final List servicesGroupedBySystemsResponseDTOList = new ArrayList<>(); + servicesGroupedBySystemsResponseDTOList.addAll(servicesBySystemId.values()); + final List servicesGroupedByServiceDefinitionResponseDTOList = new ArrayList<>(); + servicesGroupedByServiceDefinitionResponseDTOList.addAll(servicesByServiceDefinition.values()); + final AutoCompleteDataResponseDTO autoCompleteDataResponseDTO = new AutoCompleteDataResponseDTO(servicesForAutoComplete, systemsForAutoComplete, + interfacesForAutoComplete); + + return new ServiceRegistryGroupedResponseDTO(servicesGroupedBySystemsResponseDTOList, servicesGroupedByServiceDefinitionResponseDTOList, + autoCompleteDataResponseDTO); + } + + //------------------------------------------------------------------------------------------------- + public static ServiceInterfaceResponseDTO convertServiceInterfaceToServiceInterfaceResponseDTO(final ServiceInterface intf) { + Assert.notNull(intf, "Interface entry is null."); + + return new ServiceInterfaceResponseDTO(intf.getId(), intf.getInterfaceName(), Utilities.convertZonedDateTimeToUTCString(intf.getCreatedAt()), + Utilities.convertZonedDateTimeToUTCString(intf.getUpdatedAt())); + } + + //------------------------------------------------------------------------------------------------- + public static ServiceQueryResultDTO convertListOfServiceRegistryEntriesToServiceQueryResultDTO(final List entries, + final int unfilteredHits) { + final ServiceQueryResultDTO result = new ServiceQueryResultDTO(); + + if (entries != null) { + Assert.isTrue(unfilteredHits >= entries.size(), "Invalid value of unfiltered hits: " + unfilteredHits); + result.setUnfilteredHits(unfilteredHits); + for (final ServiceRegistry srEntry : entries) { + result.getServiceQueryData().add(convertServiceRegistryToServiceRegistryResponseDTO(srEntry)); + } + } + + return result; + } + + //------------------------------------------------------------------------------------------------- + public static SystemQueryResultDTO convertListOfSystemRegistryEntriesToSystemQueryResultDTO(final List entries, final int unfilteredHits) { + final List results = new ArrayList<>(); + + if (entries != null) { + Assert.isTrue(unfilteredHits >= entries.size(), "Invalid value of unfiltered hits: " + unfilteredHits); + for (final SystemRegistry srEntry : entries) { + results.add(convertSystemRegistryToSystemRegistryResponseDTO(srEntry)); + } + } + + return new SystemQueryResultDTO(results, unfilteredHits); + } + + //------------------------------------------------------------------------------------------------- + public static DeviceQueryResultDTO convertListOfDeviceRegistryEntriesToDeviceQueryResultDTO(final List entries, final int unfilteredHits) { + final List results = new ArrayList<>(); + + if (entries != null) { + Assert.isTrue(unfilteredHits >= entries.size(), "Invalid value of unfiltered hits: " + unfilteredHits); + for (final DeviceRegistry srEntry : entries) { + results.add(convertDeviceRegistryToDeviceRegistryResponseDTO(srEntry)); + } + } + + return new DeviceQueryResultDTO(results, unfilteredHits); + } + + //------------------------------------------------------------------------------------------------- + public static AuthorizationIntraCloudResponseDTO convertAuthorizationIntraCloudToAuthorizationIntraCloudResponseDTO(final AuthorizationIntraCloud entry) { + Assert.notNull(entry, "AuthorizationIntraCloud is null"); + Assert.notNull(entry.getConsumerSystem(), "Consumer is null"); + Assert.notNull(entry.getProviderSystem(), "Provider is null"); + Assert.notNull(entry.getServiceDefinition(), "ServiceDefintion is null"); + Assert.notNull(entry.getInterfaceConnections(), "InterfaceConnections is null"); + + return new AuthorizationIntraCloudResponseDTO(entry.getId(), convertSystemToSystemResponseDTO(entry.getConsumerSystem()), + convertSystemToSystemResponseDTO(entry.getProviderSystem()), + convertServiceDefinitionToServiceDefinitionResponseDTO(entry.getServiceDefinition()), + collectInterfacesFromAuthorizationIntraCloud(entry.getInterfaceConnections()), + Utilities.convertZonedDateTimeToUTCString(entry.getCreatedAt()), + Utilities.convertZonedDateTimeToUTCString(entry.getUpdatedAt())); + } + + //------------------------------------------------------------------------------------------------- + public static AuthorizationIntraCloudListResponseDTO convertAuthorizationIntraCloudListToAuthorizationIntraCloudListResponseDTO( + final Page entries) { + Assert.notNull(entries, "AuthorizationIntraCloudList is null"); + + final List authorizationIntraCloudEntries = new ArrayList<>(entries.getNumberOfElements()); + for (final AuthorizationIntraCloud entry : entries) { + authorizationIntraCloudEntries.add(convertAuthorizationIntraCloudToAuthorizationIntraCloudResponseDTO(entry)); + } + + return new AuthorizationIntraCloudListResponseDTO(authorizationIntraCloudEntries, entries.getTotalElements()); + } + + //------------------------------------------------------------------------------------------------- + public static TokenGenerationResponseDTO convertTokenMapToTokenGenerationResponseDTO(final Map> tokenMap) { + Assert.notNull(tokenMap, "Token map is null."); + + final TokenGenerationResponseDTO result = new TokenGenerationResponseDTO(); + for (final Entry> entry : tokenMap.entrySet()) { + result.getTokenData().add(new TokenDataDTO(entry.getKey(), entry.getValue())); + } + + return result; + } + + //------------------------------------------------------------------------------------------------- + public static CloudListResponseDTO convertCloudToCloudResponseDTO(final Page entries) { + Assert.notNull(entries, "Cloud list is null"); + + final List cloudEntries = new ArrayList<>(entries.getNumberOfElements()); + for (final Cloud entry : entries) { + cloudEntries.add(convertCloudToCloudResponseDTO(entry)); + } + + return new CloudListResponseDTO(cloudEntries, entries.getTotalElements()); + } + + //------------------------------------------------------------------------------------------------- + public static CloudResponseDTO convertCloudToCloudResponseDTO(final Cloud entity) { + Assert.notNull(entity, "Cloud is null"); + Assert.notNull(entity.getOperator(), "Cloud.operator is null"); + Assert.notNull(entity.getName(), "Cloud.name is null"); + Assert.notNull(entity.getCreatedAt(), "Cloud.createdAt is null"); + Assert.notNull(entity.getUpdatedAt(), "Cloud.cpdatedAt is null"); + + return new CloudResponseDTO(entity.getId(), entity.getOperator(), entity.getName(), entity.getSecure(), entity.getNeighbor(), entity.getOwnCloud(), + entity.getAuthenticationInfo(), + Utilities.convertZonedDateTimeToUTCString(entity.getCreatedAt()), + Utilities.convertZonedDateTimeToUTCString(entity.getUpdatedAt())); + } + + //------------------------------------------------------------------------------------------------- + public static RelayListResponseDTO convertRelayListToRelayResponseListDTO(final Page entries) { + Assert.notNull(entries, "Relay list is null"); + + final List relayEntries = new ArrayList<>(entries.getNumberOfElements()); + for (final Relay entry : entries) { + relayEntries.add(convertRelayToRelayResponseDTO(entry)); + } + + return new RelayListResponseDTO(relayEntries, entries.getTotalElements()); + } + + //------------------------------------------------------------------------------------------------- + public static RelayResponseDTO convertRelayToRelayResponseDTO(final Relay entry) { + Assert.notNull(entry, "Relay is null"); + Assert.notNull(entry.getAddress(), "Relay.address is null"); + Assert.notNull(entry.getType(), "Relay.type is null"); + Assert.notNull(entry.getCreatedAt(), "Relay.createdAt is null"); + Assert.notNull(entry.getCreatedAt(), "Relay.updatedAt is null"); + + return new RelayResponseDTO(entry.getId(), entry.getAddress(), entry.getPort(), entry.getSecure(), entry.getExclusive(), entry.getType(), + Utilities.convertZonedDateTimeToUTCString(entry.getCreatedAt()), + Utilities.convertZonedDateTimeToUTCString(entry.getUpdatedAt())); + } + + //------------------------------------------------------------------------------------------------- + public static List convertRelayListToRelayRequestDTOList(final List relays) { + Assert.notNull(relays, "Relay list is null."); + + final List result = new ArrayList<>(relays.size()); + for (final Relay relay : relays) { + result.add(convertRelayToRelayRequestDTO(relay)); + } + + return result; + } + + //------------------------------------------------------------------------------------------------- + public static RelayRequestDTO convertRelayToRelayRequestDTO(final Relay relay) { + Assert.notNull(relay, "relay is null."); + + return new RelayRequestDTO(relay.getAddress(), relay.getPort(), relay.getSecure(), relay.getExclusive(), relay.getType().name()); + } + + //------------------------------------------------------------------------------------------------- + public static CloudWithRelaysListResponseDTO convertCloudToCloudWithRelaysListResponseDTO(final Page entries) { + Assert.notNull(entries, "Cloud list is null"); + + final List cloudWithRelaysResponseDTOList = new ArrayList<>(entries.getNumberOfElements()); + for (final Cloud cloud : entries) { + Assert.notNull(cloud.getGatekeeperRelays(), "CloudGatekeeperRelay set is null"); + Assert.notNull(cloud.getGatewayRelays(), "CloudGatewayRelay set is null"); + + cloudWithRelaysResponseDTOList.add(convertCloudToCloudWithRelaysResponseDTO(cloud)); + } + + return new CloudWithRelaysListResponseDTO(cloudWithRelaysResponseDTOList, entries.getTotalElements()); + } + + //------------------------------------------------------------------------------------------------- + public static CloudWithRelaysResponseDTO convertCloudToCloudWithRelaysResponseDTO(final Cloud cloud) { + Assert.notNull(cloud, "Cloud is null"); + Assert.notNull(cloud.getGatekeeperRelays(), "Gatekeeper relays set is null"); + Assert.notNull(cloud.getGatewayRelays(), "Gateway relays set is null"); + + final CloudResponseDTO cloudResponseDTO = convertCloudToCloudResponseDTO(cloud); + + final Set gatekeeperRelays = new HashSet<>(); + for (final CloudGatekeeperRelay conn : cloud.getGatekeeperRelays()) { + gatekeeperRelays.add(conn.getRelay()); + } + + final Set gatewayRelays = new HashSet<>(); + for (final CloudGatewayRelay conn : cloud.getGatewayRelays()) { + gatewayRelays.add(conn.getRelay()); + } + + final List gatekeeperRelayListDTO = new ArrayList<>(gatekeeperRelays.size()); + for (final Relay gatekeeperRelay : gatekeeperRelays) { + gatekeeperRelayListDTO.add(convertRelayToRelayResponseDTO(gatekeeperRelay)); + } + + final List gatewayRelayListDTO = new ArrayList<>(gatewayRelays.size()); + for (final Relay gatewayRelay : gatewayRelays) { + gatewayRelayListDTO.add(convertRelayToRelayResponseDTO(gatewayRelay)); + } + + return new CloudWithRelaysResponseDTO(cloudResponseDTO.getId(), cloudResponseDTO.getOperator(), cloudResponseDTO.getName(), + cloudResponseDTO.getSecure(), + cloudResponseDTO.getNeighbor(), cloudResponseDTO.getOwnCloud(), cloudResponseDTO.getAuthenticationInfo(), + cloudResponseDTO.getCreatedAt(), cloudResponseDTO.getUpdatedAt(), gatekeeperRelayListDTO, gatewayRelayListDTO); + } + + //------------------------------------------------------------------------------------------------- + public static AuthorizationInterCloudListResponseDTO convertAuthorizationInterCloudListToAuthorizationInterCloudListResponseDTO( + final Page entries) { + Assert.notNull(entries, "AuthorizationInterCloudList is null"); + + final List authorizationInterCloudEntries = new ArrayList<>(entries.getNumberOfElements()); + for (final AuthorizationInterCloud entry : entries) { + authorizationInterCloudEntries.add(convertAuthorizationInterCloudToAuthorizationInterCloudResponseDTO(entry)); + } + + return new AuthorizationInterCloudListResponseDTO(authorizationInterCloudEntries, entries.getTotalElements()); + } + + //------------------------------------------------------------------------------------------------- + public static AuthorizationInterCloudResponseDTO convertAuthorizationInterCloudToAuthorizationInterCloudResponseDTO(final AuthorizationInterCloud entity) { + Assert.notNull(entity, "AuthorizationInterCloud is null"); + Assert.notNull(entity.getCloud(), "AuthorizationInterCloud.Cloud is null"); + Assert.notNull(entity.getProvider(), "AuthorizationInterCloud.Provider is null"); + Assert.notNull(entity.getServiceDefinition(), "AuthorizationInterCloud.ServiceDefinition is null"); + Assert.notNull(entity.getInterfaceConnections(), "AuthorizationInterCloud.InterfaceConnections is null"); + Assert.notNull(entity.getCreatedAt(), "AuthorizationInterCloud.CreatedAt is null"); + Assert.notNull(entity.getUpdatedAt(), "AuthorizationInterCloud.UpdatedAt is null"); + + return new AuthorizationInterCloudResponseDTO(entity.getId(), convertCloudToCloudResponseDTO(entity.getCloud()), + convertSystemToSystemResponseDTO(entity.getProvider()), + convertServiceDefinitionToServiceDefinitionResponseDTO(entity.getServiceDefinition()), + collectInterfacesFromAuthorizationInterCloud(entity.getInterfaceConnections()), + Utilities.convertZonedDateTimeToUTCString(entity.getCreatedAt()), + Utilities.convertZonedDateTimeToUTCString(entity.getUpdatedAt())); + + } + + //------------------------------------------------------------------------------------------------- + public static OrchestratorStoreResponseDTO convertOrchestratorStoreToOrchestratorStoreResponseDTO(final OrchestratorStore entity, + final SystemResponseDTO providerSystem, + final CloudResponseDTO providerCloud) { + Assert.notNull(entity, "OrchestratorStore is null"); + Assert.notNull(providerSystem, "OrchestratorStore.ProviderSystem is null"); + Assert.notNull(entity.getCreatedAt(), "OrchestratorStore.CreatedAt is null"); + Assert.notNull(entity.getUpdatedAt(), "OrchestratorStore.UpdatedAt is null"); + + return new OrchestratorStoreResponseDTO(entity.getId(), convertServiceDefinitionToServiceDefinitionResponseDTO(entity.getServiceDefinition()), + convertSystemToSystemResponseDTO(entity.getConsumerSystem()), entity.isForeign(), providerSystem, providerCloud, + convertServiceInterfaceToServiceInterfaceResponseDTO(entity.getServiceInterface()), entity.getPriority(), + Utilities.text2Map(entity.getAttribute()), + Utilities.convertZonedDateTimeToUTCString(entity.getCreatedAt()), + Utilities.convertZonedDateTimeToUTCString(entity.getUpdatedAt())); + } + + //------------------------------------------------------------------------------------------------- + public static OrchestratorStoreListResponseDTO convertOrchestratorStoreEntryListToOrchestratorStoreListResponseDTO( + final List entries) { + Assert.notNull(entries, "OrchestratorStoreList is null"); + + return new OrchestratorStoreListResponseDTO(entries, entries.size()); + } + + //------------------------------------------------------------------------------------------------- + public static OrchestratorStoreListResponseDTO convertOrchestratorStoreEntryListToOrchestratorStoreListResponseDTO( + final List entries, final long totalElements) { + Assert.notNull(entries, "OrchestratorStoreList is null"); + + return new OrchestratorStoreListResponseDTO(entries, totalElements); + } + + //------------------------------------------------------------------------------------------------- + public static SystemRequestDTO convertSystemToSystemRequestDTO(final System system) { + Assert.notNull(system, "System is null"); + + final SystemRequestDTO systemRequestDTO = new SystemRequestDTO(); + systemRequestDTO.setAddress(system.getAddress()); + systemRequestDTO.setSystemName(system.getSystemName()); + systemRequestDTO.setPort(system.getPort()); + systemRequestDTO.setAuthenticationInfo(systemRequestDTO.getAuthenticationInfo()); + + return systemRequestDTO; + } + + //------------------------------------------------------------------------------------------------- + public static SystemRequestDTO convertSystemResponseDTOToSystemRequestDTO(final SystemResponseDTO response) { + Assert.notNull(response, "response is null"); + + final SystemRequestDTO result = new SystemRequestDTO(); + result.setSystemName(response.getSystemName()); + result.setAddress(response.getAddress()); + result.setPort(response.getPort()); + result.setAuthenticationInfo(response.getAuthenticationInfo()); + + return result; + } + + //------------------------------------------------------------------------------------------------- + public static PreferredProviderDataDTO convertForeignOrchestratorStoreResponseDTOToPreferredProviderDataDTO( + final OrchestratorStoreResponseDTO orchestratorStoreResponseDTO) { + Assert.notNull(orchestratorStoreResponseDTO, "orchestratorStoreResponseDTO is null"); + Assert.isTrue(orchestratorStoreResponseDTO.getForeign(), "orchestratorStoreResponseDTO is not foreign"); + Assert.notNull(orchestratorStoreResponseDTO.getProviderSystem(), "orchestratorStoreResponseDTO.ProviderSystem is null"); + Assert.notNull(orchestratorStoreResponseDTO.getProviderCloud(), "orchestratorStoreResponseDTO.ProviderCloud is null"); + + final PreferredProviderDataDTO preferredProviderDataDTO = new PreferredProviderDataDTO(); + + final SystemRequestDTO providerSystemRequestDTO = DTOConverter + .convertSystemResponseDTOToSystemRequestDTO(orchestratorStoreResponseDTO.getProviderSystem()); + preferredProviderDataDTO.setProviderSystem(providerSystemRequestDTO); + + final CloudRequestDTO cloudRequestDTO = convertCloudResponseDTOToCloudRequestDTO(orchestratorStoreResponseDTO.getProviderCloud()); + preferredProviderDataDTO.setProviderCloud(cloudRequestDTO); + + return preferredProviderDataDTO; + } + + //------------------------------------------------------------------------------------------------- + public static CloudRequestDTO convertCloudResponseDTOToCloudRequestDTO(final CloudResponseDTO cloudResponseDTO) { + Assert.notNull(cloudResponseDTO, "cloudResponseDTO is null"); + Assert.notNull(cloudResponseDTO.getOperator(), "cloudResponseDTO.Operator is null"); + Assert.notNull(cloudResponseDTO.getName(), "cloudResponseDTO.Name is null"); + + final CloudRequestDTO cloudRequestDTO = new CloudRequestDTO(); + + cloudRequestDTO.setOperator(cloudResponseDTO.getOperator()); + cloudRequestDTO.setName(cloudResponseDTO.getName()); + cloudRequestDTO.setSecure(cloudResponseDTO.getSecure()); + cloudRequestDTO.setNeighbor(cloudResponseDTO.getNeighbor()); + cloudRequestDTO.setAuthenticationInfo(cloudResponseDTO.getAuthenticationInfo()); + + return cloudRequestDTO; + } + + //------------------------------------------------------------------------------------------------- + public static SubscriptionResponseDTO convertSubscriptionToSubscriptionResponseDTO(final Subscription subscription) { + Assert.notNull(subscription, "subscription is null"); + Assert.notNull(subscription.getSubscriberSystem(), "subscription.ConsumerSystem is null"); + Assert.notNull(subscription.getEventType(), "subscription.EventType is null"); + Assert.notNull(subscription.getNotifyUri(), "subscription.NotifyUri is null"); + Assert.notNull(subscription.getCreatedAt(), "subscription.CreatedAt is null"); + Assert.notNull(subscription.getUpdatedAt(), "subscription.UpdatedAt is null"); + + final String startDate = subscription.getStartDate() == null ? null : Utilities.convertZonedDateTimeToUTCString(subscription.getStartDate()); + final String endDate = subscription.getEndDate() == null ? null : Utilities.convertZonedDateTimeToUTCString(subscription.getEndDate()); + + final Set sources = collectPublishersFromSubscription(subscription.getPublisherConnections()); + + return new SubscriptionResponseDTO(subscription.getId(), convertEventTypeToEventTypeResponseDTO(subscription.getEventType()), + convertSystemToSystemResponseDTO(subscription.getSubscriberSystem()), + Utilities.text2Map(subscription.getFilterMetaData()), subscription.getNotifyUri(), + subscription.isMatchMetaData(), startDate, endDate, sources, + Utilities.convertZonedDateTimeToUTCString(subscription.getCreatedAt()), + Utilities.convertZonedDateTimeToUTCString(subscription.getUpdatedAt())); + } + + //------------------------------------------------------------------------------------------------- + public static SubscriptionResponseDTO convertSubscriptionToOnlyAuthorizedSourcesSubscriptionResponseDTO(final Subscription subscription) { + Assert.notNull(subscription, "subscription is null"); + Assert.notNull(subscription.getSubscriberSystem(), "subscription.ConsumerSystem is null"); + Assert.notNull(subscription.getEventType(), "subscription.EventType is null"); + Assert.notNull(subscription.getNotifyUri(), "subscription.NotifyUri is null"); + Assert.notNull(subscription.getCreatedAt(), "subscription.CreatedAt is null"); + Assert.notNull(subscription.getUpdatedAt(), "subscription.UpdatedAt is null"); + + final String startDate = subscription.getStartDate() == null ? null : Utilities.convertZonedDateTimeToUTCString(subscription.getStartDate()); + final String endDate = subscription.getEndDate() == null ? null : Utilities.convertZonedDateTimeToUTCString(subscription.getEndDate()); + + final Set sources = collectAuthorizedPublishersFromSubscription(subscription.getPublisherConnections()); + + return new SubscriptionResponseDTO(subscription.getId(), convertEventTypeToEventTypeResponseDTO(subscription.getEventType()), + convertSystemToSystemResponseDTO(subscription.getSubscriberSystem()), + Utilities.text2Map(subscription.getFilterMetaData()), subscription.getNotifyUri(), + subscription.isMatchMetaData(), startDate, endDate, sources, + Utilities.convertZonedDateTimeToUTCString(subscription.getCreatedAt()), + Utilities.convertZonedDateTimeToUTCString(subscription.getUpdatedAt())); + } + + //------------------------------------------------------------------------------------------------- + public static EventTypeResponseDTO convertEventTypeToEventTypeResponseDTO(final EventType eventType) { + Assert.notNull(eventType, "eventType is null"); + Assert.notNull(eventType.getEventTypeName(), "eventType.EvenTypeName is null"); + + return new EventTypeResponseDTO(eventType.getId(), eventType.getEventTypeName(), Utilities.convertZonedDateTimeToUTCString(eventType.getCreatedAt()), + Utilities.convertZonedDateTimeToUTCString(eventType.getUpdatedAt())); + } + + //------------------------------------------------------------------------------------------------- + public static EventDTO convertEventPublishRequestDTOToEventDTO(final EventPublishRequestDTO eventPublishRequestDTO) { + Assert.notNull(eventPublishRequestDTO, "eventPublishRequestDTO is null"); + Assert.notNull(eventPublishRequestDTO.getEventType(), "eventPublishRequestDTO.EvenType is null"); + Assert.notNull(eventPublishRequestDTO.getPayload(), "eventPublishRequestDTO.Payload is null"); + Assert.notNull(eventPublishRequestDTO.getTimeStamp(), "eventPublishRequestDTO.TimeStamp is null"); + + return new EventDTO(eventPublishRequestDTO.getEventType(), eventPublishRequestDTO.getMetaData(), eventPublishRequestDTO.getPayload(), + eventPublishRequestDTO.getTimeStamp()); + } + + //------------------------------------------------------------------------------------------------- + public static SubscriptionListResponseDTO convertSubscriptionPageToSubscriptionListResponseDTO(final Page entries) { + Assert.notNull(entries, "SubscriptionPage is null"); + + final List subscriptionEntries = new ArrayList<>(entries.getNumberOfElements()); + for (final Subscription entry : entries) { + subscriptionEntries.add(convertSubscriptionToSubscriptionResponseDTO(entry)); + } + + return new SubscriptionListResponseDTO(subscriptionEntries, entries.getTotalElements()); + } + + //------------------------------------------------------------------------------------------------- + public static RelayRequestDTO convertRelayResponseDTOToRelayRequestDTO(final RelayResponseDTO response) { + Assert.notNull(response, "Relay response is null."); + + return new RelayRequestDTO(response.getAddress(), response.getPort(), response.isSecure(), response.isExclusive(), response.getType().name()); + } + + //------------------------------------------------------------------------------------------------- + public static SystemResponseDTO convertForeignSystemToSystemResponseDTO(final ForeignSystem foreignSystem) { + Assert.notNull(foreignSystem, "ForeignSystem is null"); + + return new SystemResponseDTO(foreignSystem.getId(), foreignSystem.getSystemName(), foreignSystem.getAddress(), foreignSystem.getPort(), + foreignSystem.getAuthenticationInfo(), + Utilities.convertZonedDateTimeToUTCString(foreignSystem.getCreatedAt()), + Utilities.convertZonedDateTimeToUTCString(foreignSystem.getUpdatedAt())); + } + + //------------------------------------------------------------------------------------------------- + public static ChoreographerActionStepResponseDTO convertChoreographerActionStepToChoreographerActionStepResponseDTO( + final ChoreographerActionStep actionStep) { + Assert.notNull(actionStep, "ChoreographerActionStep is null."); + + return new ChoreographerActionStepResponseDTO(actionStep.getId(), actionStep.getName(), + collectServiceDefinitionsFromChoreographerActionStep( + actionStep.getActionStepServiceDefinitionConnections()), + collectChoreographerNextActionStepsFromChoreographerActionStep(actionStep.getNextActionSteps()), + Utilities.convertZonedDateTimeToUTCString(actionStep.getCreatedAt()), + Utilities.convertZonedDateTimeToUTCString(actionStep.getUpdatedAt())); + } + + //------------------------------------------------------------------------------------------------- + public static List collectChoreographerActionStepsFromChoreographerAction( + final Set actionStepConnections) { + Assert.notNull(actionStepConnections, "ActionStepConnectionSet is null."); + + final List result = new ArrayList<>(actionStepConnections.size()); + for (final ChoreographerActionActionStepConnection conn : actionStepConnections) { + result.add(convertChoreographerActionStepToChoreographerActionStepResponseDTO(conn.getActionStepEntry())); + } + + result.sort(Comparator.comparing(ChoreographerActionStepResponseDTO::getId)); + return result; + } + + //------------------------------------------------------------------------------------------------- + public static String collectChoreographerNextActionNameFromChoreographerAction(final ChoreographerAction nextAction) { + if (nextAction != null) { + return nextAction.getActionName(); + } + + return null; + } + + //------------------------------------------------------------------------------------------------- + public static ChoreographerActionResponseDTO convertChoreographerActionToChoreographerActionResponseDTO(final ChoreographerAction actionEntry) { + Assert.notNull(actionEntry, "ChoreographerAction entry is null."); + + return new ChoreographerActionResponseDTO(actionEntry.getId(), actionEntry.getActionName(), + collectChoreographerNextActionNameFromChoreographerAction(actionEntry.getNextAction()), + collectChoreographerActionStepsFromChoreographerAction(actionEntry.getActionActionStepConnections()), + Utilities.convertZonedDateTimeToUTCString(actionEntry.getCreatedAt()), + Utilities.convertZonedDateTimeToUTCString(actionEntry.getUpdatedAt())); + } + + //------------------------------------------------------------------------------------------------- + public static List collectChoreographerActionsFromChoreographerActionPlan( + final Set actionConnections) { + Assert.notNull(actionConnections, "ActionConnectionsSet is null."); + + final List result = new ArrayList<>(actionConnections.size()); + for (final ChoreographerActionPlanActionConnection conn : actionConnections) { + result.add(convertChoreographerActionToChoreographerActionResponseDTO(conn.getActionEntry())); + } + + result.sort(Comparator.comparing(ChoreographerActionResponseDTO::getId)); + return result; + } + + //------------------------------------------------------------------------------------------------- + public static ChoreographerActionPlanResponseDTO convertChoreographerActionPlanToChoreographerActionPlanResponseDTO( + final ChoreographerActionPlan actionPlanEntry) { + Assert.notNull(actionPlanEntry, "ChoreographerActionPlan entry is null."); + + return new ChoreographerActionPlanResponseDTO(actionPlanEntry.getId(), actionPlanEntry.getActionPlanName(), + collectChoreographerActionsFromChoreographerActionPlan(actionPlanEntry.getActionPlanActionConnections()), + Utilities.convertZonedDateTimeToUTCString(actionPlanEntry.getCreatedAt()), + Utilities.convertZonedDateTimeToUTCString(actionPlanEntry.getUpdatedAt())); + } + + //------------------------------------------------------------------------------------------------- + public static SystemRegistryResponseDTO convertSystemRegistryToSystemRegistryResponseDTO(final SystemRegistry entry) { + + Assert.notNull(entry, "SR entry is null."); + Assert.notNull(entry.getDevice(), "Related device is null."); + Assert.notNull(entry.getSystem(), "Related system is null."); + + final SystemResponseDTO systemResponseDTO = convertSystemToSystemResponseDTO(entry.getSystem()); + final DeviceResponseDTO deviceResponseDTO = convertDeviceToDeviceResponseDTO(entry.getDevice()); + + final SystemRegistryResponseDTO dto = new SystemRegistryResponseDTO(); + dto.setId(entry.getId()); + dto.setProvider(deviceResponseDTO); + dto.setSystem(systemResponseDTO); + dto.setEndOfValidity(Utilities.convertZonedDateTimeToUTCString(entry.getEndOfValidity())); + dto.setMetadata(Utilities.text2Map(entry.getMetadata())); + dto.setVersion(entry.getVersion()); + dto.setCreatedAt(Utilities.convertZonedDateTimeToUTCString(entry.getCreatedAt())); + dto.setUpdatedAt(Utilities.convertZonedDateTimeToUTCString(entry.getUpdatedAt())); + + return dto; + } + + //------------------------------------------------------------------------------------------------- + public static SystemRegistryListResponseDTO convertSystemRegistryListToSystemRegistryListResponseDTO(final Iterable page) { + Assert.notNull(page, "Iterable must not be null"); + final List list = new ArrayList<>(); + for (final SystemRegistry entry : page) { + list.add(convertSystemRegistryToSystemRegistryResponseDTO(entry)); + } + return new SystemRegistryListResponseDTO(list, list.size()); + } + + //------------------------------------------------------------------------------------------------- + public static SystemQueryResultDTO convertSystemRegistryListToSystemQueryResultDTO(final Iterable page) { + Assert.notNull(page, "Iterable must not be null"); final List list = new ArrayList<>(); - for(final SystemRegistry entry : page) - { - list.add(convertSystemRegistryToSystemRegistryResponseDTO(entry)); - } - return new SystemRegistryListResponseDTO(list, list.size()); - } - - //------------------------------------------------------------------------------------------------- - public static SystemQueryResultDTO convertSystemRegistryListToSystemQueryResultDTO(final Iterable page) - { - final List list = new ArrayList<>(); - for(final SystemRegistry entry : page) - { - list.add(convertSystemRegistryToSystemRegistryResponseDTO(entry)); - } - return new SystemQueryResultDTO(list, list.size()); - } - - //------------------------------------------------------------------------------------------------- - public static DeviceRegistryResponseDTO convertDeviceRegistryToDeviceRegistryResponseDTO(final DeviceRegistry entry) { - - Assert.notNull(entry, "DR entry is null."); - Assert.notNull(entry.getDevice(), "Related device is null."); - - final DeviceResponseDTO deviceResponseDTO = convertDeviceToDeviceResponseDTO(entry.getDevice()); - - final DeviceRegistryResponseDTO dto = new DeviceRegistryResponseDTO(); - dto.setId(entry.getId()); - dto.setDevice(deviceResponseDTO); - dto.setEndOfValidity(Utilities.convertZonedDateTimeToUTCString(entry.getEndOfValidity())); - dto.setMetadata(Utilities.text2Map(entry.getMetadata())); - dto.setVersion(entry.getVersion()); - dto.setCreatedAt(Utilities.convertZonedDateTimeToUTCString(entry.getCreatedAt())); - dto.setUpdatedAt(Utilities.convertZonedDateTimeToUTCString(entry.getUpdatedAt())); - - return dto; - } - //------------------------------------------------------------------------------------------------- - public static DeviceRegistryListResponseDTO convertDeviceRegistryListToDeviceRegistryListResponseDTO(final Iterable page) { + for (final SystemRegistry entry : page) { + list.add(convertSystemRegistryToSystemRegistryResponseDTO(entry)); + } + return new SystemQueryResultDTO(list, list.size()); + } + //------------------------------------------------------------------------------------------------- + public static DeviceRegistryResponseDTO convertDeviceRegistryToDeviceRegistryResponseDTO(final DeviceRegistry entry) { + + Assert.notNull(entry, "DR entry is null."); + Assert.notNull(entry.getDevice(), "Related device is null."); + + final DeviceResponseDTO deviceResponseDTO = convertDeviceToDeviceResponseDTO(entry.getDevice()); + + final DeviceRegistryResponseDTO dto = new DeviceRegistryResponseDTO(); + dto.setId(entry.getId()); + dto.setDevice(deviceResponseDTO); + dto.setEndOfValidity(Utilities.convertZonedDateTimeToUTCString(entry.getEndOfValidity())); + dto.setMetadata(Utilities.text2Map(entry.getMetadata())); + dto.setVersion(entry.getVersion()); + dto.setCreatedAt(Utilities.convertZonedDateTimeToUTCString(entry.getCreatedAt())); + dto.setUpdatedAt(Utilities.convertZonedDateTimeToUTCString(entry.getUpdatedAt())); + + return dto; + } + + //------------------------------------------------------------------------------------------------- + public static DeviceRegistryListResponseDTO convertDeviceRegistryListToDeviceRegistryListResponseDTO(final Iterable page) { + Assert.notNull(page, "Iterable must not be null"); + final List list = new ArrayList<>(); + for (final DeviceRegistry entry : page) { + list.add(convertDeviceRegistryToDeviceRegistryResponseDTO(entry)); + } + return new DeviceRegistryListResponseDTO(list, list.size()); + } + + //------------------------------------------------------------------------------------------------- + public static DeviceQueryResultDTO convertDeviceRegistryListToDeviceQueryResultDTO(final Iterable page) { + Assert.notNull(page, "Iterable must not be null"); final List list = new ArrayList<>(); - for(final DeviceRegistry entry : page) - { - list.add(convertDeviceRegistryToDeviceRegistryResponseDTO(entry)); - } - return new DeviceRegistryListResponseDTO(list, list.size()); - } - - //------------------------------------------------------------------------------------------------- - public static DeviceQueryResultDTO convertDeviceRegistryListToDeviceQueryResultDTO(final Iterable page) - { - final List list = new ArrayList<>(); - for(final DeviceRegistry entry : page) - { - list.add(convertDeviceRegistryToDeviceRegistryResponseDTO(entry)); - } - return new DeviceQueryResultDTO(list, list.size()); - } - - - //------------------------------------------------------------------------------------------------- - public static PingMeasurementResponseDTO convertQoSIntraPingMeasurementToPingMeasurementResponseDTO( - final QoSIntraPingMeasurement pingMeasurement) { - Assert.notNull(pingMeasurement, "pingMeasurement is null"); - - final QoSIntraMeasurementResponseDTO measurementResponseDTO = convertQoSIntraMeasurementToQoSIntraMeasurementResponseDTO(pingMeasurement.getMeasurement()); - - final PingMeasurementResponseDTO pingMeasurementResponseDTO = new PingMeasurementResponseDTO(); - pingMeasurementResponseDTO.setId(pingMeasurement.getId()); - pingMeasurementResponseDTO.setMeasurement(measurementResponseDTO); - pingMeasurementResponseDTO.setAvailable(pingMeasurement.isAvailable()); - pingMeasurementResponseDTO.setLastAccessAt(pingMeasurement.getLastAccessAt()); - pingMeasurementResponseDTO.setMinResponseTime(pingMeasurement.getMinResponseTime()); - pingMeasurementResponseDTO.setMaxResponseTime(pingMeasurement.getMaxResponseTime()); - pingMeasurementResponseDTO.setMeanResponseTimeWithTimeout(pingMeasurement.getMeanResponseTimeWithTimeout()); - pingMeasurementResponseDTO.setMeanResponseTimeWithoutTimeout(pingMeasurement.getMeanResponseTimeWithoutTimeout()); - pingMeasurementResponseDTO.setJitterWithTimeout(pingMeasurement.getJitterWithTimeout()); - pingMeasurementResponseDTO.setJitterWithoutTimeout(pingMeasurement.getJitterWithoutTimeout()); - pingMeasurementResponseDTO.setLostPerMeasurementPercent(pingMeasurement.getLostPerMeasurementPercent()); - pingMeasurementResponseDTO.setSent(pingMeasurement.getSent()); - pingMeasurementResponseDTO.setReceived(pingMeasurement.getReceived()); - pingMeasurementResponseDTO.setCountStartedAt(pingMeasurement.getCountStartedAt()); - pingMeasurementResponseDTO.setSentAll(pingMeasurement.getSentAll()); - pingMeasurementResponseDTO.setReceivedAll(pingMeasurement.getReceivedAll()); - pingMeasurementResponseDTO.setCreatedAt(pingMeasurement.getUpdatedAt()); - pingMeasurementResponseDTO.setUpdatedAt(pingMeasurement.getUpdatedAt()); - - return pingMeasurementResponseDTO; - } - - //------------------------------------------------------------------------------------------------- - public static QoSIntraMeasurementResponseDTO convertQoSIntraMeasurementToQoSIntraMeasurementResponseDTO( - final QoSIntraMeasurement measurement) { - Assert.notNull(measurement, "measurement is null"); - - final SystemResponseDTO system = convertSystemToSystemResponseDTO(measurement.getSystem()); - - return new QoSIntraMeasurementResponseDTO( - measurement.getId(), - system, - measurement.getMeasurementType(), - measurement.getLastMeasurementAt(), - measurement.getCreatedAt(), - measurement.getUpdatedAt()); - } - - //------------------------------------------------------------------------------------------------- - public static PingMeasurementListResponseDTO convertQoSIntraPingMeasurementPageToPingMeasurementListResponseDTO( - final Page entries) { - Assert.notNull(entries, "pingMeasurementPage is null"); - - final List pingMeasurementEntries = new ArrayList<>(entries.getNumberOfElements()); - for (final QoSIntraPingMeasurement entry : entries) { - pingMeasurementEntries.add(convertQoSIntraPingMeasurementToPingMeasurementResponseDTO(entry)); - } - - return new PingMeasurementListResponseDTO(pingMeasurementEntries, entries.getTotalElements()); - } - //================================================================================================= - // assistant methods - - //------------------------------------------------------------------------------------------------- - private DTOConverter() { - throw new UnsupportedOperationException(); - } - - //------------------------------------------------------------------------------------------------- - private static List systemEntryListToSystemResponseDTOList(final List systemList) { - final List systemResponseDTOs = new ArrayList<>(systemList.size()); - - for (final System system : systemList) { - systemResponseDTOs.add(convertSystemToSystemResponseDTO(system)); - } - - return systemResponseDTOs; - } - - //------------------------------------------------------------------------------------------------- - private static List deviceEntryListToDeviceResponseDTOList(final List deviceList) { - final List deviceResponseDTOs = new ArrayList<>(deviceList.size()); - - for (final Device device : deviceList) { - deviceResponseDTOs.add(convertDeviceToDeviceResponseDTO(device)); - } - - return deviceResponseDTOs; - } - - //------------------------------------------------------------------------------------------------- - private static List collectInterfacesFromServiceRegistry(final Set interfaceConnections) { - final List result = new ArrayList<>(interfaceConnections.size()); - for (final ServiceRegistryInterfaceConnection conn : interfaceConnections) { - result.add(convertServiceInterfaceToServiceInterfaceResponseDTO(conn.getServiceInterface())); - } - - result.sort((dto1, dto2) -> dto1.getInterfaceName().compareToIgnoreCase(dto2.getInterfaceName())); - - return result; - } - - //------------------------------------------------------------------------------------------------- - private static List collectInterfacesFromAuthorizationIntraCloud(final Set interfaceConnections) { - final List result = new ArrayList<>(interfaceConnections.size()); - for (final AuthorizationIntraCloudInterfaceConnection conn : interfaceConnections) { - result.add(convertServiceInterfaceToServiceInterfaceResponseDTO(conn.getServiceInterface())); - } - - result.sort((dto1, dto2) -> dto1.getInterfaceName().compareToIgnoreCase(dto2.getInterfaceName())); - - return result; - } - - //------------------------------------------------------------------------------------------------- - private static List collectInterfacesFromAuthorizationInterCloud(final Set interfaceConnections) { - final List result = new ArrayList<>(interfaceConnections.size()); - for (final AuthorizationInterCloudInterfaceConnection conn : interfaceConnections) { - result.add(convertServiceInterfaceToServiceInterfaceResponseDTO(conn.getServiceInterface())); - } - - result.sort((dto1, dto2) -> dto1.getInterfaceName().compareToIgnoreCase(dto2.getInterfaceName())); - - return result; - } - - //------------------------------------------------------------------------------------------------- - private static List collectServiceDefinitionsFromChoreographerActionStep(final Set serviceDefinitionConnections) { - final List result = new ArrayList<>(serviceDefinitionConnections.size()); - for (final ChoreographerActionStepServiceDefinitionConnection conn : serviceDefinitionConnections) { - result.add(convertServiceDefinitionToServiceDefinitionResponseDTO(conn.getServiceDefinitionEntry())); - } - - result.sort(Comparator.comparing(ServiceDefinitionResponseDTO::getId)); - return result; - } - - //------------------------------------------------------------------------------------------------- - private static List collectChoreographerNextActionStepsFromChoreographerActionStep(final Set nextActionSteps) { - final List result = new ArrayList<>(nextActionSteps.size()); - for (final ChoreographerNextActionStep nextActionStep : nextActionSteps) { - result.add(convertChoreographerNextActionStepToChoreographerNextActionStepResponseDTO(nextActionStep.getNextActionStepEntry())); - } - - result.sort(Comparator.comparing(ChoreographerNextActionStepResponseDTO::getId)); - return result; - } - - //------------------------------------------------------------------------------------------------- - private static ChoreographerNextActionStepResponseDTO convertChoreographerNextActionStepToChoreographerNextActionStepResponseDTO(final ChoreographerActionStep nextActionStepEntry) { - return new ChoreographerNextActionStepResponseDTO(nextActionStepEntry.getId(), nextActionStepEntry.getName()); - } - - //------------------------------------------------------------------------------------------------- - private static Set collectPublishersFromSubscription(final Set connections) { - final Set result = new HashSet<>(connections.size()); - for (final SubscriptionPublisherConnection conn : connections) { - result.add(convertSystemToSystemResponseDTO(conn.getSystem())); - } - - return result; - } - - //------------------------------------------------------------------------------------------------- - private static Set collectAuthorizedPublishersFromSubscription(final Set connections) { - final Set result = new HashSet<>(connections.size()); - for (final SubscriptionPublisherConnection conn : connections) { - if (conn.isAuthorized()) { - result.add(convertSystemToSystemResponseDTO(conn.getSystem())); - } - } - - return result; - } + for (final DeviceRegistry entry : page) { + list.add(convertDeviceRegistryToDeviceRegistryResponseDTO(entry)); + } + return new DeviceQueryResultDTO(list, list.size()); + } + + //------------------------------------------------------------------------------------------------- + public static PingMeasurementResponseDTO convertQoSIntraPingMeasurementToPingMeasurementResponseDTO( + final QoSIntraPingMeasurement pingMeasurement) { + Assert.notNull(pingMeasurement, "pingMeasurement is null"); + + final QoSIntraMeasurementResponseDTO measurementResponseDTO = convertQoSIntraMeasurementToQoSIntraMeasurementResponseDTO( + pingMeasurement.getMeasurement()); + + final PingMeasurementResponseDTO pingMeasurementResponseDTO = new PingMeasurementResponseDTO(); + pingMeasurementResponseDTO.setId(pingMeasurement.getId()); + pingMeasurementResponseDTO.setMeasurement(measurementResponseDTO); + pingMeasurementResponseDTO.setAvailable(pingMeasurement.isAvailable()); + pingMeasurementResponseDTO.setLastAccessAt(pingMeasurement.getLastAccessAt()); + pingMeasurementResponseDTO.setMinResponseTime(pingMeasurement.getMinResponseTime()); + pingMeasurementResponseDTO.setMaxResponseTime(pingMeasurement.getMaxResponseTime()); + pingMeasurementResponseDTO.setMeanResponseTimeWithTimeout(pingMeasurement.getMeanResponseTimeWithTimeout()); + pingMeasurementResponseDTO.setMeanResponseTimeWithoutTimeout(pingMeasurement.getMeanResponseTimeWithoutTimeout()); + pingMeasurementResponseDTO.setJitterWithTimeout(pingMeasurement.getJitterWithTimeout()); + pingMeasurementResponseDTO.setJitterWithoutTimeout(pingMeasurement.getJitterWithoutTimeout()); + pingMeasurementResponseDTO.setLostPerMeasurementPercent(pingMeasurement.getLostPerMeasurementPercent()); + pingMeasurementResponseDTO.setSent(pingMeasurement.getSent()); + pingMeasurementResponseDTO.setReceived(pingMeasurement.getReceived()); + pingMeasurementResponseDTO.setCountStartedAt(pingMeasurement.getCountStartedAt()); + pingMeasurementResponseDTO.setSentAll(pingMeasurement.getSentAll()); + pingMeasurementResponseDTO.setReceivedAll(pingMeasurement.getReceivedAll()); + pingMeasurementResponseDTO.setCreatedAt(pingMeasurement.getUpdatedAt()); + pingMeasurementResponseDTO.setUpdatedAt(pingMeasurement.getUpdatedAt()); + + return pingMeasurementResponseDTO; + } + + //------------------------------------------------------------------------------------------------- + public static QoSIntraMeasurementResponseDTO convertQoSIntraMeasurementToQoSIntraMeasurementResponseDTO( + final QoSIntraMeasurement measurement) { + Assert.notNull(measurement, "measurement is null"); + + final SystemResponseDTO system = convertSystemToSystemResponseDTO(measurement.getSystem()); + + return new QoSIntraMeasurementResponseDTO( + measurement.getId(), + system, + measurement.getMeasurementType(), + measurement.getLastMeasurementAt(), + measurement.getCreatedAt(), + measurement.getUpdatedAt()); + } + //================================================================================================= + // assistant methods + + //------------------------------------------------------------------------------------------------- + public static PingMeasurementListResponseDTO convertQoSIntraPingMeasurementPageToPingMeasurementListResponseDTO( + final Page entries) { + Assert.notNull(entries, "pingMeasurementPage is null"); + + final List pingMeasurementEntries = new ArrayList<>(entries.getNumberOfElements()); + for (final QoSIntraPingMeasurement entry : entries) { + pingMeasurementEntries.add(convertQoSIntraPingMeasurementToPingMeasurementResponseDTO(entry)); + } + + return new PingMeasurementListResponseDTO(pingMeasurementEntries, entries.getTotalElements()); + } + + //------------------------------------------------------------------------------------------------- + private static List systemEntryListToSystemResponseDTOList(final List systemList) { + final List systemResponseDTOs = new ArrayList<>(systemList.size()); + + for (final System system : systemList) { + systemResponseDTOs.add(convertSystemToSystemResponseDTO(system)); + } + + return systemResponseDTOs; + } + + //------------------------------------------------------------------------------------------------- + private static List deviceEntryListToDeviceResponseDTOList(final List deviceList) { + final List deviceResponseDTOs = new ArrayList<>(deviceList.size()); + + for (final Device device : deviceList) { + deviceResponseDTOs.add(convertDeviceToDeviceResponseDTO(device)); + } + + return deviceResponseDTOs; + } + + //------------------------------------------------------------------------------------------------- + private static List collectInterfacesFromServiceRegistry(final Set interfaceConnections) { + final List result = new ArrayList<>(interfaceConnections.size()); + for (final ServiceRegistryInterfaceConnection conn : interfaceConnections) { + result.add(convertServiceInterfaceToServiceInterfaceResponseDTO(conn.getServiceInterface())); + } + + result.sort((dto1, dto2) -> dto1.getInterfaceName().compareToIgnoreCase(dto2.getInterfaceName())); + + return result; + } + + //------------------------------------------------------------------------------------------------- + private static List collectInterfacesFromAuthorizationIntraCloud( + final Set interfaceConnections) { + final List result = new ArrayList<>(interfaceConnections.size()); + for (final AuthorizationIntraCloudInterfaceConnection conn : interfaceConnections) { + result.add(convertServiceInterfaceToServiceInterfaceResponseDTO(conn.getServiceInterface())); + } + + result.sort((dto1, dto2) -> dto1.getInterfaceName().compareToIgnoreCase(dto2.getInterfaceName())); + + return result; + } + + //------------------------------------------------------------------------------------------------- + private static List collectInterfacesFromAuthorizationInterCloud( + final Set interfaceConnections) { + final List result = new ArrayList<>(interfaceConnections.size()); + for (final AuthorizationInterCloudInterfaceConnection conn : interfaceConnections) { + result.add(convertServiceInterfaceToServiceInterfaceResponseDTO(conn.getServiceInterface())); + } + + result.sort((dto1, dto2) -> dto1.getInterfaceName().compareToIgnoreCase(dto2.getInterfaceName())); + + return result; + } + + //------------------------------------------------------------------------------------------------- + private static List collectServiceDefinitionsFromChoreographerActionStep( + final Set serviceDefinitionConnections) { + final List result = new ArrayList<>(serviceDefinitionConnections.size()); + for (final ChoreographerActionStepServiceDefinitionConnection conn : serviceDefinitionConnections) { + result.add(convertServiceDefinitionToServiceDefinitionResponseDTO(conn.getServiceDefinitionEntry())); + } + + result.sort(Comparator.comparing(ServiceDefinitionResponseDTO::getId)); + return result; + } + + //------------------------------------------------------------------------------------------------- + private static List collectChoreographerNextActionStepsFromChoreographerActionStep( + final Set nextActionSteps) { + final List result = new ArrayList<>(nextActionSteps.size()); + for (final ChoreographerNextActionStep nextActionStep : nextActionSteps) { + result.add(convertChoreographerNextActionStepToChoreographerNextActionStepResponseDTO(nextActionStep.getNextActionStepEntry())); + } + + result.sort(Comparator.comparing(ChoreographerNextActionStepResponseDTO::getId)); + return result; + } + + //------------------------------------------------------------------------------------------------- + private static ChoreographerNextActionStepResponseDTO convertChoreographerNextActionStepToChoreographerNextActionStepResponseDTO( + final ChoreographerActionStep nextActionStepEntry) { + return new ChoreographerNextActionStepResponseDTO(nextActionStepEntry.getId(), nextActionStepEntry.getName()); + } + + //------------------------------------------------------------------------------------------------- + private static Set collectPublishersFromSubscription(final Set connections) { + final Set result = new HashSet<>(connections.size()); + for (final SubscriptionPublisherConnection conn : connections) { + result.add(convertSystemToSystemResponseDTO(conn.getSystem())); + } + + return result; + } + + //------------------------------------------------------------------------------------------------- + private static Set collectAuthorizedPublishersFromSubscription(final Set connections) { + final Set result = new HashSet<>(connections.size()); + for (final SubscriptionPublisherConnection conn : connections) { + if (conn.isAuthorized()) { + result.add(convertSystemToSystemResponseDTO(conn.getSystem())); + } + } + + return result; + } } \ No newline at end of file diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateType.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateType.java index 54fba8563..cc0ace910 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateType.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/CertificateType.java @@ -1,6 +1,9 @@ package eu.arrowhead.common.dto.shared; import eu.arrowhead.common.Utilities; +import org.springframework.util.Assert; + +import java.util.Objects; public enum CertificateType { @@ -18,6 +21,8 @@ public enum CertificateType { } public static CertificateType getTypeFromCN(final String commonName) { + if (Objects.isNull(commonName)) { return CertificateType.UNKNOWN; } + final String[] split = commonName.split("\\."); if (Utilities.isKeyStoreCNArrowheadValid(commonName)) { @@ -39,6 +44,7 @@ private static CertificateType getTypeFromCNPart(final String commonNamePart) { } public boolean hasMinimumStrength(final CertificateType minimumStrengthType) { + Assert.notNull(minimumStrengthType, "CertificateType must not be null"); return this.strength >= minimumStrengthType.strength; } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingResponseDTO.java index 20f88a8d7..6dbe5e7e9 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingResponseDTO.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; +import org.springframework.util.Assert; import java.io.Serializable; import java.util.Map; @@ -30,6 +31,8 @@ public DeviceRegistryOnboardingResponseDTO(final long id, final DeviceResponseDT } public void load(final DeviceRegistryResponseDTO dto) { + Assert.notNull(dto, "DeviceRegistryResponseDTO must not be null"); + setId(dto.getId()); setDevice(dto.getDevice()); setEndOfValidity(dto.getEndOfValidity()); diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryFormDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryFormDTO.java index 240db7488..3e47de93a 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryFormDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemQueryFormDTO.java @@ -3,9 +3,7 @@ import org.springframework.util.Assert; import java.io.Serializable; -import java.util.Arrays; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.StringJoiner; @@ -69,7 +67,7 @@ public String toString() { private SystemQueryFormDTO(final Builder builder) { this.systemNameRequirements = builder.systemNameRequirements; - this.deviceNameRequirements = builder.deiceNameRequirements; + this.deviceNameRequirements = builder.deviceNameRequirements; this.metadataRequirements = builder.metadataRequirements; this.versionRequirement = builder.versionRequirement; this.minVersionRequirement = builder.minVersionRequirement; @@ -86,7 +84,7 @@ public static class Builder { // members private final String systemNameRequirements; - private String deiceNameRequirements; + private String deviceNameRequirements; private Map metadataRequirements; private Integer versionRequirement; private Integer minVersionRequirement; @@ -105,8 +103,8 @@ public Builder(final String systemNameRequirements) { //------------------------------------------------------------------------------------------------- - public Builder deviceName(final String deiceNameRequirements) { - this.deiceNameRequirements = deiceNameRequirements; + public Builder deviceName(final String deviceNameRequirements) { + this.deviceNameRequirements = deviceNameRequirements; return this; } diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingResponseDTO.java b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingResponseDTO.java index b1679b094..6ba626b6a 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingResponseDTO.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingResponseDTO.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; +import org.springframework.util.Assert; import java.io.Serializable; import java.util.Map; @@ -48,6 +49,8 @@ public String toString() { public void load(final SystemRegistryResponseDTO dto) { + Assert.notNull(dto, "SystemRegistryResponseDTO must not be null"); + this.setId(dto.getId()); this.setProvider(dto.getProvider()); this.setSystem(dto.getSystem()); diff --git a/deviceregistry/pom.xml b/deviceregistry/pom.xml index 1b089d82d..f58eb7910 100644 --- a/deviceregistry/pom.xml +++ b/deviceregistry/pom.xml @@ -17,21 +17,11 @@ arrowhead-core-common ${revision} - - org.springframework.boot - spring-boot-starter-test - test - com.h2database h2 test - - org.springframework - spring-test - test - diff --git a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java index 5bbe4cb51..416388f1f 100644 --- a/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java +++ b/deviceregistry/src/main/java/eu/arrowhead/core/deviceregistry/database/service/DeviceRegistryDBService.java @@ -11,6 +11,7 @@ import eu.arrowhead.common.database.repository.DeviceRepository; import eu.arrowhead.common.drivers.CertificateAuthorityDriver; import eu.arrowhead.common.dto.internal.CertificateSigningRequestDTO; +import eu.arrowhead.common.dto.internal.CertificateSigningResponseDTO; import eu.arrowhead.common.dto.internal.DTOConverter; import eu.arrowhead.common.dto.internal.DeviceListResponseDTO; import eu.arrowhead.common.dto.internal.DeviceRegistryListResponseDTO; @@ -102,6 +103,7 @@ public DeviceResponseDTO getDeviceById(long deviceId) { public DeviceRegistryOnboardingWithNameResponseDTO onboardAndRegisterDeviceRegistry(final DeviceRegistryOnboardingWithNameRequestDTO request, final String host, final String address) { logger.debug("onboardAndRegisterDeviceRegistry started..."); + Assert.notNull(request, "DeviceRegistryOnboardingWithNameRequestDTO must not be null"); final CertificateCreationRequestDTO creationRequestDTO = request.getCertificateCreationRequest(); final KeyPair keyPair = securityUtilities.extractOrGenerateKeyPair(creationRequestDTO); @@ -110,15 +112,15 @@ public DeviceRegistryOnboardingWithNameResponseDTO onboardAndRegisterDeviceRegis try { certificateSigningRequest = securityUtilities .createCertificateSigningRequest(creationRequestDTO.getCommonName(), keyPair, CertificateType.AH_DEVICE, host, address); - } catch (Exception e) { + } catch (final Exception e) { logger.error(e.getMessage(), e); throw new ArrowheadException("Unable to create certificate signing request: " + e.getMessage()); } - final var signingResponse = signCertificate(certificateSigningRequest); + final CertificateCreationResponseDTO signingResponse = signCertificate(certificateSigningRequest); signingResponse.setKeyPairDTO(securityUtilities.encodeKeyPair(keyPair)); - final var retValue = new DeviceRegistryOnboardingWithNameResponseDTO(); + final DeviceRegistryOnboardingWithNameResponseDTO retValue = new DeviceRegistryOnboardingWithNameResponseDTO(); retValue.setCertificateResponse(signingResponse); retValue.load(registerDeviceRegistry(request)); return retValue; @@ -129,10 +131,12 @@ public DeviceRegistryOnboardingWithNameResponseDTO onboardAndRegisterDeviceRegis public DeviceRegistryOnboardingWithCsrResponseDTO onboardAndRegisterDeviceRegistry(final DeviceRegistryOnboardingWithCsrRequestDTO request) { logger.debug("onboardAndRegisterDeviceRegistry started..."); - final var signingResponse = signCertificate(request.getCertificateSigningRequest()); + Assert.notNull(request, "DeviceRegistryOnboardingWithCsrRequestDTO must not be null"); + + final CertificateCreationResponseDTO signingResponse = signCertificate(request.getCertificateSigningRequest()); securityUtilities.extractAndSetPublicKey(signingResponse); - final var retValue = new DeviceRegistryOnboardingWithCsrResponseDTO(); + final DeviceRegistryOnboardingWithCsrResponseDTO retValue = new DeviceRegistryOnboardingWithCsrResponseDTO(); retValue.setCertificateResponse(signingResponse); retValue.load(registerDeviceRegistry(request)); return retValue; @@ -142,6 +146,7 @@ public DeviceRegistryOnboardingWithCsrResponseDTO onboardAndRegisterDeviceRegist @Transactional(rollbackFor = ArrowheadException.class) public DeviceListResponseDTO getDeviceEntries(final CoreUtilities.ValidatedPageParams pageParams, final String sortField) { logger.debug("getDeviceList started..."); + Assert.notNull(pageParams, "ValidatedPageParams must not be null"); final String validatedSortField = Utilities.isEmpty(sortField) ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); @@ -218,6 +223,7 @@ public void removeDeviceById(final long id) { @Transactional(rollbackFor = ArrowheadException.class) public DeviceResponseDTO mergeDevice(final long deviceId, final DeviceRequestDTO request) { logger.debug("mergeDevice started..."); + Assert.notNull(request, "DeviceRequestDTO must not be null"); try { final Optional deviceOptional = deviceRepository.findById(deviceId); @@ -236,6 +242,8 @@ public DeviceResponseDTO mergeDevice(final long deviceId, final DeviceRequestDTO @Transactional(rollbackFor = ArrowheadException.class) public DeviceRegistryListResponseDTO getDeviceRegistryEntries(final CoreUtilities.ValidatedPageParams params, final String sortField) { logger.debug("getDeviceRegistryEntries started..."); + Assert.notNull(params, "ValidatedPageParams must not be null"); + final String validatedSortField = sortField == null ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); if (!DeviceRegistry.SORTABLE_FIELDS_BY.contains(validatedSortField)) { @@ -261,6 +269,8 @@ public DeviceRegistryListResponseDTO getDeviceRegistryEntriesByDeviceName(final final CoreUtilities.ValidatedPageParams params, final String sortField) { logger.debug("getDeviceRegistryEntriesByDeviceName started..."); + Assert.notNull(params, "ValidatedPageParams must not be null"); + final String validatedSortField = sortField == null ? CoreCommonConstants.COMMON_FIELD_NAME_ID : sortField.trim(); if (!DeviceRegistry.SORTABLE_FIELDS_BY.contains(validatedSortField)) { @@ -471,7 +481,6 @@ public DeviceQueryResultDTO queryRegistry(final DeviceQueryFormDTO form) { devices = deviceRepository.findByDeviceName(deviceName); if (devices.isEmpty()) { - // no service definition found logger.debug("Device not found: {}", deviceName); return DTOConverter.convertDeviceRegistryListToDeviceQueryResultDTO(List.of()); } @@ -510,7 +519,7 @@ public DeviceQueryResultDTO queryRegistry(final DeviceQueryFormDTO form) { }); } - logger.debug("Potential system providers after filtering: {}", registryList.size()); + logger.debug("Potential devices after filtering: {}", registryList.size()); return DTOConverter.convertListOfDeviceRegistryEntriesToDeviceQueryResultDTO(registryList, unfilteredHits); } catch (final IllegalStateException e) { throw new InvalidParameterException("Invalid keys in the metadata requirements (whitespace only differences)"); @@ -610,8 +619,8 @@ private long validateId(final long id) { private DeviceRegistry getDeviceRegistryEntryById(final long id) { logger.debug("getDeviceRegistryEntryById started..."); try { - final Optional systemRegistry = deviceRegistryRepository.findById(id); - return systemRegistry.orElseThrow(() -> new InvalidParameterException("System Registry with id of '" + id + "' does not exist")); + final Optional deviceRegistry = deviceRegistryRepository.findById(id); + return deviceRegistry.orElseThrow(() -> new InvalidParameterException("Device Registry with id of '" + id + "' does not exist")); } catch (final InvalidParameterException ex) { throw ex; } catch (final Exception ex) { @@ -635,28 +644,28 @@ private Device findOrCreateDevice(String deviceName, String address, String macA final String validateAddress = Utilities.lowerCaseTrim(address); final String validatedMacAddress = Utilities.lowerCaseTrim(macAddress); - final Optional optProvider = deviceRepository.findByDeviceNameAndMacAddress(validateName, validatedMacAddress); - Device provider; + final Optional optDevice = deviceRepository.findByDeviceNameAndMacAddress(validateName, validatedMacAddress); + Device device; - if (optProvider.isPresent()) { - provider = optProvider.get(); - if (!Objects.equals(authenticationInfo, provider.getAuthenticationInfo()) || - !Objects.equals(validateAddress, provider.getAddress())) { // authentication info or provider has changed - provider.setAuthenticationInfo(authenticationInfo); - provider.setAddress(validateAddress); - provider = deviceRepository.saveAndFlush(provider); + if (optDevice.isPresent()) { + device = optDevice.get(); + if (!Objects.equals(authenticationInfo, device.getAuthenticationInfo()) || + !Objects.equals(validateAddress, device.getAddress())) { // authentication info or device has changed + device.setAuthenticationInfo(authenticationInfo); + device.setAddress(validateAddress); + device = deviceRepository.saveAndFlush(device); } } else { - provider = createDevice(validateName, validateAddress, validatedMacAddress, authenticationInfo); + device = createDevice(validateName, validateAddress, validatedMacAddress, authenticationInfo); } - return provider; + return device; } //------------------------------------------------------------------------------------------------- private CertificateCreationResponseDTO signCertificate(final String signingRequest) { logger.debug("Contact CertificateAuthority ..."); - final var csrDTO = new CertificateSigningRequestDTO(signingRequest); - final var signingResponse = caDriver.signCertificate(csrDTO); + final CertificateSigningRequestDTO csrDTO = new CertificateSigningRequestDTO(signingRequest); + final CertificateSigningResponseDTO signingResponse = caDriver.signCertificate(csrDTO); logger.debug("Processing response from Certificate Authority ..."); final CertificateCreationResponseDTO certificateResponseDTO = new CertificateCreationResponseDTO(); @@ -770,5 +779,4 @@ private DeviceRegistry setModifiedValuesOfDeviceRegistryEntryFields(final Device throw new ArrowheadException(CoreCommonConstants.DATABASE_OPERATION_EXCEPTION_MSG); } } - } diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java index 931604b51..4f43b8d5d 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/OnboardingController.java @@ -5,7 +5,6 @@ import eu.arrowhead.common.Defaults; import eu.arrowhead.common.SSLProperties; import eu.arrowhead.common.Utilities; -import eu.arrowhead.common.dto.shared.DeviceResponseDTO; import eu.arrowhead.common.dto.shared.OnboardingWithCsrRequestDTO; import eu.arrowhead.common.dto.shared.OnboardingWithCsrResponseDTO; import eu.arrowhead.common.dto.shared.OnboardingWithNameRequestDTO; @@ -14,7 +13,7 @@ import eu.arrowhead.common.exception.AuthException; import eu.arrowhead.common.exception.BadPayloadException; import eu.arrowhead.common.exception.InvalidParameterException; -import eu.arrowhead.core.onboarding.database.service.OnboardingDBService; +import eu.arrowhead.core.onboarding.service.OnboardingService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; @@ -65,7 +64,7 @@ public class OnboardingController { private static final String CSR_NULL_ERROR_MESSAGE = " CertificateSigningRequest must have value "; private final Logger logger = LogManager.getLogger(OnboardingController.class); - private final OnboardingDBService onboardingDBService; + private final OnboardingService onboardingDBService; private final SSLProperties sslProperties; @@ -76,7 +75,7 @@ public class OnboardingController { private Optional sharedSecret; @Autowired - public OnboardingController(final OnboardingDBService onboardingDBService, final SSLProperties sslProperties) { + public OnboardingController(final OnboardingService onboardingDBService, final SSLProperties sslProperties) { this.onboardingDBService = onboardingDBService; this.sslProperties = sslProperties; } diff --git a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java b/onboarding/src/main/java/eu/arrowhead/core/onboarding/service/OnboardingService.java similarity index 90% rename from onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java rename to onboarding/src/main/java/eu/arrowhead/core/onboarding/service/OnboardingService.java index 5b97473f0..f0b7f7360 100644 --- a/onboarding/src/main/java/eu/arrowhead/core/onboarding/database/service/OnboardingDBService.java +++ b/onboarding/src/main/java/eu/arrowhead/core/onboarding/service/OnboardingService.java @@ -1,4 +1,4 @@ -package eu.arrowhead.core.onboarding.database.service; +package eu.arrowhead.core.onboarding.service; import eu.arrowhead.common.CoreCommonConstants; import eu.arrowhead.common.SecurityUtilities; @@ -22,25 +22,26 @@ import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.Assert; import org.springframework.web.util.UriComponents; import java.security.KeyPair; import java.util.function.Consumer; @Service -public class OnboardingDBService { +public class OnboardingService { //================================================================================================= // members - private final Logger logger = LogManager.getLogger(OnboardingDBService.class); + private final Logger logger = LogManager.getLogger(OnboardingService.class); private final OrchestrationDriver orchestrationDriver; private final CertificateAuthorityDriver caDriver; private final SecurityUtilities securityUtilities; @Autowired - public OnboardingDBService(final OrchestrationDriver orchestrationDriver, - final CertificateAuthorityDriver caDriver, - final SecurityUtilities securityUtilities) { + public OnboardingService(final OrchestrationDriver orchestrationDriver, + final CertificateAuthorityDriver caDriver, + final SecurityUtilities securityUtilities) { this.orchestrationDriver = orchestrationDriver; this.caDriver = caDriver; this.securityUtilities = securityUtilities; @@ -53,6 +54,8 @@ public OnboardingDBService(final OrchestrationDriver orchestrationDriver, public OnboardingWithNameResponseDTO onboarding(final OnboardingWithNameRequestDTO onboardingRequest, final String host, final String address) throws DriverUtilities.DriverException { logger.debug("onboarding started..."); + Assert.notNull(onboardingRequest, "OnboardingWithNameRequestDTO must not be null"); + Assert.notNull(onboardingRequest.getCreationRequestDTO(), "CreationRequestDTO must not be null"); final CertificateCreationRequestDTO creationRequestDTO = onboardingRequest.getCreationRequestDTO(); final KeyPair keyPair = securityUtilities.extractOrGenerateKeyPair(creationRequestDTO); @@ -81,6 +84,8 @@ public OnboardingWithNameResponseDTO onboarding(final OnboardingWithNameRequestD public OnboardingWithCsrResponseDTO onboarding(final OnboardingWithCsrRequestDTO onboardingRequest) throws DriverUtilities.DriverException { logger.debug("onboarding started..."); + Assert.notNull(onboardingRequest, "OnboardingWithCsrRequestDTO must not be null"); + Assert.notNull(onboardingRequest.getCertificateSigningRequest(), "CertificateSigningRequest must not be null"); final var signingResponseDTO = executeCertificateSigningRequest(onboardingRequest.getCertificateSigningRequest()); final var responseDto = new OnboardingWithCsrResponseDTO(); diff --git a/onboarding/src/test/java/eu/arrowhead/core/onboarding/OnboardingControllerTest.java b/onboarding/src/test/java/eu/arrowhead/core/onboarding/OnboardingControllerTest.java index 4f75bee6f..f2aaa7e0b 100644 --- a/onboarding/src/test/java/eu/arrowhead/core/onboarding/OnboardingControllerTest.java +++ b/onboarding/src/test/java/eu/arrowhead/core/onboarding/OnboardingControllerTest.java @@ -11,7 +11,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import eu.arrowhead.common.database.service.CommonDBService; -import eu.arrowhead.core.onboarding.database.service.OnboardingDBService; +import eu.arrowhead.core.onboarding.service.OnboardingService; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -44,7 +44,7 @@ public class OnboardingControllerTest { private ObjectMapper objectMapper; @MockBean(name = "mockOnboardingDBService") - private OnboardingDBService onboardingDBService; + private OnboardingService onboardingDBService; @MockBean(name = "mockCommonDBService") private CommonDBService commonDBService; diff --git a/onboarding/src/test/java/eu/arrowhead/core/onboarding/OnboardingTestContext.java b/onboarding/src/test/java/eu/arrowhead/core/onboarding/OnboardingTestContext.java index 26c37ad1d..7940d5c71 100644 --- a/onboarding/src/test/java/eu/arrowhead/core/onboarding/OnboardingTestContext.java +++ b/onboarding/src/test/java/eu/arrowhead/core/onboarding/OnboardingTestContext.java @@ -2,7 +2,7 @@ import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.database.service.CommonDBService; -import eu.arrowhead.core.onboarding.database.service.OnboardingDBService; +import eu.arrowhead.core.onboarding.service.OnboardingService; import org.mockito.Mockito; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; @@ -29,8 +29,8 @@ public class OnboardingTestContext { //------------------------------------------------------------------------------------------------- @Bean @Primary // This bean is primary only in test context - public OnboardingDBService mockOnboardingDBService() { - return Mockito.mock(OnboardingDBService.class); + public OnboardingService mockOnboardingDBService() { + return Mockito.mock(OnboardingService.class); } //------------------------------------------------------------------------------------------------- diff --git a/orchestrator/pom.xml b/orchestrator/pom.xml index 97f72d94b..a2ef22e72 100644 --- a/orchestrator/pom.xml +++ b/orchestrator/pom.xml @@ -11,6 +11,14 @@ Arrowhead Orchestrator Arrowhead Orchestrator core service + + + eu.arrowhead + arrowhead-core-common + ${revision} + + + diff --git a/scripts/device_registry_privileges.sql b/scripts/device_registry_privileges.sql index dc57bfecf..0b5fc3ac9 100644 --- a/scripts/device_registry_privileges.sql +++ b/scripts/device_registry_privileges.sql @@ -4,12 +4,14 @@ REVOKE ALL, GRANT OPTION FROM 'device_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`device` TO 'device_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`device_registry` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'system_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'device_registry'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'device_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`device` TO 'device_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`device_registry` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'system_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'device_registry'@'%'; FLUSH PRIVILEGES; \ No newline at end of file diff --git a/scripts/system_registry_privileges.sql b/scripts/system_registry_privileges.sql index 9aba93cbc..5edaddc01 100644 --- a/scripts/system_registry_privileges.sql +++ b/scripts/system_registry_privileges.sql @@ -7,7 +7,7 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`system_registry` TO 'system_registry'@'loca GRANT ALL PRIVILEGES ON `arrowhead`.`device` TO 'system_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'system_registry'@'localhost'; -REVOKE ALL, GRANT OPTION FROM 'service_registry'@'%'; +REVOKE ALL, GRANT OPTION FROM 'system_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'system_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`system_registry` TO 'system_registry'@'%'; diff --git a/systemregistry/pom.xml b/systemregistry/pom.xml index d55df90f6..97610eee4 100644 --- a/systemregistry/pom.xml +++ b/systemregistry/pom.xml @@ -17,21 +17,11 @@ arrowhead-core-common ${revision} - - org.springframework.boot - spring-boot-starter-test - test - com.h2database h2 test - - org.springframework - spring-test - test - From cac23129ded9943d6382fe74e5d0b40daa36f6b2 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Fri, 17 Apr 2020 15:18:38 +0200 Subject: [PATCH 299/301] Added null check to drivers --- .../common/drivers/CertificateAuthorityDriver.java | 2 ++ .../eu/arrowhead/common/drivers/OrchestrationDriver.java | 3 +++ .../eu/arrowhead/common/drivers/ServiceRegistryDriver.java | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/core-common/src/main/java/eu/arrowhead/common/drivers/CertificateAuthorityDriver.java b/core-common/src/main/java/eu/arrowhead/common/drivers/CertificateAuthorityDriver.java index f41eeba95..20a4ea20b 100644 --- a/core-common/src/main/java/eu/arrowhead/common/drivers/CertificateAuthorityDriver.java +++ b/core-common/src/main/java/eu/arrowhead/common/drivers/CertificateAuthorityDriver.java @@ -10,6 +10,7 @@ import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; +import org.springframework.util.Assert; import org.springframework.web.util.UriComponents; @Service @@ -29,6 +30,7 @@ public CertificateAuthorityDriver(final DriverUtilities driverUtilities, final H public CertificateSigningResponseDTO signCertificate(final CertificateSigningRequestDTO request) throws DriverUtilities.DriverException { logger.traceEntry("signCertificate: {}", request); + Assert.notNull(request,"CertificateSigningRequestDTO must not be null"); final UriComponents uri = driverUtilities.findUriByOrchestrator(CoreSystemService.CERTIFICATE_AUTHORITY_SIGN_SERVICE); final ResponseEntity httpResponse = httpService .sendRequest(uri, HttpMethod.POST, CertificateSigningResponseDTO.class, request); diff --git a/core-common/src/main/java/eu/arrowhead/common/drivers/OrchestrationDriver.java b/core-common/src/main/java/eu/arrowhead/common/drivers/OrchestrationDriver.java index 0602ac4b7..e5c3ebdbd 100644 --- a/core-common/src/main/java/eu/arrowhead/common/drivers/OrchestrationDriver.java +++ b/core-common/src/main/java/eu/arrowhead/common/drivers/OrchestrationDriver.java @@ -10,6 +10,7 @@ import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; +import org.springframework.util.Assert; import org.springframework.web.util.UriComponents; @Service @@ -29,11 +30,13 @@ public OrchestrationDriver(final DriverUtilities driverUtilities, final HttpServ public UriComponents findCoreSystemService(final CoreSystemService service) throws DriverUtilities.DriverException { logger.traceEntry("findCoreSystemService: {}", service); + Assert.notNull(service, "CoreSystemService must not be null"); return logger.traceExit(driverUtilities.findUriByOrchestrator(service)); } public OrchestrationResponseDTO orchestrate(final OrchestrationFormRequestDTO request) throws DriverUtilities.DriverException { logger.traceEntry("orchestrate: {}", request); + Assert.notNull(request, "OrchestrationFormRequestDTO must not be null"); final UriComponents uri = driverUtilities.getOrchestrationQueryUri(); final ResponseEntity httpResponse = httpService .sendRequest(uri, HttpMethod.POST, OrchestrationResponseDTO.class, request); diff --git a/core-common/src/main/java/eu/arrowhead/common/drivers/ServiceRegistryDriver.java b/core-common/src/main/java/eu/arrowhead/common/drivers/ServiceRegistryDriver.java index d0c1feac9..a5ea526be 100644 --- a/core-common/src/main/java/eu/arrowhead/common/drivers/ServiceRegistryDriver.java +++ b/core-common/src/main/java/eu/arrowhead/common/drivers/ServiceRegistryDriver.java @@ -13,6 +13,7 @@ import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; +import org.springframework.util.Assert; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.util.UriComponents; @@ -35,11 +36,14 @@ public ServiceRegistryDriver(final DriverUtilities driverUtilities, final HttpSe public UriComponents findCoreSystemService(final CoreSystemService service) throws DriverUtilities.DriverException { logger.traceEntry("findCoreSystemService:{}", service); + Assert.notNull(service, "CoreSystemService must not be null"); return logger.traceExit(driverUtilities.findUriByServiceRegistry(service)); } public ServiceQueryResultDTO queryRegistry(final ServiceQueryFormDTO form) { logger.traceEntry("queryRegistry: {}", form); + Assert.notNull(form, "ServiceQueryFormDTO must not be null"); + final UriComponents uri = driverUtilities.getServiceRegistryQueryUri(); final ResponseEntity httpEntity = httpService .sendRequest(uri, HttpMethod.POST, ServiceQueryResultDTO.class, form); @@ -48,6 +52,8 @@ public ServiceQueryResultDTO queryRegistry(final ServiceQueryFormDTO form) { public ServiceRegistryResponseDTO registerService(final ServiceRegistryRequestDTO request) throws DriverUtilities.DriverException { logger.traceEntry("registerService: {}", request); + Assert.notNull(request, "ServiceRegistryRequestDTO must not be null"); + final UriComponents uri = driverUtilities.findUriByOrchestrator(CoreSystemService.SERVICE_REGISTRY_REGISTER_SERVICE); final ResponseEntity httpEntity = httpService .sendRequest(uri, HttpMethod.POST, ServiceRegistryResponseDTO.class, request); From 14eec580d2f7f13d42ad82a0b8cbef014e527230 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Tue, 21 Apr 2020 09:41:28 +0200 Subject: [PATCH 300/301] added database privileges for system and device registry --- scripts/device_registry_privileges.sql | 12 ++++++++++-- scripts/system_registry_privileges.sql | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/scripts/device_registry_privileges.sql b/scripts/device_registry_privileges.sql index 0b5fc3ac9..403fc9484 100644 --- a/scripts/device_registry_privileges.sql +++ b/scripts/device_registry_privileges.sql @@ -4,14 +4,22 @@ REVOKE ALL, GRANT OPTION FROM 'device_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`device` TO 'device_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`device_registry` TO 'device_registry'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'device_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'device_registry'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'device_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`device` TO 'device_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`device_registry` TO 'device_registry'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'device_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'device_registry'@'%'; FLUSH PRIVILEGES; \ No newline at end of file diff --git a/scripts/system_registry_privileges.sql b/scripts/system_registry_privileges.sql index 5edaddc01..a4746c2d2 100644 --- a/scripts/system_registry_privileges.sql +++ b/scripts/system_registry_privileges.sql @@ -2,16 +2,24 @@ USE `arrowhead`; REVOKE ALL, GRANT OPTION FROM 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`device` TO 'system_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'system_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`system_registry` TO 'system_registry'@'localhost'; -GRANT ALL PRIVILEGES ON `arrowhead`.`device` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'system_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'system_registry'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`device` TO 'system_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`system_` TO 'system_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`system_registry` TO 'system_registry'@'%'; -GRANT ALL PRIVILEGES ON `arrowhead`.`device` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'system_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'system_registry'@'%'; FLUSH PRIVILEGES; \ No newline at end of file From 82153719194e801b0205b7619ca847efd75e03c4 Mon Sep 17 00:00:00 2001 From: Mario Zsilak Date: Tue, 21 Apr 2020 09:45:01 +0200 Subject: [PATCH 301/301] added database privileges for authorization tables --- scripts/device_registry_privileges.sql | 8 ++++++++ scripts/system_registry_privileges.sql | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/scripts/device_registry_privileges.sql b/scripts/device_registry_privileges.sql index 403fc9484..eaa1e60ce 100644 --- a/scripts/device_registry_privileges.sql +++ b/scripts/device_registry_privileges.sql @@ -9,6 +9,10 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'device_registry'@'l GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'device_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'device_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'device_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'device_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'device_registry'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'device_registry'@'%'; @@ -20,6 +24,10 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'device_registry'@'% GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'device_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'device_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'device_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'device_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'device_registry'@'%'; FLUSH PRIVILEGES; \ No newline at end of file diff --git a/scripts/system_registry_privileges.sql b/scripts/system_registry_privileges.sql index a4746c2d2..37ea8a6e0 100644 --- a/scripts/system_registry_privileges.sql +++ b/scripts/system_registry_privileges.sql @@ -9,6 +9,10 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'system_registry'@'l GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'system_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'system_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'system_registry'@'localhost'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'system_registry'@'localhost'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'system_registry'@'localhost'; REVOKE ALL, GRANT OPTION FROM 'system_registry'@'%'; @@ -20,6 +24,10 @@ GRANT ALL PRIVILEGES ON `arrowhead`.`service_definition` TO 'system_registry'@'% GRANT ALL PRIVILEGES ON `arrowhead`.`service_interface` TO 'system_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry` TO 'system_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`service_registry_interface_connection` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_intra_cloud_interface_connection` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud` TO 'system_registry'@'%'; +GRANT ALL PRIVILEGES ON `arrowhead`.`authorization_inter_cloud_interface_connection` TO 'system_registry'@'%'; GRANT ALL PRIVILEGES ON `arrowhead`.`logs` TO 'system_registry'@'%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#Y-HQ4uQ>UxgP zl2VIRfReY=P|o_m?YsbBH5iDVra;b2C`uhqL_rPOc zRX=WBU#t7=UiJGM#pi94pU*AtlQd2{;vN6%QpLsYIFaCGJ{S2wiAEy^bT-*XU^+Vv zyg%yl4&ar=kDtxX?*ks?rx>;-LJ+j}=*(<${XUCF9f$lAt6|nX6!wsN^4o>T!*}HE z0@Z;_%MJ)|El~6F9WxrzufrsTJ&+?>SYPw8gKVAb1aS3{O8%QEH8oY ztF~s{#QL+W=!PjcF9B0BB;+)JYaH}<+n2#I8B}5(aF$-01LQHdN`(tbz|{z@XE%kS k3L`D)fEY;=g^mAt&)?8nwUX(22?G##y85}Sb4q9e0AocIUjP6A diff --git a/documentation/qos_monitor/use_cases/GetMeaurements.uxf b/documentation/qos_monitor/use_cases/GetMeaurements.uxf new file mode 100644 index 000000000..704fd9726 --- /dev/null +++ b/documentation/qos_monitor/use_cases/GetMeaurements.uxf @@ -0,0 +1,32 @@ +10SERVICE REGISTRY DTOUMLSpecialState330402020type=initialRelation330503080lt=<-10;60;10;10Relation34045030140lt=<-10;120;10;10UMLState18010400530QoS Monitor Controller +valign=topUMLState27036017040call getPingMeasurements +bg=yellow +type=senderRelation430120360280lt=<. + +340;10;170;10;170;260;10;260UMLState65020420350QoS DB Service +valign=topUMLState7709022040getPingMeasurements called +bg=yellow +type=receiverUMLState80027020040getPingMeasurements + answer produced +bg=yellow +type=senderUMLSpecialState850502020type=initialRelation850603050lt=<-10;30;10;10Relation8501203080lt=<-10;60;10;10Relation430280700180lt=<. +10;160;680;160;680;10;570;10UMLState25011017050received +getPingMeasurements +request +bg=yellow +type=receiverUMLState79018019040getAllMeasurement +bg=blueRelation3302303070lt=<- +10;50;10;10UMLSpecialState3305705050type=final +bg=green +UMLState26020019040validate +request parameters +bg=blueRelation8502103080lt=<-10;60;10;10Relation3301503070lt=<-10;50;10;10UMLSpecialState3202804040type=decision +bg=orange +Relation33031018070lt=<- +request parameters are valid10;50;10;10UMLState27042017040getPingMeasurements +returned +bg=yellow +type=receiverRelation12028022040lt=<- +request parameters are invalid10;20;200;20UMLSpecialState802805050type=final +bg=red + \ No newline at end of file diff --git a/documentation/qos_monitor/use_cases/PingMeasurement.png b/documentation/qos_monitor/use_cases/PingMeasurement.png index 89f40a9038e6de138f621b035864d5d132f67c5a..d42af9a06df9fca526d8f2132bcf2bf288d89680 100644 GIT binary patch literal 80313 zcmdpeby!sE+Ws&MFoZIIbj^T>N{a&0jS7fJcZigfl0$b$8-O6Kq<|8Fw1ke*r8J1h z(8$pJdk6RV&e`XD@&9jM>`N~$*IMs--zVlc|-9o1VV@d z|A)ef!Ed09WU~+m5^_^fPTR|Lxq&o=b|`)41Fg zNJz$!!yrgv z%CSrn2iCi`rrLSJM`P%E{-RM&E1{d-QBu#EcKZIe>+VImIyySE7K8){$bbC24VLAD zqj?rXk#Z22?7#gqqadjGa0nFnA3tnBe933rr zb}$4U`0qcVlB56rEBrswSA@t<=2)V%|C^NuCa5s~=lehiqT#X_BW>PLvj1k;jih@O zHa-2}XPDuF1kd7`d=I0Qu4s>Rst!(=D>?y zGHm15u)`vqV%zq|w3Qw!hP6lAV+%<}PT9=P^@*i*tK#;fm6xtLji)eOwME=c#gO6m zQ(kepC*W9EM_0H1-M!DYC&x#XK08j{Cr3LA6P{DAO&h%Xj&`Orjt+JxH9uMB1^W+m z)*>(Cx2RVga#XoWHosM-h7mBVjLh)gx2v5?ePD}8Kn+$qo7oS)&7NGIW<5PM+3P`1 zxi$J1hl&@%=uNY7RpR?;G$iF(BPjJ&xfhB1%9I<3kOBDHV&WkC3(GYl9@^dV$4@n+ zvonu3^W9d*uiMo6%E<*eQXm9Qk5o1Z_O+v90V{KIeW=tV&3~`MtbgmfS>|glmJ9GK zGbN)x=XFO3tn%`cxsfk7F-=?FjIO#&%X;I!aHmr-I{Y!UzVpq(<<{LVZwfT-a!mN` zO!S3jAs=iOlObDRr%!4og7s=dlxbS=&F)#}zI~fu>bIq{I8o=hi$QXp8cR?N{Eb0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2wiAEy^bT-*XU^+Vv zyg%yl4&ar=kDtxX?*ks?rx>;-LJ+j}=*(<${XUCF9f$lAt6|nX6!wsN^4o>T!*}HE z0@Z;_%MJ)|El~6F9WxrzufrsTJ&+?>SYPw8gKVAb1aS3{O8%QEH8oY ztF~s{#QL+W=!PjcF9B0BB;+)JYaH}<+n2#I8B}5(aF$-01LQHdN`(tbz|{z@XE%kS k3L`D)fEY;=g^mAt&)?8nwUX(22?G##y85}Sb4q9e0AocIUjP6A diff --git a/documentation/qos_monitor/use_cases/PingMeasurement.uxf b/documentation/qos_monitor/use_cases/PingMeasurement.uxf index e4c8646a6..1ed7174e8 100644 --- a/documentation/qos_monitor/use_cases/PingMeasurement.uxf +++ b/documentation/qos_monitor/use_cases/PingMeasurement.uxf @@ -1,26 +1,53 @@ -10SERVICE REGISTRY DTOUMLSpecialState170402020type=initialRelation1705030100lt=<-10;80;10;10UMLSpecialState1601604040bg=orange -type=decisionRelation19070170140lt=<- -m2=[Ping Task Still running]30;60;30;10;100;10;100;110;10;110UMLState110240190220getSystemsToMeasure +10SERVICE REGISTRY DTOUMLSpecialState330402020type=initialRelation3305030100lt=<-10;80;10;10UMLSpecialState3201604040bg=orange +type=decisionRelation35070170140lt=<- +m2=[Ping Task Still running]30;60;30;10;100;10;100;110;10;110UMLState270240190200getSystemsToMeasure valign=top bg=blue -bg=blueUMLSpecialState1605104040bg=orange -type=decisionRelation1704503080lt=<-10;60;10;10UMLState2010400850Ping Task -valign=topRelation1701203060lt=<-10;40;10;10UMLState12027017040call queryAll +bg=blueUMLSpecialState3205404040bg=orange +type=decisionRelation3304303080lt=<-10;60;10;10UMLState18010400850Ping Task +valign=topRelation3301203060lt=<-10;40;10;10UMLState28029017040call queryAll bg=yellow -type=senderRelation280120300190lt=<- -280;10;160;10;160;170;10;170Relation8017010030lt=<-80;10;10;10UMLSyncBarHorizontal13012010020{joinSpec= +type=senderRelation440120350210lt=<. + +330;10;160;10;160;190;10;190Relation24017010030lt=<-80;10;10;10UMLSyncBarHorizontal29012010020{joinSpec= date is on or after July 1st and the exam -is passed}UMLTimer3016012090Ping Task +is passed}UMLTimer19016012090Ping Task Config Sequence -bg=blackUMLState49010420330ServiceRegistry -valign=topUMLState5609022040queryAll called +bg=blackUMLState65010420330ServiceRegistry +valign=topUMLState7709019040queryAll called bg=yellow -type=receiverUMLState59026027040queryAll answer produced +type=receiverUMLState77026019040queryAll answer produced bg=yellow -type=senderUMLSpecialState670502020type=initialRelation670603050lt=<-10;30;10;10Relation6701203070lt=<-10;50;10;10Relation260270750140lt=<- -10;120;10;90;730;90;730;10;600;10UMLState12039017040queryAll returned +type=senderUMLSpecialState850502020type=initialRelation850603050lt=<-10;30;10;10Relation8501203070lt=<-10;50;10;10Relation420270750120lt=<. +10;100;10;80;730;80;730;10;540;10UMLState28037017040queryAll returned bg=yellow -type=receiverRelation6702003080lt=<-10;60;10;10UMLState59017019040getServiceRegistryEntries -bg=blueRelation1701903070lt=<-10;50;10;10 \ No newline at end of file +type=receiverRelation8502003080lt=<-10;60;10;10UMLState77017019040getServiceRegistryEntries +bg=blueRelation33019015070lt=<- +m2=[Ping Task not running]10;50;10;10UMLSyncBarHorizontal2704809020{joinSpec= +date is on or +after July 1st +and the exam +is passed}Relation3304803080lt=<-10;60;10;10Relation35054011050lt=<- +has more +system90;20;10;20UMLState44054010040ping system +bg=blueRelation33057070120lt=<- +has +no more +system10;100;10;10UMLSpecialState3306702020type=finalUMLState41061015040calculate measurement +bg=blueRelation4805703060lt=<-10;40;10;10UMLState40068016050save +measurements and logs +bg=yellow +type=senderUMLState40074016050measurements and logs +saved +bg=yellow +type=receiverRelation4606403060lt=<-10;40;10;10Relation220450260390lt=<-80;40;80;10;10;10;10;370;240;370;240;340UMLState650480420370QoS DB Service +valign=topUMLSpecialState8405202020type=initialUMLState77058016050measurements and logs +saved +bg=yellow +type=receiverUMLState78075016050save +measurements and logs +bg=yellow +type=senderUMLState78067015040save to DB +bg=blueRelation550620240110lt=<.220;10;60;10;60;90;10;90Relation550760620130lt=<.10;10;80;10;80;110;600;110;600;20;390;20Relation8406203070lt=<-10;50;10;10Relation8407003070lt=<-10;50;10;10 \ No newline at end of file diff --git a/documentation/qos_monitor/use_cases/Reset_Counter.png b/documentation/qos_monitor/use_cases/Reset_Counter.png index 89f40a9038e6de138f621b035864d5d132f67c5a..0e25c349ed411d0e7d95ea478c61886a92d3bc73 100644 GIT binary patch literal 57910 zcmc$`bySpV_dY(945BiCfJlRMN_Q!uG*Z$E3?SXz5+YJk(xrfegmi<1(v5U?NK5m( zXE^8mob$fl|9@-YaxLX~=HC0>aqVmGJ;6!}(zkEkzX^drZa;ha_&EfE)&YT_(m`*4 ze+fykcZEPGAp4(m#r$r=a30Ri;JUVuSnmzTMNm7{Ljxz+#h~Q zPw0Fg(Et8v6vGl{pdk^5p#S%eI5i~wy#oXV_CG&R_~QS*2mRP%@%e)G54!(*O5iAy6Yc6zG!Nx@F7F|B*2wTHI9fS>H^02iUz&WD~ewKYxyCi;7f+_$k&|C4Osv3Qk|UbzJ^t7eJ+ zw9CTn>V+_&)$$3eOcLwb$gefqf@agT0z8)E(f4`GqO*4TZe4#?E_(gxIX7X<%L^L?>CoayKDA?yQOy~2+) zbR7vq4*DJqWh+vcO;#3{`+k3j{9WH6Xp(?^pnCob32Y*^PYdnggZPTV65*n!re#A#o;S%w8Z~2uLyNiU;n*C>-uMCn0Gz_Ee~iZH(uLcL_E5SbbsmV!POWIy>$2A zb$nb@lxF`C$PoI8C0g^rpVj_1>R)x9)w%!Sy#Yl@?l*u_cr zC3P_VzU(wC-)MhM>x%8kDz5HSF$!wUs4#yL#EH_-PzXEUVB%!4YL~wxDZfL8O7S1d zdQKhjL5YolA+6?jJ;_9Yiey*_;{O^gP-}0WZB@)i!MFO-HBh!N57Ue zXqTEsZd6Gm3)##<Zj=1{j}ybBQR@RZLq5)29#!O6k+n~c{4gPO^AJ89QYq6bZp_Qg zy(v{hi`T(&HwcG9k9nXsSx7qbNoYoGZLLyE$<1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&0}e2-p2(XcNi3+oDNhW z*bmbq5V0JnsU~#kFW`=F^UU}4|9@`;PjWV!Y@6eY=&t-U4`2QFVUZb4cKYpr8M<5S&~=L7pNoBVfY%Z-IYfe*#Y-HQ4uQ>UxgP zl2VIRfReY=P|o_m?YsbBH5iDVra;b2C`uhqL_rPOc zRX=WBU#t7=UiJGM#pi94pU*AtlQd2{;vN6%QpLsYIFaCGJ{S2wiAEy^bT-*XU^+Vv zyg%yl4&ar=kDtxX?*ks?rx>;-LJ+j}=*(<${XUCF9f$lAt6|nX6!wsN^4o>T!*}HE z0@Z;_%MJ)|El~6F9WxrzufrsTJ&+?>SYPw8gKVAb1aS3{O8%QEH8oY ztF~s{#QL+W=!PjcF9B0BB;+)JYaH}<+n2#I8B}5(aF$-01LQHdN`(tbz|{z@XE%kS k3L`D)fEY;=g^mAt&)?8nwUX(22?G##y85}Sb4q9e0AocIUjP6A diff --git a/documentation/qos_monitor/use_cases/Reset_Counter.uxf b/documentation/qos_monitor/use_cases/Reset_Counter.uxf new file mode 100644 index 000000000..30e9c9988 --- /dev/null +++ b/documentation/qos_monitor/use_cases/Reset_Counter.uxf @@ -0,0 +1,44 @@ +10SERVICE REGISTRY DTOUMLSpecialState330402020type=initialRelation3305030100lt=<-10;80;10;10UMLSpecialState3201604040bg=orange +type=decisionRelation35070220140lt=<- +m2=[Reset Counter Task Still running]30;60;30;10;100;10;100;110;10;110UMLState270250190200restrart counter +valign=top +bg=blue +bg=blueRelation3304403070lt=<-10;50;10;10UMLState18010400530Reset Counter Task +valign=topRelation3301203060lt=<-10;40;10;10UMLState28029017040call update measurement +bg=yellow +type=senderRelation440120350210lt=<. + +330;10;160;10;160;190;10;190Relation24017010030lt=<-80;10;10;10UMLSyncBarHorizontal29012010020{joinSpec= +date is on or +after July 1st +and the exam +is passed}UMLTimer19016012090Reset Counter Task +Config Sequence +bg=blackUMLState65020420480QoS DB Service +valign=topUMLState7709019040update measurement called +bg=yellow +type=receiverUMLState76044019040queryAll answer produced +bg=yellow +type=senderUMLSpecialState850502020type=initialRelation850603050lt=<-10;30;10;10Relation8001203070lt=<-10;50;10;10Relation420340710200lt=<. +10;30;10;10;210;10;210;180;690;180;690;120;530;120UMLState28037017040update measurement +returned +bg=yellow +type=receiverRelation8002003060lt=<-10;40;10;10UMLState72017019040getAllMeasurement +bg=blueRelation33019021080lt=<- +m2=[Reset Counter Task not running]10;60;10;10UMLSpecialState3304902020type=finalUMLSyncBarHorizontal77023010020{joinSpec= +date is on or +after July 1st +and the exam +is passed}UMLSpecialState7602704040bg=orange +type=decisionUMLState91027010040update +count started at +bg=blueRelation7702303060lt=<-10;40;10;10Relation79027014060lt=<- +has more +measurements +120;20;10;20UMLState91033010040update +sent +bg=blueUMLState91039010040update received +bg=blueRelation9503003050lt=<-10;30;10;10Relation9503603050lt=<-10;30;10;10Relation840210200220lt=<-10;30;10;10;180;10;180;200;170;200Relation770300110160lt=<- +has no more +measurements +10;140;10;10 \ No newline at end of file From 82398b9524247cafdb2eb80e1acfa0a70acd0663 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 14 Feb 2020 10:45:21 +0100 Subject: [PATCH 193/301] corrected setMaxResponseTime --- .../java/eu/arrowhead/common/dto/internal/DTOConverter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java index 40ea1f6ec..94c753881 100644 --- a/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java +++ b/core-common/src/main/java/eu/arrowhead/common/dto/internal/DTOConverter.java @@ -666,7 +666,7 @@ public static PingMeasurementResponseDTO convertQoSIntraPingMeasurementToPingMea pingMeasurementResponseDTO.setAvailable(pingMeasurement.isAvailable()); pingMeasurementResponseDTO.setLastAccessAt(pingMeasurement.getLastAccessAt()); pingMeasurementResponseDTO.setMinResponseTime(pingMeasurement.getMinResponseTime()); - pingMeasurementResponseDTO.setMaxResponseTime(pingMeasurement.getMinResponseTime()); + pingMeasurementResponseDTO.setMaxResponseTime(pingMeasurement.getMaxResponseTime()); pingMeasurementResponseDTO.setMeanResponseTimeWithTimeout(pingMeasurement.getMeanResponseTimeWithTimeout()); pingMeasurementResponseDTO.setMeanResponseTimeWithoutTimeout(pingMeasurement.getMeanResponseTimeWithoutTimeout()); pingMeasurementResponseDTO.setJitterWithTimeout(pingMeasurement.getJitterWithTimeout()); From 62577a96933185f78698807d18c24fd3e8cf2aa2 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 14 Feb 2020 11:06:23 +0100 Subject: [PATCH 194/301] updated qos_monitor endpoints docaumentation --- .../qos_monitor/sdd/qos_monitor_sdd.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) diff --git a/documentation/qos_monitor/sdd/qos_monitor_sdd.md b/documentation/qos_monitor/sdd/qos_monitor_sdd.md index 434eda3bb..337eb6ea6 100644 --- a/documentation/qos_monitor/sdd/qos_monitor_sdd.md +++ b/documentation/qos_monitor/sdd/qos_monitor_sdd.md @@ -58,6 +58,21 @@ The QoS Monitor has the following use cases: | -------- | ----------- | ------ | ----- | ------ | | [Echo](#qos_monitor_endpoints_get_echo) | /echo | GET | - | OK | + + +### Management endpoint description
+ +| Function | URL subpath | Method | Input | Output | +| -------- | ----------- | ------ | ----- | ------ | +| [Get ping measurements mgmt](#qos_monitor_endpoints_get_ping_measurements_list) | /mgmt/ping/measurements | GET | direction && item_per_page && page && sort_field | [PingMeasurement list response](#qos_monitor_ping_measurement_list_response) | +| [Get ping measurements by system id mgmt](#qos_monitor_mgmt_endpoints_get_ping_measurement_by_system_id) | /mgmt/ping/measurements/{id} | GET | id | [Ping Measurment response](#qos_monitor_ping_measurement_response) | + +### Private endpoint description
+ +| Function | URL subpath | Method | Input | Output | +| -------- | ----------- | ------ | ----- | ------ | +| [Get ping measurements by system id](#qos_monitor_endpoints_get_ping_measurement_by_system_id) | /ping/measurements/{id} | GET | id | [Ping Measurment response](#qos_monitor_ping_measurement_response) | +
### Echo @@ -67,3 +82,128 @@ GET /qos_monitor/echo Returns a "Got it" message with the purpose of testing the core service availability. +### Get ping measurements mgmt + +``` +GET /mgmt/ping/measurements +``` + +__Get subscriptions query parameters__ the input : + +`https://qos_monitor_ip:qos_monitor_port/qos_monitor/mgmt/ping/measurements?dirction=`ASC`&item_per_page=`100`&page=`0`&sort_field=`id + +| __Get ping measurements mgmt__ query parameters | +| ------------------------------------------------------- | + +| Parameter | Description | Necessity | Format/Limitations | +| --------- | ----------- | --------- | ----------- | +| `direction` | Direction of sorting. | optional | valid values: "ASC", "DESC" - default: "ASC"| +| `item_per_page` | Maximum number of items returned. | optional (mandatory, if page is defined)| integer | +| `page` | Zero based page index. | optional (mandatory, if item_per_page is defined)| integer | +| `sort_field` | The field to sort the results by. | optional | valid values: "id", "updatedAt", "createdAt" - default: "id" | + + + +__PingMeasurement list response__ the output : + +```json +{ + "data": [ + { + "id": 1, + "measurement": { + "id": 1, + "system": { + "id": 5, + "systemName": "testsystem", + "address": "testsystem.ai", + "port": 12345, + "createdAt": "2020-02-04 09:38:56", + "updatedAt": "2020-02-04 09:38:56" + }, + "measurementType": "PING", + "lastMeasurementAt": "2020-02-14T10:48:10+01:00", + "createdAt": "2020-02-04T10:42:04+01:00", + "updatedAt": "2020-02-14T10:48:47+01:00" + }, + "available": true, + "lastAccessAt": "2020-02-14T10:48:10+01:00", + "minResponseTime": 15, + "maxResponseTime": 26, + "meanResponseTimeWithTimeout": 18, + "meanResponseTimeWithoutTimeout": 18, + "jitterWithTimeout": 3, + "jitterWithoutTimeout": 3, + "lostPerMeasurementPercent": 0, + "sent": 12075, + "received": 12070, + "countStartedAt": "2020-02-07T00:00:00+01:00", + "sentAll": 63175, + "receivedAll": 56721, + "createdAt": "2020-02-14T10:48:47+01:00", + "updatedAt": "2020-02-14T10:48:47+01:00" + } + ], + "count": 1 +} +``` + + + +### Get ping measurements by system id mgmt + +``` +GET /mgmt/ping/measurements/{id} +``` + +__Get ping measurements by system id mgmt path parameter__ the input : + +`https://qos_monitor_ip:qos_monitor_port/qos_monitor/mgmt/ping/measurements/`1 + +| __Get ping measurement by system id__ path parameter | +| ------------------------------------------------------- | + +| Parameter | Description | Necessity | Format/Limitations | +| --------- | ----------- | --------- | ----------- | +| `id` | Id of measured system | mandatory | integer | + + + +__Ping Measurment response by system id__ the output : + +```json + { + "id": 1, + "measurement": { + "id": 1, + "system": { + "id": 5, + "systemName": "testsystem", + "address": "testsystem.ai", + "port": 12345, + "createdAt": "2020-02-04 09:38:56", + "updatedAt": "2020-02-04 09:38:56" + }, + "measurementType": "PING", + "lastMeasurementAt": "2020-02-14T10:48:10+01:00", + "createdAt": "2020-02-04T10:42:04+01:00", + "updatedAt": "2020-02-14T10:48:47+01:00" + }, + "available": true, + "lastAccessAt": "2020-02-14T10:48:10+01:00", + "minResponseTime": 15, + "maxResponseTime": 26, + "meanResponseTimeWithTimeout": 18, + "meanResponseTimeWithoutTimeout": 18, + "jitterWithTimeout": 3, + "jitterWithoutTimeout": 3, + "lostPerMeasurementPercent": 0, + "sent": 12075, + "received": 12070, + "countStartedAt": "2020-02-07T00:00:00+01:00", + "sentAll": 63175, + "receivedAll": 56721, + "createdAt": "2020-02-14T10:48:47+01:00", + "updatedAt": "2020-02-14T10:48:47+01:00" + } +``` From 8dbbc2e407bf87e3962bfc1e4a887515ab2cacc9 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 14 Feb 2020 11:22:12 +0100 Subject: [PATCH 195/301] updated README.md and qos_monitor endpoints docaumentation --- README.md | 224 ++++++++++++++++++ .../qos_monitor/sdd/qos_monitor_sdd.md | 8 + 2 files changed, 232 insertions(+) diff --git a/README.md b/README.md index ba608b505..6128af178 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,13 @@ Please be aware, that 4.1.3 is __NOT__ backwards compatible with 4.1.2. If you h * [Client](#gateway_endpoints_client) * [Private](#gateway_endpoints_private) * [Management](#gateway_endpoints_mgmt) + 6. [QoS Monitor](#qos_monitor) + * [System Design Description Overview](#qos_monitor_sdd) + * [Services and Use Cases](#qos_monitor_usecases) + * [Endpoints](#qos_monitor_endpoints) + * [Client](#qos_monitor_endpoints_client) + * [Private](#qos_monitor_endpoints_private) + * [Management](#qos_monitor_endpoints_mgmt) @@ -6234,3 +6241,220 @@ __ActiveSession__ is the output. | `responseControlQueue` | control queue of response messaging through the the Relay | | `sessionStartedAt` | Time stamp of session start | + + +# QOS MONITOR + + + +## System Design Description Overview + +The purpose of QoS Monitor supporting core system is providing qos measurements to the QoS Manager. + +![#1589F0](https://placehold.it/15/1589F0/000000?text=+) `AH Service Registry` +![#f03c15](https://placehold.it/15/f03c15/000000?text=+) `AH Authorization` +![#c5f015](https://placehold.it/15/c5f015/000000?text=+) `AH Orchestrator / QoS Manager` +![#ffcc44](https://placehold.it/15/a33c00/000000?text=+) `AH QoS Monitor` +![Alt text](/documentation/qos_monitor/sdd/overview.png) + + + +## System Design Overview +![Alt text](/documentation/qos_monitor/sysd/qos_monitor_sys_d.jpg) + + + +## Provided services + +The QoS Monitor provides the following services: +* [Echo](#qos_monitor_endpoints_get_echo) +* [Ping Measurement](#qos_monitor_endpoints_ping_measurement_by_system_id) + + + +## Consumed services + +The QoS Monitor consumes the following service: +* QueryAll private service from the ServiceRegistry core system + + + +## Use cases + +The QoS Monitor has the following use cases: +* [Ping Measurement](documentation/qos_monitor/use_cases/QoSMonitor_use_case_1.md) +![Alt text](/documentation/qos_monitor/use_cases/PingMeasurement.png) +* [Reset Counter](documentation/qos_monitor/use_cases/QoSMonitor_use_case_2.md) +![Alt text](/documentation/qos_monitor/use_cases/Reset_Counter.png) +* [Get Measurements](documentation/qos_monitor/use_cases/QoSMonitor_use_case_3.md) +![Alt text](/documentation/qos_monitor/use_cases/GetMeaurements.png) + + + +## Endpoints + + + +### Client endpoint description
+ +| Function | URL subpath | Method | Input | Output | +| -------- | ----------- | ------ | ----- | ------ | +| [Echo](#qos_monitor_endpoints_get_echo) | /echo | GET | - | OK | + +
+ +### Management endpoint description
+ +| Function | URL subpath | Method | Input | Output | +| -------- | ----------- | ------ | ----- | ------ | +| [Get ping measurements mgmt](#qos_monitor_endpoints_get_ping_measurements_list) | /mgmt/ping/measurements | GET | direction && item_per_page && page && sort_field | [PingMeasurement list response](#qos_monitor_ping_measurement_list_response) | +| [Get ping measurements by system id mgmt](#qos_monitor_mgmt_endpoints_get_ping_measurement_by_system_id) | /mgmt/ping/measurements/{id} | GET | id | [Ping Measurment response](#qos_monitor_ping_measurement_response) | + +
+ +### Private endpoint description
+ +| Function | URL subpath | Method | Input | Output | +| -------- | ----------- | ------ | ----- | ------ | +| [Get ping measurements by system id](#qos_monitor_endpoints_get_ping_measurement_by_system_id) | /ping/measurements/{id} | GET | id | [Ping Measurment response](#qos_monitor_ping_measurement_response) | + +
+ +### Echo +``` +GET /qos_monitor/echo +``` + +Returns a "Got it" message with the purpose of testing the core service availability. + +### Get ping measurements mgmt + +``` +GET /mgmt/ping/measurements +``` + +__Get subscriptions query parameters__ the input : + +`https://qos_monitor_ip:qos_monitor_port/qos_monitor/mgmt/ping/measurements?dirction=`ASC`&item_per_page=`100`&page=`0`&sort_field=`id + +| __Get ping measurements mgmt__ query parameters | +| ------------------------------------------------------- | + +| Parameter | Description | Necessity | Format/Limitations | +| --------- | ----------- | --------- | ----------- | +| `direction` | Direction of sorting. | optional | valid values: "ASC", "DESC" - default: "ASC"| +| `item_per_page` | Maximum number of items returned. | optional (mandatory, if page is defined)| integer | +| `page` | Zero based page index. | optional (mandatory, if item_per_page is defined)| integer | +| `sort_field` | The field to sort the results by. | optional | valid values: "id", "updatedAt", "createdAt" - default: "id" | + + + +__PingMeasurement list response__ the output : + +```json +{ + "data": [ + { + "id": 1, + "measurement": { + "id": 1, + "system": { + "id": 5, + "systemName": "testsystem", + "address": "testsystem.ai", + "port": 12345, + "createdAt": "2020-02-04 09:38:56", + "updatedAt": "2020-02-04 09:38:56" + }, + "measurementType": "PING", + "lastMeasurementAt": "2020-02-14T10:48:10+01:00", + "createdAt": "2020-02-04T10:42:04+01:00", + "updatedAt": "2020-02-14T10:48:47+01:00" + }, + "available": true, + "lastAccessAt": "2020-02-14T10:48:10+01:00", + "minResponseTime": 15, + "maxResponseTime": 26, + "meanResponseTimeWithTimeout": 18, + "meanResponseTimeWithoutTimeout": 18, + "jitterWithTimeout": 3, + "jitterWithoutTimeout": 3, + "lostPerMeasurementPercent": 0, + "sent": 12075, + "received": 12070, + "countStartedAt": "2020-02-07T00:00:00+01:00", + "sentAll": 63175, + "receivedAll": 56721, + "createdAt": "2020-02-14T10:48:47+01:00", + "updatedAt": "2020-02-14T10:48:47+01:00" + } + ], + "count": 1 +} +``` + + + +### Get ping measurements by system id mgmt + +``` +GET /mgmt/ping/measurements/{id} +``` + +__Get ping measurements by system id mgmt path parameter__ the input : + +`https://qos_monitor_ip:qos_monitor_port/qos_monitor/mgmt/ping/measurements/`1 + +| __Get ping measurement by system id__ path parameter | +| ------------------------------------------------------- | + +| Parameter | Description | Necessity | Format/Limitations | +| --------- | ----------- | --------- | ----------- | +| `id` | Id of measured system | mandatory | integer | + + + +__Ping Measurment response by system id__ the output : + +```json + { + "id": 1, + "measurement": { + "id": 1, + "system": { + "id": 5, + "systemName": "testsystem", + "address": "testsystem.ai", + "port": 12345, + "createdAt": "2020-02-04 09:38:56", + "updatedAt": "2020-02-04 09:38:56" + }, + "measurementType": "PING", + "lastMeasurementAt": "2020-02-14T10:48:10+01:00", + "createdAt": "2020-02-04T10:42:04+01:00", + "updatedAt": "2020-02-14T10:48:47+01:00" + }, + "available": true, + "lastAccessAt": "2020-02-14T10:48:10+01:00", + "minResponseTime": 15, + "maxResponseTime": 26, + "meanResponseTimeWithTimeout": 18, + "meanResponseTimeWithoutTimeout": 18, + "jitterWithTimeout": 3, + "jitterWithoutTimeout": 3, + "lostPerMeasurementPercent": 0, + "sent": 12075, + "received": 12070, + "countStartedAt": "2020-02-07T00:00:00+01:00", + "sentAll": 63175, + "receivedAll": 56721, + "createdAt": "2020-02-14T10:48:47+01:00", + "updatedAt": "2020-02-14T10:48:47+01:00" + } +``` + + + +### Get ping measurements by system id + +For private endpoints no detailed description available. \ No newline at end of file diff --git a/documentation/qos_monitor/sdd/qos_monitor_sdd.md b/documentation/qos_monitor/sdd/qos_monitor_sdd.md index 337eb6ea6..46db24866 100644 --- a/documentation/qos_monitor/sdd/qos_monitor_sdd.md +++ b/documentation/qos_monitor/sdd/qos_monitor_sdd.md @@ -67,6 +67,8 @@ The QoS Monitor has the following use cases: | [Get ping measurements mgmt](#qos_monitor_endpoints_get_ping_measurements_list) | /mgmt/ping/measurements | GET | direction && item_per_page && page && sort_field | [PingMeasurement list response](#qos_monitor_ping_measurement_list_response) | | [Get ping measurements by system id mgmt](#qos_monitor_mgmt_endpoints_get_ping_measurement_by_system_id) | /mgmt/ping/measurements/{id} | GET | id | [Ping Measurment response](#qos_monitor_ping_measurement_response) | + + ### Private endpoint description
| Function | URL subpath | Method | Input | Output | @@ -207,3 +209,9 @@ __Ping Measurment response by system id__ the output : "updatedAt": "2020-02-14T10:48:47+01:00" } ``` + +
+ +### Get ping measurements by system id + +For private endpoints no detailed description available. \ No newline at end of file From f675d20f1f06e6aa7c9e956242a033ebf9712897 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 14 Feb 2020 12:10:31 +0100 Subject: [PATCH 196/301] Update QoSMonitor_use_case_1.md --- .../qos_monitor/use_cases/QoSMonitor_use_case_1.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/documentation/qos_monitor/use_cases/QoSMonitor_use_case_1.md b/documentation/qos_monitor/use_cases/QoSMonitor_use_case_1.md index 46b92da5c..1538505e6 100644 --- a/documentation/qos_monitor/use_cases/QoSMonitor_use_case_1.md +++ b/documentation/qos_monitor/use_cases/QoSMonitor_use_case_1.md @@ -1,3 +1,10 @@ -## Use case: Ping Measurement \ No newline at end of file +## Use case: Ping Measurement +| Name | Description | +| ---- | --------- | +| ID | Ping Measurement | +| Brief Description | QosMonitors Ping Task process is tasked to measure the ping related values of all the availble systems | +| Primary Actors | QosMonitor - Ping Task process, QosMonitor - DB service, Service Registry | +| Preconditions | -  Service Registry has to be availble. +| Main Flow | - The Ping Task Configuration send a start signal to PingTask.
- If the PingTask is still working on the last task, it skips the start signal.
- If the PingTask is not working it starts working.
- PingTask call ServiceRegistry's for the list of registered systems.
- When list returned PingTask check if there are system on the list.
- If not, PingTask finish working.
- If there are systems, PingTask start:
-- Ping the system.
-- Calculate measurement results.
-- Logs results to DB.
-- Check for next system to measure. From 95ed62e73bf74ec6261ac36fdd09f9345ffe933f Mon Sep 17 00:00:00 2001 From: Svetlin Tanyi Date: Fri, 14 Feb 2020 12:59:05 +0100 Subject: [PATCH 197/301] Certificate Generation scripts by Emanuel Palm (https://github.com/emanuelpalm) --- scripts/certificate_generation/lib_certs.sh | 364 ++++++++++++++++++++ scripts/certificate_generation/mk_certs.sh | 98 ++++++ scripts/certificate_generation/rm_certs.sh | 12 + 3 files changed, 474 insertions(+) create mode 100644 scripts/certificate_generation/lib_certs.sh create mode 100644 scripts/certificate_generation/mk_certs.sh create mode 100644 scripts/certificate_generation/rm_certs.sh diff --git a/scripts/certificate_generation/lib_certs.sh b/scripts/certificate_generation/lib_certs.sh new file mode 100644 index 000000000..a1ef62b2d --- /dev/null +++ b/scripts/certificate_generation/lib_certs.sh @@ -0,0 +1,364 @@ +# Created by Emanuel Palm (https://github.com/emanuelpalm) + +# Uses `keytool`, typically bundled with Java installations, to generate and +# sign keystores, certificates and truststores for Arrowhead roots, clouds, +# systems and system operators. + +# The environment variable PASSWORD is used to set the password of all +# created key stores. If it is not set, "123456" is used by default. The +# password can be changed for individual keystores and truststores later if +# desired. +if [[ -z "${PASSWORD}" ]]; then + export PASSWORD="123456" +fi + +# Creates a root certificate keystore and a corresponding PEM certificate. +# +# If the keystore already exists, the operation does nothing. If the PEM +# cerificate is missing, it will be created either from the already +# existing or new keystore. +# +# @param $1 Path to desired root certificate keystore. +# @param $2 Desired Common Name of root certificate. +create_root_keystore() { + local ROOT_KEYSTORE=$1 + local ROOT_KEY_ALIAS=$2 + local ROOT_CERT_FILE="${ROOT_KEYSTORE%.*}.crt" + + if [ ! -f "${ROOT_KEYSTORE}" ]; then + echo -e "\e[34mCreating \e[33m${ROOT_KEYSTORE}\e[34m ...\e[0m" + mkdir -p "$(dirname "${ROOT_KEYSTORE}")" + rm -f "${ROOT_CERT_FILE}" + + keytool -genkeypair -v \ + -keystore "${ROOT_KEYSTORE}" \ + -storepass:env "PASSWORD" \ + -keyalg "RSA" \ + -keysize "2048" \ + -validity "3650" \ + -alias "${ROOT_KEY_ALIAS}" \ + -keypass:env "PASSWORD" \ + -dname "CN=${ROOT_KEY_ALIAS}" \ + -ext "BasicConstraints=ca:true,pathlen:3" + fi + + if [ ! -f "${ROOT_CERT_FILE}" ]; then + echo -e "\e[34mCreating \e[33m${ROOT_CERT_FILE}\e[34m ...\e[0m" + + keytool -exportcert -v \ + -keystore "${ROOT_KEYSTORE}" \ + -storepass:env "PASSWORD" \ + -alias "${ROOT_KEY_ALIAS}" \ + -keypass:env "PASSWORD" \ + -file "${ROOT_CERT_FILE}" \ + -rfc + fi +} + +# Creates a cloud certificate keystore, containing a certificate signed by the +# specified root, and a corresponding PEM certificate. +# +# If the keystore already exists, the operation does nothing. If the PEM +# cerificate is missing, it will be created either from the already +# existing or new keystore. If the root keystore has changed since an +# existing cloud keystore was created, it is recreated. +# +# @param $1 Path to root certificate keystore. +# @param $2 Common Name of root certificate. +# @param $3 Path to desired cloud certificate keystore. +# @param $4 Desired Common Name of cloud certificate. +create_cloud_keystore() { + local ROOT_KEYSTORE=$1 + local ROOT_KEY_ALIAS=$2 + local ROOT_CERT_FILE="${ROOT_KEYSTORE%.*}.crt" + local CLOUD_KEYSTORE=$3 + local CLOUD_KEY_ALIAS=$4 + local CLOUD_CERT_FILE="${CLOUD_KEYSTORE%.*}.crt" + + if [ -f "${CLOUD_KEYSTORE}" ] && [ "${ROOT_KEYSTORE}" -nt "${CLOUD_KEYSTORE}" ]; then + rm -f "${CLOUD_KEYSTORE}" + fi + + if [ ! -f "${CLOUD_KEYSTORE}" ]; then + echo -e "\e[34mCreating \e[33m${CLOUD_KEYSTORE}\e[34m ...\e[0m" + mkdir -p "$(dirname "${CLOUD_KEYSTORE}")" + rm -f "${CLOUD_CERT_FILE}" + + keytool -genkeypair -v \ + -keystore "${CLOUD_KEYSTORE}" \ + -storepass:env "PASSWORD" \ + -keyalg "RSA" \ + -keysize "2048" \ + -validity "3650" \ + -alias "${CLOUD_KEY_ALIAS}" \ + -keypass:env "PASSWORD" \ + -dname "CN=${CLOUD_KEY_ALIAS}" \ + -ext "BasicConstraints=ca:true,pathlen:2" + + keytool -importcert -v \ + -keystore "${CLOUD_KEYSTORE}" \ + -storepass:env "PASSWORD" \ + -alias "${ROOT_KEY_ALIAS}" \ + -file "${ROOT_CERT_FILE}" \ + -trustcacerts \ + -noprompt + + keytool -certreq -v \ + -keystore "${CLOUD_KEYSTORE}" \ + -storepass:env "PASSWORD" \ + -alias "${CLOUD_KEY_ALIAS}" \ + -keypass:env "PASSWORD" | + keytool -gencert -v \ + -keystore "${ROOT_KEYSTORE}" \ + -storepass:env "PASSWORD" \ + -validity "3650" \ + -alias "${ROOT_KEY_ALIAS}" \ + -keypass:env "PASSWORD" \ + -ext "BasicConstraints=ca:true,pathlen:2" \ + -rfc | + keytool -importcert \ + -keystore "${CLOUD_KEYSTORE}" \ + -storepass:env "PASSWORD" \ + -alias "${CLOUD_KEY_ALIAS}" \ + -keypass:env "PASSWORD" \ + -trustcacerts \ + -noprompt + fi + + if [ ! -f "${CLOUD_CERT_FILE}" ]; then + echo -e "\e[34mCreating \e[33m${CLOUD_CERT_FILE}\e[34m ...\e[0m" + + keytool -exportcert -v \ + -keystore "${CLOUD_KEYSTORE}" \ + -storepass:env "PASSWORD" \ + -alias "${CLOUD_KEY_ALIAS}" \ + -keypass:env "PASSWORD" \ + -file "${CLOUD_CERT_FILE}" \ + -rfc + fi +} + +# Creates a system certificate keystore, containing a certificate signed by +# the specified cloud, and a corresponding PEM certificate and public key +# file. +# +# If the keystore already exists, the operation does nothing. If either the +# PEM cerificate or public key file is missing, those will be created either +# from the already existing or new keystore. If the cloud keystore has changed +# since an existing system keystore was created, it is recreated. +# +# @param $1 Path to root certificate keystore. +# @param $2 Common Name of root certificate. +# @param $3 Path to cloud certificate keystore. +# @param $4 Common Name of cloud certificate. +# @param $5 Path to desired system certificate keystore. +# @param $6 Desired Common Name of system certificate. +create_system_keystore() { + local ROOT_KEYSTORE=$1 + local ROOT_KEY_ALIAS=$2 + local ROOT_CERT_FILE="${ROOT_KEYSTORE%.*}.crt" + local CLOUD_KEYSTORE=$3 + local CLOUD_KEY_ALIAS=$4 + local CLOUD_CERT_FILE="${CLOUD_KEYSTORE%.*}.crt" + local SYSTEM_KEYSTORE=$5 + local SYSTEM_KEY_ALIAS=$6 + local SYSTEM_PUB_FILE="${SYSTEM_KEYSTORE%.*}.pub" + local SAN=$7 + + if [ -f "${SYSTEM_KEYSTORE}" ] && [ "${CLOUD_KEYSTORE}" -nt "${SYSTEM_KEYSTORE}" ]; then + rm -f "${SYSTEM_KEYSTORE}" + fi + + if [ ! -f "${SYSTEM_KEYSTORE}" ]; then + echo -e "\e[34mCreating \e[33m${SYSTEM_KEYSTORE}\e[34m ...\e[0m" + mkdir -p "$(dirname "${SYSTEM_KEYSTORE}")" + rm -f "${SYSTEM_PUB_FILE}" + + keytool -genkeypair -v \ + -keystore "${SYSTEM_KEYSTORE}" \ + -storepass:env "PASSWORD" \ + -keyalg "RSA" \ + -keysize "2048" \ + -validity "3650" \ + -alias "${SYSTEM_KEY_ALIAS}" \ + -keypass:env "PASSWORD" \ + -dname "CN=${SYSTEM_KEY_ALIAS}" \ + -ext "SubjectAlternativeName=${SAN}" + + keytool -importcert -v \ + -keystore "${SYSTEM_KEYSTORE}" \ + -storepass:env "PASSWORD" \ + -alias "${ROOT_KEY_ALIAS}" \ + -file "${ROOT_CERT_FILE}" \ + -trustcacerts \ + -noprompt + + keytool -importcert -v \ + -keystore "${SYSTEM_KEYSTORE}" \ + -storepass:env "PASSWORD" \ + -alias "${CLOUD_KEY_ALIAS}" \ + -file "${CLOUD_CERT_FILE}" \ + -trustcacerts \ + -noprompt + + keytool -certreq -v \ + -keystore "${SYSTEM_KEYSTORE}" \ + -storepass:env "PASSWORD" \ + -alias "${SYSTEM_KEY_ALIAS}" \ + -keypass:env "PASSWORD" | + keytool -gencert -v \ + -keystore "${CLOUD_KEYSTORE}" \ + -storepass:env "PASSWORD" \ + -validity "3650" \ + -alias "${CLOUD_KEY_ALIAS}" \ + -keypass:env "PASSWORD" \ + -ext "SubjectAlternativeName=${SAN}" \ + -rfc | + keytool -importcert \ + -keystore "${SYSTEM_KEYSTORE}" \ + -storepass:env "PASSWORD" \ + -alias "${SYSTEM_KEY_ALIAS}" \ + -keypass:env "PASSWORD" \ + -trustcacerts \ + -noprompt + fi + + if [ ! -f "${SYSTEM_PUB_FILE}" ]; then + echo -e "\e[34mCreating \e[33m${SYSTEM_PUB_FILE}\e[34m ...\e[0m" + + keytool -list \ + -keystore "${SYSTEM_KEYSTORE}" \ + -storepass:env "PASSWORD" \ + -alias "${SYSTEM_KEY_ALIAS}" \ + -rfc | + openssl x509 \ + -inform pem \ + -pubkey \ + -noout >"${SYSTEM_PUB_FILE}" + fi +} + +# Creates a system operator certificate keystore, containing a certificate +# signed by the specified cloud, a PEM certificate file, a CA (Certificate +# Authority) file, a public key file and a private key file. +# +# If the keystore already exists, the operation does nothing. If the PEM +# cerificate is missing, it will be created either from the already +# existing or new keystore. If the cloud keystore has changed since an +# existing system operator keystore was created, it is recreated. +# +# @param $1 Path to root certificate keystore. +# @param $2 Common Name of root certificate. +# @param $3 Path to cloud certificate keystore. +# @param $4 Common Name of cloud certificate. +# @param $5 Path to desired system operator certificate keystore. +# @param $6 Desired Common Name of system operator certificate. +create_sysop_keystore() { + local ROOT_KEYSTORE=$1 + local ROOT_CERT_FILE="${ROOT_KEYSTORE%.*}.crt" + local CLOUD_KEYSTORE=$3 + local CLOUD_CERT_FILE="${CLOUD_KEYSTORE%.*}.crt" + local SYSOP_KEYSTORE=$5 + local SYSOP_KEY_ALIAS=$6 + local SYSOP_PUB_FILE="${SYSOP_KEYSTORE%.*}.pub" + local SYSOP_CA_FILE="${SYSOP_KEYSTORE%.*}.ca" + local SYSOP_CERT_FILE="${SYSOP_KEYSTORE%.*}.crt" + local SYSOP_KEY_FILE="${SYSOP_KEYSTORE%.*}.key" + + local CREATE_KEYSTORE_OR_PUB_FILE=0 + + if [ -f "${SYSOP_KEYSTORE}" ] && [ "${CLOUD_KEYSTORE}" -nt "${SYSOP_KEYSTORE}" ]; then + rm -f "${SYSOP_KEYSTORE}" + fi + + if [ ! -f "${SYSOP_KEYSTORE}" ]; then + rm -f "${SYSOP_CA_FILE}" + rm -f "${SYSOP_CERT_FILE}" + rm -f "${SYSOP_KEY_FILE}" + CREATE_KEYSTORE_OR_PUB_FILE=1 + fi + + if [ ! -f "${SYSOP_PUB_FILE}" ]; then + CREATE_KEYSTORE_OR_PUB_FILE=1 + fi + + if [[ "${CREATE_KEYSTORE_OR_PUB_FILE}" == "1" ]]; then + create_system_keystore "$1" "$2" "$3" "$4" "$5" "$6" "dns:localost,ip:127.0.0.1" + fi + + if [ ! -f "${SYSOP_CA_FILE}" ]; then + echo -e "\e[34mCreating \e[33m${SYSOP_CA_FILE}\e[34m ...\e[0m" + + cat "${ROOT_CERT_FILE}" >"${SYSOP_CA_FILE}" + cat "${CLOUD_CERT_FILE}" >>"${SYSOP_CA_FILE}" + fi + + if [ ! -f "${SYSOP_CERT_FILE}" ]; then + echo -e "\e[34mCreating \e[33m${SYSOP_CERT_FILE}\e[34m ...\e[0m" + + keytool -exportcert -v \ + -keystore "${SYSOP_KEYSTORE}" \ + -storepass:env "PASSWORD" \ + -alias "${SYSOP_KEY_ALIAS}" \ + -keypass:env "PASSWORD" \ + -rfc >>"${SYSOP_CERT_FILE}" + fi + + if [ ! -f "${SYSOP_KEY_FILE}" ]; then + echo -e "\e[34mCreating \e[33m${SYSOP_KEY_FILE}\e[34m ...\e[0m" + + openssl pkcs12 \ + -in "${SYSOP_KEYSTORE}" \ + -passin env:PASSWORD \ + -out "${SYSOP_KEY_FILE}" \ + -nocerts \ + -nodes + fi +} + +# Creates truststore and populates it with identified certificates. +# +# If the truststore already exists, the operation does nothing. Unless, +# however, any of the identified certificate files are newer than the +# the truststore, in which case the truststore is recreated. +# +# $1 Path to desired truststore. +# $2,4,6... Paths to certificate file ".crt". +# $3,5,7... Common Names of certificates in ".crt" files. +create_truststore() { + local TRUSTSTORE=$1 + local ARGC=$# + local ARGV=("$@") + + if [ -f "${TRUSTSTORE}" ]; then + for ((j = 1; j < ARGC; j = j + 2)); do + local FILE="${ARGV[j]}" + if [ -f "${FILE}" ] && [ "${TRUSTSTORE}" -nt "${FILE}" ]; then + rm -f "${FILE}" + fi + done + fi + + if [ ! -f "${TRUSTSTORE}" ]; then + echo -e "\e[34mCreating \e[33m${TRUSTSTORE}\e[34m ...\e[0m" + mkdir -p "$(dirname "${TRUSTSTORE}")" + + for ((j = 1; j < ARGC; j = j + 2)); do + keytool -importcert -v \ + -keystore "${TRUSTSTORE}" \ + -storepass:env "PASSWORD" \ + -file "${ARGV[j]}" \ + -alias "${ARGV[j + 1]}" \ + -trustcacerts \ + -noprompt + done + fi +} + +# Makes sure that interrupts are not ignored while generating certificates. +exit_script() { + echo -e "\e[1;31mAborting ...\e[0m" + trap - SIGINT SIGTERM + kill -- -$$ +} +trap exit_script SIGINT SIGTERM \ No newline at end of file diff --git a/scripts/certificate_generation/mk_certs.sh b/scripts/certificate_generation/mk_certs.sh new file mode 100644 index 000000000..a6cc7c44f --- /dev/null +++ b/scripts/certificate_generation/mk_certs.sh @@ -0,0 +1,98 @@ +#!/bin/bash + +# Created by Emanuel Palm (https://github.com/emanuelpalm) + +cd "$(dirname "$0")" || exit +source "lib_certs.sh" +cd .. + +# ROOT + +create_root_keystore \ + "cloud-root/crypto/root.p12" "arrowhead.eu" + +# RELAY "CLOUD" + +create_cloud_keystore \ + "cloud-root/crypto/root.p12" "arrowhead.eu" \ + "cloud-relay/crypto/conet-demo-relay.p12" "conet-demo-relay.ltu.arrowhead.eu" + +create_system_keystore \ + "cloud-root/crypto/root.p12" "arrowhead.eu" \ + "cloud-relay/crypto/conet-demo-relay.p12" "conet-demo-relay.ltu.arrowhead.eu" \ + "cloud-relay/crypto/alpha.p12" "alpha.conet-demo-relay.ltu.arrowhead.eu" \ + "dns:alpha.relay,ip:172.23.1.11,dns:localhost,ip:127.0.0.1" + +create_truststore \ + "cloud-relay/crypto/truststore.p12" \ + "cloud-root/crypto/root.crt" "arrowhead.eu" + +# CONSUMER CLOUD + +create_cloud_keystore \ + "cloud-root/crypto/root.p12" "arrowhead.eu" \ + "cloud-data-consumer/crypto/conet-demo-consumer.p12" "conet-demo-consumer.ltu.arrowhead.eu" + +create_consumer_system_keystore() { + SYSTEM_NAME=$1 + + create_system_keystore \ + "cloud-root/crypto/root.p12" "arrowhead.eu" \ + "cloud-data-consumer/crypto/conet-demo-consumer.p12" "conet-demo-consumer.ltu.arrowhead.eu" \ + "cloud-data-consumer/crypto/${SYSTEM_NAME}.p12" "${SYSTEM_NAME}.conet-demo-consumer.ltu.arrowhead.eu" \ + "dns:core.consumer,ip:172.23.2.13,dns:localhost,ip:127.0.0.1" +} + +create_consumer_system_keystore "authorization" +create_consumer_system_keystore "contract_proxy" +create_consumer_system_keystore "data_consumer" +create_consumer_system_keystore "event_handler" +create_consumer_system_keystore "gatekeeper" +create_consumer_system_keystore "gateway" +create_consumer_system_keystore "orchestrator" +create_consumer_system_keystore "service_registry" + +create_sysop_keystore \ + "cloud-root/crypto/root.p12" "arrowhead.eu" \ + "cloud-data-consumer/crypto/conet-demo-consumer.p12" "conet-demo-consumer.ltu.arrowhead.eu" \ + "cloud-data-consumer/crypto/sysop.p12" "sysop.conet-demo-consumer.ltu.arrowhead.eu" + +create_truststore \ + "cloud-data-consumer/crypto/truststore.p12" \ + "cloud-data-consumer/crypto/conet-demo-consumer.crt" "conet-demo-consumer.ltu.arrowhead.eu" \ + "cloud-relay/crypto/conet-demo-relay.crt" "conet-demo-relay.ltu.arrowhead.eu" + +# PRODUCER CLOUD + +create_cloud_keystore \ + "cloud-root/crypto/root.p12" "arrowhead.eu" \ + "cloud-data-producer/crypto/conet-demo-producer.p12" "conet-demo-producer.ltu.arrowhead.eu" + +create_producer_system_keystore() { + SYSTEM_NAME=$1 + + create_system_keystore \ + "cloud-root/crypto/root.p12" "arrowhead.eu" \ + "cloud-data-producer/crypto/conet-demo-producer.p12" "conet-demo-producer.ltu.arrowhead.eu" \ + "cloud-data-producer/crypto/${SYSTEM_NAME}.p12" "${SYSTEM_NAME}.conet-demo-producer.ltu.arrowhead.eu" \ + "dns:core.producer,ip:172.23.3.13,dns:localhost,ip:127.0.0.1" +} + +create_producer_system_keystore "authorization" +create_producer_system_keystore "contract_proxy" +create_producer_system_keystore "data_consumer" +create_producer_system_keystore "event_handler" +create_producer_system_keystore "gatekeeper" +create_producer_system_keystore "gateway" +create_producer_system_keystore "orchestrator" +create_producer_system_keystore "service_registry" + +create_sysop_keystore \ + "cloud-root/crypto/root.p12" "arrowhead.eu" \ + "cloud-data-producer/crypto/conet-demo-producer.p12" "conet-demo-producer.ltu.arrowhead.eu" \ + "cloud-data-producer/crypto/sysop.p12" "sysop.conet-demo-producer.ltu.arrowhead.eu" + +create_truststore \ + "cloud-data-producer/crypto/truststore.p12" \ + "cloud-data-producer/crypto/conet-demo-producer.crt" "conet-demo-producer.ltu.arrowhead.eu" \ + "cloud-relay/crypto/conet-demo-relay.crt" "conet-demo-relay.ltu.arrowhead.eu" \ No newline at end of file diff --git a/scripts/certificate_generation/rm_certs.sh b/scripts/certificate_generation/rm_certs.sh new file mode 100644 index 000000000..0357c400e --- /dev/null +++ b/scripts/certificate_generation/rm_certs.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Created by Emanuel Palm (https://github.com/emanuelpalm) + +# With great power comes great responsibility. + +# Removes all keystores, certificates and truststores potentially created by +# `mk_certs.sh`. + +cd "$(dirname "$0")" || exit +cd .. +find cloud-* -regex ".*\.\(p12\|crt\|jks\|pub\|key\|ca\)" -exec rm -f {} \; \ No newline at end of file From be295afeed324af3d7377cade80d4b9aa6ab43a1 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 14 Feb 2020 13:08:59 +0100 Subject: [PATCH 198/301] Update QoSMonitor_use_case_2.md --- .../qos_monitor/use_cases/QoSMonitor_use_case_2.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/documentation/qos_monitor/use_cases/QoSMonitor_use_case_2.md b/documentation/qos_monitor/use_cases/QoSMonitor_use_case_2.md index ad1fd05b7..b1f88f689 100644 --- a/documentation/qos_monitor/use_cases/QoSMonitor_use_case_2.md +++ b/documentation/qos_monitor/use_cases/QoSMonitor_use_case_2.md @@ -1,3 +1,10 @@
-## Use case: Reset Counter \ No newline at end of file +## Use case: Reset Counter + +| Name | Description | +| ---- | --------- | +| ID | Reset Counter | +| Brief Description | QosMonitors Reset Counter Task process is tasked to reset the ping mesasurements sent, received and count-started-at fields | +| Primary Actors | QosMonitor - Reset Counter Task process, QosMonitor - DB service | +| Main Flow | - The Reset Counter Task Configuration send a start signal to PingTask.
- If the Reset Counter Task is still working on the last task, it skips the start signal.
- If the Reset Counter Task is not working it starts working.
- Reset Counter Task call QoS DB Service's to update ping measurments.
- QoS DB Service retrieve all ping measurement.
- QoS DB Service reset all ping mesasurements sent, received fields to 0 and reset count-started-at field to current date.
- Qos DB Service return ok to Reset Counter Task.
- Reset Counter Task stops working. From a0a6e04cad411a78e58c4b6f7612a9b0128d1609 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 14 Feb 2020 13:26:29 +0100 Subject: [PATCH 199/301] Update QoSMonitor_use_case_3.md --- .../qos_monitor/use_cases/QoSMonitor_use_case_3.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/documentation/qos_monitor/use_cases/QoSMonitor_use_case_3.md b/documentation/qos_monitor/use_cases/QoSMonitor_use_case_3.md index 89c671aa7..92973d3da 100644 --- a/documentation/qos_monitor/use_cases/QoSMonitor_use_case_3.md +++ b/documentation/qos_monitor/use_cases/QoSMonitor_use_case_3.md @@ -1,3 +1,10 @@
-## Use case: Get Measurements \ No newline at end of file +## Use case: Get Measurements + +| Name | Description | +| ---- | --------- | +| ID | Get Measurements| +| Brief Description | QosMonitors is tasked to retrieve ping measurements | +| Primary Actors | Orchestrator - QosManager, QosMonitor - Controller, QosMonitor - DB service | +| Main Flow | - QosManager sends a getPingMeasurements request to QoS Monitor.
- QoS Monitor checks if the request came from the Orchestrator.
- If not, QoS Monitor returns Authorization Exception.
- If the request came from the Orchestrator, QoSMonitor Controller validate the request parameter.
- If the parameter is not valid, the Controller returns BadRequest Exception.
- If the parameter is valid, the Controller call QoS DB Service for the ping measurement specified by the request parameter.
- Qos DB Service returns the ping measurement to the Controller.
- The Controller returns the ping measurement to the QoS Manager. From 9e2c5b5fb94d08f3c030dfc5e4bb5c47a1fcc732 Mon Sep 17 00:00:00 2001 From: Gabor Majoros Date: Fri, 14 Feb 2020 13:40:24 +0100 Subject: [PATCH 200/301] updated use case diagrams --- .../qos_monitor/use_cases/GetMeaurements.png | Bin 56745 -> 71157 bytes .../qos_monitor/use_cases/GetMeaurements.uxf | 44 +++++++++++------- .../qos_monitor/use_cases/PingMeasurement.png | Bin 80313 -> 80573 bytes .../qos_monitor/use_cases/PingMeasurement.uxf | 2 +- .../qos_monitor/use_cases/Reset_Counter.png | Bin 57910 -> 58497 bytes .../qos_monitor/use_cases/Reset_Counter.uxf | 4 +- 6 files changed, 30 insertions(+), 20 deletions(-) diff --git a/documentation/qos_monitor/use_cases/GetMeaurements.png b/documentation/qos_monitor/use_cases/GetMeaurements.png index 59bf20fd07d36c2526d7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